uneeq-js 2.46.6 → 2.46.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/umd/index.js +67 -54
- package/package.json +10 -12
- package/readme.md +3 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={2541:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ActivationState:()=>a,Client:()=>f,CompatClient:()=>m,FrameImpl:()=>i,Parser:()=>o,Stomp:()=>g,StompConfig:()=>h,StompHeaders:()=>d,StompSocketState:()=>s,StompSubscription:()=>p,Versions:()=>u});const n="\n";class i{constructor(e){const{command:t,headers:r,body:n,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},r||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=n||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(e,t){const r={},n=e=>e.replace(/^\s+|\s+$/g,"");for(const o of e.headers.reverse()){o.indexOf(":");const s=n(o[0]);let a=n(o[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=i.hdrValueUnEscape(a)),r[s]=a}return new i({command:e.command,headers:r,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(e,this._binaryBody).buffer:e+this._body+"\0"}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const r=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${i.hdrValueEscape(`${r}`)}`):e.push(`${t}:${r}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(n)+n+n}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const r=(new TextEncoder).encode(e),n=new Uint8Array([0]),i=new Uint8Array(r.length+t.length+n.length);return i.set(r),i.set(t,r.length),i.set(n,r.length+t.length),i}static marshall(e){return new i(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let r;if(r=e instanceof ArrayBuffer?new Uint8Array(e):this._encoder.encode(e),t&&0!==r[r.length-1]){const e=new Uint8Array(r.length+1);e.set(r,0),e[r.length]=0,r=e}for(let e=0;e<r.length;e++){const t=r[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter((e=>"content-length"===e[0]))[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!=this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(s||(s={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(a||(a={}));class u{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map((e=>`v${e.replace(".","")}.stomp`))}}u.V1_0="1.0",u.V1_1="1.1",u.V1_2="1.2",u.default=new u([u.V1_0,u.V1_1,u.V1_2]);class c{constructor(e,t,r={}){this._client=e,this._webSocket=t,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===u.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,r=this._subscriptions[t]||this.onUnhandledMessage,n=e,i=this,o=this._connectedVersion===u.V1_2?n.headers.ack:n.headers["message-id"];n.ack=(e={})=>i.ack(o,t,e),n.nack=(e={})=>i.nack(o,t,e),r(n)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(r)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(e){Object.assign(this,e)}start(){const e=new o((e=>{const t=i.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`),(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)}),(()=>{this.debug("<<< PONG")}));this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug(`<<< ${e}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._onclose=e=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==u.V1_1&&e.version!==u.V1_2)return;if(!e["heart-beat"])return;const[t,r]=e["heart-beat"].split(",").map((e=>parseInt(e,10)));if(0!==this.heartbeatOutgoing&&0!==r){const e=Math.max(this.heartbeatOutgoing,r);this.debug(`send PING every ${e}ms`),this._pinger=setInterval((()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(n),this.debug(">>> PING"))}),e)}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval((()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())}),e)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var e,t;this._webSocket.terminate||(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;const r=new Date,n=this.onclose;this.onclose=e=>{const n=(new Date).getTime()-r.getTime();t(`Discarded socket closed after ${n}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),n.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:r,body:n,binaryBody:o,skipContentLengthHeader:s}=e,a=new i({command:t,headers:r,body:n,binaryBody:o,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let u=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${u}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&"string"==typeof u&&(u=(new TextEncoder).encode(u)),"string"==typeof u&&this.splitLargeFrames){let e=u;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(u)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,(e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)})),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(e){const{destination:t,headers:r,body:n,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},r);this._transmit({command:"SEND",headers:s,body:n,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,r={}){(r=Object.assign({},r)).id||(r.id="sub-"+this._counter++),r.destination=e,this._subscriptions[r.id]=t,this._transmit({command:"SUBSCRIBE",headers:r});const n=this;return{id:r.id,unsubscribe:e=>n.unsubscribe(r.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const r=this;return{id:t,commit(){r.commit(t)},abort(){r.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,r={}){r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"ACK",headers:r})}nack(e,t,r={}){return r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"NACK",headers:r})}}var l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class f{constructor(e={}){this.stompVersions=u.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=a.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===a.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}configure(e){Object.assign(this,e)}activate(){if(this.state===a.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(a.ACTIVE),this._connect())}_connect(){return l(this,void 0,void 0,(function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout((()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())}),this.connectionTimeout)),this.debug("Opening Web Socket...");const e=this._createWebSocket();this._stompHandler=new c(this,e,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}))}_createWebSocket(){let e;return e=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),e.binaryType="arraybuffer",e}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout((()=>{this._connect()}),this.reconnectDelay))}deactivate(){return l(this,void 0,void 0,(function*(){let e;return this.state!==a.ACTIVE?(this.debug(`Already ${a[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(a.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==s.CLOSED?(e=new Promise(((e,t)=>{this._resolveSocketClose=e})),this._disposeStompHandler(),e):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(e){this._stompHandler.publish(e)}watchForReceipt(e,t){this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,r={}){return this._stompHandler.subscribe(e,t,r)}unsubscribe(e,t={}){this._stompHandler.unsubscribe(e,t)}begin(e){return this._stompHandler.begin(e)}commit(e){this._stompHandler.commit(e)}abort(e){this._stompHandler.abort(e)}ack(e,t,r={}){this._stompHandler.ack(e,t,r)}nack(e,t,r={}){this._stompHandler.nack(e,t,r)}}class h{}class d{}class p{}class v{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class m extends f{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new v(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,r,n,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");return"function"==typeof e[1]?[i,r,n,t]=e:6===e.length?[i.login,i.passcode,r,n,t,i.host]=e:[i.login,i.passcode,r,n,t]=e,[i,r,n,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},r=""){const n=!1===(t=Object.assign({},t))["content-length"];n&&delete t["content-length"],this.publish({destination:e,headers:t,body:r,skipContentLengthHeader:n})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class g{static client(e,t){return null==t&&(t=u.default.protocolVersions()),new m((()=>new(g.WebSocketClass||WebSocket)(e,t)))}static over(e){let t;return"function"==typeof e?t=e:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),t=()=>e),new m(t)}}g.WebSocketClass=null},6551:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>J}),console.log("BUILD/SERIOUSLY.MODULE");let n,i,o,s,a,u,c,l={},f={},h={},d={},p=[],v={},m={},g={canvas:[],image:[],video:[]},y={},b=window.WeakMap&&new WeakMap,_=0,w=function(){},S={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},E=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,T=/^#(([0-9a-fA-F]{3,8}))/,O=["x","y","z","w"],C=["r","g","b","a"],x={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},P=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(e,t,r,n,i,o,s){s||(s=M.create());var a=t-e,u=n-r,c=o-i;return s[0]=2*i/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/u,s[6]=0,s[7]=0,s[8]=(t+e)/a,s[9]=(n+r)/u,s[10]=-(o+i)/c,s[11]=-1,s[12]=0,s[13]=0,s[14]=-o*i*2/c,s[15]=0,s},perspective:function(e,t,r,n,i){var o=r*Math.tan(e*Math.PI/360),s=o*t;return M.frustum(-s,s,-o,o,r,n,i)},multiply:function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=r[0],_=r[1],w=r[2],S=r[3];return e[0]=b*n+_*a+w*f+S*v,e[1]=b*i+_*u+w*h+S*m,e[2]=b*o+_*c+w*d+S*g,e[3]=b*s+_*l+w*p+S*y,b=r[4],_=r[5],w=r[6],S=r[7],e[4]=b*n+_*a+w*f+S*v,e[5]=b*i+_*u+w*h+S*m,e[6]=b*o+_*c+w*d+S*g,e[7]=b*s+_*l+w*p+S*y,b=r[8],_=r[9],w=r[10],S=r[11],e[8]=b*n+_*a+w*f+S*v,e[9]=b*i+_*u+w*h+S*m,e[10]=b*o+_*c+w*d+S*g,e[11]=b*s+_*l+w*p+S*y,b=r[12],_=r[13],w=r[14],S=r[15],e[12]=b*n+_*a+w*f+S*v,e[13]=b*i+_*u+w*h+S*m,e[14]=b*o+_*c+w*d+S*g,e[15]=b*s+_*l+w*p+S*y,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],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}},A=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){var t,r,n;return t=(new Date).getTime(),r=Math.max(0,16-(t-N)),n=window.setTimeout((function(){e(t+r)}),r),N=t+r,n}),j=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){window.cancelTimeout(e)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],I=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],D=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function L(e,t){var r,n;if("string"==typeof e)r=document.querySelector(e);else if(!e)return!1;return e.tagName&&(r=e),r?(n=r.tagName.toLowerCase(),t&&t.indexOf(n)<0?e:r):e}function F(e,t){var r,n;for(r in e.prototype&&t.prototype&&e.prototype!==t.prototype&&F(e.prototype,t.prototype),t)t.hasOwnProperty(r)&&((n=Object.getOwnPropertyDescriptor(t,r)).get||n.set?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:n.get,set:n.set}):e[r]=t[r]);return e}function U(e){var t;if(!console)return w;if("function"==typeof console[e])t=console[e];else{if("function"!=typeof console.log)return w;t=console.log}return t.bind?t.bind(console):function(){t.apply(console,arguments)}}function B(e,t){if(t||(t="HTMLElement"),e instanceof window[t])return!0;if(!e||"object"!=typeof e)return!1;for(;e;)if((e=Object.getPrototypeOf(e))&&e.constructor.name===t)return!0;return!1}function W(e,t,r,n,i){function o(e,t,r){return(r%=1)<0&&(r+=1),r<1/6?e+(t-e)*r*6:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var s,a;return s=2*r-(a=r<.5?r*(t+1):r+t-r*t),i||(i=[]),i[0]=o(s,a,e+1/3),i[1]=o(s,a,e),i[2]=o(s,a,e-1/3),i[3]=n,i}function V(e){var t,r,n,i="#",o=e[3]<1?4:3;for(t=0;t<o;t++)n=(r=Math.min(255,Math.round(255*e[t]||0))).toString(16),r<16&&(n="0"+n),i+=n;return i}function q(e){return Array.isArray(e)||e&&e.BYTES_PER_ELEMENT&&"length"in e}function z(e){if("function"!=typeof e)throw new Error("setTimeoutZero argument is not a function");p.push(e),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){p.length&&p.shift()()}),0)}function H(e,t){var r;try{r=window.WebGLDebugUtils&&t&&t.debugContext?window.WebGLDebugUtils.makeDebugContext(e.getContext("webgl",t)):e.getContext("webgl",t)}catch(e){}if(!r)try{r=e.getContext("experimental-webgl",t)}catch(e){}return r}function G(){var e;return n&&n.getError()===n.CONTEXT_LOST_WEBGL&&(n=void 0),n||!window.WebGLRenderingContext||o||(e=document.createElement("canvas"),n=H(e),n?e.addEventListener("webglcontextlost",(function t(r){r.preventDefault(),n&&n.canvas===this&&(n=void 0,e.removeEventListener("webglcontextlost",t,!1))}),!1):X.logger.warn("Unable to access WebGL.")),n}function $(e){var t,r,n;function i(e,n){var i,o;q(e)?(i=e[0],o=e[1]||i):i=e,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),r[i]=o,n||(t.firstValue=i)}function o(e){return e}for(n in e.inputs)if(e.inputs.hasOwnProperty(n)){if(e.reserved.indexOf(n)>=0||Object.prototype[n])throw new Error("Reserved input name: "+n);(t=e.inputs[n]).name=n,isNaN(t.min)&&(t.min=-1/0),isNaN(t.max)&&(t.max=1/0),isNaN(t.minCount)&&(t.minCount=-1/0),isNaN(t.maxCount)&&(t.maxCount=1/0),isNaN(t.step)&&(t.step=0),isNaN(t.mod)&&(t.mod=0),"enum"===t.type&&t.options&&q(t.options)&&t.options.length&&(r={},t.options.forEach(i),t.options=r),"vector"===t.type?t.dimensions<2?t.dimensions=2:t.dimensions>4||!t.dimensions||isNaN(t.dimensions)?t.dimensions=4:t.dimensions=Math.round(t.dimensions):t.dimensions=1,t.shaderDirty=!!t.shaderDirty,"function"!=typeof t.validate&&(t.validate=X.inputValidators[t.type]||o),e.defaultImageInput||"image"!==t.type||(e.defaultImageInput=n)}}function Y(e,t,r,n){var i,o,s,a;!0===n||n&&n.useFloat,this.type=e.UNSIGNED_BYTE,i=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,i),n&&n.texture?(this.texture=n.texture,e.bindTexture(e.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===e.FLOAT?(s=new Float32Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.FLOAT,s)):(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),this.type=e.UNSIGNED_BYTE)}catch(n){this.type=e.UNSIGNED_BYTE,s=new Uint8Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,s)}if(o=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0),(a=e.checkFramebufferStatus(e.FRAMEBUFFER))===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(a===e.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+a);e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this.gl=e,this.frameBuffer=i,this.renderBuffer=o,this.width=t,this.height=r}function K(e,t,r){var n,i,o,s,a,u,c,l,f="";function h(t,r){var n,i;if(n=r?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){for(t=t.split(/[\n\r]/),i=0;i<t.length;i++)t[i]=i+1+":\t"+t[i];throw t.unshift("Error compiling "+(r?"fragment":"vertex")+" shader:"),X.logger.error(t.join("\n")),new Error("Shader error: "+e.getShaderInfoLog(n))}return n}function d(t,r){if(t.type===e.SAMPLER_2D)return function(n){t.glTexture=e["TEXTURE"+n],e.uniform1i(r,n)};if(t.type===e.BOOL||t.type===e.INT)return t.size>1?function(t){e.uniform1iv(r,t)}:function(t){e.uniform1i(r,t)};if(t.type===e.FLOAT)return t.size>1?function(t){e.uniform1fv(r,t)}:function(t){e.uniform1f(r,t)};if(t.type===e.FLOAT_VEC2)return function(t){e.uniform2f(r,t[0],t[1])};if(t.type===e.FLOAT_VEC3)return function(t){e.uniform3f(r,t[0],t[1],t[2])};if(t.type===e.FLOAT_VEC4)return function(t){e.uniform4f(r,t[0],t[1],t[2],t[3])};if(t.type===e.FLOAT_MAT3)return function(t){e.uniformMatrix3fv(r,!1,t)};if(t.type===e.FLOAT_MAT4)return function(t){e.uniformMatrix4fv(r,!1,t)};throw new Error("Unknown shader uniform type: "+t.type)}function p(t){return function(){return e.getUniform(n,t)}}if(i=h(t),o=h(r,!0),n=e.createProgram(),e.attachShader(n,i),(s=e.getShaderInfoLog(i))&&(f+="Vertex shader error: "+s+"\n"),e.attachShader(n,o),(s=e.getShaderInfoLog(o))&&(f+="Fragment shader error: "+s+"\n"),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw f+=e.getProgramInfoLog(n),e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o),(c=R.exec(t)||R.exec(r))&&(f="Shader = "+c[1]+"\n"+f),P.forEach((function(t){f+="\n"+t+": "+e.getParameter(e[t])})),new Error("Could not initialize shader:\n"+f);for(e.useProgram(n),this.uniforms={},u=e.getProgramParameter(n,e.ACTIVE_UNIFORMS),a=0;a<u;++a)(l={info:e.getActiveUniform(n,a)}).name=l.info.name.replace(/\[0\]$/,""),l.loc=e.getUniformLocation(n,l.name),l.set=d(l.info,l.loc),l.get=p(l.loc),this.uniforms[l.name]=l,this[l.name]||(this[l.name]=l);for(this.attributes={},this.location={},u=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),a=0;a<u;++a)(l={info:e.getActiveAttrib(n,a)}).name=l.info.name,l.location=e.getAttribLocation(n,l.name),this.attributes[l.name]=l,this.location[l.name]=l.location;this.gl=e,this.program=n,this.destroy=function(){var t;for(t in e&&(e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o)),this)this.hasOwnProperty(t)&&delete this[t];n=null,i=null,o=null}}function X(e){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(e);var t,r,n,i,o,a,p,y,S,E,T,O,C,P,k,I=++_,N=this,U=[],W={},q=0,G=[],J=[],Z=[],Q=[],ee={},te=[],re=[],ne={},ie={},oe=!1,se=!1;function ae(e,t){var r,n,i;return!!t&&(r=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.STATIC_DRAW),r.size=3,n=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW),i=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,e.coords,t.STATIC_DRAW),i.size=2,{vertex:r,index:n,texCoord:i,length:e.indices.length,mode:e.mode||t.TRIANGLES})}function ue(e){var t={};return t.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),t.indices=new Uint16Array([0,1,2,0,2,3]),t.coords=new Float32Array([0,0,1,0,1,1,0,1]),ae(t,e)}function ce(e){var n,s;if(!r)if(e.canvas.addEventListener("webglcontextlost",fe,!1),e.canvas.addEventListener("webglcontextrestored",le,!1),e.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(r=e,t=e.canvas,i=ue(r),o=new K(r,"#define SHADER_NAME seriously.base\n"+u,"#define SHADER_NAME seriously.base\n"+c),n=0;n<Q.length;n++)(s=Q[n]).gl=r,s.initialize(),s.buildShader();for(n=0;n<G.length;n++)(s=G[n]).initialize();for(n=0;n<J.length;n++)(s=J[n]).model||(s.model=i,s.shader=o)}}function le(){var e,t,i,o;if(n&&!r){if(B(t=n.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(e=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:n.debugContext})){if(e.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ce(e),n.renderToTexture?n.frameBuffer=new Y(r,n.width,n.height,!1):n.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(o=U[i]).setDirty(),o.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function fe(e){var n,s;for(e&&(X.logger.warn("WebGL context lost"),e.preventDefault()),k&&(j(k),k=0),t&&t.removeEventListener("webglcontextlost",fe,!1),n=0;n<Q.length;n++)(s=Q[n]).gl=null,s.initialized=!1,s.baseShader=null,s.model=null,s.frameBuffer=null,s.texture=null,s.shader&&s.shader.destroy&&(s.shader.destroy(),s.effect.commonShader&&delete ie[s.hook]),s.shaderDirty=!0,s.shader=null,s.effect.lostContext&&s.effect.lostContext.call(s),e&&s.emit("webglcontextlost");for(n=0;n<G.length;n++)(s=G[n]).texture=null,s.initialized=!1,s.allowRefresh=!1,e&&s.emit("webglcontextlost");for(n=0;n<Z.length;n++)(s=Z[n]).frameBuffer=null,s.texture=null,e&&s.emit("webglcontextlost");for(n=0;n<J.length;n++)(s=J[n]).model=!1,s.frameBuffer=null,e&&s.emit("webglcontextlost");o&&o.destroy&&o.destroy(),r&&(r.deleteBuffer(i.vertex),r.deleteBuffer(i.texCoord),r.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,o=null,r=null,t=null}function he(e){var t,r,n=!1;if(k=0,te.length)for(n=!0,t=0;t<te.length;t++)te[t].call(N,e);if(G&&G.length)for(n=!0,t=0;t<G.length;t++)((r=G[t]).dirty||r.checkDirty&&r.checkDirty())&&(r.dirty=!1,r.setDirty());for(t=0;t<J.length;t++)(r=J[t]).auto&&r.dirty&&r.render();if(re.length)for(n=!0,t=0;t<re.length;t++)re[t].call(N);n&&!k&&(k=A(he))}function de(e,t,n,i,o,s){var a,u,c,l,f,h,d,v,m,g=0,b=o&&o.gl||r;if(b){for(a in o?(l=s&&s.width||o.width||b.canvas.width,f=s&&s.height||o.height||b.canvas.height):(l=s&&s.width||b.canvas.width,f=s&&s.height||b.canvas.height),e.use(),b.viewport(0,0,l,f),b.bindFramebuffer(b.FRAMEBUFFER,i),b.enableVertexAttribArray(e.location.position),b.enableVertexAttribArray(e.location.texCoord),t.texCoord&&(b.bindBuffer(b.ARRAY_BUFFER,t.texCoord),b.vertexAttribPointer(e.location.texCoord,t.texCoord.size,b.FLOAT,!1,0,0)),b.bindBuffer(b.ARRAY_BUFFER,t.vertex),b.vertexAttribPointer(e.location.position,t.vertex.size,b.FLOAT,!1,0,0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,t.index),s&&s.depth?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),s?void 0===s.blend||s.blend?(r.enable(r.BLEND),h=void 0===s.srcRGB?r.ONE:s.srcRGB,v=s.dstRGB||r.ZERO,d=void 0===s.srcAlpha?h:s.srcAlpha,m=void 0===s.dstAlpha?v:s.dstAlpha,r.blendFuncSeparate(h,v,d,m),r.blendEquation(s.blendEquation||r.FUNC_ADD)):r.disable(r.BLEND):(r.enable(r.BLEND),r.blendFunc(r.ONE,r.ZERO),r.blendEquation(r.FUNC_ADD)),n)n.hasOwnProperty(a)&&(u=n[a],(c=e.uniforms[a])&&(B(u,"WebGLTexture")?(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u),c.set(g),g++):u instanceof p||u instanceof y||u instanceof S?u.texture&&(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u.texture),c.set(g),g++):null!=u&&c.set(u)));s&&void 0!==s.clear&&!s.clear||(b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)),b.drawElements(t.mode,t.length,b.UNSIGNED_SHORT,0),r.enable(r.DEPTH_TEST)}}function pe(e,t,r){var n,i;if(("string"!=typeof e||!t&&0!==t)&&(r&&"object"==typeof r||(r=t),t=e),"string"==typeof e&&h[e]||(e=null),t instanceof p||t instanceof y||t instanceof S)n=t;else if(t instanceof T||t instanceof O||t instanceof C){if(!(n=W[t.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),i=0;i<G.length;i++)if(n=G[i],(!e||e===n.hook)&&n.compare&&n.compare(t,r))return n;n=new p(e,t,r)}return n}function ve(e,t){var r,n,i;if(!(e instanceof y||e instanceof S))return!1;if(e===t)return!0;for(r in i=e.sources)if(i.hasOwnProperty(r)&&((n=i[r])===t||ve(n,t)))return!0;return!1}(a=function(){this.ready=!1,this.width=1,this.height=1,this.gl=r,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=q,q++}).prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},a.prototype.setUnready=function(){var e;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setUnready()},a.prototype.setDirty=function(){var e;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setDirty()},a.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,e))},a.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},a.prototype.resize=function(){var e,t;this.source?(e=this.source.width,t=this.source.height):this.sources&&this.sources.source?(e=this.sources.source.width,t=this.sources.source.height):this.inputs&&this.inputs.width?(e=this.inputs.width,t=this.inputs.height||e):this.inputs&&this.inputs.height?e=t=this.inputs.height:(e=1,t=1),e=Math.floor(e),t=Math.floor(t),this.width===e&&this.height===t||(this.width=e,this.height=t,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=t),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,t)},a.prototype.on=function(e,t){var r,n=-1;e&&"function"==typeof t&&((r=this.listeners[e])?n=r.indexOf(t):r=this.listeners[e]=[],n<0&&r.push(t))},a.prototype.off=function(e,t){var r,n=-1;e&&"function"==typeof t&&(r=this.listeners[e])&&(n=r.indexOf(t))>=0&&r.splice(n,1)},a.prototype.emit=function(e){var t,r=this.listeners[e];if(r&&r.length)for(t=0;t<r.length;t++)z(r[t])},a.prototype.destroy=function(){var e,t;for(t in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];for(e in this.uniforms)this.uniforms.hasOwnProperty(e)&&delete this.uniforms[e];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(e=U.indexOf(this))>=0&&U.splice(e,1),delete W[this.id],this.isDestroyed=!0},T=function(e){var t,r=e;function n(e,t){var n,i,o;return o=r.effect.inputs[e],n=r.inputElements[e],"string"==typeof t&&isNaN(t)&&("enum"===o.type?o.options.hasOwnProperty(t)||(t=L(t,["select"])):"number"===o.type||"boolean"===o.type?t=L(t,["input","select"]):"image"===o.type&&(t=L(t,["canvas","img","video"]))),B(t,"HTMLInputElement")||B(t,"HTMLSelectElement")?(i=t.value,n&&n.element!==t&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e],n=null),n||(n={element:t,listener:function(e,n){return function(){var i,s;i="checkbox"===t.type?t.checked:n.value,s=r.setInput(e,i),"color"===o.type&&(s=V(s).substr(0,7)),s!==i&&(n.value=s)}}(e,t)},r.inputElements[e]=n,"range"===t.type?(t.addEventListener("input",n.listener,!0),t.addEventListener("change",n.listener,!0)):t.addEventListener("change",n.listener,!0)),n&&"checkbox"===t.type&&(i=t.checked)):(n&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e]),i=t),r.setInput(e,i),r.inputs[e]}function i(e){return function(t){var r=n(e,t);return r&&r.pub}}function o(e){return function(){var t=r.inputs[e];return t&&t.pub}}function s(e){return function(t){return n(e,t)}}function a(e){return function(){return r.inputs[e]}}for(t in r.effect.inputs)if(r.effect.inputs.hasOwnProperty(t)){if(void 0!==this[t])throw new Error("Cannot overwrite Seriously."+t);"image"===r.effect.inputs[t].type?Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:o(t),set:i(t)}):Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:a(t),set:s(t)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.effect.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}}}),this.render=function(){return r.render(),this},this.readPixels=function(e,t,n,i,o){return r.readPixels(e,t,n,i,o)},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.inputs=function(e){var t,n,i,o;if(i=r.effect.inputs,e)return(n=i[e])?(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t):null;for(o in t={},i)i.hasOwnProperty(o)&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.matte=function(e){r.matte(e)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},y=function(e,t){var n,i,o,u,c={};for(n in a.call(this,t),this.gl=r,this.effectRef=l[e],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=e,this.options=t,this.transform=null,this.effect=F({},this.effectRef),this.effectRef.definition&&F(this.effect,this.effectRef.definition.call(this,t)),$(this.effect),this.uniforms.transform=s,this.inputs={},u=ne[e],this.effect.inputs)this.effect.inputs.hasOwnProperty(n)&&(void 0!==(i=this.effect.inputs[n]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),o=i.validate.call(this,i.defaultValue,i),u&&void 0!==u[n]&&(o=i.validate.call(this,u[n],i,i.defaultValue,o),u[n]=o,"image"===i.type&&(c[n]=o)),this.inputs[n]=o,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(n in r&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new T(this),U.push(this),W[this.id]=this,Q.push(this),v[e].push(this),c)c.hasOwnProperty(n)&&this.setInput(n,c[n])},y.prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var e=this;this.baseShader=o,this.shape?this.model=ae(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){e.initFrameBuffer(!0)}),r):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize()},y.prototype.updateReady=function(){var e,t,r,n,i=!0;for(t in(r=this.effect).inputs)if(r.inputs.hasOwnProperty(t)&&"image"===this.effect.inputs[t].type&&(!this.sources[t]||!this.sources[t].ready)&&(!r.requires||r.requires.call(this,t,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),n=i?"setReady":"setUnready",this.targets))for(e=0;e<this.targets.length;e++)this.targets[e][n]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},y.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},y.prototype.removeSource=function(e){var t,r=e&&e.pub;for(t in this.inputs)!this.inputs.hasOwnProperty(t)||this.inputs[t]!==e&&this.inputs[t]!==r||(this.inputs[t]=null);for(t in this.sources)!this.sources.hasOwnProperty(t)||this.sources[t]!==e&&this.sources[t]!==r||(this.sources[t]=null)},y.prototype.buildShader=function(){var e,t=this.effect,n=this;function i(e){return R.test(e)?e:"#define SHADER_NAME seriously."+n.hook+"\n"+e}this.shaderDirty&&(t.commonShader&&ie[this.hook]?(this.shader||ie[this.hook].count++,this.shader=ie[this.hook].shader):t.shader?(this.shader&&!t.commonShader&&this.shader.destroy(),(e=t.shader.call(this,this.inputs,{vertex:u,fragment:c},X.util))instanceof K?this.shader=e:e&&e.vertex&&e.fragment?this.shader=new K(r,i(e.vertex),i(e.fragment)):this.shader=o,t.commonShader&&(ie[this.hook]={count:1,shader:this.shader})):this.shader=o,this.shaderDirty=!1)},y.prototype.render=function(){var e,t,n,i=this.effect,o=this;if(r){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(e in this.sources)!this.sources.hasOwnProperty(e)||i.requires&&!i.requires.call(this,e,this.inputs)||(n="function"==typeof this.inPlace?this.inPlace(e):this.inPlace,this.sources[e].render(!n));this.frameBuffer&&(t=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,t,(function(e,t,r,n,i,s){de(e,t,r,n,i||o,s)})),this.emit("render")):t&&(de(this.shader,this.model,this.uniforms,t,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(e,t){var r,n,i,o,a,u=this;if(this.effect.inputs.hasOwnProperty(e)){if("image"===(r=this.effect.inputs[e]).type){if(t){if((t=pe(t))!==this.sources[e]){if(function(){var t,r=u.sources[e];if(r){for(t in u.sources)if(t!==e&&u.sources.hasOwnProperty(t)&&u.sources[t]===r)return;r.removeTarget(u)}}(),ve(t,this))throw new Error("Attempt to make cyclical connection.");this.sources[e]=t,t.addTarget(this)}}else delete this.sources[e],t=!1;n=this.sources[e],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(o=this.sources[i[0]],this.uniforms.transform=o&&o.cumulativeMatrix||s):this.uniforms.transform=s}else a=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,n=t=r.validate.call(this,t,r,a,this.inputs[e]);return this.inputs[e]===t&&"color"!==r.type&&"vector"!==r.type||(this.inputs[e]=t,r.uniform&&(this.uniforms[r.uniform]=n),"image"===r.type?(this.resize(),this.updateReady()):r.updateSources&&this.updateReady(),r.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),r.update&&r.update.call(this,t)),t}},y.prototype.alias=function(e,t){var r=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),ee[t]={node:this,input:e},Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return r.inputs[e]},set:function(t){return r.setInput(e,t)}})),this},y.prototype.matte=function(e){var t,r,n,i,o,s,a,u=[],c=[],l={};function f(e){var t,r,n,i,o,s,a,l,f,h,d,p=[];if(!e.simple){for(t=0;t<e.edges.length;t++)for(n=e.edges[t],r=t+1;r<e.edges.length;r++)i=e.edges[r],v=n[0],m=n[1],g=i[0],void 0,void 0,void 0,S=void 0,E=void 0,b=((y=i[1]).x-g.x)*(v.y-g.y)-(y.y-g.y)*(v.x-g.x),_=(m.x-v.x)*(v.y-g.y)-(m.y-v.y)*(v.x-g.x),(o=!!((w=(y.y-g.y)*(m.x-v.x)-(y.x-g.x)*(m.y-v.y))&&(E=_/w,(S=b/w)>0&&S<=1&&E>0&&E<=1))&&{x:v.x+S*(m.x-v.x),y:v.y+S*(m.y-v.y)})&&(o.edge1=n,o.edge2=i,p.push(o));var v,m,g,y,b,_,w,S,E;if(p.length){for(f=[],t=0;t<p.length;t++)n=(o=p[t]).edge1,i=o.edge2,h={x:o.x,y:o.y,prev:n[0],next:i[1],id:c.length},e.vertices.push(h),c.push(h),d={x:o.x,y:o.y,prev:i[0],next:n[1],id:c.length},e.vertices.push(d),c.push(h),h.prev.next=h,h.next.prev=h,d.prev.next=d,d.next.prev=d;do{s={edges:[],vertices:[],simple:!0},f.push(s),a=l=e.vertices[0];do{t=e.vertices.indexOf(l),e.vertices.splice(t,1),s.edges.push([l,l.next]),s.vertices.push(l),l=l.next}while(l!==a)}while(e.vertices.length);for(t=u.indexOf(e),u.splice(t,1),t=0;t<f.length;t++)u.push(f[t])}else e.simple=!0}}function h(e){var t,r,n,i,o=e.vertices.length,s=0;for(t=o-1,r=0;r<o;t=r,r++)n=e.vertices[t],i=e.vertices[r],s+=n.x*i.y-i.x*n.y;return s>0}function d(e){var t,n,i,o,s,a,u,c,l,f,h,d=e.vertices,p=[],v=[];function m(e,t,r,n){var i,o,s,a,u,c,l,f,h,d,p,v;return i=r.x-t.x,o=r.y-t.y,s=e.x-r.x,a=e.y-r.y,u=t.x-e.x,c=t.y-e.y,l=n.x-e.x,f=n.y-e.y,h=n.x-t.x,d=n.y-t.y,p=n.x-r.x,v=n.y-r.y,i*d-o*h>=0&&s*v-a*p>=0&&u*f-c*l>=0}function g(e,t,r,n,i){var o,s,a,u;if(s=d[i[e]],a=d[i[t]],u=d[i[r]],0>(a.x-s.x)*(u.y-s.y)-(a.y-s.y)*(u.x-s.x))return!1;for(o=0;o<n;o++)if(o!==e&&o!==t&&o!==r&&m(s,a,u,d[i[o]]))return!1;return!0}if(n=d.length,e.clockWise)for(t=0;t<n;t++)p[t]=t;else for(t=0;t<n;t++)p[t]=n-1-t;for(o=2*(i=n),t=i-1;i>2;){if(o--<=0)return v;if(i<=(s=t)&&(s=0),i<=(t=s+1)&&(t=0),i<(a=t+1)&&(a=0),g(s,t,a,i,p)){for(u=p[s],c=p[t],l=p[a],e.clockWise?(v.push(d[u]),v.push(d[c]),v.push(d[l])):(v.push(d[l]),v.push(d[c]),v.push(d[u])),f=t,h=t+1;h<i;f++,h++)p[f]=p[h];o=2*--i}}r.indices=v}for(t=function(e){return e&&e.length&&Array.isArray(e)?Array.isArray(e[0])?Array.isArray(e[0])&&!isNaN(e[0][0])?[e]:e:[e]:[]}(e),n=0;n<t.length;n++){for(e=t[n],a=null,r={vertices:[],edges:[]},i=0;i<e.length;i++)"object"!=typeof(o=e[i])||isNaN(o.x)||isNaN(o.y)?o.length>=2&&!isNaN(o[0])&&!isNaN(o[1])&&(s={x:o[0],y:o[1],id:c.length}):s={x:o.x,y:o.y,id:c.length},s&&(a?(a.next=s,s.prev=a,s.next=r.vertices[0],r.vertices[0].prev=s):(r.head=s,s.next=s,s.prev=s),c.push(s),r.vertices.push(s),a=s);if(r.vertices.length>2)for(3===r.vertices.length&&(r.simple=!0),u.push(r),i=0;i<r.vertices.length;i++)s=r.vertices[i],r.edges.push([s,s.next])}for(n=u.length-1;n>=0;n--)f(r=u[n]);for(n=0;n<u.length;n++)(r=u[n]).clockWise=h(r),d(r);for(l.vertices=[],l.coords=[],n=0;n<c.length;n++)o=c[n],l.vertices.push(2*o.x-1),l.vertices.push(-2*o.y+1),l.vertices.push(-1),l.coords.push(o.x),l.coords.push(-1*o.y+1);for(l.vertices=new Float32Array(l.vertices),l.coords=new Float32Array(l.coords),l.indices=[],n=0;n<u.length;n++)for(r=u[n],i=0;i<r.indices.length;i++)o=r.indices[i],l.indices.push(o.id);l.indices=new Uint16Array(l.indices),this.shape=l,this.gl&&ae(l,this.gl)},y.prototype.destroy=function(){var e,t,r,n=this.hook;for(t in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,ie[n]&&(ie[n].count--,ie[n].count||delete ie[n]),this.shader&&this.shader.destroy&&this.shader!==o&&!ie[n]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(t)&&((r=this.inputElements[t]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(t in this.sources)this.sources.hasOwnProperty(t)&&((r=this.sources[t])&&r.removeTarget&&r.removeTarget(this),delete this.sources[t]);for(;this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Q.indexOf(this))>=0&&Q.splice(e,1),(e=v[n].indexOf(this))>=0&&v[n].splice(e,1),a.prototype.destroy.call(this)},O=function(e){var t=e;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return t.source}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}},width:{enumerable:!0,configurable:!0,get:function(){return t.width}},height:{enumerable:!0,configurable:!0,get:function(){return t.height}}}),this.render=function(){t.render()},this.update=function(){t.setDirty()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},p=function(e,t,n){var i,o,s=n||{},u=void 0===s.flip||s.flip,c=s.width,l=s.height,f=!1,d=this,p=!1;function v(e,t,r,n){var i=h[e];if(i.definition){if(!(i=i.definition.call(d,t,r,n)))return null;i=F(F({},h[e]),i)}return i}function m(e){return d.source===e}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(n&&"object"==typeof n||(n=t),t=e),"string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),"string"==typeof e&&h[e]&&(o=v(e,t,n,!0))&&(this.hook=e,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source)),!o&&B(t))"CANVAS"===t.tagName?(this.width=t.width,this.height=t.height,this.render=this.renderImageCanvas,p=!0,this.hook="canvas",this.compare=m):"IMG"===t.tagName&&(this.width=t.naturalWidth||1,this.height=t.naturalHeight||1,t.complete&&t.naturalWidth||(f=!0),t.addEventListener("load",(function(){d.isDestroyed||(d.width===t.naturalWidth&&d.height===t.naturalHeight||(d.width=t.naturalWidth,d.height=t.naturalHeight,d.resize()),d.setDirty(),d.setReady())}),!0),this.render=this.renderImageCanvas,p=!0,this.hook="image",this.compare=m);else if(!o&&B(t,"WebGLTexture")){if(r&&!r.isTexture(t))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(l)||(c=l):isNaN(l)&&(l=c),this.width=c,this.height=l,void 0===s.flip&&(u=!1),p=!0,this.texture=t,this.initialized=!0,this.hook="texture",this.compare=m,this.render=function(){}}if(!p&&!o)for(i in h)if(h.hasOwnProperty(i)&&h[i]&&(o=v(i,t,n,!1))){this.hook=i,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source);break}if(!p)throw new Error("Unknown source type");this.source=t,void 0===this.flip&&(this.flip=u),this.targets=[],f||d.setReady(),this.pub=new O(this),U.push(this),W[this.id]=this,G.push(this),g[this.hook].push(this),G.length&&!k&&he()},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,p.prototype.initialize=function(){var e;r&&!this.texture&&this.ready&&(e=r.createTexture(),r.bindTexture(r.TEXTURE_2D,e),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.bindTexture(r.TEXTURE_2D,null),this.texture=e,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},p.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,{texture:this.texture,useFloat:e}))},p.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},p.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},p.prototype.resize=function(){var e,t;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(e=0;e<this.targets.length;e++)(t=this.targets[e]).resize(),t.setTransformDirty&&t.setTransformDirty()},p.prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},p.prototype.render=function(){var e=this.source;r&&(e||0===e)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,r,de,i,o)&&(this.dirty=!1,this.emit("render")))},p.prototype.renderImageCanvas=function(){var e=this.source;if(r&&e&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){r.bindTexture(r.TEXTURE_2D,this.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),this.dirty=!1,this.emit("render"),!0}catch(e){e.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},p.prototype.destroy=function(){var e,t,n;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),r&&this.texture&&r.deleteTexture(this.texture);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in(e=G.indexOf(this))>=0&&G.splice(e,1),(e=g[this.hook].indexOf(this))>=0&&g[this.hook].splice(e,1),this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];a.prototype.destroy.call(this)},P=function(e){var t=e;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(t.source)return t.source.pub},set:function(e){t.setSource(e)}},original:{enumerable:!0,configurable:!0,get:function(){return t.target}},width:{enumerable:!0,configurable:!0,get:function(){return t.width},set:function(e){!isNaN(e)&&e>0&&t.width!==e&&(t.width=e,t.resize(),t.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return t.height},set:function(e){!isNaN(e)&&e>0&&t.height!==e&&(t.height=e,t.resize(),t.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}}}),this.render=function(){t.render()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.go=function(e){t.go(e)},this.stop=function(){t.stop()},this.getTexture=function(){return t.frameBuffer.texture},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.inputs=function(e){return{source:{type:"image"}}},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},E=function(e,t,s){var l,f,h,p,v,m,g,y,_,S=this,E=!1;function T(e,t,n,s){var a=d[e];if(a.definition){if(!(a=a.definition.call(S,t,n,s)))return null;a=F(F({},d[e]),a),S.hook=_,E=!0,S.plugin=a,S.compare=a.compare,a.target&&(t=a.target),a.gl&&!S.gl&&(S.gl=a.gl,r||ce(a.gl)),S.gl===r&&(S.model=i,S.shader=o)}return a}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(s&&"object"==typeof s||(s=t),t=e),f=void 0===(l=s||{}).flip||l.flip,h=parseInt(l.width,10),p=parseInt(l.height,10),m=l.debugContext,"string"==typeof e&&d[e]&&T(e,t,l,!0),this.renderToTexture=l.renderToTexture,B(t,"WebGLFramebuffer"))if(g=t,B(l,"HTMLCanvasElement"))t=l;else if(B(l,"WebGLRenderingContext"))t=l.canvas;else if(B(l.canvas,"HTMLCanvasElement"))t=l.canvas;else{if(!B(l.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");t=l.context.canvas}if(B(t,"HTMLCanvasElement")){if(h=t.width,p=t.height,(!r||r.canvas!==t&&l.allowSecondaryWebGL)&&(v=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:m})),v)r&&r!==v?(this.gl=v,this.frameBuffer={frameBuffer:g||null},this.shader=new K(this.gl,u,c),this.model=ue.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(r.TEXTURE_2D,this.texture),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(n||(n=this),r||ce(v),this.render=this.renderWebGL,l.renderToTexture?r&&(this.frameBuffer=new Y(r,h,p,!1)):this.frameBuffer={frameBuffer:g||null});else{if(!l.allowSecondaryWebGL&&r&&r.canvas!==t)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=w,X.logger.log("Unable to create WebGL context.")}E=!0}if(!E)for(_ in d)if(d.hasOwnProperty(_)&&d[_]&&T(_,t,l,!1))break;if(!E)throw new Error("Unknown target type");b&&((y=b.get(t))?X.logger.warn("Target already in use by another instance",t,Object.keys(y).map((function(e){return y[e]}))):(y={},b.set(t,y)),y[N.id]=N),this.target=t,this.transform=null,this.transformDirty=!0,this.flip=f,h&&(this.width=h),p&&(this.height=p),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==l.auto?this.auto=l.auto:this.auto=oe,this.frames=0,this.pub=new P(this),U.push(this),W[this.id]=this,J.push(this)},(E.prototype=Object.create(a.prototype)).constructor=E,E.prototype.setSource=function(e){var t;(t=pe(e))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&(this.resize(),t.ready?this.setReady():this.setUnready()),this.setDirty())},E.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=A(he))},E.prototype.resize=function(){B(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},E.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},E.prototype.go=function(){this.auto=!0,this.setDirty()},E.prototype.stop=function(){this.auto=!1},E.prototype.render=function(){r&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,de,o,i)},E.prototype.renderWebGL=function(){var e,t,n;if(this.resize(),r&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||s:this.transformDirty&&(e=this.transform,M.copy(e,this.source.cumulativeMatrix||s),t=this.source.width/this.width,n=this.source.height/this.height,e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=n,e[5]*=n,e[6]*=n,e[7]*=n,this.uniforms.transform=e,this.transformDirty=!1),de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this,x),this.emit("render"),this.dirty=!1}},E.prototype.renderSecondaryWebGL=function(){var e,t,r,n,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),e=this.source.width,t=this.source.height,this.pixels&&this.pixels.length===e*t*4||(this.pixels=new Uint8Array(e*t*4)),this.source.readPixels(0,0,e,t,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),e===this.width&&t===this.height?this.uniforms.transform=s:this.transformDirty&&(r=this.transform,M.copy(r,s),n=this.source.width/this.width,i=this.source.height/this.height,r[0]*=n,r[1]*=n,r[2]*=n,r[3]*=n,r[4]*=i,r[5]*=i,r[6]*=i,r[7]*=i,this.uniforms.transform=r,this.transformDirty=!1),this.uniforms.source=this.texture,de(this.shader,this.model,this.uniforms,null,this,x),this.dirty=!1)},E.prototype.removeSource=function(e){this.source!==e&&this.source!==e.pub||(this.source=null)},E.prototype.destroy=function(){var e,r;this.source&&this.source.removeTarget&&this.source.removeTarget(this),b&&(delete(r=b.get(this.target))[N.id],Object.keys(r).length||b.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(e=J.indexOf(this))>=0&&J.splice(e,1),a.prototype.destroy.call(this),this===n&&(t.removeEventListener("webglcontextrestored",le,!1),fe(),n=null)},C=function(e){var t,r=e,n=this;function i(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){return t.get.call(r)},set:function(n){!function(e,t,n){var i,o,s;i=r.inputElements[e],"string"==typeof n&&isNaN(n)&&("enum"===t.type?t.options.hasOwnProperty(n)||(n=L(n,["select"])):"number"===t.type||"boolean"===t.type?n=L(n,["input","select"]):"image"===t.type&&(n=L(n,["canvas","img","video"]))),B(n,"HTMLInputElement")||B(n,"HTMLSelectElement")?(o=n.value,i&&i.element!==n&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e],i=null),i||(i={element:n,listener:(s=n,function(){var t,i;t="checkbox"===n.type?n.checked:s.value,i=r.setInput(e,t),"color"===n.type&&(i=V(i)),i!==t&&(s.value=i)})},r.inputElements[e]=i,"range"===n.type?(n.addEventListener("input",i.listener,!0),n.addEventListener("change",i.listener,!0)):n.addEventListener("change",i.listener,!0)),i&&"checkbox"===n.type&&(o=n.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e]),o=n),r.setInput(e,o)}(e,t,n)}})}function o(e){return function(){e.apply(r,arguments)&&r.setTransformDirty()}}for(t in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.plugin.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}},source:{enumerable:!0,configurable:!0,get:function(){return r.source&&r.source.pub},set:function(e){r.setSource(e)}}}),r.methods)r.methods.hasOwnProperty(t)&&(this[t]=o(r.methods[t]));for(t in r.inputs)r.inputs.hasOwnProperty(t)&&i(t,r.inputs[t]);this.update=function(){r.setDirty()},this.inputs=function(e){var t,n,i,o;if(i=r.plugin.inputs,e)return!(n=i[e])||n.method?null:(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t);for(o in t={},i)i.hasOwnProperty(o)&&!i[o].method&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},S=function(e,t){var r,n,i,o,s;for(r in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=f[e],this.hook=e,this.id=q,q++,this.options=t,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=F({},this.transformRef),this.transformRef.definition&&F(this.plugin,this.transformRef.definition.call(this,t)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&((n=this.plugin.inputs[r]).method&&"function"==typeof n.method?this.methods[r]=n.method:"function"==typeof n.set&&"function"==typeof n.get&&(this.inputs[r]=n));for(r in $(this.plugin),s=ne[e],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&"function"==typeof(n=this.plugin.inputs[r]).set&&"function"==typeof n.get&&"function"!=typeof n.method&&(i=n.get.call(this),o=void 0===n.defaultValue?i:n.defaultValue,o=n.validate.call(this,o,n,i),s&&void 0!==s[r]&&(o=n.validate.call(this,s[r],n,n.defaultValue,o),s[r]=o),o!==i&&n.set.call(this,o));U.push(this),W[this.id]=this,this.pub=new C(this),Z.push(this),m[e].push(this)},S.prototype=Object.create(a.prototype),S.prototype.constructor=S,S.prototype.setDirty=function(){this.renderDirty=!0,a.prototype.setDirty.call(this)},S.prototype.setTransformDirty=function(){var e,t;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,e=0;e<this.targets.length;e++)(t=this.targets[e]).setTransformDirty?t.setTransformDirty():t.setDirty()},S.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty()},S.prototype.setSource=function(e){var t;if((t=pe(e))!==this.source){if(ve(t,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&t.ready?this.setReady():this.setUnready(),this.resize()}},S.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},S.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1),this.targets&&this.targets.length&&this.resize()},S.prototype.setInput=function(e,t){var r,n,i;if(this.plugin.inputs.hasOwnProperty(e))return r=this.plugin.inputs[e],n=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,i=r.get.call(this),void 0===n&&(n=i),t=r.validate.call(this,t,r,n,i),r.set.call(this,t)&&this.setTransformDirty(),r.get.call(this)},S.prototype.alias=function(e,t){var r,n,i=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),(r=this.inputs[e])?(n=i.inputs[e],Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return n.get.call(i)},set:function(e){n.set.call(i,e)&&i.setTransformDirty()}})):(r=this.methods[e])&&(n=r,N[t]=function(){n.apply(i,arguments)&&i.setTransformDirty()}),r&&(ee[t]={node:this,input:e})),this},S.prototype.render=function(e){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||s),this.transformDirty=!1),e&&r?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new Y(r,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||s,de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},S.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},S.prototype.destroy=function(){var e,t,r,n=this.hook;for(e in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(e)&&((r=this.inputElements[e]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Z.indexOf(this))>=0&&Z.splice(e,1),(e=m[n].indexOf(this))>=0&&m[n].splice(e,1),a.prototype.destroy.call(this)},S.prototype.setReady=a.prototype.setReady,S.prototype.setUnready=a.prototype.setUnready,S.prototype.on=a.prototype.on,S.prototype.off=a.prototype.off,S.prototype.emit=a.prototype.emit,(e=B(e,"HTMLCanvasElement")?{canvas:e}:e||{}).canvas,this.effect=function(e,t){if(!l[e])throw new Error("Unknown effect: "+e);return new y(e,t).pub},this.source=function(e,t,r){return pe(e,t,r).pub},this.transform=function(t,r){if("string"!=typeof t&&(r=t,t=!1),t){if(!f[t])throw new Error("Unknown transform: "+t)}else if(t=e&&e.defaultTransform||"2d",!f[t])throw new Error("No transform specified");return new S(t,r).pub},this.target=function(e,t,r){var n,i,o;for(e&&"string"==typeof e&&!d[e]&&(i=document.querySelector(e)),("string"!=typeof e||!t&&0!==t||i)&&(r&&"object"==typeof r||(r=t),t=i||e,e=null),"string"==typeof t&&isNaN(t)&&(t=document.querySelector(t)),o=0;o<J.length;o++)if(n=J[o],(!e||e===n.hook)&&(n.target===t||n.compare&&n.compare(t,r)))return n.pub;return(n=new E(e,t,r)).pub},this.aliases=function(){return Object.keys(ee)},this.removeAlias=function(e){ee[e]&&(delete this[e],delete ee[e])},this.defaults=function(e,t){var r;if(e)if("object"!=typeof e)null===t?delete ne[e]:"object"==typeof t&&(ne[e]=F({},t));else for(r in e)e.hasOwnProperty(r)&&this.defaults(r,e[r]);else if(null===e)for(r in ne)ne.hasOwnProperty(r)&&delete ne[r]},this.go=function(e,t){var r;for("function"==typeof e&&te.indexOf(e)<0&&te.push(e),"function"==typeof t&&re.indexOf(t)<0&&re.push(t),oe=!0,r=0;r<J.length;r++)J[r].go();k||!te.length&&!re.length||he()},this.stop=function(){te.length=0,re.length=0,j(k),k=0},this.render=function(){var t;for(t=0;t<J.length;t++)J[t].render(e)},this.destroy=function(){for(var e,t;U.length;)U[0].pub.destroy();for(e in this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w);N=null,G=[],J=[],Q=[],U=[],te.length=0,re.length=0,j(k),k=0,se=!0},this.isDestroyed=function(){return se},this.incompatible=function(e){var t,r,n;if(n=X.incompatible(e))return n;if(!e){for(t in v)if(v.hasOwnProperty(t)&&v[t].length&&(r=l[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"plugin-"+t;for(t in g)if(g.hasOwnProperty(t)&&g[t].length&&(r=h[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"source-"+t}return!1},this.isNode=function(e){var t;return!(!e||!(t=W[e.id])||t.isDestroyed)},this.isSource=function(e){return this.isNode(e)&&e instanceof O},this.isEffect=function(e){return this.isNode(e)&&e instanceof T},this.isTransform=function(e){return this.isNode(e)&&e instanceof C},this.isTarget=function(e){return this.isNode(e)&&e instanceof P},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return I}}}),this.defaults(e.defaults)}window.addEventListener("message",(function(e){e.source===window&&"seriously-timeout-message"===e.data&&(e.stopPropagation(),p.length>0&&p.shift()())}),!0),Y.prototype.resize=function(e,t){var r=this.gl;this.width===e&&this.height===t||(this.width=e,this.height=t,r&&(r.bindTexture(r.TEXTURE_2D,this.texture),r.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,this.renderBuffer),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,t,0,r.RGBA,r.UNSIGNED_BYTE,null),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,e,t),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.texture,0),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,null)))},Y.prototype.destroy=function(){var e=this.gl;e&&(e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&e.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},K.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(e){var t,r,n;if(void 0===o&&((t=document.createElement("canvas"))&&t.getContext?window.WebGLRenderingContext?(r=G())||(o="context"):o="webgl":o="canvas"),o)return o;if(e){if((n=l[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"plugin-"+e;if((n=h[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"source-"+e}return!1},X.plugin=function(e,t,r){var n;if(l[e])X.logger.warn("Effect ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=k,n.inputs&&$(n),n.title||(n.title=e),l[e]=n,v[e]=[],n},X.removePlugin=function(e){var t;if(!e)return this;if(!l[e])return this;if(t=v[e]){for(;t.length;)t.shift().destroy();delete v[e]}return delete l[e],this},X.source=function(e,t,r){var n;if(h[e])X.logger.warn("Source ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),h[e]=n,g[e]=[],n},X.removeSource=function(e){var t;if(!e)return this;if(!h[e])return this;if(t=g[e]){for(;t.length;)t.shift().destroy();delete g[e]}return delete h[e],this},X.transform=function(e,t,r){var n;if(f[e])X.logger.warn("Transform ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=I,n.inputs&&$(n),n.title||(n.title=e),f[e]=n,m[e]=[],n},X.removeTransform=function(e){var t;if(!e)return this;if(!f[e])return this;if(t=m[e]){for(;t.length;)t.shift().destroy();delete m[e]}return delete f[e],this},X.target=function(e,t,r){var n;if(d[e])X.logger.warn("Target ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),d[e]=n,y[e]=[],n},X.removeTarget=function(e){var t;if(!e)return this;if(!d[e])return this;if(t=y[e]){for(;t.length;)t.shift().destroy();delete y[e]}return delete d[e],this},X.inputValidators={color:function(e,t,r,n){var o,s,a,u;if(s=n||[],"string"==typeof e){if((a=E.exec(e))&&a.length){if(a.length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(s[3]=1,u=0;u<3;u++)s[u]=parseFloat(a[u+2])/255;return isNaN(a[6])||(s[3]=parseFloat(a[6])),"hsl"===a[1].toLowerCase()?W(s[0],s[1],s[2],s[3],s):s}if((a=T.exec(e))&&a.length)return 3===(o=a[1]).length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=1):4===o.length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=parseInt(o[3],16)/15):6===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=1):8===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=parseInt(o.substr(6,2),16)/255):s[0]=s[1]=s[2]=s[3]=0,s;if(a=S[e.toLowerCase()]){for(u=0;u<4;u++)s[u]=a[u];return s}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=e,(o=i.fillStyle)&&"#000000"!==o?X.inputValidators.color(o,t,r,n):(s[0]=s[1]=s[2]=s[3]=0,s)}if(q(e)){if((s=e).length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(u=0;u<3;u++)if(isNaN(s[u]))return s[0]=s[1]=s[2]=s[3]=0,s;return s.length<4&&s.push(1),s}if("number"==typeof e)return s[0]=s[1]=s[2]=e,s[3]=1,s;if("object"==typeof e){for(u=0;u<4;u++)null===e[o=C[u]]||isNaN(e[o])?s[u]=3===u?1:0:s[u]=e[o];return s}return s[0]=s[1]=s[2]=s[3]=0,s},number:function(e,t,r){return e=parseFloat(e),isNaN(e)?r||0:(t.mod&&(e-=t.mod*Math.floor(e/t.mod)),e<t.min?t.min:e>t.max?t.max:t.step?Math.round(e/t.step)*t.step:e)},enum:function(e,t,r){var n=t.options||[];return"string"==typeof e?e=e.toLowerCase():"number"==typeof e?e=e.toString():e||(e=""),n.hasOwnProperty(e)?e:r||""},vector:function(e,t,r,n){var i,o,s,a=t.dimensions||4;if(i=n||[],q(e)){for(o=0;o<a;o++)i[o]=e[o]||0;return i}if("object"==typeof e){for(o=0;o<a;o++)void 0===e[s=O[o]]&&(s=C[o]),i[o]=e[s]||0;return i}for(e=parseFloat(e)||0,o=0;o<a;o++)i[o]=e;return i},boolean:function(e){return!(!e||e&&e.toLowerCase&&"false"===e.toLowerCase())},string:function(e){return"string"==typeof e?e:0===e||e?e.toString?e.toString():String(e):""}},X.prototype.effects=X.effects=function(){var e,t,r,n,i,o={};for(e in l)if(l.hasOwnProperty(e)){for(i in r={title:(t=l[e]).title||e,description:t.description||"",inputs:{}},t.inputs)t.inputs.hasOwnProperty(i)&&(n=t.inputs[i],r.inputs[i]={type:n.type,defaultValue:n.defaultValue,step:n.step,min:n.min,max:n.max,mod:n.mod,minCount:n.minCount,maxCount:n.maxCount,dimensions:n.dimensions,title:n.title||i,description:n.description||"",options:n.options||[]});o[e]=r}return o},window.Float32Array&&(s=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var e;for(e in window.Seriously)window.Seriously.hasOwnProperty(e)&&"plugin"!==e&&"object"==typeof window.Seriously[e]&&X.plugin(e,window.Seriously[e])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(e){var t,r,n,i;if(!(t=L(e,["img","canvas","video"])))return!1;if(!(r=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===t.naturalWidth&&"IMG"===t.tagName)return X.logger.warn("Image not loaded"),!1;if(0===t.readyState&&0===t.videoWidth&&"VIDEO"===t.tagName)return X.logger.warn("Video not loaded"),!1;if(n=G()){(i=n.createTexture())||X.logger.error("Test WebGL context has been lost"),n.bindTexture(n.TEXTURE_2D,i);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+e.message),n.deleteTexture(i),!1}n.deleteTexture(i)}else{n=r.getContext("2d");try{n.drawImage(t,0,0),n.getImageData(0,0,1,1)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+e.message),!1}}return!0},hslToRgb:W,colors:S,setTimeoutZero:z,ShaderProgram:K,FrameBuffer:Y,requestAnimationFrame:A,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",(function(e,t,r){var n,i,o=this,s=!1,u=!1,c=!1,l=0;function f(){e.removeEventListener("loadedmetadata",f,!0),s||(e.videoWidth?(o.width===e.videoWidth&&o.height===e.videoHeight||(o.width=e.videoWidth,o.height=e.videoHeight,o.resize()),u&&o.setReady()):(u=!0,setTimeout(f,50)))}function h(){c=!0}function d(){c=!1,o.setDirty()}if(B(e,"HTMLVideoElement"))return e.readyState?f():(u=!0,e.addEventListener("loadedmetadata",f,!0)),e.addEventListener("seeking",h,!1),e.addEventListener("seeked",d,!1),{deferTexture:u,source:e,render:function t(r){var s;if(l=e.currentTime,!e.videoHeight||!e.videoWidth)return!1;a?(i||(i=document.createElement("canvas").getContext("2d"),(n=i.canvas).width=o.width,n.height=o.height),s=n,i.drawImage(e,0,0,o.width,o.height)):s=e,r.bindTexture(r.TEXTURE_2D,o.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,o.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,s),void 0===a){if(r.getError()===r.INVALID_VALUE)return a=!0,t(r);a=!1}return!0}catch(e){e.code===window.DOMException.SECURITY_ERR?(o.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",e)}return!1},checkDirty:function(){return!c&&e.currentTime!==l},compare:function(e){return o.source===e},destroy:function(){s=!0,e.removeEventListener("seeking",h,!1),e.removeEventListener("seeked",d,!1),e.removeEventListener("loadedmetadata",f,!0)}}}),{title:"Video"}),X.transform("2d",(function(e){var t=this,r=!(e&&e.radians),n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0;function h(){var e,h,d,p,v,m,g,y,b,_,w,S=t.matrix;function E(e,t){S[12]=S[0]*e+S[4]*t+S[12],S[13]=S[1]*e+S[5]*t+S[13],S[14]=S[2]*e+S[6]*t+S[14],S[15]=S[3]*e+S[7]*t+S[15]}a||u||c||l||f||1!==o||1!==s?(M.identity(S),E(a+n,u+i),l&&(S[4]=l/t.width),f&&(S[1]=f/t.height),c&&(p=S[0],v=S[1],m=S[2],g=S[3],y=S[4],b=S[5],_=S[6],w=S[7],e=-(r?c*Math.PI/180:c),h=Math.sin(e),d=Math.cos(e),S[0]=p*d+y*h,S[1]=v*d+b*h,S[2]=m*d+_*h,S[3]=g*d+w*h,S[4]=y*d-p*h,S[5]=b*d-v*h,S[6]=_*d-m*h,S[7]=w*d-g*h),1!==o&&(S[0]*=o,S[1]*=o,S[2]*=o,S[3]*=o),1!==s&&(S[4]*=s,S[5]*=s,S[6]*=s,S[7]*=s),E(-n,-i),t.transformed=!0):t.transformed=!1}return{inputs:{reset:{method:function(){return n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0,!!t.transformed&&(t.transformed=!1,!0)}},translate:{method:function(e,t){return isNaN(e)&&(e=a),isNaN(t)&&(t=u),(e!==a||t!==u)&&(a=e,u=t,h(),!0)},type:["number","number"]},translateX:{get:function(){return a},set:function(e){return e!==a&&(a=e,h(),!0)},type:"number"},translateY:{get:function(){return u},set:function(e){return e!==u&&(u=e,h(),!0)},type:"number"},rotation:{get:function(){return c},set:function(e){return e!==c&&(c=parseFloat(e),h(),!0)},type:"number"},center:{method:function(e,t){return isNaN(e)&&(e=n),isNaN(t)&&(t=i),(e!==n||t!==i)&&(n=e,i=t,h(),!0)},type:["number","number"]},centerX:{get:function(){return n},set:function(e){return e!==n&&(n=e,h(),!0)},type:"number"},centerY:{get:function(){return i},set:function(e){return e!==i&&(i=e,h(),!0)},type:"number"},skew:{method:function(e,t){return isNaN(e)&&(e=l),isNaN(t)&&(t=f),(e!==l||t!==f)&&(l=e,f=t,h(),!0)},type:["number","number"]},skewX:{get:function(){return l},set:function(e){return e!==l&&(l=e,h(),!0)},type:"number"},skewY:{get:function(){return f},set:function(e){return e!==f&&(f=e,h(),!0)},type:"number"},scale:{method:function(e,t){var r,n;if(r=isNaN(e)?o:e,isNaN(t)){if(isNaN(e))return!1;n=r}else n=t;return(r!==o||n!==s)&&(o=r,s=n,h(),!0)},type:["number","number"]},scaleX:{get:function(){return o},set:function(e){return e!==o&&(o=e,h(),!0)},type:"number"},scaleY:{get:function(){return s},set:function(e){return e!==s&&(s=e,h(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var e=this,t=!0;function r(){var r=e.matrix;t?(r[0]=-1,r[5]=1):(r[0]=1,r[5]=-1)}return M.identity(e.matrix),r(),e.transformDirty=!0,e.transformed=!0,{inputs:{direction:{get:function(){return t?"horizontal":"vertical"},set:function(e){var n;return(n="vertical"!==e)!==t&&(t=n,r(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var e,t,r=this,n="contain";function i(){var i,o,s,a,u=r.matrix,c=e||r.width,l=t||r.height,f=r.source,h=f&&f.width||1,d=f&&f.height||1;"distort"===n||c===h&&l===d?r.transformed=!1:(s=h/d,a=c/l,"none"===n?(i=h/c,o=d/l):"width"===n||"contain"===n&&a<=s?(i=1,o=a/s):"height"===n||"contain"===n&&a>s?(i=s/a,o=1):a>s?(i=1,o=a/s):(i=s/a,o=1),1!==i||1!==o?(M.identity(u),1!==i&&(u[0]*=i,u[1]*=i,u[2]*=i,u[3]*=i),1!==o&&(u[4]*=o,u[5]*=o,u[6]*=o,u[7]*=o),r.transformed=!0):r.transformed=!1)}function o(){return e||r.source&&r.source.width||1}function s(){return t||r.source&&r.source.height||1}return this.resize=function(){var e,t=o(),r=s();if(this.width!==t||this.height!==r)for(this.width=t,this.height=r,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=r),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,r),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty(),i()},{inputs:{width:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},height:{get:s,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},mode:{get:function(){return n},set:function(e){return e!==n&&(n=e,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),u=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n";const J=X},6303:(e,t,r)=>{"use strict";r.r(t),r(6551).default.plugin("chroma",{shader:function(e,t){return t.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),t.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),t},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|v(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return Y(G(t,e.length-r),e,r,n)}function S(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return Y($(t),e,r,n)}function T(e,t,r,n){return Y(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.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===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){o=c[e],s=l[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function M(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function A(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function j(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function B(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function q(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},1227:(e,t,r)=>{var n=r(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},2114:e=>{"use strict";function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(r){n.message=e.message,n.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=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 i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){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,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8806:function(e,t,r){!function(e){function t(){}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===i.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function n(e){for(var t=0,r=Math.min(65536,e.length+1),n=new Uint16Array(r),i=[],o=0;;){var s=t<e.length;if(!s||o>=r-1){if(i.push(String.fromCharCode.apply(null,n.subarray(0,o))),!s)return i.join("");e=e.subarray(t),o=t=0}if(0==(128&(s=e[t++])))n[o++]=s;else if(192==(224&s)){var a=63&e[t++];n[o++]=(31&s)<<6|a}else if(224==(240&s)){a=63&e[t++];var u=63&e[t++];n[o++]=(31&s)<<12|a<<6|u}else 240==(248&s)&&(65535<(s=(7&s)<<18|(a=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++])&&(s-=65536,n[o++]=s>>>10&1023|55296,s=56320|1023&s),n[o++]=s)}}if(e.TextEncoder&&e.TextDecoder)return!1;var i=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var r=e.length,n=0,i=Math.max(32,r+(r>>>1)+7),o=new Uint8Array(i>>>3<<3);t<r;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<r){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(n+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[n++]=s;else{if(0==(4294965248&s))o[n++]=s>>>6&31|192;else if(0==(4294901760&s))o[n++]=s>>>12&15|224,o[n++]=s>>>6&63|128;else{if(0!=(4292870144&s))continue;o[n++]=s>>>18&7|240,o[n++]=s>>>12&63|128,o[n++]=s>>>6&63|128}o[n++]=63&s|128}}return o.slice?o.slice(0,n):o.subarray(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1});var o=n;"function"==typeof Buffer&&Buffer.from?o=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(e){try{var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"})),r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(),r.responseText}catch(t){return n(e)}finally{t&&URL.revokeObjectURL(t)}}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),o(e)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==r.g?r.g:this)},5177:e=>{e.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*v}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6486:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",S="[object Map]",E="[object Number]",T="[object Object]",O="[object Promise]",C="[object RegExp]",x="[object Set]",P="[object String]",R="[object Symbol]",M="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",k="[object Float32Array]",I="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",W="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,$=RegExp(H.source),Y=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",xe="\\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",Pe="["+we+"]",Re="["+xe+"]",Me="["+Se+"]",Ae="\\d+",je="["+Ee+"]",ke="["+Te+"]",Ie="[^"+we+xe+Ae+Ee+Te+Oe+"]",De="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Oe+"]",Be="\\u200d",We="(?:"+ke+"|"+Ie+")",Ve="(?:"+Ue+"|"+Ie+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Me+"|"+De+")?",Ge="["+Ce+"]?",$e=Ge+He+"(?:"+Be+"(?:"+[Ne,Le,Fe].join("|")+")"+Ge+He+")*",Ye="(?:"+[je,Le,Fe].join("|")+")"+$e,Ke="(?:"+[Ne+Me+"?",Me,Le,Fe,Pe].join("|")+")",Xe=RegExp("['’]","g"),Je=RegExp(Me,"g"),Ze=RegExp(De+"(?="+De+")|"+Ke+$e,"g"),Qe=RegExp([Ue+"?"+ke+"+"+qe+"(?="+[Re,Ue,"$"].join("|")+")",Ve+"+"+ze+"(?="+[Re,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+qe,Ue+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ye].join("|"),"g"),et=RegExp("["+Be+we+Se+Ce+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[k]=it[I]=it[D]=it[N]=it[L]=it[F]=it[U]=it[B]=it[W]=!0,it[v]=it[m]=it[A]=it[g]=it[j]=it[y]=it[b]=it[_]=it[S]=it[E]=it[T]=it[C]=it[x]=it[P]=it[M]=!1;var ot={};ot[v]=ot[m]=ot[A]=ot[j]=ot[g]=ot[y]=ot[k]=ot[I]=ot[D]=ot[N]=ot[L]=ot[S]=ot[E]=ot[T]=ot[C]=ot[x]=ot[P]=ot[R]=ot[F]=ot[U]=ot[B]=ot[W]=!0,ot[b]=ot[_]=ot[M]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ut=parseInt,ct="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ct||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,vt=pt&&ct.process,mt=function(){try{return dt&&dt.require&&dt.require("util").types||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Tt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function xt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Pt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Rt(e,t){return!(null==e||!e.length)&&Ut(e,t,0)>-1}function Mt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function jt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function kt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function It(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Dt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=qt("length");function Lt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Wt,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Wt(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:h}function qt(e){return function(t){return null==t?i:t[e]}}function zt(e){return function(t){return null==e?i:e[t]}}function Ht(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function $t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,fr(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return At(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var er=zt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function cr(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):Nt(e)}function lr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hr=zt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dr=function e(t){var r,n=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ee=t.Math,Te=t.Object,Oe=t.RegExp,Ce=t.String,xe=t.TypeError,Pe=n.prototype,Re=Se.prototype,Me=Te.prototype,Ae=t["__core-js_shared__"],je=Re.toString,ke=Me.hasOwnProperty,Ie=0,De=(r=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ne=Me.toString,Le=je.call(Te),Fe=ft._,Ue=Oe("^"+je.call(ke).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:i,We=t.Symbol,Ve=t.Uint8Array,qe=Be?Be.allocUnsafe:i,ze=or(Te.getPrototypeOf,Te),He=Te.create,Ge=Me.propertyIsEnumerable,$e=Pe.splice,Ye=We?We.isConcatSpreadable:i,Ke=We?We.iterator:i,Ze=We?We.toStringTag:i,et=function(){try{var e=uo(Te,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=Ee.ceil,dt=Ee.floor,vt=Te.getOwnPropertySymbols,mt=Be?Be.isBuffer:i,Nt=t.isFinite,zt=Pe.join,pr=or(Te.keys,Te),vr=Ee.max,mr=Ee.min,gr=ie.now,yr=t.parseInt,br=Ee.random,_r=Pe.reverse,wr=uo(t,"DataView"),Sr=uo(t,"Map"),Er=uo(t,"Promise"),Tr=uo(t,"Set"),Or=uo(t,"WeakMap"),Cr=uo(Te,"create"),xr=Or&&new Or,Pr={},Rr=Lo(wr),Mr=Lo(Sr),Ar=Lo(Er),jr=Lo(Tr),kr=Lo(Or),Ir=We?We.prototype:i,Dr=Ir?Ir.valueOf:i,Nr=Ir?Ir.toString:i;function Lr(e){if(ea(e)&&!qs(e)&&!(e instanceof Wr)){if(e instanceof Br)return e;if(ke.call(e,"__wrapped__"))return Fo(e)}return new Br(e)}var Fr=function(){function e(){}return function(t){if(!Qs(t))return{};if(He)return He(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Ur(){}function Br(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Wr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new zr;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new qr(e);this.size=t.size}function $r(e,t){var r=qs(e),n=!r&&Vs(e),i=!r&&!n&&$s(e),o=!r&&!n&&!i&&ua(e),s=r||n||i||o,a=s?$t(e.length,Ce):[],u=a.length;for(var c in e)!t&&!ke.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,u))||a.push(c);return a}function Yr(e){var t=e.length;return t?e[Hn(0,t-1)]:i}function Kr(e,t){return jo(Ci(e),on(t,0,e.length))}function Xr(e){return jo(Ci(e))}function Jr(e,t,r){(r!==i&&!Us(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];ke.call(e,t)&&Us(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Qr(e,t){for(var r=e.length;r--;)if(Us(e[r][0],t))return r;return-1}function en(e,t,r,n){return ln(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&xi(t,Ma(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Oa(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,u=1&t,c=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Qs(e))return e;var f=qs(e);if(f){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return Ci(e,a)}else{var h=fo(e),d=h==_||h==w;if($s(e))return _i(e,u);if(h==T||h==v||d&&!o){if(a=c||d?{}:po(e),!u)return c?function(e,t){return xi(e,lo(e),t)}(e,function(e,t){return e&&xi(t,Aa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,tn(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case A:return wi(e);case g:case y:return new i(+e);case j:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case k:case I:case D:case N:case L:case F:case U:case B:case W:return Si(e,r);case S:return new i;case E:case P: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 x:return new i;case R:return n=e,Dr?Te(Dr.call(n)):{}}}(e,h,u)}}s||(s=new Gr);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var m=f?i:(l?c?to:eo:c?Aa:Ma)(e);return Ot(m||e,(function(n,i){m&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Te(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function un(e,t,r){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,r)}),t)}function cn(e,t,r,n){var i=-1,o=Rt,s=!0,a=e.length,u=[],c=t.length;if(!a)return u;r&&(t=At(t,Kt(r))),n?(o=Mt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Hr(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var h=c;h--;)if(t[h]===f)continue e;u.push(l)}else o(t,f,n)||u.push(l)}return u}Lr.templateSettings={escape:K,evaluate:X,interpolate:J,variable:"",imports:{_:Lr}},Lr.prototype=Ur.prototype,Lr.prototype.constructor=Lr,Br.prototype=Fr(Ur.prototype),Br.prototype.constructor=Br,Wr.prototype=Fr(Ur.prototype),Wr.prototype.constructor=Wr,Vr.prototype.clear=function(){this.__data__=Cr?Cr(null):{},this.size=0},Vr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vr.prototype.get=function(e){var t=this.__data__;if(Cr){var r=t[e];return r===s?i:r}return ke.call(t,e)?t[e]:i},Vr.prototype.has=function(e){var t=this.__data__;return Cr?t[e]!==i:ke.call(t,e)},Vr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cr&&t===i?s:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=Qr(t,e);return!(r<0||(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,0))},qr.prototype.get=function(e){var t=this.__data__,r=Qr(t,e);return r<0?i:t[r][1]},qr.prototype.has=function(e){return Qr(this.__data__,e)>-1},qr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Vr,map:new(Sr||qr),string:new Vr}},zr.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},zr.prototype.get=function(e){return so(this,e).get(e)},zr.prototype.has=function(e){return so(this,e).has(e)},zr.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,s),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new qr,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!Sr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(e,t),this.size=r.size,this};var ln=Mi(yn),fn=Mi(bn,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function dn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(u===i?a==a&&!aa(a):r(a,u)))var u=a,c=s}return c}function pn(e,t){var r=[];return ln(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function vn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=vo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?vn(a,t-1,r,n,i):jt(i,a):n||(i[i.length]=a)}return i}var mn=Ai(),gn=Ai(!0);function yn(e,t){return e&&mn(e,t,Ma)}function bn(e,t){return e&&gn(e,t,Ma)}function _n(e,t){return Pt(t,(function(t){return Xs(e[t])}))}function wn(e,t){for(var r=0,n=(t=mi(t,e)).length;null!=e&&r<n;)e=e[No(t[r++])];return r&&r==n?e:i}function Sn(e,t,r){var n=t(e);return qs(e)?n:jt(n,r(e))}function En(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Te(e)?function(e){var t=ke.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=Ne.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return Ne.call(e)}(e)}function Tn(e,t){return e>t}function On(e,t){return null!=e&&ke.call(e,t)}function Cn(e,t){return null!=e&&t in Te(e)}function xn(e,t,r){for(var o=r?Mt:Rt,s=e[0].length,a=e.length,u=a,c=n(a),l=1/0,f=[];u--;){var h=e[u];u&&t&&(h=At(h,Kt(t))),l=mr(h.length,l),c[u]=!r&&(t||s>=120&&h.length>=120)?new Hr(u&&h):i}h=e[0];var d=-1,p=c[0];e:for(;++d<s&&f.length<l;){var v=h[d],m=t?t(v):v;if(v=r||0!==v?v:0,!(p?Jt(p,m):o(f,m,r))){for(u=a;--u;){var g=c[u];if(!(g?Jt(g,m):o(e[u],m,r)))continue e}p&&p.push(m),f.push(v)}}return f}function Pn(e,t,r){var n=null==(e=Oo(e,t=mi(t,e)))?e:e[No(Ko(t))];return null==n?i:Et(n,e,r)}function Rn(e){return ea(e)&&En(e)==v}function Mn(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=qs(e),u=qs(t),c=a?m:fo(e),l=u?m:fo(t),f=(c=c==v?T:c)==T,h=(l=l==v?T:l)==T,d=c==l;if(d&&$s(e)){if(!$s(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Gr),a||ua(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case y:case E:return Us(+e,+t);case b:return e.name==t.name&&e.message==t.message;case C:case P:return e==t+"";case S:var a=ir;case x:var u=1&n;if(a||(a=ar),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var l=Zi(a(e),a(t),n,i,o,s);return s.delete(e),l;case R:if(Dr)return Dr.call(e)==Dr.call(t)}return!1}(e,t,c,r,n,o,s);if(!(1&r)){var p=f&&ke.call(e,"__wrapped__"),_=h&&ke.call(t,"__wrapped__");if(p||_){var w=p?e.value():e,O=_?t.value():t;return s||(s=new Gr),o(w,O,r,n,s)}}return!!d&&(s||(s=new Gr),function(e,t,r,n,o,s){var a=1&r,u=eo(e),c=u.length;if(c!=eo(t).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in t:ke.call(t,f)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=a;++l<c;){var m=e[f=u[l]],g=t[f];if(n)var y=a?n(g,m,f,t,e,s):n(m,g,f,e,t,s);if(!(y===i?m===g||o(m,g,r,n,s):y)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,r,n,o,s))}(e,t,r,n,Mn,o))}function An(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Te(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=r[o])[0],l=e[c],f=u[1];if(a&&u[2]){if(l===i&&!(c in e))return!1}else{var h=new Gr;if(n)var d=n(l,f,c,e,t,h);if(!(d===i?Mn(f,l,3,n,h):d))return!1}}return!0}function jn(e){return!(!Qs(e)||(t=e,De&&De in t))&&(Xs(e)?Ue:ve).test(Lo(e));var t}function kn(e){return"function"==typeof e?e:null==e?ru:"object"==typeof e?qs(e)?Fn(e[0],e[1]):Ln(e):fu(e)}function In(e){if(!wo(e))return pr(e);var t=[];for(var r in Te(e))ke.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Dn(e,t){return e<t}function Nn(e,t){var r=-1,i=Hs(e)?n(e.length):[];return ln(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Ln(e){var t=ao(e);return 1==t.length&&t[0][2]?Eo(t[0][0],t[0][1]):function(r){return r===e||An(r,e,t)}}function Fn(e,t){return yo(e)&&So(t)?Eo(No(e),t):function(r){var n=Oa(r,e);return n===i&&n===t?Ca(r,e):Mn(t,n,3)}}function Un(e,t,r,n,o){e!==t&&mn(t,(function(s,a){if(o||(o=new Gr),Qs(s))!function(e,t,r,n,o,s,a){var u=Co(e,r),c=Co(t,r),l=a.get(c);if(l)Jr(e,r,l);else{var f=s?s(u,c,r+"",e,t,a):i,h=f===i;if(h){var d=qs(c),p=!d&&$s(c),v=!d&&!p&&ua(c);f=c,d||p||v?qs(u)?f=u:Gs(u)?f=Ci(u):p?(h=!1,f=_i(c,!0)):v?(h=!1,f=Si(c,!0)):f=[]:na(c)||Vs(c)?(f=u,Vs(u)?f=ma(u):Qs(u)&&!Xs(u)||(f=po(c))):h=!1}h&&(a.set(c,f),o(f,c,n,s,a),a.delete(c)),Jr(e,r,f)}}(e,t,a,r,Un,n,o);else{var u=n?n(Co(e,a),s,a+"",e,t,o):i;u===i&&(u=s),Jr(e,a,u)}}),Aa)}function Bn(e,t){var r=e.length;if(r)return mo(t+=t<0?r:0,r)?e[t]:i}function Wn(e,t,r){t=t.length?At(t,(function(e){return qs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[ru];var n=-1;t=At(t,Kt(oo()));var i=Nn(e,(function(e,r,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var u=Ei(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Vn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Xn(o,mi(s,e),a)}return o}function qn(e,t,r,n){var i=n?Bt:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Ci(t)),r&&(a=At(e,Kt(r)));++o<s;)for(var u=0,c=t[o],l=r?r(c):c;(u=i(a,l,u,n))>-1;)a!==e&&$e.call(a,u,1),$e.call(e,u,1);return e}function zn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;mo(i)?$e.call(e,i,1):ui(e,i)}}return e}function Hn(e,t){return e+dt(br()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function $n(e,t){return Ro(To(e,t,ru),e+"")}function Yn(e){return Yr(Ua(e))}function Kn(e,t){var r=Ua(e);return jo(r,on(t,0,r.length))}function Xn(e,t,r,n){if(!Qs(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,u=e;null!=u&&++o<s;){var c=No(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];(l=n?n(f,c,u):i)===i&&(l=Qs(f)?f:mo(t[o+1])?[]:{})}Zr(u,c,l),u=u[c]}return e}var Jn=xr?function(e,t){return xr.set(e,t),e}:ru,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qa(t),writable:!0})}:ru;function Qn(e){return jo(Ua(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return ln(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,ru,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,u=null===t,c=aa(t),l=t===i;o<s;){var f=dt((o+s)/2),h=r(e[f]),d=h!==i,p=null===h,v=h==h,m=aa(h);if(a)var g=n||v;else g=l?v&&(n||d):u?v&&d&&(n||!p):c?v&&d&&!p&&(n||!m):!p&&!m&&(n?h<=t:h<t);g?o=f+1:s=f}return mr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Us(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(qs(e))return At(e,si)+"";if(aa(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Rt,o=e.length,s=!0,a=[],u=a;if(r)s=!1,i=Mt;else if(o>=200){var c=t?null:Gi(e);if(c)return ar(c);s=!1,i=Jt,u=new Hr}else u=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue e;t&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function ui(e,t){return null==(e=Oo(e,t=mi(t,e)))||delete e[No(Ko(t))]}function ci(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function li(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Wr&&(r=r.value()),kt(t,(function(e,t){return t.func.apply(t.thisArg,jt([e],t.args))}),r)}function hi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],u=-1;++u<i;)u!=o&&(s[o]=cn(s[o]||a,e[u],t,r));return ai(vn(s,1),t,r)}function di(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var u=n<s?t[n]:i;r(a,e[n],u)}return a}function pi(e){return Gs(e)?e:[]}function vi(e){return"function"==typeof e?e:ru}function mi(e,t){return qs(e)?e:yo(e,t)?[e]:Do(ga(e))}var gi=$n;function yi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var bi=st||function(e){return ft.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=qe?qe(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ei(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,u=null===t,c=t==t,l=aa(t);if(!u&&!l&&!s&&e>t||s&&a&&c&&!u&&!l||n&&a&&c||!r&&c||!o)return 1;if(!n&&!s&&!l&&e<t||l&&r&&o&&!n&&!s||u&&r&&o||!a&&o||!c)return-1}return 0}function Ti(e,t,r,i){for(var o=-1,s=e.length,a=r.length,u=-1,c=t.length,l=vr(s-a,0),f=n(c+l),h=!i;++u<c;)f[u]=t[u];for(;++o<a;)(h||o<s)&&(f[r[o]]=e[o]);for(;l--;)f[u++]=e[o++];return f}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=-1,u=r.length,c=-1,l=t.length,f=vr(s-u,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++c<l;)h[p+c]=t[c];for(;++a<u;)(d||o<s)&&(h[p+r[a]]=e[o++]);return h}function Ci(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function xi(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var u=t[s],c=n?n(r[u],e[u],u,r,e):i;c===i&&(c=e[u]),o?rn(r,u,c):Zr(r,u,c)}return r}function Pi(e,t){return function(r,n){var i=qs(r)?Tt:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Ri(e){return $n((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&go(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Te(t);++n<o;){var u=r[n];u&&e(t,u,n,s)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Hs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Te(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ai(e){return function(t,r,n){for(var i=-1,o=Te(t),s=n(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===r(o[u],u,o))break}return t}}function ji(e){return function(t){var r=nr(t=ga(t))?lr(t):i,n=r?r[0]:t.charAt(0),o=r?yi(r,1).join(""):t.slice(1);return n[e]()+o}}function ki(e){return function(t){return kt(Xa(Va(t).replace(Xe,"")),e,"")}}function Ii(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Qs(n)?n:r}}function Di(e){return function(t,r,n){var o=Te(t);if(!Hs(t)){var s=oo(r,3);t=Ma(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function Ni(e){return Qi((function(t){var r=t.length,n=r,s=Br.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new xe(o);if(s&&!u&&"wrapper"==no(a))var u=new Br([],!0)}for(n=u?n:r;++n<r;){var c=no(a=t[n]),l="wrapper"==c?ro(a):i;u=l&&bo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[no(l[0])].apply(u,l[3]):1==a.length&&bo(a)?u[c]():u.thru(a)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&qs(n))return u.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Li(e,t,r,o,s,a,u,l,f,h){var d=t&c,p=1&t,v=2&t,m=24&t,g=512&t,y=v?i:Ii(e);return function c(){for(var b=arguments.length,_=n(b),w=b;w--;)_[w]=arguments[w];if(m)var S=io(c),E=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,S);if(o&&(_=Ti(_,o,s,m)),a&&(_=Oi(_,a,u,m)),b-=E,m&&b<h){var T=sr(_,S);return zi(e,t,Li,c.placeholder,r,_,T,l,f,h-b)}var O=p?r:this,C=v?O[e]:e;return b=_.length,l?_=function(e,t){for(var r=e.length,n=mr(t.length,r),o=Ci(e);n--;){var s=t[n];e[n]=mo(s,r)?o[s]:i}return e}(_,l):g&&b>1&&_.reverse(),d&&f<b&&(_.length=f),this&&this!==ft&&this instanceof c&&(C=y||Ii(C)),C.apply(O,_)}}function Fi(e,t){return function(r,n){return function(e,t,r,n){return yn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Ui(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Bi(e){return Qi((function(t){return t=At(t,Kt(oo())),$n((function(r){var n=this;return e(t,(function(e){return Et(e,n,r)}))}))}))}function Wi(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Gn(t,e):t;var n=Gn(t,ht(e/cr(t)));return nr(t)?yi(lr(n),0,e).join(""):n.slice(0,e)}function Vi(e){return function(t,r,o){return o&&"number"!=typeof o&&go(t,r,o)&&(r=o=i),t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r,i){for(var o=-1,s=vr(ht((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:ha(o),e)}}function qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=va(t),r=va(r)),e(t,r)}}function zi(e,t,r,n,o,s,a,c,l,f){var h=8&t;t|=h?u:64,4&(t&=~(h?64:u))||(t&=-4);var d=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,l,f],p=r.apply(i,d);return bo(e)&&xo(p,d),p.placeholder=n,Mo(p,e,t)}function Hi(e){var t=Ee[e];return function(e,r){if(e=va(e),(r=null==r?0:mr(da(r),292))&&Nt(e)){var n=(ga(e)+"e").split("e");return+((n=(ga(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Gi=Tr&&1/ar(new Tr([,-0]))[1]==l?function(e){return new Tr(e)}:au;function $i(e){return function(t){var r=fo(t);return r==S?ir(t):r==x?ur(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Yi(e,t,r,s,l,f,h,d){var p=2&t;if(!p&&"function"!=typeof e)throw new xe(o);var v=s?s.length:0;if(v||(t&=-97,s=l=i),h=h===i?h:vr(da(h),0),d=d===i?d:da(d),v-=l?l.length:0,64&t){var m=s,g=l;s=l=i}var y=p?i:ro(e),b=[e,t,r,s,l,m,g,f,h,d];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==c&&8==r||n==c&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?Ti(l,u,t[4]):u,e[4]=l?sr(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Oi(l,u,t[6]):u,e[6]=l?sr(e[5],a):t[6]),(u=t[7])&&(e[7]=u),n&c&&(e[8]=null==e[8]?t[8]:mr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],r=b[2],s=b[3],l=b[4],!(d=b[9]=b[9]===i?p?0:e.length:vr(b[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Ii(e);return function s(){for(var a=arguments.length,u=n(a),c=a,l=io(s);c--;)u[c]=arguments[c];var f=a<3&&u[0]!==l&&u[a-1]!==l?[]:sr(u,l);return(a-=f.length)<r?zi(e,t,Li,s.placeholder,i,u,f,i,i,r-a):Et(this&&this!==ft&&this instanceof s?o:e,this,u)}}(e,t,d):t!=u&&33!=t||l.length?Li.apply(i,b):function(e,t,r,i){var o=1&t,s=Ii(e);return function t(){for(var a=-1,u=arguments.length,c=-1,l=i.length,f=n(l+u),h=this&&this!==ft&&this instanceof t?s:e;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++a];return Et(h,o?r:this,f)}}(e,t,r,s);else var _=function(e,t,r){var n=1&t,i=Ii(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Mo((y?Jn:xo)(_,b),e,t)}function Ki(e,t,r,n){return e===i||Us(e,Me[r])&&!ke.call(n,r)?t:e}function Xi(e,t,r,n,o,s){return Qs(e)&&Qs(t)&&(s.set(t,e),Un(e,t,i,Xi,s),s.delete(t)),e}function Ji(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&r?new Hr:i;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],m=t[h];if(n)var g=a?n(m,v,h,t,e,s):n(v,m,h,e,t,s);if(g!==i){if(g)continue;d=!1;break}if(p){if(!Dt(t,(function(e,t){if(!Jt(p,t)&&(v===e||o(v,e,r,n,s)))return p.push(t)}))){d=!1;break}}else if(v!==m&&!o(v,m,r,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Qi(e){return Ro(To(e,i,zo),e+"")}function eo(e){return Sn(e,Ma,co)}function to(e){return Sn(e,Aa,lo)}var ro=xr?function(e){return xr.get(e)}:au;function no(e){for(var t=e.name+"",r=Pr[t],n=ke.call(Pr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(ke.call(Lr,"placeholder")?Lr:e).placeholder}function oo(){var e=Lr.iteratee||nu;return e=e===nu?kn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ma(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return jn(r)?r:i}var co=vt?function(e){return null==e?[]:(e=Te(e),Pt(vt(e),(function(t){return Ge.call(e,t)})))}:pu,lo=vt?function(e){for(var t=[];e;)jt(t,co(e)),e=ze(e);return t}:pu,fo=En;function ho(e,t,r){for(var n=-1,i=(t=mi(t,e)).length,o=!1;++n<i;){var s=No(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&mo(s,i)&&(qs(e)||Vs(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fr(ze(e))}function vo(e){return qs(e)||Vs(e)||!!(Ye&&e&&e[Ye])}function mo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function go(e,t,r){if(!Qs(r))return!1;var n=typeof t;return!!("number"==n?Hs(r)&&mo(t,r.length):"string"==n&&t in r)&&Us(r[t],e)}function yo(e,t){if(qs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||Q.test(e)||!Z.test(e)||null!=t&&e in Te(t)}function bo(e){var t=no(e),r=Lr[t];if("function"!=typeof r||!(t in Wr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=j||Sr&&fo(new Sr)!=S||Er&&fo(Er.resolve())!=O||Tr&&fo(new Tr)!=x||Or&&fo(new Or)!=M)&&(fo=function(e){var t=En(e),r=t==T?e.constructor:i,n=r?Lo(r):"";if(n)switch(n){case Rr:return j;case Mr:return S;case Ar:return O;case jr:return x;case kr:return M}return t});var _o=Ae?Xs:vu;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function So(e){return e==e&&!Qs(e)}function Eo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Te(r))}}function To(e,t,r){return t=vr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=vr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=n(t+1);++o<t;)u[o]=i[o];return u[t]=r(a),Et(e,this,u)}}function Oo(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function Co(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Ao(Jn),Po=lt||function(e,t){return ft.setTimeout(e,t)},Ro=Ao(Zn);function Mo(e,t,r){var n=t+"";return Ro(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ot(p,(function(r){var n="_."+r[0];t&r[1]&&!Rt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Ao(e){var t=0,r=0;return function(){var n=gr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function jo(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=Hn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var ko,Io,Do=(ko=ks((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)})),t}),(function(e){return 500===Io.size&&Io.clear(),e})),Io=ko.cache,ko);function No(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Wr)return e.clone();var t=new Br(e.__wrapped__,e.__chain__);return t.__actions__=Ci(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Uo=$n((function(e,t){return Gs(e)?cn(e,vn(t,1,Gs,!0)):[]})),Bo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),oo(r,2)):[]})),Wo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),i,r):[]}));function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ft(e,oo(t,3),i)}function qo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=da(r),o=r<0?vr(n+o,0):mr(o,n-1)),Ft(e,oo(t,3),o,!0)}function zo(e){return null!=e&&e.length?vn(e,1):[]}function Ho(e){return e&&e.length?e[0]:i}var Go=$n((function(e){var t=At(e,pi);return t.length&&t[0]===e[0]?xn(t):[]})),$o=$n((function(e){var t=Ko(e),r=At(e,pi);return t===Ko(r)?t=i:r.pop(),r.length&&r[0]===e[0]?xn(r,oo(t,2)):[]})),Yo=$n((function(e){var t=Ko(e),r=At(e,pi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?xn(r,i,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=$n(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qn(e,t):e}var Zo=Qi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return zn(e,At(t,(function(e){return mo(e,r)?+e:e})).sort(Ei)),n}));function Qo(e){return null==e?e:_r.call(e)}var es=$n((function(e){return ai(vn(e,1,Gs,!0))})),ts=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),ai(vn(e,1,Gs,!0),oo(t,2))})),rs=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,ai(vn(e,1,Gs,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Gs(e))return t=vr(e.length,t),!0})),$t(t,(function(t){return At(e,qt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:At(r,(function(e){return Et(t,i,e)}))}var os=$n((function(e,t){return Gs(e)?cn(e,t):[]})),ss=$n((function(e){return hi(Pt(e,Gs))})),as=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),hi(Pt(e,Gs),oo(t,2))})),us=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,hi(Pt(e,Gs),i,t)})),cs=$n(ns),ls=$n((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function fs(e){var t=Lr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Qi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Wr&&mo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Br(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Pi((function(e,t,r){ke.call(e,r)?++e[r]:rn(e,r,1)})),vs=Di(Vo),ms=Di(qo);function gs(e,t){return(qs(e)?Ot:ln)(e,oo(t,3))}function ys(e,t){return(qs(e)?Ct:fn)(e,oo(t,3))}var bs=Pi((function(e,t,r){ke.call(e,r)?e[r].push(t):rn(e,r,[t])})),_s=$n((function(e,t,r){var i=-1,o="function"==typeof t,s=Hs(e)?n(e.length):[];return ln(e,(function(e){s[++i]=o?Et(t,e,r):Pn(e,t,r)})),s})),ws=Pi((function(e,t,r){rn(e,r,t)}));function Ss(e,t){return(qs(e)?At:Nn)(e,oo(t,3))}var Es=Pi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ts=$n((function(e,t){if(null==e)return[];var r=t.length;return r>1&&go(e,t[0],t[1])?t=[]:r>2&&go(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,vn(t,1),[])})),Os=ct||function(){return ft.Date.now()};function Cs(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Yi(e,c,i,i,i,i,t)}function xs(e,t){var r;if("function"!=typeof t)throw new xe(o);return e=da(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ps=$n((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ps));n|=u}return Yi(e,n,t,r,i)})),Rs=$n((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Rs));n|=u}return Yi(t,n,e,r,i)}));function Ms(e,t,r){var n,s,a,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new xe(o);function v(t){var r=n,o=s;return n=s=i,f=t,u=e.apply(o,r)}function m(e){var r=e-l;return l===i||r>=t||r<0||d&&e-f>=a}function g(){var e=Os();if(m(e))return y(e);c=Po(g,function(e){var r=t-(e-l);return d?mr(r,a-(e-f)):r}(e))}function y(e){return c=i,p&&n?v(e):(n=s=i,u)}function b(){var e=Os(),r=m(e);if(n=arguments,s=this,l=e,r){if(c===i)return function(e){return f=e,c=Po(g,t),h?v(e):u}(l);if(d)return bi(c),c=Po(g,t),v(l)}return c===i&&(c=Po(g,t)),u}return t=va(t)||0,Qs(r)&&(h=!!r.leading,a=(d="maxWait"in r)?vr(va(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),b.cancel=function(){c!==i&&bi(c),f=0,n=l=s=c=i},b.flush=function(){return c===i?u:y(Os())},b}var As=$n((function(e,t){return un(e,1,t)})),js=$n((function(e,t,r){return un(e,va(t)||0,r)}));function ks(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(ks.Cache||zr),r}function Is(e){if("function"!=typeof e)throw new xe(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)}}ks.Cache=zr;var Ds=gi((function(e,t){var r=(t=1==t.length&&qs(t[0])?At(t[0],Kt(oo())):At(vn(t,1),Kt(oo()))).length;return $n((function(n){for(var i=-1,o=mr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Et(e,this,n)}))})),Ns=$n((function(e,t){var r=sr(t,io(Ns));return Yi(e,u,i,t,r)})),Ls=$n((function(e,t){var r=sr(t,io(Ls));return Yi(e,64,i,t,r)})),Fs=Qi((function(e,t){return Yi(e,256,i,i,i,t)}));function Us(e,t){return e===t||e!=e&&t!=t}var Bs=qi(Tn),Ws=qi((function(e,t){return e>=t})),Vs=Rn(function(){return arguments}())?Rn:function(e){return ea(e)&&ke.call(e,"callee")&&!Ge.call(e,"callee")},qs=n.isArray,zs=gt?Kt(gt):function(e){return ea(e)&&En(e)==A};function Hs(e){return null!=e&&Zs(e.length)&&!Xs(e)}function Gs(e){return ea(e)&&Hs(e)}var $s=mt||vu,Ys=yt?Kt(yt):function(e){return ea(e)&&En(e)==y};function Ks(e){if(!ea(e))return!1;var t=En(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Xs(e){if(!Qs(e))return!1;var t=En(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==da(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Kt(bt):function(e){return ea(e)&&fo(e)==S};function ra(e){return"number"==typeof e||ea(e)&&En(e)==E}function na(e){if(!ea(e)||En(e)!=T)return!1;var t=ze(e);if(null===t)return!0;var r=ke.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==Le}var ia=_t?Kt(_t):function(e){return ea(e)&&En(e)==C},oa=wt?Kt(wt):function(e){return ea(e)&&fo(e)==x};function sa(e){return"string"==typeof e||!qs(e)&&ea(e)&&En(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&En(e)==R}var ua=St?Kt(St):function(e){return ea(e)&&Zs(e.length)&&!!it[En(e)]},ca=qi(Dn),la=qi((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(Hs(e))return sa(e)?lr(e):Ci(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=fo(e);return(t==S?ir:t==x?ar:Ua)(e)}function ha(e){return e?(e=va(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),r=t%1;return t==t?r?t-r:t:0}function pa(e){return e?on(da(e),0,d):0}function va(e){if("number"==typeof e)return e;if(aa(e))return h;if(Qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=pe.test(e);return r||me.test(e)?ut(e.slice(2),r?2:8):de.test(e)?h:+e}function ma(e){return xi(e,Aa(e))}function ga(e){return null==e?"":si(e)}var ya=Ri((function(e,t){if(wo(t)||Hs(t))xi(t,Ma(t),e);else for(var r in t)ke.call(t,r)&&Zr(e,r,t[r])})),ba=Ri((function(e,t){xi(t,Aa(t),e)})),_a=Ri((function(e,t,r,n){xi(t,Aa(t),e,n)})),wa=Ri((function(e,t,r,n){xi(t,Ma(t),e,n)})),Sa=Qi(nn),Ea=$n((function(e,t){e=Te(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&go(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Aa(s),u=-1,c=a.length;++u<c;){var l=a[u],f=e[l];(f===i||Us(f,Me[l])&&!ke.call(e,l))&&(e[l]=s[l])}return e})),Ta=$n((function(e){return e.push(i,Xi),Et(ka,i,e)}));function Oa(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ca(e,t){return null!=e&&ho(e,t,Cn)}var xa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),Qa(ru)),Pa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ke.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Ra=$n(Pn);function Ma(e){return Hs(e)?$r(e):In(e)}function Aa(e){return Hs(e)?$r(e,!0):function(e){if(!Qs(e))return function(e){var t=[];if(null!=e)for(var r in Te(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&ke.call(e,n))&&r.push(n);return r}(e)}var ja=Ri((function(e,t,r){Un(e,t,r)})),ka=Ri((function(e,t,r,n){Un(e,t,r,n)})),Ia=Qi((function(e,t){var r={};if(null==e)return r;var n=!1;t=At(t,(function(t){return t=mi(t,e),n||(n=t.length>1),t})),xi(e,to(e),r),n&&(r=sn(r,7,Ji));for(var i=t.length;i--;)ui(r,t[i]);return r})),Da=Qi((function(e,t){return null==e?{}:function(e,t){return Vn(e,t,(function(t,r){return Ca(e,r)}))}(e,t)}));function Na(e,t){if(null==e)return{};var r=At(to(e),(function(e){return[e]}));return t=oo(t),Vn(e,r,(function(e,r){return t(e,r[0])}))}var La=$i(Ma),Fa=$i(Aa);function Ua(e){return null==e?[]:Xt(e,Ma(e))}var Ba=ki((function(e,t,r){return t=t.toLowerCase(),e+(r?Wa(t):t)}));function Wa(e){return Ka(ga(e).toLowerCase())}function Va(e){return(e=ga(e))&&e.replace(ye,er).replace(Je,"")}var qa=ki((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),za=ki((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ha=ji("toLowerCase"),Ga=ki((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),$a=ki((function(e,t,r){return e+(r?" ":"")+Ka(t)})),Ya=ki((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ka=ji("toUpperCase");function Xa(e,t,r){return e=ga(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=$n((function(e,t){try{return Et(e,i,t)}catch(e){return Ks(e)?e:new we(e)}})),Za=Qi((function(e,t){return Ot(t,(function(t){t=No(t),rn(e,t,Ps(e[t],e))})),e}));function Qa(e){return function(){return e}}var eu=Ni(),tu=Ni(!0);function ru(e){return e}function nu(e){return kn("function"==typeof e?e:sn(e,1))}var iu=$n((function(e,t){return function(r){return Pn(r,e,t)}})),ou=$n((function(e,t){return function(r){return Pn(e,r,t)}}));function su(e,t,r){var n=Ma(t),i=_n(t,n);null!=r||Qs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ma(t)));var o=!(Qs(r)&&"chain"in r&&!r.chain),s=Xs(e);return Ot(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ci(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function au(){}var uu=Bi(At),cu=Bi(xt),lu=Bi(Dt);function fu(e){return yo(e)?qt(No(e)):function(e){return function(t){return wn(t,e)}}(e)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var mu,gu=Ui((function(e,t){return e+t}),0),yu=Hi("ceil"),bu=Ui((function(e,t){return e/t}),1),_u=Hi("floor"),wu=Ui((function(e,t){return e*t}),1),Su=Hi("round"),Eu=Ui((function(e,t){return e-t}),0);return Lr.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=Cs,Lr.assign=ya,Lr.assignIn=ba,Lr.assignInWith=_a,Lr.assignWith=wa,Lr.at=Sa,Lr.before=xs,Lr.bind=Ps,Lr.bindAll=Za,Lr.bindKey=Rs,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Lr.chain=fs,Lr.chunk=function(e,t,r){t=(r?go(e,t,r):t===i)?1:vr(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,u=n(ht(o/t));s<o;)u[a++]=ei(e,s,s+=t);return u},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return jt(qs(r)?Ci(r):[r],vn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[r(e[0]),e[1]]})):[],$n((function(r){for(var n=-1;++n<t;){var i=e[n];if(Et(i[0],this,r))return Et(i[1],this,r)}}))},Lr.conforms=function(e){return function(e){var t=Ma(e);return function(r){return an(r,e,t)}}(sn(e,1))},Lr.constant=Qa,Lr.countBy=ps,Lr.create=function(e,t){var r=Fr(e);return null==t?r:tn(r,t)},Lr.curry=function e(t,r,n){var o=Yi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.curryRight=function e(t,r,n){var o=Yi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.debounce=Ms,Lr.defaults=Ea,Lr.defaultsDeep=Ta,Lr.defer=As,Lr.delay=js,Lr.difference=Uo,Lr.differenceBy=Bo,Lr.differenceWith=Wo,Lr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:da(t))<0?0:t,n):[]},Lr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:da(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Lr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&go(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=da(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:da(n))<0&&(n+=o),n=r>n?0:pa(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Lr.filter=function(e,t){return(qs(e)?Pt:pn)(e,oo(t,3))},Lr.flatMap=function(e,t){return vn(Ss(e,t),1)},Lr.flatMapDeep=function(e,t){return vn(Ss(e,t),l)},Lr.flatMapDepth=function(e,t,r){return r=r===i?1:da(r),vn(Ss(e,t),r)},Lr.flatten=zo,Lr.flattenDeep=function(e){return null!=e&&e.length?vn(e,l):[]},Lr.flattenDepth=function(e,t){return null!=e&&e.length?vn(e,t=t===i?1:da(t)):[]},Lr.flip=function(e){return Yi(e,512)},Lr.flow=eu,Lr.flowRight=tu,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Lr.functions=function(e){return null==e?[]:_n(e,Ma(e))},Lr.functionsIn=function(e){return null==e?[]:_n(e,Aa(e))},Lr.groupBy=bs,Lr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Lr.intersection=Go,Lr.intersectionBy=$o,Lr.intersectionWith=Yo,Lr.invert=xa,Lr.invertBy=Pa,Lr.invokeMap=_s,Lr.iteratee=nu,Lr.keyBy=ws,Lr.keys=Ma,Lr.keysIn=Aa,Lr.map=Ss,Lr.mapKeys=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Lr.mapValues=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Lr.matches=function(e){return Ln(sn(e,1))},Lr.matchesProperty=function(e,t){return Fn(e,sn(t,1))},Lr.memoize=ks,Lr.merge=ja,Lr.mergeWith=ka,Lr.method=iu,Lr.methodOf=ou,Lr.mixin=su,Lr.negate=Is,Lr.nthArg=function(e){return e=da(e),$n((function(t){return Bn(t,e)}))},Lr.omit=Ia,Lr.omitBy=function(e,t){return Na(e,Is(oo(t)))},Lr.once=function(e){return xs(2,e)},Lr.orderBy=function(e,t,r,n){return null==e?[]:(qs(t)||(t=null==t?[]:[t]),qs(r=n?i:r)||(r=null==r?[]:[r]),Wn(e,t,r))},Lr.over=uu,Lr.overArgs=Ds,Lr.overEvery=cu,Lr.overSome=lu,Lr.partial=Ns,Lr.partialRight=Ls,Lr.partition=Es,Lr.pick=Da,Lr.pickBy=Na,Lr.property=fu,Lr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Lr.pull=Xo,Lr.pullAll=Jo,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,oo(r,2)):e},Lr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,i,r):e},Lr.pullAt=Zo,Lr.range=hu,Lr.rangeRight=du,Lr.rearg=Fs,Lr.reject=function(e,t){return(qs(e)?Pt:pn)(e,Is(oo(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return zn(e,i),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return $n(e,t=t===i?t:da(t))},Lr.reverse=Qo,Lr.sampleSize=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),(qs(e)?Kr:Kn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Lr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Xn(e,t,r,n)},Lr.shuffle=function(e){return(qs(e)?Xr:Qn)(e)},Lr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&go(e,t,r)?(t=0,r=n):(t=null==t?0:da(t),r=r===i?n:da(r)),ei(e,t,r)):[]},Lr.sortBy=Ts,Lr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Lr.split=function(e,t,r){return r&&"number"!=typeof r&&go(e,t,r)&&(t=r=i),(r=r===i?d:r>>>0)?(e=ga(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?yi(lr(e),0,r):e.split(t,r):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:vr(da(t),0),$n((function(r){var n=r[t],i=yi(r,0,t);return n&&jt(i,n),Et(e,this,i)}))},Lr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Lr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:da(t))<0?0:t):[]},Lr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:da(t)))<0?0:t,n):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new xe(o);return Qs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ms(e,t,{leading:n,maxWait:t,trailing:i})},Lr.thru=hs,Lr.toArray=fa,Lr.toPairs=La,Lr.toPairsIn=Fa,Lr.toPath=function(e){return qs(e)?At(e,No):aa(e)?[e]:Ci(Do(ga(e)))},Lr.toPlainObject=ma,Lr.transform=function(e,t,r){var n=qs(e),i=n||$s(e)||ua(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qs(e)&&Xs(o)?Fr(ze(e)):{}}return(i?Ot:yn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Lr.unary=function(e){return Cs(e,1)},Lr.union=es,Lr.unionBy=ts,Lr.unionWith=rs,Lr.uniq=function(e){return e&&e.length?ai(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Lr.unset=function(e,t){return null==e||ui(e,t)},Lr.unzip=ns,Lr.unzipWith=is,Lr.update=function(e,t,r){return null==e?e:ci(e,t,vi(r))},Lr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ci(e,t,vi(r),n)},Lr.values=Ua,Lr.valuesIn=function(e){return null==e?[]:Xt(e,Aa(e))},Lr.without=os,Lr.words=Xa,Lr.wrap=function(e,t){return Ns(vi(t),e)},Lr.xor=ss,Lr.xorBy=as,Lr.xorWith=us,Lr.zip=cs,Lr.zipObject=function(e,t){return di(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return di(e||[],t||[],Xn)},Lr.zipWith=ls,Lr.entries=La,Lr.entriesIn=Fa,Lr.extend=ba,Lr.extendWith=_a,su(Lr,Lr),Lr.add=gu,Lr.attempt=Ja,Lr.camelCase=Ba,Lr.capitalize=Wa,Lr.ceil=yu,Lr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=va(r))==r?r:0),t!==i&&(t=(t=va(t))==t?t:0),on(va(e),t,r)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Ma(t))},Lr.deburr=Va,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=bu,Lr.endsWith=function(e,t,r){e=ga(e),t=si(t);var n=e.length,o=r=r===i?n:on(da(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Lr.eq=Us,Lr.escape=function(e){return(e=ga(e))&&Y.test(e)?e.replace(G,tr):e},Lr.escapeRegExp=function(e){return(e=ga(e))&&re.test(e)?e.replace(te,"\\$&"):e},Lr.every=function(e,t,r){var n=qs(e)?xt:hn;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.find=vs,Lr.findIndex=Vo,Lr.findKey=function(e,t){return Lt(e,oo(t,3),yn)},Lr.findLast=ms,Lr.findLastIndex=qo,Lr.findLastKey=function(e,t){return Lt(e,oo(t,3),bn)},Lr.floor=_u,Lr.forEach=gs,Lr.forEachRight=ys,Lr.forIn=function(e,t){return null==e?e:mn(e,oo(t,3),Aa)},Lr.forInRight=function(e,t){return null==e?e:gn(e,oo(t,3),Aa)},Lr.forOwn=function(e,t){return e&&yn(e,oo(t,3))},Lr.forOwnRight=function(e,t){return e&&bn(e,oo(t,3))},Lr.get=Oa,Lr.gt=Bs,Lr.gte=Ws,Lr.has=function(e,t){return null!=e&&ho(e,t,On)},Lr.hasIn=Ca,Lr.head=Ho,Lr.identity=ru,Lr.includes=function(e,t,r,n){e=Hs(e)?e:Ua(e),r=r&&!n?da(r):0;var i=e.length;return r<0&&(r=vr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ut(e,t,i)},Lr.inRange=function(e,t,r){return t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r){return e>=mr(t,r)&&e<vr(t,r)}(e=va(e),t,r)},Lr.invoke=Ra,Lr.isArguments=Vs,Lr.isArray=qs,Lr.isArrayBuffer=zs,Lr.isArrayLike=Hs,Lr.isArrayLikeObject=Gs,Lr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&En(e)==g},Lr.isBuffer=$s,Lr.isDate=Ys,Lr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(qs(e)||"string"==typeof e||"function"==typeof e.splice||$s(e)||ua(e)||Vs(e)))return!e.length;var t=fo(e);if(t==S||t==x)return!e.size;if(wo(e))return!In(e).length;for(var r in e)if(ke.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return Mn(e,t)},Lr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Mn(e,t,i,r):!!n},Lr.isError=Ks,Lr.isFinite=function(e){return"number"==typeof e&&Nt(e)},Lr.isFunction=Xs,Lr.isInteger=Js,Lr.isLength=Zs,Lr.isMap=ta,Lr.isMatch=function(e,t){return e===t||An(e,t,ao(t))},Lr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,An(e,t,ao(t),r)},Lr.isNaN=function(e){return ra(e)&&e!=+e},Lr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jn(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=ra,Lr.isObject=Qs,Lr.isObjectLike=ea,Lr.isPlainObject=na,Lr.isRegExp=ia,Lr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=f},Lr.isSet=oa,Lr.isString=sa,Lr.isSymbol=aa,Lr.isTypedArray=ua,Lr.isUndefined=function(e){return e===i},Lr.isWeakMap=function(e){return ea(e)&&fo(e)==M},Lr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==En(e)},Lr.join=function(e,t){return null==e?"":zt.call(e,t)},Lr.kebabCase=qa,Lr.last=Ko,Lr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=da(r))<0?vr(n+o,0):mr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ft(e,Wt,o,!0)},Lr.lowerCase=za,Lr.lowerFirst=Ha,Lr.lt=ca,Lr.lte=la,Lr.max=function(e){return e&&e.length?dn(e,ru,Tn):i},Lr.maxBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Tn):i},Lr.mean=function(e){return Vt(e,ru)},Lr.meanBy=function(e,t){return Vt(e,oo(t,2))},Lr.min=function(e){return e&&e.length?dn(e,ru,Dn):i},Lr.minBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Dn):i},Lr.stubArray=pu,Lr.stubFalse=vu,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=wu,Lr.nth=function(e,t){return e&&e.length?Bn(e,da(t)):i},Lr.noConflict=function(){return ft._===this&&(ft._=Fe),this},Lr.noop=au,Lr.now=Os,Lr.pad=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(dt(i),r)+e+Wi(ht(i),r)},Lr.padEnd=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?e+Wi(t-n,r):e},Lr.padStart=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?Wi(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),yr(ga(e).replace(ne,""),t||0)},Lr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&go(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=br();return mr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Hn(e,t)},Lr.reduce=function(e,t,r){var n=qs(e)?kt:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,ln)},Lr.reduceRight=function(e,t,r){var n=qs(e)?It:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,fn)},Lr.repeat=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),Gn(ga(e),t)},Lr.replace=function(){var e=arguments,t=ga(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,r){var n=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[No(t[n])];s===i&&(n=o,s=r),e=Xs(s)?s.call(e):s}return e},Lr.round=Su,Lr.runInContext=e,Lr.sample=function(e){return(qs(e)?Yr:Yn)(e)},Lr.size=function(e){if(null==e)return 0;if(Hs(e))return sa(e)?cr(e):e.length;var t=fo(e);return t==S||t==x?e.size:In(e).length},Lr.snakeCase=Ga,Lr.some=function(e,t,r){var n=qs(e)?Dt:ti;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.sortedIndex=function(e,t){return ri(e,t)},Lr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&Us(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(Us(e[r],t))return r}return-1},Lr.startCase=$a,Lr.startsWith=function(e,t,r){return e=ga(e),r=null==r?0:on(da(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Lr.subtract=Eu,Lr.sum=function(e){return e&&e.length?Gt(e,ru):0},Lr.sumBy=function(e,t){return e&&e.length?Gt(e,oo(t,2)):0},Lr.template=function(e,t,r){var n=Lr.templateSettings;r&&go(e,t,r)&&(t=i),e=ga(e),t=_a({},t,n,Ki);var o,s,a=_a({},t.imports,n.imports,Ki),u=Ma(a),c=Xt(a,u),l=0,f=t.interpolate||be,h="__p += '",d=Oe((t.escape||be).source+"|"+f.source+"|"+(f===J?fe:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(ke.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,a,u){return n||(n=i),h+=e.slice(l,u).replace(_e,rr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),h+="';\n";var v=ke.call(t,"variable")&&t.variable;if(v){if(ce.test(v))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(q,"$1").replace(z,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(u,p+"return "+h).apply(i,c)}));if(m.source=h,Ks(m))throw m;return m},Lr.times=function(e,t){if((e=da(e))<1||e>f)return[];var r=d,n=mr(e,d);t=oo(t),e-=d;for(var i=$t(n,t);++r<e;)t(r);return i},Lr.toFinite=ha,Lr.toInteger=da,Lr.toLength=pa,Lr.toLower=function(e){return ga(e).toLowerCase()},Lr.toNumber=va,Lr.toSafeInteger=function(e){return e?on(da(e),-9007199254740991,f):0===e?e:0},Lr.toString=ga,Lr.toUpper=function(e){return ga(e).toUpperCase()},Lr.trim=function(e,t,r){if((e=ga(e))&&(r||t===i))return Yt(e);if(!e||!(t=si(t)))return e;var n=lr(e),o=lr(t);return yi(n,Zt(n,o),Qt(n,o)+1).join("")},Lr.trimEnd=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.slice(0,fr(e)+1);if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,0,Qt(n,lr(t))+1).join("")},Lr.trimStart=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,Zt(n,lr(t))).join("")},Lr.truncate=function(e,t){var r=30,n="...";if(Qs(t)){var o="separator"in t?t.separator:o;r="length"in t?da(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=ga(e)).length;if(nr(e)){var a=lr(e);s=a.length}if(r>=s)return e;var u=r-cr(n);if(u<1)return n;var c=a?yi(a,0,u).join(""):e.slice(0,u);if(o===i)return c+n;if(a&&(u+=c.length-u),ia(o)){if(e.slice(u).search(o)){var l,f=c;for(o.global||(o=Oe(o.source,ga(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(e.indexOf(si(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+n},Lr.unescape=function(e){return(e=ga(e))&&$.test(e)?e.replace(H,hr):e},Lr.uniqueId=function(e){var t=++Ie;return ga(e)+t},Lr.upperCase=Ya,Lr.upperFirst=Ka,Lr.each=gs,Lr.eachRight=ys,Lr.first=Ho,su(Lr,(mu={},yn(Lr,(function(e,t){ke.call(Lr.prototype,t)||(mu[t]=e)})),mu),{chain:!1}),Lr.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Lr[e].placeholder=Lr})),Ot(["drop","take"],(function(e,t){Wr.prototype[e]=function(r){r=r===i?1:vr(da(r),0);var n=this.__filtered__&&!t?new Wr(this):this.clone();return n.__filtered__?n.__takeCount__=mr(r,n.__takeCount__):n.__views__.push({size:mr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Wr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Wr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Wr.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Wr.prototype[e]=function(){return this.__filtered__?new Wr(this):this[r](1)}})),Wr.prototype.compact=function(){return this.filter(ru)},Wr.prototype.find=function(e){return this.filter(e).head()},Wr.prototype.findLast=function(e){return this.reverse().find(e)},Wr.prototype.invokeMap=$n((function(e,t){return"function"==typeof e?new Wr(this):this.map((function(r){return Pn(r,e,t)}))})),Wr.prototype.reject=function(e){return this.filter(Is(oo(e)))},Wr.prototype.slice=function(e,t){e=da(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Wr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=da(t))<0?r.dropRight(-t):r.take(t-e)),r)},Wr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wr.prototype.toArray=function(){return this.take(d)},yn(Wr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Lr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,u=t instanceof Wr,c=a[0],l=u||qs(t),f=function(e){var t=o.apply(Lr,jt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,v=u&&!d;if(!s&&l){t=v?t:new Wr(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[f],thisArg:i}),new Br(m,h)}return p&&v?e.apply(this,a):(m=this.thru(f),p?n?m.value()[0]:m.value():m)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(qs(i)?i:[],e)}return this[r]((function(r){return t.apply(qs(r)?r:[],e)}))}})),yn(Wr.prototype,(function(e,t){var r=Lr[t];if(r){var n=r.name+"";ke.call(Pr,n)||(Pr[n]=[]),Pr[n].push({name:t,func:r})}})),Pr[Li(i,2).name]=[{name:"wrapper",func:i}],Wr.prototype.clone=function(){var e=new Wr(this.__wrapped__);return e.__actions__=Ci(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ci(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ci(this.__views__),e},Wr.prototype.reverse=function(){if(this.__filtered__){var e=new Wr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=qs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=mr(t,e+s);break;case"takeRight":e=vr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=n?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=mr(u,this.__takeCount__);if(!r||!n&&i==u&&d==u)return fi(e,this.__actions__);var p=[];e:for(;u--&&h<d;){for(var v=-1,m=e[c+=t];++v<f;){var g=l[v],y=g.iteratee,b=g.type,_=y(m);if(2==b)m=_;else if(!_){if(1==b)continue e;break e}}p[h++]=m}return p},Lr.prototype.at=ds,Lr.prototype.chain=function(){return fs(this)},Lr.prototype.commit=function(){return new Br(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,r=this;r instanceof Ur;){var n=Fo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wr){var t=e;return this.__actions__.length&&(t=new Wr(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Qo],thisArg:i}),new Br(t,this.__chain__)}return this.thru(Qo)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Ke&&(Lr.prototype[Ke]=function(){return this}),Lr}();ft._=dr,(n=function(){return dr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},7824:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},3399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;var n=r(6486),i=r(3701);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data=[]}var t,r;return t=e,(r=[{key:"get",value:function(e){return(0,i.findExistingMetric)(e,this.data)}},{key:"set",value:function(e,t){var r=(0,i.findExistingMetric)(t,this.data);return r?r.value=e:this.data.push({labels:t,value:e}),this}},{key:"collect",value:function(e){return(0,n.filter)(this.data,(function(t){return(0,n.matches)(e)(t.labels)}))}},{key:"resetAll",value:function(){var e=this;return(0,n.each)(this.data,(function(t){e.reset(t.labels)})),this}}])&&o(t.prototype,r),e}();t.Collector=s},4486:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(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&&s(e,t)}(t,e),r=t,(a=[{key:"inc",value:function(e){return this.add(1,e),this}},{key:"add",value:function(e,t){if(e<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(e));var r=this.get(t);return this.set(r?r.value+e:e,t),this}},{key:"reset",value:function(e){this.set(0,e)}}])&&i(r.prototype,a),t}(r(3399).Collector);t.Counter=a},1993:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Gauge=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(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&&s(e,t)}(t,e),r=t,(a=[{key:"dec",value:function(e){var t=this.get(e);return this.set(t?t.value-1:0,e),this}},{key:"sub",value:function(e,t){var r=this.get(t);return this.set(r?r.value-e:0,t),this}}])&&i(r.prototype,a),t}(r(4486).Counter);t.Gauge=a},8215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Histogram=void 0;var n=r(6486);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e){return{entries:(0,n.reduce)(e,(function(e,t){return e[t.toString()]=0,e}),{"+Inf":0}),sum:0,count:0,raw:[]}}var l=function(e){function t(){var e,r,n,o,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?a(e):t}(this,s(t).call(this)),o=void 0,(n="buckets")in(r=a(e))?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,e.buckets=u.sort((function(e,t){return e>t?1:-1})),e.set(c(e.buckets)),e.observe=e.observe.bind(a(e)),e}var r,l;return function(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&&u(e,t)}(t,e),r=t,l=[{key:"observe",value:function(e,t){var r=this.get(t);null==r&&(r=this.set(c(this.buckets),t).get(t)),r.value.raw.push(e),r.value.entries["+Inf"]+=1;var i=function(e,t){if(t<e[e.length-1])for(var r=0;r<e.length;r+=1)if(t<=e[r])return r}(this.buckets,e);if(null!=i)for(var o=i;o<this.buckets.length;o+=1){var s=r.value.entries[this.buckets[o].toString()];r.value.entries[this.buckets[o].toString()]=s+1}return r.value.sum=(0,n.sum)(r.value.raw),r.value.count+=1,this}},{key:"reset",value:function(e){this.set(c(this.buckets),e)}}],l&&o(r.prototype,l),t}(r(3399).Collector);t.Histogram=l},4427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default=void 0;var i=r(4961),o=r(5262);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=function(){return new i.Registry}},4961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;var n=r(6486),i=r(4486),o=r(1993),s=r(8215),a=r(3701);function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data={counter:{},gauge:{},histogram:{}}}var t,r;return t=e,r=[{key:"validateInput",value:function(e,t,r,i){if(""===String(t))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(e))throw new Error("Unknown metric type ".concat(e));if("string"!=typeof r&&null!=r)throw new Error("help must be string or undefined/null");if((0,n.has)(this.data,"".concat(e,".").concat(t)))throw new Error("A metric with the name '".concat(t,"' already exists for type '").concat(e,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(e,t,n,a),"counter"===e?(r=new i.Counter,this.data.counter[t]={help:n,instance:r,type:e}):"gauge"===e?(r=new o.Gauge,this.data.gauge[t]={help:n,instance:r,type:e}):(r=new s.Histogram(a),this.data.histogram[t]={help:n,instance:r,type:e}),r}},{key:"metrics",value:function(){return(0,n.reduce)(this.data,(function(e,t,r){return e+(0,n.reduce)(t,(function(e,t,i){var o=t.instance.collect(),s=e;return t.help.length>0&&(s+="# HELP ".concat(i," ").concat(t.help,"\n")),(s+="# TYPE ".concat(i," ").concat(r,"\n"))+(0,n.reduce)(o,(function(e,t){return e+("histogram"===r?(0,a.formatHistogramOrSummary)(i,t):(0,a.formatCounterOrGauge)(i,t))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,n.each)(this.data,(function(e){(0,n.each)(e,(function(e){e.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(e,t){var r=(null!=e?[this.data[e]]:(0,n.valuesIn)(this.data)).find((function(e){return(0,n.has)(e,t)}));return null!=r?r[t].instance:void 0}}],r&&u(t.prototype,r),e}();t.Registry=c},5262:()=>{},3701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatHistogramOrSummary=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",o=function(e){var t=(0,n.map)(e.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return 0===t.length?"":"".concat(t.join(","))}(t);return o.length>0?(i+="".concat(e,"_count{").concat(o,"} ").concat(t.value.count,"\n"),i+="".concat(e,"_sum{").concat(o,"} ").concat(t.value.sum,"\n")):(i+="".concat(e,"_count ").concat(t.value.count,"\n"),i+="".concat(e,"_sum ").concat(t.value.sum,"\n")),(0,n.reduce)(t.value.entries,(function(t,n,s){return o.length>0?i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'",').concat(o,"} ").concat(n,"\n"):i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'"} ').concat(n,"\n"),i}),i)},t.findExistingMetric=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e?(0,n.find)(t,(function(t){return(0,n.isEqual)(t.labels,e)})):t[0]},t.formatCounterOrGauge=function(e,t){var r=" ".concat(t.value.toString());if(null==t.labels||0===Object.keys(t.labels).length)return"".concat(e).concat(r,"\n");var i=(0,n.map)(t.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return"".concat(e,"{").concat(i.join(","),"}").concat(r,"\n")};var n=r(6486)},4375:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},1798:(e,t,r)=>{"use strict";var n=r(4155),i=65536,o=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var a=0;a<e;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4281:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"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,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),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"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(9481),s=r(4229);r(5717)(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,r)=>{"use strict";e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var n,i=r(4155);e.exports=O,O.ReadableState=T,r(7187).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,d,p=r(7327),v=r(1195),m=r(2457).getHighWaterMark,g=r(4281).q,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(O,a);var S=v.errorOrDestroy,E=["error","close","destroy","pause","resume"];function T(e,t,i){n=n||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(2553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r(6753),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function C(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?S(e,new w):x(e,a,t,!0);else if(a.ended)S(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):j(e,a)):x(e,a,t,!1)}else n||(a.reading=!1,j(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),j(e,t)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=v.destroy,O.prototype._undestroy=v.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},O.prototype.unshift=function(e){return C(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){f||(f=r(2553).s);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var P=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(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 M(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(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,L(e)}function j(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(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?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(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 r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function W(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}O.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):M(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?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),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){S(this,new _("_read()"))},O.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",f),l=!0,!n.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&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",c);var l=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==W(n.pipes,e))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),v(),e.removeListener("error",h),0===s(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",d),v()}function v(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=W(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?M(this):n.reading||i.nextTick(D,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(I,this),r},O.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(I,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},O.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},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5850)),h(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=F,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===d&&(d=r(5167)),d(O,e,t)})},4605:(e,t,r)=>{"use strict";e.exports=l;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=O,O.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,d=r(4281).q,p=d.ERR_INVALID_ARG_TYPE,v=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,g=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function T(e,t,s){n=n||r(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),A(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?i.nextTick(x,e,r,s,o):x(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function O(e){var t=this instanceof(n=n||r(6753));if(!t&&!s.call(O,this))return new O(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function C(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,C(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(C(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(M,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(O,u),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===O&&e&&e._writableState instanceof T}})):s=function(e){return e instanceof this},O.prototype.pipe=function(){S(this,new g)},O.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new _;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,n,i,o);return u}(this,o,a,e,t,r)),s},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new v("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function v(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[u]=null,t(p(r,!1)))}}function m(e){i.nextTick(v,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(y,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[u]=null,e(p(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[f]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",m.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(8764).Buffer,a=r(2361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?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 1===this.length?this.head=this.tail=null:this.head=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,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},1195:(e,t,r)=>{"use strict";var n=r(4155);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},v=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?v():t.on("request",v)):a&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&h.forEach(u),o||(h.forEach(u),f(l))}))}));return t.reduce(c)}},2457:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},2872:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(2419);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(9518);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(2801);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var u=r(9106);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return u.animationFrames}});var c=r(3032);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return c.Subject}});var l=r(5240);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var f=r(3274);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return f.ReplaySubject}});var h=r(280);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return h.AsyncSubject}});var d=r(580);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var p=r(2445);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var v=r(8615);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return v.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return v.queueScheduler}});var m=r(3660);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(4123);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var y=r(218);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return y.Scheduler}});var b=r(3865);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return b.Subscription}});var _=r(5125);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=r(3104);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var S=r(9985);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return S.pipe}});var E=r(2576);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return E.noop}});var T=r(4781);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return T.identity}});var O=r(8386);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return O.isObservable}});var C=r(9309);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return C.lastValueFrom}});var x=r(8182);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return x.firstValueFrom}});var P=r(2351);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return P.ArgumentOutOfRangeError}});var R=r(9474);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return R.EmptyError}});var M=r(8598);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return M.NotFoundError}});var A=r(2642);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return A.ObjectUnsubscribedError}});var j=r(6156);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return j.SequenceError}});var k=r(4173);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var I=r(4805);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return I.UnsubscriptionError}});var D=r(3050);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return D.bindCallback}});var N=r(8130);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var L=r(9258);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return L.combineLatest}});var F=r(2239);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return F.concat}});var U=r(2873);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return U.connectable}});var B=r(7885);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return B.defer}});var W=r(6332);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return W.empty}});var V=r(7245);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return V.forkJoin}});var q=r(5432);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return q.from}});var z=r(3267);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return z.fromEvent}});var H=r(470);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return H.fromEventPattern}});var G=r(4303);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return G.generate}});var $=r(1757);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return $.iif}});var Y=r(8990);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return Y.interval}});var K=r(1846);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return K.merge}});var X=r(1339);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return X.never}});var J=r(5726);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var Z=r(724);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return Z.onErrorResumeNext}});var Q=r(4380);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(7273);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(5182);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(322);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(2098);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(7513);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(2962);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(7654);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(5207);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ue=r(6332);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ue.EMPTY}});var ce=r(1339);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ce.NEVER}}),i(r(8433),t);var le=r(3280);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var fe=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return fe.audit}});var he=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return he.auditTime}});var de=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return de.buffer}});var pe=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var ve=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return ve.bufferTime}});var me=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ye=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ye.catchError}});var be=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return be.combineAll}});var _e=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var Se=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return Se.concatAll}});var Ee=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Ee.concatMap}});var Te=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Te.concatMapTo}});var Oe=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Oe.concatWith}});var Ce=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Ce.connect}});var xe=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return xe.count}});var Pe=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Pe.debounce}});var Re=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Re.debounceTime}});var Me=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Me.defaultIfEmpty}});var Ae=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Ae.delay}});var je=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return je.delayWhen}});var ke=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var Ie=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ie.distinct}});var De=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return De.distinctUntilChanged}});var Ne=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Ne.distinctUntilKeyChanged}});var Le=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return Le.elementAt}});var Fe=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Fe.endWith}});var Ue=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Ue.every}});var Be=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Be.exhaust}});var We=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return We.exhaustAll}});var Ve=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return Ve.exhaustMap}});var qe=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return qe.expand}});var ze=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return ze.filter}});var He=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return He.finalize}});var Ge=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return Ge.find}});var $e=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return $e.findIndex}});var Ye=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return Ye.first}});var Ke=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ke.groupBy}});var Xe=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Xe.ignoreElements}});var Je=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Ze=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Ze.last}});var Qe=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ut=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ut.mergeWith}});var ct=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ct.min}});var lt=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var ft=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return ft.observeOn}});var ht=r(7582);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ht.onErrorResumeNextWith}});var dt=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return dt.pairwise}});var pt=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var vt=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return vt.publish}});var mt=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var yt=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return yt.publishReplay}});var bt=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return bt.raceWith}});var _t=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var St=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return St.repeatWhen}});var Et=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Et.retry}});var Tt=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return Tt.retryWhen}});var Ot=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ot.refCount}});var Ct=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ct.sample}});var xt=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return xt.sampleTime}});var Pt=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Pt.scan}});var Rt=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Rt.sequenceEqual}});var Mt=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Mt.share}});var At=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return At.shareReplay}});var jt=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return jt.single}});var kt=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var It=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return It.skipLast}});var Dt=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Dt.skipUntil}});var Nt=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return Nt.skipWhile}});var Lt=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Lt.startWith}});var Ft=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ft.subscribeOn}});var Ut=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ut.switchAll}});var Bt=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Bt.switchMap}});var Wt=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Wt.switchMapTo}});var Vt=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Vt.switchScan}});var qt=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return qt.take}});var zt=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return zt.takeLast}});var Ht=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ht.takeUntil}});var Gt=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Gt.takeWhile}});var $t=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $t.tap}});var Yt=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Yt.throttle}});var Kt=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Kt.throttleTime}});var Xt=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Xt.throwIfEmpty}});var Jt=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Zt=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Zt.timeout}});var Qt=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var ur=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return ur.zipAll}});var cr=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return cr.zipWith}})},280:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(3032).Subject);t.AsyncSubject=o},5240:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(3032).Subject);t.BehaviorSubject=o},3104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n,i=r(6332),o=r(5726),s=r(2098),a=r(3005);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C";var u=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return a.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,a="N"===t?o.of(r):"E"===t?s.throwError((function(){return n})):"C"===t?i.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,u=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,u):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=u,t.observeNotification=c},7286:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},2419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(5125),i=r(3865),o=r(2801),s=r(9985),a=r(3280),u=r(3005),c=r(6110),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&u.isFunction(e.next)&&u.isFunction(e.error)&&u.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return c.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},3274:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(3032),s=r(7950),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(7950),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},3032:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(2419),a=r(3865),u=r(2642),c=r(6967),l=r(6110),f=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new h(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new u.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,c.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new h(e,t)},t}(s.Observable);t.Subject=f;var h=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(f);t.AnonymousSubject=h},5125:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(3005),s=r(3865),a=r(3280),u=r(7968),c=r(2576),l=r(7286),f=r(4590),h=r(6110),d=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?b(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?b(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?b(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=d;var p=Function.prototype.bind;function v(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),g=function(e){function t(t,r,n){var i,s,u=e.call(this)||this;return o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:u&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&v(t.next,s),error:t.error&&v(t.error,s),complete:t.complete&&v(t.complete,s)}):i=t,u.destination=new m(i),u}return i(t,e),t}(d);function y(e){a.config.useDeprecatedSynchronousErrorHandling?h.captureError(e):u.reportUnhandledError(e)}function b(e,t){var r=a.config.onStoppedNotification;r&&f.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:c.noop,error:function(e){throw e},complete:c.noop}},3865:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(3005),a=r(4805),u=r(6967),c=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,u,c;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=n(f),d=h.next();!d.done;d=h.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else f.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){c=e instanceof a.UnsubscriptionError?e.errors:[e]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var m=n(v),g=m.next();!g.done;g=m.next()){var y=g.value;try{l(y)}catch(e){c=null!=c?c:[],e instanceof a.UnsubscriptionError?c=o(o([],i(c)),i(e.errors)):c.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(u=m.return)&&u.call(m)}finally{if(r)throw r.error}}}if(c)throw new a.UnsubscriptionError(c)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&u.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&u.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=c,t.EMPTY_SUBSCRIPTION=c.EMPTY,t.isSubscription=function(e){return e instanceof c||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(9474),i=r(5125);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},9309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(9474);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},9518:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(2419),s=r(3865),a=r(8739),u=r(4990),c=r(4935),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,c.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(u.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},3050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(9592);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},9592:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(9016),s=r(2419),a=r(276),u=r(1914),c=r(1184),l=r(280);t.bindCallbackInternals=function e(t,r,f,h){if(f){if(!o.isScheduler(f))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,h).apply(this,n).pipe(u.mapOneOrManyArgs(f))};h=f}return h?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(h),c.observeOn(h))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=new l.AsyncSubject,c=!0;return new s.Observable((function(s){var a=u.subscribe(s);if(c){c=!1;var l=!1,f=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void u.error(n)}u.next(1<e.length?e:e[0]),f=!0,l&&u.complete()}])),f&&u.complete(),l=!0}return a}))}}},8130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(9592);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},9258:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(2419),i=r(1203),o=r(5432),s=r(4781),a=r(1914),u=r(2433),c=r(641),l=r(4990),f=r(7738);function h(e,t,r){return void 0===r&&(r=s.identity),function(n){d(t,(function(){for(var i=e.length,s=new Array(i),a=i,u=i,c=function(i){d(t,(function(){var c=o.from(e[i],t),f=!1;c.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,f||(f=!0,u--),u||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},f=0;f<i;f++)c(f)}),n)}}function d(e,t,r){e?f.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popResultSelector(e),f=i.argsArgArrayOrObject(e),d=f.args,p=f.keys;if(0===d.length)return o.from([],r);var v=new n.Observable(h(d,r,p?function(e){return c.createObject(p,e)}:s.identity));return l?v.pipe(a.mapOneOrManyArgs(l)):v},t.combineLatestInit=h},2239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(4413),i=r(2433),o=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},2873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(3032),i=r(2419),o=r(7885),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,u=void 0===a||a,c=n(),l=new i.Observable((function(e){return c.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(c),u&&r.add((function(){return c=n()}))),r},l}},7885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(2419),i=r(7103);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},9106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(2419),i=r(6813),o=r(505);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(2419);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},7245:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(2419),i=r(1203),o=r(7103),s=r(2433),a=r(4990),u=r(1914),c=r(641);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),f=l.args,h=l.keys,d=new n.Observable((function(e){var t=f.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(f[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(h?c.createObject(h,r):r),e.complete())})))},u=0;u<t;u++)s(u);else e.complete()}));return r?d.pipe(u.mapOneOrManyArgs(r)):d}},5432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(5207),i=r(7103);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},3267:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(7103),o=r(2419),s=r(9475),a=r(3909),u=r(3005),c=r(1914),l=["addListener","removeListener"],f=["addEventListener","removeEventListener"],h=["on","off"];function d(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,v){if(u.isFunction(p)&&(v=p,p=void 0),v)return e(t,r,p).pipe(c.mapOneOrManyArgs(v));var m=n(function(e){return u.isFunction(e.addEventListener)&&u.isFunction(e.removeEventListener)}(t)?f.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return u.isFunction(e.addListener)&&u.isFunction(e.removeListener)}(t)?l.map(d(t,r)):function(e){return u.isFunction(e.on)&&u.isFunction(e.off)}(t)?h.map(d(t,r)):[],2),g=m[0],y=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}},470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(2419),i=r(3005),o=r(1914);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(2419);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},4303:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(4781),o=r(9016),s=r(7885),a=r(1297);t.generate=function(e,t,r,u,c){var l,f,h,d;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=d,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,h(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(d=(l=e).initialState,t=l.condition,r=l.iterate,f=l.resultSelector,h=void 0===f?i.identity:f,c=l.scheduler):(d=e,!u||o.isScheduler(u)?(h=i.identity,c=u):h=u),s.defer(c?function(){return a.scheduleIterable(p(),c)}:p)}},1757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(7885);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},7103:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(3909),u=r(6018),c=r(2419),l=r(9500),f=r(9595),h=r(9906),d=r(2743),p=r(7823),v=r(3005),m=r(7968),g=r(2801);function y(e){return new c.Observable((function(t){var r=e[g.observable]();if(v.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function b(e){return new c.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new c.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new c.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function S(e){return new c.Observable((function(t){(function(e,t){var r,s,a,u;return n(this,void 0,void 0,(function(){var n,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=i.sent(),a={error:c},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(u=r.return)?[4,u.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function E(e){return S(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof c.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return y(e);if(a.isArrayLike(e))return b(e);if(u.isPromise(e))return _(e);if(f.isAsyncIterable(e))return S(e);if(d.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return E(e)}throw h.createInvalidObservableTypeError(e)},t.fromInteropObservable=y,t.fromArrayLike=b,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=S,t.fromReadableStreamLike=E},8990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(2445),i=r(7513);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(3783),i=r(7103),o=r(6332),s=r(2433),a=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),u=s.popNumber(e,1/0),c=e;return c.length?1===c.length?i.innerFrom(c[0]):n.mergeAll(u)(a.from(c,r)):o.EMPTY}},1339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(2419),i=r(2576);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},5726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(2433),i=r(5432);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(2419),i=r(5498),o=r(4990),s=r(2576),a=r(7103);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var u=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(u),u.add(n)}else e.complete()};n()}))}},4380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(5432);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},7273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154),o=r(7103);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},5182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(2419),i=r(7103),o=r(5498),s=r(4990);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(2419),i=r(6332);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},2098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(2419),i=r(3005);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},7513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(2419),i=r(2445),o=r(9016),s=r(1677);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},2962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(2419),i=r(7103),o=r(6332);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},7654:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(2419),s=r(7103),a=r(5498),u=r(6332),c=r(4990),l=r(2433);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),f=a.argsOrArgArray(e);return f.length?new o.Observable((function(e){var t=f.map((function(){return[]})),o=f.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(f[a]).subscribe(c.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var u=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(u))):u),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},u=0;!e.closed&&u<f.length;u++)a(u);return function(){t=o=null}})):u.EMPTY}},4990:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(5125);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},6474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(4935),i=r(7103),o=r(4990);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,u=!1,c=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}u&&r.complete()},l=function(){a=null,u&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,c,l))}),(function(){u=!0,(!n||!a||a.closed)&&r.complete()})))}))}},5382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(2445),i=r(6474),o=r(7513);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},9715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},3814:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(4935),o=r(4990),s=r(6967);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],u=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,c,l,f,h=null;u++%t==0&&a.push([]);try{for(var d=n(a),p=d.next();!p.done;p=d.next())(g=p.value).push(r),e<=g.length&&(h=null!=h?h:[]).push(g)}catch(e){o={error:e}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(o)throw o.error}}if(h)try{for(var v=n(h),m=v.next();!m.done;m=v.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7211:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(3865),o=r(4935),s=r(4990),a=r(6967),u=r(2445),c=r(2433),l=r(7738);t.bufferTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:u.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return o.operate((function(t,r){var o=[],u=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),u&&f()},f=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,d,(function(){return c(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):u=!0,f();var h=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var u=a.value,l=u.buffer;l.push(e),v<=l.length&&c(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==h||h.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(h)}))}},4943:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(3865),o=r(4935),s=r(7103),a=r(4990),u=r(2576),c=r(6967);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){c.arrRemove(l,r),o.next(r),n.unsubscribe()}),u.noop)))}),u.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},1240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,u=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,u,i.noop))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},9548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(7103),i=r(4990),o=r(4935);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,u=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):u=!0}))),u&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(3240);t.combineAll=n.combineLatestAll},6318:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(9258),s=r(4935),a=r(5498),u=r(1914),c=r(9985),l=r(2433);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var f=l.popResultSelector(t);return f?c.pipe(e.apply(void 0,i([],n(t))),u.mapOneOrManyArgs(f)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},3240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(9258),i=r(2069);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},5024:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(6318);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},4919:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(4935),s=r(4413),a=r(2433),u=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(u.from(i([t],n(e)),r)).subscribe(o)}))}},4413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(3783);t.concatAll=function(){return n.mergeAll(1)}},7498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(9475),i=r(3005);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},6109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(7498),i=r(3005);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},9664:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(4919);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},1995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(3032),i=r(7103),o=r(4935),s=r(851),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(122);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,u=null,c=function(){if(null==u||u.unsubscribe(),u=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==u||u.unsubscribe(),n=!0,a=t,u=o.createOperatorSubscriber(r,c,i.noop),s.innerFrom(e(t)).subscribe(u)}),(function(){c(),r.complete()}),void 0,(function(){a=u=null})))}))}},1385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(2445),i=r(4935),o=r(4990);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function c(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);u()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(c,e),n.add(i))}),(function(){u(),n.complete()}),void 0,(function(){s=i=null})))}))}},1658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(4935),i=r(4990);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},5841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(2445),i=r(8798),o=r(7513);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},8798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(2239),i=r(4783),o=r(9438),s=r(8313),a=r(9475),u=r(7103);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return u.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},1080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},3054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(4935),i=r(4990),o=r(2576),s=r(7103);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},8737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(4781),i=r(4935),o=r(4990);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},7957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(8737);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},8633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(2351),i=r(9154),o=r(1779),s=r(1658),a=r(4783);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(u){return u.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},911:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(2239),s=r(5726);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},2096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(4935),i=r(4990);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},67:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(5337);t.exhaust=n.exhaustAll},5337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(5635),i=r(4781);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},5635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(4990);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},9745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(4935),i=r(7788);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},9154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(4935),i=r(4990);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},9283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(4935);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},7119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(4935),i=r(4990);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},4706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(4935),i=r(7119);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(9474),i=r(9154),o=r(4783),s=r(1658),a=r(1779),u=r(4781);t.first=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},1788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(9475);t.flatMap=n.mergeMap},9749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(2419),i=r(7103),o=r(3032),s=r(4935),a=r(4990);t.groupBy=function(e,t,r,u){return s.operate((function(s,c){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,u=t.connector):l=t;var f=new Map,h=function(e){f.forEach(e),e(c)},d=function(e){return h((function(t){return t.error(e)}))},p=0,v=!1,m=new a.OperatorSubscriber(c,(function(t){try{var s=e(t),h=f.get(s);if(!h){f.set(s,h=u?u():new o.Subject);var g=(b=s,_=h,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&v&&m.unsubscribe()}}))).key=b,w);if(c.next(g),r){var y=a.createOperatorSubscriber(h,(function(){h.complete(),null==y||y.unsubscribe()}),void 0,void 0,(function(){return f.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(y))}}h.next(l?l(t):t)}catch(e){d(e)}var b,_,w}),(function(){return h((function(e){return e.complete()}))}),d,(function(){return f.clear()}),(function(){return v=!0,0===p}));s.subscribe(m)}))}},9438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(4935),i=r(4990),o=r(2576);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},8515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(4935),i=r(4990);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(4781),i=r(1914),o=r(9985),s=r(9475),a=r(2);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},2435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(9474),i=r(9154),o=r(1980),s=r(1779),a=r(1658),u=r(4781);t.last=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},7291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(4935),i=r(4990);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},8313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(7291);t.mapTo=function(e){return n.map((function(){return e}))}},3209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},2620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(122),i=r(3005);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},9821:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(4935),s=r(5498),a=r(3783),u=r(2433),c=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(c.from(i([t],n(e)),r)).subscribe(o)}))}},3783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(9475),i=r(4781);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},7788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(7103),i=r(7738),o=r(4990);t.mergeInternals=function(e,t,r,s,a,u,c,l){var f=[],h=0,d=0,p=!1,v=function(){!p||f.length||h||t.complete()},m=function(e){return h<s?g(e):f.push(e)},g=function(e){u&&t.next(e),h++;var l=!1;n.innerFrom(r(e,d++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{h--;for(var e=function(){var e=f.shift();c?i.executeSchedule(t,c,(function(){return g(e)})):g(e)};f.length&&h<s;)e();v()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,v()}))),function(){null==l||l()}}},9475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(7788),a=r(3005);t.mergeMap=function e(t,r,u){return void 0===u&&(u=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),u):("number"==typeof r&&(u=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,u)})))}},1211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(9475),i=r(3005);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},7267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(4935),i=r(7788);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},9303:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(9821);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},9714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(122),i=r(3005);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},3848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(9518),i=r(3005),o=r(1995);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},1184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(7738),i=r(4935),o=r(4990);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},7582:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(5498),s=r(724);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},2731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(4935),i=r(4990);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},5649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},4691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(7291);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},4474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(3032),i=r(3848),o=r(1995);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},52:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(5240),i=r(9518);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},2110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(280),i=r(9518);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},9864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(3274),i=r(3848),o=r(3005);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},9764:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(5498),s=r(179);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},179:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(5182),s=r(4935),a=r(4781);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(8345),i=r(4935);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},8739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(4935),i=r(4990);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},5313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(6332),i=r(4935),o=r(4990),s=r(7103),a=r(7513);t.repeat=function(e){var t,r,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,r=e.delay):u=e),u<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,c=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),u=o.createOperatorSubscriber(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<u?n?c():r=!0:t.complete()}))),r&&c()};l()}))}},4068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=!1,l=!1,f=function(){return l&&c&&(r.complete(),!0)},h=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!f()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?h():u=!0}),(function(){c=!0,f()})))),a).next()}))),u&&(o.unsubscribe(),o=null,u=!1,h())};h()}))}},64:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(4935),i=r(4990),o=r(4781),s=r(7513),a=r(7103);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,u=void 0===r?1/0:r,c=t.delay,l=t.resetOnSuccess,f=void 0!==l&&l;return u<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){f&&(n=0),t.next(e)}),void 0,(function(e){if(n++<u){var f=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=c){var h="number"==typeof c?s.timer(c):a.innerFrom(c(e,n)),d=i.createOperatorSubscriber(t,(function(){d.unsubscribe(),f()}),(function(){t.complete()}));h.subscribe(d)}else f()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},1188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?c():u=!0})))),a&&a.next(t)}))),u&&(o.unsubscribe(),o=null,u=!1,c())};c()}))}},4193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(7103),i=r(4935),o=r(2576),s=r(4990);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},6170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(2445),i=r(4193),o=r(8990);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},5876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(4935),i=r(8345);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},8345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(4990);t.scanInternals=function(e,t,r,i,o){return function(s,a){var u=r,c=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;c=u?e(c,t,r):(u=!0,t),i&&a.next(c)}),o&&function(){u&&a.next(c),a.complete()}))}}},1791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(4935),i=r(4990),o=r(7103);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},u=function(e){n.next(e),n.complete()},c=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?u(!1):e.buffer.push(n):!t(n,i.shift())&&u(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&u(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(c(s,a)),o.innerFrom(e).subscribe(c(a,s))}))}},5137:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(7103),s=r(3032),a=r(5125),u=r(4935);function c(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var u=new a.SafeSubscriber({next:function(){u.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(u)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,f=void 0===l||l,h=e.resetOnRefCountZero,d=void 0===h||h;return function(e){var t,n,s,l=0,h=!1,p=!1,v=function(){null==n||n.unsubscribe(),n=void 0},m=function(){v(),t=s=void 0,h=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return u.operate((function(e,u){l++,p||h||v();var y=s=null!=s?s:r();u.add((function(){0!=--l||p||h||(n=c(g,d))})),y.subscribe(u),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return y.next(e)},error:function(e){p=!0,v(),n=c(m,i,e),y.error(e)},complete:function(){h=!0,v(),n=c(m,f),y.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},1348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(3274),i=r(5137);t.shareReplay=function(e,t,r){var o,s,a,u,c=!1;return e&&"object"==typeof e?(o=e.bufferSize,u=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},8242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(9474),i=r(6156),o=r(8598),s=r(4935),a=r(4990);t.single=function(e){return s.operate((function(t,r){var s,u=!1,c=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){c=!0,e&&!e(n,l++,t)||(u&&r.error(new i.SequenceError("Too many matching values")),u=!0,s=n)}),(function(){u?(r.next(s),r.complete()):r.error(c?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},3169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(9154);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},2454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(4781),i=r(4935),o=r(4990);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},6931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},7913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(4935),i=r(4990);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(2239),i=r(2433),o=r(4935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(4935);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},9253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(8518),i=r(4781);t.switchAll=function(){return n.switchMap(i.identity)}},8518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(7103),i=r(4935),o=r(4990);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,u=!1,c=function(){return u&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var u=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,u++):e)}),(function(){s=null,c()})))}),(function(){u=!0,c()})))}))}},1173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(8518),i=r(3005);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},3855:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(8518),i=r(4935);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},4783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(6332),i=r(4935),o=r(4990);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},1980:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(6332),o=r(4935),s=r(4990);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},9845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},6060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(4935),i=r(4990);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},1138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(3005),i=r(4935),o=r(4990),s=r(4781);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},7306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(4935),i=r(4990),o=r(7103);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,u=void 0===a||a,c=s.trailing,l=void 0!==c&&c,f=!1,h=null,d=null,p=!1,v=function(){null==d||d.unsubscribe(),d=null,l&&(y(),p&&n.complete())},m=function(){d=null,p&&n.complete()},g=function(t){return d=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,v,m))},y=function(){if(f){f=!1;var e=h;h=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){f=!0,h=e,(!d||d.closed)&&(u?y():g(e))}),(function(){p=!0,(!(l&&f&&d)||d.closed)&&n.complete()})))}))}},8968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(2445),i=r(7306),o=r(7513);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},1779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(9474),i=r(4935),o=r(4990);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},8005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(2445),i=r(4935),o=r(4990);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},4173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(2445),i=r(1677),o=r(4935),s=r(7103),a=r(7029),u=r(4990),c=r(7738);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,f=r.each,h=r.with,d=void 0===h?l:h,p=r.scheduler,v=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==f)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=c.executeSchedule(t,v,(function(){try{r.unsubscribe(),s.innerFrom(d({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(u.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),f>0&&l(f)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-v.now():f)}))}},7223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(2445),i=r(1677),o=r(4173);t.timeoutWith=function(e,t,r){var s,a,u;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(u=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:u})}},8975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(7950),i=r(7291);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(122),i=r(4935),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},2826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(2576),a=r(7103);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var u=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),u)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,u)),function(){null==i||i.unsubscribe(),i=null}}))}},7526:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(3032),o=r(4935),s=r(4990);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],u=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,c;try{for(var l=n(a),f=l.next();!f.done;f=l.next())f.value.next(t)}catch(e){s={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}var h=u-e+1;if(h>=0&&h%r==0&&a.shift().complete(),++u%r==0){var d=new i.Subject;a.push(d),o.next(d.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(3032),i=r(2445),o=r(3865),s=r(4935),a=r(4990),u=r(6967),c=r(2433),l=r(7738);t.windowTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,c=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),u.arrRemove(i,e),s&&f()},f=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,d,(function(){return c(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):s=!0,f();var h=function(e){return i.slice().forEach(e)},m=function(e){h((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){h((function(t){t.window.next(e),v<=++t.seen&&c(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},1883:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(3032),o=r(3865),s=r(4935),a=r(7103),u=r(4990),c=r(2576),l=r(6967);t.windowToggle=function(e,t){return s.operate((function(r,s){var f=[],h=function(e){for(;0<f.length;)f.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(u.createOperatorSubscriber(s,(function(e){var r=new i.Subject;f.push(r);var n,d=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void h(e)}s.next(r.asObservable()),d.add(n.subscribe(u.createOperatorSubscriber(s,(function(){l.arrRemove(f,r),r.complete(),d.unsubscribe()}),c.noop,h)))}),c.noop)),r.subscribe(u.createOperatorSubscriber(s,(function(e){var t,r,i=f.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<f.length;)f.shift().complete();s.complete()}),h,(function(){for(;0<f.length;)f.shift().unsubscribe()})))}))}},4309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(7103);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,u=function(e){i.error(e),r.error(e)},c=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void u(e)}t.subscribe(a=o.createOperatorSubscriber(r,c,c,u))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),u,(function(){null==a||a.unsubscribe(),i=null})))}))}},3041:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(4935),s=r(4990),a=r(7103),u=r(4781),c=r(2576),l=r(2433);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,f=new Array(l),h=e.map((function(){return!1})),d=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){f[t]=e,d||h[t]||(h[t]=!0,(d=h.every(u.identity))&&(h=null))}),c.noop))},v=0;v<l;v++)p(v);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(d){var t=i([e],n(f));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},4400:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(7654),s=r(4935);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},8593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(7654),i=r(2069);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},8096:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(4400);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},7631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(2419);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},8489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(2419),i=r(7738);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},1297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(2419),i=r(3725),o=r(3005),s=r(7738);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},4001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(7103),i=r(1184),o=r(276);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},5143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(7103),i=r(1184),o=r(276);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},3676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(8489),i=r(7823);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},5207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(4001),i=r(5143),o=r(7631),s=r(1297),a=r(8489),u=r(9500),c=r(6018),l=r(3909),f=r(2743),h=r(9595),d=r(9906),p=r(7823),v=r(3676);t.scheduled=function(e,t){if(null!=e){if(u.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(c.isPromise(e))return i.schedulePromise(e,t);if(h.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(f.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return v.scheduleReadableStreamLike(e,t)}throw d.createInvalidObservableTypeError(e)}},1986:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(3865).Subscription);t.Action=o},7574:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(9702),s=r(505),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},2934:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AnimationFrameScheduler=o},2189:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(9702),s=r(8908),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},5523:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AsapScheduler=o},9702:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(1986),s=r(8203),a=r(6967),u=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),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=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=u},3643:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(218),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},6201:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(9702).AsyncAction);t.QueueAction=o},5860:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(3643).AsyncScheduler);t.QueueScheduler=o},4123:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(9702),s=r(3865),a=function(e){function t(t,r){void 0===t&&(t=u),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(3643).AsyncScheduler);t.VirtualTimeScheduler=a;var u=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},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}(o.AsyncAction);t.VirtualAction=u},3660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(7574),i=r(2934);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},505:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(3865);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(2189),i=r(5523);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},2445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(9702),i=r(3643);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},8908:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(7629),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},8203:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},8615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(6201),i=r(5860);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},4590:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},3725:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},2801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(7029);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(7029);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},8598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(7029);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},2642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(7029);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},6156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(7029);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(7029);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},2433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(3005),i=r(9016);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},7029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},6110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(3280),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},4781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},3909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},9595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(3005);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},3005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},9500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(2801),i=r(3005);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},2743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(3725),i=r(3005);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},8386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(2419),i=r(3005);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},6018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(3005);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},7823:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(c,l):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function c(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),s.shift(),s.length&&u(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(3005);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(3005);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},4935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(3005);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1914:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(7291),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},2576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},9985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(4781);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(3280),i=r(4590);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},9906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},4857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var u=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return u.bufferToggle}});var c=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return c.bufferWhen}});var l=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var f=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return f.combineAll}});var h=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return h.combineLatestAll}});var d=r(6318);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return d.combineLatest}});var p=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var v=r(4919);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return v.concat}});var m=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var y=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return y.concatMapTo}});var b=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return b.concatWith}});var _=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var S=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return S.debounce}});var E=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return E.debounceTime}});var T=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return T.defaultIfEmpty}});var O=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return O.delay}});var C=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return C.delayWhen}});var x=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return x.dematerialize}});var P=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return P.distinct}});var R=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return R.distinctUntilChanged}});var M=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return M.distinctUntilKeyChanged}});var A=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return A.elementAt}});var j=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return j.endWith}});var k=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var I=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return I.exhaust}});var D=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return D.exhaustAll}});var N=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return N.exhaustMap}});var L=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return L.expand}});var F=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return F.filter}});var U=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return U.finalize}});var B=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return B.find}});var W=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return W.findIndex}});var V=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return V.first}});var q=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return q.groupBy}});var z=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return z.ignoreElements}});var H=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return H.isEmpty}});var G=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return G.last}});var $=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return $.map}});var Y=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return Y.mapTo}});var K=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return K.materialize}});var X=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return X.max}});var J=r(9821);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var Z=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return Z.mergeAll}});var Q=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(7582);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ue=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ue.pairwise}});var ce=r(5649);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ce.partition}});var le=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var fe=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return fe.publish}});var he=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return he.publishBehavior}});var de=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return de.publishLast}});var pe=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var ve=r(9764);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return ve.race}});var me=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ye=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ye.repeat}});var be=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return be.repeatWhen}});var _e=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var Se=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Se.refCount}});var Ee=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ee.sample}});var Te=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Te.sampleTime}});var Oe=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Oe.scan}});var Ce=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Ce.sequenceEqual}});var xe=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return xe.share}});var Pe=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Pe.shareReplay}});var Re=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Re.single}});var Me=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Me.skip}});var Ae=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Ae.skipLast}});var je=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return je.skipUntil}});var ke=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var Ie=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ie.startWith}});var De=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return De.subscribeOn}});var Ne=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ne.switchAll}});var Le=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Le.switchMap}});var Fe=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Fe.switchMapTo}});var Ue=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ue.switchScan}});var Be=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Be.take}});var We=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return We.takeLast}});var Ve=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ve.takeUntil}});var qe=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return qe.takeWhile}});var ze=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return ze.tap}});var He=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return He.throttle}});var Ge=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Ge.throttleTime}});var $e=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return $e.throwIfEmpty}});var Ye=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Ye.timeInterval}});var Ke=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ke.timeout}});var Xe=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Xe.timeoutWith}});var Je=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Ze=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Ze.toArray}});var Qe=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(4400);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},9509:(e,t,r)=>{var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7539:e=>{"use strict";const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const n=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let u;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===a&&(u=c[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&u&&(t.rtx={ssrc:u}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&a&&r.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=l}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;return i=e||t.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t},8853:(e,t,r)=>{const n=r(1227)("simple-peer"),i=r(5177),o=r(1798),s=r(8473),a=r(4375),u=r(2114),{Buffer:c}=r(8764),l=65536;function f(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class h extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||h.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},h.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?u(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):u(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(u(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(u(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(u(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(u(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?("Ignoring unsupported ICE candidate.",console.warn("Ignoring unsupported ICE candidate.")):this.destroy(u(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(u(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const r=this._senderMap.get(e)||new Map;let n=r.get(t);if(n)throw n.removed?u(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):u(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");n=this._pc.addTrack(e,t),r.set(t,n),this._senderMap.set(e,r),this._needsNegotiation()}replaceTrack(e,t,r){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const n=this._senderMap.get(e),i=n?n.get(r):null;if(!i)throw u(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,n),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(u(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const r=this._senderMap.get(e),n=r?r.get(t):null;if(!n)throw u(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(u(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(u(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=l),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(u(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,r){if(this.destroyed)return r(u(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(u(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>l?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=r):r(null)}else this._debug("write before connect"),this._chunk=e,this._cb=r}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(u(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(u(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(u(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((r=>{const n=[];r.forEach((e=>{n.push(t(e))})),e(null,n)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((r=>{if(this.destroyed)return;const n=[];r.result().forEach((e=>{const r={};e.names().forEach((t=>{r[t]=e.stat(t)})),r.id=e.id,r.type=e.type,r.timestamp=e.timestamp,n.push(t(r))})),e(null,n)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,r)=>{if(this.destroyed)return;t&&(r=[]);const n={},i={},o={};let s=!1;r.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(n[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(i[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)}));const a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let r=n[e.remoteCandidateId];r&&(r.ip||r.address)?(this.remoteAddress=r.ip||r.address,this.remotePort=Number(r.port)):r&&r.ipAddress?(this.remoteAddress=r.ipAddress,this.remotePort=Number(r.portNumber)):"string"==typeof e.googRemoteAddress&&(r=e.googRemoteAddress.split(":"),this.remoteAddress=r[0],this.remotePort=Number(r[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(r.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),s||Object.keys(o).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(u(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>l||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}h.WEBRTC_SUPPORT=!!i(),h.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},h.channelConfig={},e.exports=h},2553:(e,t,r)=>{"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r: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 r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},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}},3607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(8806);const a=o(r(835)),u=r(6123);s(r(8512),t);var c=r(6123);Object.defineProperty(t,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),s(r(835),t),window.AdapterJS=a,window.Uneeq=u.Uneeq},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoundMeter=void 0;const n=r(2872),i=r(7501);t.SoundMeter=class{constructor(e){this.instant$=new n.BehaviorSubject(0),this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);const t=this;this.script.onaudioprocess=e=>{const r=e.inputBuffer.getChannelData(0);let n,i=0,o=0;for(n=0;n<r.length;++n)i+=r[n]*r[n],Math.abs(r[n])>.99&&(o+=1);t.instant=Math.sqrt(i/r.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/r.length,t.instant$.next(parseFloat(t.instant.toFixed(2)))}}connectToSource(e,t){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(e){console.error(e),void 0!==t&&t(e)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},4518:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoEditor=void 0;const s=o(r(6551));t.VideoEditor=class{constructor(){}applyChromaKeyEffect(e,t){try{r(6303);const n=s.default();let i,o,a;i=n.transform("reformat"),i.source=t,i.width=e.width,i.height=e.height,a=n.target(e),o=n.effect("chroma"),o.source=i,a.source=o,n.go()}catch(e){console.error(e)}}}},1181:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.API=void 0,t.API=class{constructor(e,t="",r=(()=>{})){this.xAuthToken="",this.apiUrl=e,this.apiKey=t,this.loggedOutHandler=r}set callId(e){this._callId=e}get authToken(){return this.xAuthToken}startSession(e){return this.postRequest("/api/v1/customers/",e,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",e)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:e})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(e){return this.postRequest("/api/v2/clients/start-session",e,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(e){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:e})}sendMediaUnavailable(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",e)}getEdgeNodeId(e){let t=e.replace("turn:","http://");t=t.replace("turns:","https://");const r=new Request(t,{method:"GET"});return this.makeRequest(r)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(e){return r(this,void 0,void 0,(function*(){const t=yield fetch(e);if(!t.ok){401===t.status&&this.loggedOutHandler();const e=yield t.json();throw{status:t.status,body:e}}return 204===t.status?new Promise(((e,t)=>{e()})):(this.xAuthToken=t.headers.get("x-auth-token")||this.xAuthToken,yield t.json())}))}getRequest(e){const t=new Request(this.apiUrl+e,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(t)}postRequest(e,t={},r={},n={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},n),body:JSON.stringify(t)},o=new Request(this.apiUrl+e,Object.assign(i,r));return this.makeRequest(o)}putRequest(e,t={},r={}){const n={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(t)},i=new Request(this.apiUrl+e,Object.assign(n,r));return this.makeRequest(i)}}},2958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasService=void 0,t.CanvasService=class{constructor(e){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=e}createCanvas(){const e=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(e),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.height=this.canvasHeight,e.width=this.canvasWidth,e}}},1546:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;const i=r(3607),o=r(1929);t.DeviceManager=class{constructor(e,t){this.options=e,this.api=t,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new o.MediaHandler(this.options,(()=>this.remoteVideoReady())),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(e){this.mediaHandler.setEdgeNodeId(e),this.getDevices(!0)}enableLocalDevices(e,t){const r=this.options.uneeqOptions.sendLocalVideo!==e,n=this.options.uneeqOptions.sendLocalAudio!==t;(r||n)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=e,this.options.uneeqOptions.sendLocalAudio=t,r&&!1===e&&this.publishStream.getVideoTracks().forEach((e=>e.stop())),n&&!1===t&&this.publishStream.getAudioTracks().forEach((e=>e.stop())),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(e=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const t=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then((t=>n(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),e){if(this.options.uneeqOptions.sendLocalVideo){const e=t.getVideoTracks();e.length>0&&(this.publishStream.getVideoTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}if(this.options.uneeqOptions.sendLocalAudio){const e=t.getAudioTracks();e.length>0&&(this.publishStream.getAudioTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})))).catch((e=>{t.options.userMessages.next(new i.DeviceErrorMessage(e)),console.error("device error: ",e),this.sendMediaUnavailableInfo("NotAllowedError"===e.name),this.revertMediaOptions()}))}setMicDevice(e,t=!0){const r=this.devices.audioInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredMicrophoneId=e,this.audioConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(e));else{const t="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setCamDevice(e,t=!0){const r=this.devices.videoInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredCameraId=e,this.videoConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(e));else{const t="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setAvatarSpeakerDevice(e){if(this.mediaHandler.avatarVideoElement){const t=this.devices.audioOutput.filter((t=>t.deviceId===e));if(t&&t.length>0)this.options.uneeqOptions.preferredSpeakerId=e,this.mediaHandler.avatarVideoElement.setSinkId(e).then((()=>{this.speakerConstraints.deviceId=e,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(e))})).catch((t=>{const r="Uneeq setSpeaker: Error setting device. "+t.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(r,e))}));else{const t="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getMediaDevices(),r={audioInputs:t.audioInput.length,videoInputs:t.videoInput.length,hasUserDeniedPermission:e};return this.api.sendMediaUnavailable(r)}))}getMediaDevices(){return n(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t={audioInput:[],audioOutput:[],videoInput:[]};return t.audioInput=e.filter((e=>"audioinput"===e.kind)),t.audioOutput=e.filter((e=>"audiooutput"===e.kind)),t.videoInput=e.filter((e=>"videoinput"===e.kind)),t}))}initDeviceList(){return n(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=e=>{this.initDeviceList()};const e=yield this.getMediaDevices();JSON.stringify(e)!==JSON.stringify(this.devices)&&(this.devices=e,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))}))}}},6886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanVideoPlayManager=void 0;const n=r(8512),i=r(7501);t.DigitalHumanVideoPlayManager=class{constructor(e,t){this.messages=e,this.publicUnmuteDigitalHumanMethod=t,this.remoteVideoPlayCount=0}play(e){this.video=e,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new n.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=e=>{this.messages.next(new n.DigitalHumanVideoError(e))},this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})).catch((()=>{this.digitalHumanFailedToPlayUnmuted()})))}digitalHumanFailedToPlayUnmuted(){this.messages.next(new n.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then((()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new n.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",(()=>{this.publicUnmuteDigitalHumanMethod()}),{once:!0})})).catch((e=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",e),this.playRemoteVideoWithExponentialBackoff()}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})),this.remoteVideoPlayCount++,setTimeout((()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()}),100*(this.remoteVideoPlayCount-1)))}}},7789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocaleDetector=void 0;class r{static validateOrDetectSpeechLocales(e){let t=e.speechToTextLocales;t&&t.length>0&&(t.split(":").forEach((e=>{this.sttSupportedLocales[e]||(console.error(`UneeQ: Speech to text not supported for: ${e}. Defaulting to en-US`),t=this.defaultLocale)})),"undefined"!==t&&"null"!==t||(t=this.defaultLocale));const r=(window.navigator.languages||[window.navigator.language]).map((e=>((e.length<5||"zh-CN"===e)&&(e=this.localeMappings[e]||null),e&&!this.sttSupportedLocales[e]&&(console.warn(`UneeQ: Speech to text not supported for one of the detected languages: ${e}. Replacing with en-US.`),e=this.defaultLocale),e))).slice(0,4).filter(n).filter(((e,t,r)=>r.indexOf(e)===t));let i=r.join(":").replace(/:\s*$/,"");return i&&0!==i.length||(i=this.defaultLocale),t&&t.length>0?console.debug(`UneeQ: Configured speech to text languages: ${t}`):console.warn(`UneeQ: Detected speechToText languages from browser: ${i}`),t||i}}function n(e){return null!=e}t.LocaleDetector=r,r.defaultLocale="en-US",r.localeMappings={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP",de:"de-DE",ko:"ko-KR",zh:"cmn-Hans-CN",it:"it-IT",pt:"pt-PT",nl:"nl-NL",sv:"sv-SE",da:"da-DK",no:"no-NO",fi:"fi-FI",ru:"ru-RU",pl:"pl-PL",tr:"tr-TR",ar:"ar-SA",th:"th-TH",id:"id-ID",cs:"cs-CZ",hu:"hu-HU",ro:"ro-RO",he:"he-IL",vi:"vi-VN",uk:"uk-UA",hi:"hi-IN","zh-CN":"cmn-Hans-CN"},r.sttSupportedLocales={"af-ZA":!0,"sq-AL":!0,"am-ET":!0,"ar-DZ":!0,"ar-BH":!0,"ar-EG":!0,"ar-IQ":!0,"ar-IL":!0,"ar-JO":!0,"ar-KW":!0,"ar-LB":!0,"ar-MR":!0,"ar-MA":!0,"ar-OM":!0,"ar-QA":!0,"ar-SA":!0,"ar-PS":!0,"ar-TN":!0,"ar-AE":!0,"ar-YE":!0,"hy-AM":!0,"az-AZ":!0,"eu-ES":!0,"bn-BD":!0,"bn-IN":!0,"bs-BA":!0,"bg-BG":!0,"my-MM":!0,"ca-ES":!0,"yue-Hant-HK":!0,"cmn-Hans-CN":!0,"cmn-Hant-TW":!0,"hr-HR":!0,"cs-CZ":!0,"da-DK":!0,"nl-BE":!0,"nl-NL":!0,"en-AU":!0,"en-CA":!0,"en-GH":!0,"en-HK":!0,"en-IN":!0,"en-IE":!0,"en-KE":!0,"en-NZ":!0,"en-NG":!0,"en-PK":!0,"en-PH":!0,"en-SG":!0,"en-ZA":!0,"en-TZ":!0,"en-GB":!0,"en-US":!0,"et-EE":!0,"fil-PH":!0,"fi-FI":!0,"fr-BE":!0,"fr-CA":!0,"fr-FR":!0,"fr-CH":!0,"gl-ES":!0,"ka-GE":!0,"de-AT":!0,"de-DE":!0,"de-CH":!0,"el-GR":!0,"gu-IN":!0,"iw-IL":!0,"hi-IN":!0,"hu-HU":!0,"is-IS":!0,"id-ID":!0,"it-IT":!0,"it-CH":!0,"ja-JP":!0,"jv-ID":!0,"kn-IN":!0,"kk-KZ":!0,"km-KH":!0,"ko-KR":!0,"lo-LA":!0,"lv-LV":!0,"lt-LT":!0,"mk-MK":!0,"ms-MY":!0,"ml-IN":!0,"mr-IN":!0,"mn-MN":!0,"ne-NP":!0,"no-NO":!0,"fa-IR":!0,"pl-PL":!0,"pt-BR":!0,"pt-PT":!0,"pa-Guru-IN":!0,"ro-RO":!0,"ru-RU":!0,"rw-RW":!0,"sr-RS":!0,"si-LK":!0,"sk-SK":!0,"sl-SI":!0,"ss-latn-za":!0,"st-ZA":!0,"es-AR":!0,"es-BO":!0,"es-CL":!0,"es-CO":!0,"es-CR":!0,"es-DO":!0,"es-EC":!0,"es-SV":!0,"es-GT":!0,"es-HN":!0,"es-MX":!0,"es-NI":!0,"es-PA":!0,"es-PY":!0,"es-PE":!0,"es-PR":!0,"es-ES":!0,"es-US":!0,"es-UY":!0,"es-VE":!0,"su-ID":!0,"sw-KE":!0,"sw-TZ":!0,"sv-SE":!0,"ta-IN":!0,"ta-MY":!0,"ta-SG":!0,"ta-LK":!0,"te-IN":!0,"th-TH":!0,"tn-latn-za":!0,"tr-TR":!0,"ts-ZA":!0,"uk-UA":!0,"ur-IN":!0,"ur-PK":!0,"uz-UZ":!0,"ve-ZA":!0,"vi-VN":!0,"xh-ZA":!0,"zu-ZA":!0}},7501:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=t.LogType=void 0,function(e){e.debug="debug",e.log="log",e.warn="warn",e.error="error"}(r=t.LogType||(t.LogType={}));class n{constructor(){this.enabled=!1}log(e,...t){this.emitLogMessage(r.log,e,t)}warn(e,...t){this.emitLogMessage(r.warn,e,t)}error(e,...t){this.emitLogMessage(r.error,e,t)}debug(e,...t){this.emitLogMessage(r.debug,e,t)}emitLogMessage(e,t,n){(this.enabled||e===r.error)&&(n.length>0?console[e](t,n):console[e](t))}}t.Logger=n,t.logger=new n},1929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHandler=void 0;const n=r(2872),i=r(4857),o=r(3607),s=r(4518),a=r(7563),u=r(2958),c=r(7501),l=r(8477);t.MediaHandler=class{constructor(e,t){this.options=e,this.remoteVideoReady=t,this.remoteStream$=new n.BehaviorSubject(null),this.localStream$=new n.BehaviorSubject(null),this.publishState$=new n.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.pipe(i.filter((e=>null!==e))).subscribe((r=>{this.avatarVideoElement=this.options.digitalHumanVideoElement,this.avatarVideoElement.srcObject=r,e.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",e.uneeqOptions.avatarVideoContainerElement.innerHTML="",e.uneeqOptions.avatarVideoContainerElement.appendChild(this.avatarVideoElement),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(this.avatarVideoElement),t()})),this.localStream$.pipe(i.filter((e=>null!==e))).subscribe((t=>{const r=document.createElement("video");this.localVideoElement=r,r.srcObject=t,r.autoplay=!0,r.muted=!0,r.setAttribute("playsinline","true"),r.setAttribute("style","width: 100%; height: 100%;"),e.uneeqOptions.localVideoContainerElement.innerHTML="",e.uneeqOptions.localVideoContainerElement.appendChild(r),this.options.voiceInputManager&&this.options.voiceInputManager.initMicActivity(t),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()})),this.options.internalMessages$.pipe(i.filter((e=>"AnswerMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(e)})),this.options.internalMessages$.pipe(i.filter((e=>"IceCandidateMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(e)}))}setEdgeNodeId(e){this.options.session.edgeNodeId=e,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){c.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),t&&t.getTracks().forEach((e=>e.enabled=!1)),e&&e.getTracks().forEach((e=>e.enabled=!1))}resume(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();t&&t.getTracks().forEach((e=>e.enabled=!0)),e&&e.getTracks().forEach((e=>e.enabled=!0)),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const e=this.localStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const e=this.remoteStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.options.voiceInputManager&&this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(e){this.webRTC&&this.webRTC.sendDataMessage(e)}gatherWebRTCStats(e){var t;null===(t=this.webRTC)||void 0===t||t.getStats(e)}publishVideo(){const e=this.options.session.streamId,t=this.options.session.avatarStreamId,r=this.options.session.turnServerAddresses,n=this.options.session.turnUsername,i=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,f=this.remoteStream$,h=this.localStream$.getValue();if(!h||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let d=0;c.logger.log("UserSession | publishVideo - stream:",h,"publishStreamName:",e),c.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new l.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:e,subscribeStreamName:t,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:e=>{c.logger.log("WEBRTC: onAddStream "+e.stream),f.next(e.stream)},forceTurnServerUse:s,iceServers:[{urls:r,username:n,credential:i}],onConnect:()=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),u.getValue()===a.PublishSubscribeState.CONNECTING&&u.next(a.PublishSubscribeState.CONNECTED)},onError:e=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",d),d<3?(d++,this.performWebRTCConnection(h),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(c.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(h)):this.webRTC.updateStreamTracks(h)}performWebRTCConnection(e){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(e))}initTransparentBackground(e){const t=new u.CanvasService(this.options.uneeqOptions).createCanvas();(new s.VideoEditor).applyChromaKeyEffect(t,e),this.avatarVideoElement.style.display="none"}}},4887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;const n=r(4857),i=r(3607),o=r(4050);t.MessageHandler=class{constructor(e,t){this.internalMessages$=e,this.messages=t,this.deviceManager={getDevices:(e,t)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe((e=>{const t={type:o.PromMessageType.QuestionMessageReceived,value:{id:e.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarQuestionMessage(e.question,e.id))})),this.getMessagesOfType("AvatarAnswerText").subscribe((e=>{const t={type:o.PromMessageType.AnswerMessageReceived,value:{id:e.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarAnswerMessage(e.answer,e.answerAvatar,e.answerSpeech,e.questionId))})),this.getMessagesOfType("AvatarAnswerHTML").subscribe((e=>{this.messages.next(new i.AvatarAnswerContentMessage(e.html,e.messageId,e.hasDisplayHtml)),this.messages.next(new i.InstructionsMessage(e.instructions))})),this.getMessagesOfType("AvatarTextInputStarted").subscribe((e=>this.messages.next(new i.StartedSpeakingMessage))),this.getMessagesOfType("AvatarTextInputFinished").subscribe((e=>{this.messages.next(new i.FinishedSpeakingMessage),this.messages.next(new i.AvatarTextInputFinishedMessage)})),this.getMessagesOfType("AvatarStarting").subscribe((e=>{this.deviceManager.edgeNodeId=e.edgeNodeId})),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe((e=>{this.messages.next(new i.ClientMediaStreamUpdateMessage(e.clientStreamingAudio,e.clientStreamingVideo,e.serverStreamingAudio,e.serverStreamingVideo)),e.clientStreamingAudio&&e.clientStreamingVideo&&e.serverStreamingAudio&&e.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))})),this.getMessagesOfType("SessionErrorMessage").subscribe((e=>{console.error(e.error),this.messages.next(new i.SessionErrorMessage(e.error))})),this.getMessagesOfType("SessionInfoMessage").subscribe((e=>{this.messages.next(new i.SessionInfoMessage(e.info))})),this.getMessagesOfType("SessionEndedMessage").subscribe((()=>{const e={type:o.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})})),this.getMessagesOfType("AvatarRequestCompleted").subscribe((e=>{this.messages.next(new i.AvatarRequestCompleted(e.reason))})),this.getMessagesOfType("AvatarRequestIgnored").subscribe((e=>{this.messages.next(new i.AvatarRequestIgnored(e.reason))}))}setDeviceManager(e){this.deviceManager=e}getMessagesOfType(e){return this.internalMessages$.pipe(n.filter((t=>t.faceMeMessageType===e)))}}},8957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=t.MessagingService=void 0;const n=r(8637);Object.defineProperty(t,"MessagingService",{enumerable:!0,get:function(){return n.MessagingService}});const i=r(7229);Object.defineProperty(t,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},8637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const n=r(2541),i=r(2872),o=r(7501),s=r(7229);t.MessagingService=class{constructor(e,t){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=e,this.options=Object.assign(this.options,t),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new i.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const r={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new n.Client(r),this.stompClient.onConnect=e=>this.onStompConnected(e),this.stompClient.onDisconnect=e=>{o.logger.log("Stomp client disconnected",e)},this.stompClient.onStompError=e=>{o.logger.log("Stomp client error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketError=e=>{o.logger.log("Stomp client web socket error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketClose=e=>{o.logger.log("Stomp client web socket closed",e),this.onStompClientConnectionClosed(e)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const e=this.state$.getValue();if(e===s.MessagingState.CONNECTED||e===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.options.autoReconnect=!1,this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(e){console.error("MessagingService | disconnect: error",e),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(e,t){o.logger.log("MessagingService | send:",e,t);const r={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},n=JSON.stringify(t);this.stompClient.publish({destination:e,body:n,headers:r})}getTopic(e){o.logger.log("MessagingService | subscribeToTopic: "+e);const t=this.subscriptions[e];if(t)return o.logger.log("existing subscription... not re-subscribing to topic"),t;const r=new i.Subject;return this.stompClient.subscribe(e,(e=>{r.next(e),this.messages$.next(e)})),this.subscriptions[e]=r,r}onStompConnected(e){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(e){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout((()=>{this.connect()}),this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription"),this.stompClient.subscribe("/",(e=>{this.messages$.next(e)}))}}},7229:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=void 0,(r=t.MessagingState||(t.MessagingState={}))[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"},2694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsService=void 0;const n=r(3607),i=r(9824),o=r(4050);t.MetricsService=class{constructor(e,t,r){this.uneeqOptions=e,this.internalMessages=t,this.messages=r,this.clientPerformanceStats={},this.options=e,this.internalMessages$=t,this.messages$=r}parseAndLogWebRtcStats(e){try{e.forEach((e=>{var t,r;if("inbound-rtp"===e.type&&"video"===e.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",e.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",e.frameWidth);const n=e.framesDropped,o=n?n-(null===(t=this.clientPerformanceStats.totalFramesDropped)||void 0===t?void 0:t.value):0;this.clientPerformanceStats.newFramesDropped=o?new i.ClientPerformanceStat("New Frames Dropped",o):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=n?new i.ClientPerformanceStat("Total Frames Dropped",n):new i.ClientPerformanceStat;const s=e.packetsLost,a=s?s-(null===(r=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===r?void 0:r.value):0;this.clientPerformanceStats.inboundNewPacketsLost=a?new i.ClientPerformanceStat("New packets lost",a):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=s?new i.ClientPerformanceStat("Total packets lost",s):new i.ClientPerformanceStat;const u=e.framesPerSecond;this.clientPerformanceStats.framesPerSec=u?new i.ClientPerformanceStat("Frames per second",u):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===e.type&&"video"===e.kind){const t=e.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=t?new i.ClientPerformanceStat("Round Trip Time",t):new i.ClientPerformanceStat}else if("outbound-rtp"===e.type&&"video"===e.kind){const t=e.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",t)}})),this.options.enableClientPerformanceMessage&&this.messages$.next(new n.ClientPerformanceMessage(this.clientPerformanceStats));const t={type:o.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t})}catch(e){console.warn("Unable to parseAndLogWebRTCStats",e)}}}},6400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineStatusService=void 0;const n=r(3607);t.OnlineStatusService=class{constructor(e,t){this.messages=e,this.offlineTimeoutLimitHandler=t,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",(()=>this.handleOffline())),window.addEventListener("online",(()=>this.handleOnline()))}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout((()=>{this.offlineTimeoutLimitHandler()}),this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new n.OnlineStatusUpdateMessage(this.online))}}},4050:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Prom=t.PromMessageType=void 0;const i=n(r(4427));var o;!function(e){e[e.SessionStart=0]="SessionStart",e[e.WebRtcPerformance=1]="WebRtcPerformance",e[e.AvailabilityCheck=2]="AvailabilityCheck",e[e.QuestionMessageReceived=3]="QuestionMessageReceived",e[e.AnswerMessageReceived=4]="AnswerMessageReceived",e[e.SessionEnded=5]="SessionEnded"}(o=t.PromMessageType||(t.PromMessageType={})),t.Prom=class{constructor(e){this.apiUrl=e,this.prom_prefix="client_sdk_",this.registry=i.default(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.metricsIntervalId=setInterval((()=>{this.sendMetrics()}),1e4)}handleMessage(e){var t,r,n,i,s,a,u;const c=Object.assign(e.labels||{},{platform:"js"});switch(e.type){case o.SessionStart:this.sessionStartTime.observe(e.value,c);break;case o.QuestionMessageReceived:this.messageTimings.push(e.value);break;case o.AnswerMessageReceived:const l=this.calculateConversationRtt(e);l>0&&this.conversationRoundTripTime.observe(l,c);break;case o.WebRtcPerformance:const f=e.value;f.outboundQualityLimitationReason?c.qualityLimitationReason=null===(t=f.outboundQualityLimitationReason)||void 0===t?void 0:t.value:c.qualityLimitationReason="unknown",f.newFramesDropped&&this.webRtcFramesDropped.observe(null===(r=f.newFramesDropped)||void 0===r?void 0:r.value,c),f.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(n=f.framesPerSec)||void 0===n?void 0:n.value,c),f.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=f.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),f.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(s=f.inboundRoundTripTime)||void 0===s?void 0:s.value,c),f.frameHeight&&this.webRtcFrameHeight.observe(null===(a=f.frameHeight)||void 0===a?void 0:a.value,c),f.frameWidth&&this.webRtcFrameWidth.observe(null===(u=f.frameWidth)||void 0===u?void 0:u.value,c);break;case o.AvailabilityCheck:this.availabilityCheckTime.observe(e.value,c);break;case o.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(e){if(e.value&&this.messageTimings){const t=this.messageTimings.find((t=>t.id===e.value.id));if(t){const r=t.receivedOn;if(r){const n=(e.value.receivedOn-r)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(t),1),n}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const e=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(e),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},8591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeSessionCheck=void 0;const n=r(7501),i=r(39);class o{static validate(e){const t=new i.UneeqLocalStorage;let r=void 0!==e.resumeSession&&e.resumeSession;t.getItemSafely("uneeqResumeSessionPersonaId")===e.conversationId||(n.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),r=!1);const s=o.browserTabIsActive();if(r&&!s&&(n.logger.log("UneeQ: Browser tab is not active so unable to resume"),r=!1),r){const e=t.getItemSafely("uneeqResumeSessionId");if(null!==e)return{resumeSession:!0,resumeSessionId:e}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}t.ResumeSessionCheck=o},1116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.StreamManager=class{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(e){return e.getVideoTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.canvasVideoTrack),e}addSilentAudioTrackToStream(e){return e.getAudioTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.silentAudioTrack),e}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){const e=document.createElement("canvas");return e.width=40,e.height=30,e.getContext("2d"),e.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){const e=new window.AudioContext;this.audioContextInstance=e,this.audioSourceDestination=e.createMediaStreamDestination()}return this.audioSourceDestination.stream.getAudioTracks()[0]}}},39:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqLocalStorage=void 0;const n=r(7501);t.UneeqLocalStorage=class{constructor(){}get available(){return void 0===this.localStorageAvailable&&(this.localStorageAvailable=this.checkIfLocalStorageAvailable()),this.localStorageAvailable}setItemSafely(e,t){this.available?localStorage.setItem(e,t):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}getItemSafely(e){return this.available?localStorage.getItem(e):void n.logger.log("UneeQ: unable to access localStorage because it is not available.")}removeItemSafely(e){this.available?localStorage.removeItem(e):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}checkIfLocalStorageAvailable(){const e="UneeqLocalStoreCheck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}}},8477:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqWebRTC=void 0;const i=n(r(8853)),o=n(r(835)),s=r(3607),a=r(7501);t.UneeqWebRTC=class{constructor(e){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(e,t)=>{this.options.userMessages.next(new s.WebRtcStatsMessage(t)),this.statTimer=window.setTimeout((()=>{this.client.getStats(this.onStats)}),2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},e),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(e){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:e,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",(e=>{this.log("error",e),void 0!==this.options.onError&&this.options.onError(e)})),this.client.on("signal",(e=>{const t={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in e&&"offer"===e.type)t.payload=JSON.stringify({type:"offer",sdp:e.sdp}),t.type="OfferMessage",this.log("Offer payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t);else if("candidate"in e){const r=JSON.stringify(e.candidate);this.options.forceTurnServerUse&&!r.match(/typ relay/)||r.match(/::/)||(t.payload=r,t.type="IceCandidate",this.log("IC payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(e))})),this.client.on("connect",(()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()})),this.client.on("data",(e=>{this.log("data: "+e),void 0!==this.options.onData&&this.options.onData(e),this.options.userMessages.next(new s.WebRtcDataMessage(e))})),this.client.on("close",(()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()})),this.client.on("stream",(e=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:e})}))}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);return this.log("got answer: ",t),this.client.signal(t),!0}return this.log("ignoring answer: ",e),!1}handleIceCandidate(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);if("candidate"in t&&""===t.candidate){if("edge"===o.default.browserDetails.browser){const e=this.client._pc;e.remoteDescription&&e.remoteDescription.type&&e.addIceCandidate(null)}}else this.client.signal({candidate:t});return!0}return!1}sendDataMessage(e){this.client.send(e)}getStats(e){return this.client&&this.client.getStats(e)}updateStreamTracks(e){e.getTracks().forEach((e=>{this.client._pc.getSenders().find((t=>e.kind===t.track.kind)).replaceTrack(e).then((()=>{a.logger.log("Updated publish media stream track for "+e.kind)})).catch((t=>{a.logger.error("Error: updating publish media stream track failed for "+e.kind,t)}))}))}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client.getStats(this.onStats)}isMessageForUs(e){return e.requestUniqueId===this.uniqueId}log(e,...t){a.logger.log("UneeqWebRTC: "+e,t)}warn(e,...t){a.logger.warn("UneeqWebRTC: "+e,t)}}},4333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputManager=void 0;const n=r(4857),i=r(881),o=r(8512),s=r(608),a=r(7501);t.VoiceInputManager=class{constructor(e,t,r,n){this.options=e,this.api=t,this.messages=r,this.enableMicrophone=n,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(e.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(e){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(e){e===s.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=s.VoiceInputMode.PUSH_TO_TALK:e===s.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=s.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new o.WarningMessage("Invalid voice input mode selected: "+e))}startRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){a.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(e){this.stream=e,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(e,(e=>this.micActivityConnected(e)))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new o.MicActivityNotSupportedMessage),this.messages.next(new o.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(s.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe((e=>{switch(e.uneeqMessageType){case o.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case o.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1}}))}requestNotSupportedInVoiceActivityMode(e){this.messages.next(new o.WarningMessage("Request not supported in voice activity mode: "+e))}apiStartRecording(){this.recording=!0,this.messages.next(new o.RecordingStartedMessage),this.api.avatarStartRecording().catch((()=>{this.recording=!1,this.messages.next(new o.RecordingStoppedMessage)}))}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording().finally((()=>this.messages.next(new o.RecordingStoppedMessage)))}micActivityConnected(e){e?this.messages.next(new o.MicActivityErrorMessage(e)):this.soundMeter&&this.soundMeter.instant$.pipe(n.distinctUntilChanged()).subscribe((e=>{this.handleVoiceActivity(e)}))}handleVoiceActivity(e){this.options.micActivityMessages&&this.messages.next(new o.MicActivityMessage(e)),this.options.voiceInputMode!==s.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(e>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):e<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout((()=>{this.recording&&this.apiStopRecording()}),this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},9824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientPerformanceStat=void 0,t.ClientPerformanceStat=class{constructor(e="",t=0){this.label=e,this.value=t}}},8512:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanUnmuted=t.DigitalHumanPlayedInMutedModeSuccess=t.DigitalHumanFailedToPlay=t.DigitalHumanVideoError=t.ClientPerformanceMessage=t.ClientMediaStreamUpdateMessage=t.OnlineStatusUpdateMessage=t.SessionInfoMessage=t.AvatarRequestIgnored=t.AvatarRequestCompleted=t.SessionErrorMessage=t.WebRtcStatsMessage=t.WebRtcDataMessage=t.SessionLiveMessage=t.WarningMessage=t.RecordingStoppedMessage=t.RecordingStartedMessage=t.DevicePermissionAllowedMessage=t.AvatarTextInputFinishedMessage=t.FinishedSpeakingMessage=t.StartedSpeakingMessage=t.AvatarQuestionMessage=t.InstructionsMessage=t.AvatarAnswerContentMessage=t.AvatarAnswerMessage=t.ResumeSessionUnavailable=t.ConnectionLostMessage=t.VoiceActivityInputModeNotSupportedMessage=t.MicActivityNotSupportedMessage=t.MicActivityMessage=t.MicActivityErrorMessage=t.ServiceUnavailableMessage=t.AvatarUnavailableMessage=t.AvatarAvailableMessage=t.SessionEndedMessage=t.SessionResumedMessage=t.SessionPausedMessage=t.DeviceListUpdatedMessage=t.DeviceErrorMessage=t.SetSpeakerSuccessMessage=t.SetMicSuccessMessage=t.SetCameraSuccessMessage=t.DeviceNotFoundErrorMessage=t.ReadyMessage=t.UneeqMessageType=void 0,function(e){e.Ready="Ready",e.DeviceNotFoundError="DeviceNotFoundError",e.SetCameraSuccess="SetCameraSuccess",e.SetMicSuccess="SetMicSuccess",e.SetSpeakerSuccess="SetSpeakerSuccess",e.SessionPaused="SessionPaused",e.SessionResumed="SessionResumed",e.SessionEnded="SessionEnded",e.AvatarAvailable="AvatarAvailable",e.AvatarUnavailable="AvatarUnavailable",e.ConnectionLost="ConnectionLost",e.ResumeSessionUnavailable="ResumeSessionUnavailable",e.ServiceUnavailable="ServiceUnavailable",e.OnlineStatusUpdate="OnlineStatusUpdate",e.MicActivityNotSupported="MicActivityNotSupported",e.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",e.MicActivityError="MicActivityError",e.MicActivity="MicActivity",e.DeviceError="DeviceError",e.DeviceListUpdated="DeviceListUpdated",e.AvatarAnswer="AvatarAnswer",e.AvatarAnswerContent="AvatarAnswerContent",e.Instructions="Instructions",e.StartedSpeaking="StartedSpeaking",e.FinishedSpeaking="FinishedSpeaking",e.AvatarTextInputFinished="AvatarTextInputFinished",e.AvatarQuestionText="AvatarQuestionText",e.DevicePermissionAllowed="DevicePermissionAllowed",e.RecordingStarted="RecordingStarted",e.RecordingStopped="RecordingStopped",e.Warning="Warning",e.SessionLive="SessionLive",e.WebRtcData="WebRtcData",e.WebRtcStats="WebRtcStats",e.SessionError="SessionError",e.SessionInfo="SessionInfo",e.AvatarRequestCompleted="AvatarRequestCompleted",e.AvatarRequestIgnored="AvatarRequestIgnored",e.ClientMediaStreamUpdate="ClientMediaStreamUpdate",e.ClientPerformanceMessage="ClientPerformanceMessage",e.DigitalHumanVideoError="DigitalHumanVideoError",e.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",e.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",e.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r=t.UneeqMessageType||(t.UneeqMessageType={})),t.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}},t.DeviceNotFoundErrorMessage=class{constructor(e,t){this.msg=e,this.deviceId=t,this.uneeqMessageType=r.DeviceNotFoundError}},t.SetCameraSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetCameraSuccess}},t.SetMicSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetMicSuccess}},t.SetSpeakerSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetSpeakerSuccess}},t.DeviceErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.DeviceError}},t.DeviceListUpdatedMessage=class{constructor(e){this.devices=e,this.uneeqMessageType=r.DeviceListUpdated}},t.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}},t.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}},t.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}},t.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}},t.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}},t.ServiceUnavailableMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.ServiceUnavailable}},t.MicActivityErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.MicActivityError}},t.MicActivityMessage=class{constructor(e){this.level=e,this.uneeqMessageType=r.MicActivity}},t.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}},t.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}},t.ConnectionLostMessage=class{constructor(e){this.connectionState=e,this.uneeqMessageType=r.ConnectionLost}},t.ResumeSessionUnavailable=class{constructor(){this.uneeqMessageType=r.ResumeSessionUnavailable}},t.AvatarAnswerMessage=class{constructor(e,t,n,i){this.answer=e,this.answerAvatar=t,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}},t.AvatarAnswerContentMessage=class{constructor(e,t,n=!1){this.content=e,this.transcriptId=t,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}},t.InstructionsMessage=class{constructor(e){this.instructions=e,this.uneeqMessageType=r.Instructions}},t.AvatarQuestionMessage=class{constructor(e,t){this.question=e,this.transcriptId=t,this.uneeqMessageType=r.AvatarQuestionText}},t.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}},t.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}},t.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}},t.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}},t.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}},t.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}},t.WarningMessage=class{constructor(e){this.msg=e,this.uneeqMessageType=r.Warning}},t.SessionLiveMessage=class{constructor(e,t){this.showLogo=e,this.sessionResumed=t,this.uneeqMessageType=r.SessionLive}},t.WebRtcDataMessage=class{constructor(e){this.data=e,this.uneeqMessageType=r.WebRtcData}},t.WebRtcStatsMessage=class{constructor(e){this.stats=e,this.uneeqMessageType=r.WebRtcStats}},t.SessionErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.SessionError}},t.AvatarRequestCompleted=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestCompleted}},t.AvatarRequestIgnored=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestIgnored}},t.SessionInfoMessage=class{constructor(e){this.info=e,this.uneeqMessageType=r.SessionInfo}},t.OnlineStatusUpdateMessage=class{constructor(e){this.online=e,this.uneeqMessageType=r.OnlineStatusUpdate}},t.ClientMediaStreamUpdateMessage=class{constructor(e,t,n,i){this.clientStreamingAudio=e,this.clientStreamingVideo=t,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}},t.ClientPerformanceMessage=class{constructor(e){this.clientPerformance=e,this.uneeqMessageType=r.ClientPerformanceMessage}},t.DigitalHumanVideoError=class{constructor(e){this.error=e,this.uneeqMessageType=r.DigitalHumanVideoError}},t.DigitalHumanFailedToPlay=class{constructor(){this.uneeqMessageType=r.DigitalHumanFailedToPlay,this.msg="Digital Human failed to play with sound. This most likely occurred because the user has not yet interacted with the page and was blocked due to the browser's autoplay policy. Video will automatically be muted and attempted to be played again."}},t.DigitalHumanPlayedInMutedModeSuccess=class{constructor(){this.uneeqMessageType=r.DigitalHumanPlayedInMutedModeSuccess,this.msg="Digital Human was successfully played in muted mode. After the user interacts with the page you will need to call unmuteDigitalHuman() to unmute the video."}},t.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},7636:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SessionType=void 0,(r=t.SessionType||(t.SessionType={}))[r.WEB=0]="WEB"},7563:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PublishSubscribeState=void 0,(r=t.PublishSubscribeState||(t.PublishSubscribeState={})).DISCONNECTED="DISCONNECTED",r.CONNECTING="CONNECTING",r.CONNECTED="CONNECTED",r.FAILED="FAILED"},9794:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SourceApp=void 0,(r=t.SourceApp||(t.SourceApp={})).HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",r.SHOWCASE="SHOWCASE",r.SPLIT_SCREEN="SPLIT_SCREEN",r.INTERACTIONS="INTERACTIONS",r.UNKNOWN="UNKNOWN"},608:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputMode=void 0,(r=t.VoiceInputMode||(t.VoiceInputMode={})).PUSH_TO_TALK="PUSH_TO_TALK",r.VOICE_ACTIVITY="VOICE_ACTIVITY",r.SPEECH_RECOGNITION="SPEECH_RECOGNITION"},6123:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0;const o=r(2872),s=r(4857),a=i(r(4147)),u=r(1181),c=r(1546),l=r(6886),f=r(7789),h=r(7501),d=r(4887),p=r(8957),v=r(2694),m=r(6400),g=r(4050),y=r(8591),b=r(1116),_=r(39),w=r(4333),S=r(8512),E=r(7636),T=r(7563),O=r(9794),C=r(608);t.Uneeq=class{constructor(e){this.ready=new o.BehaviorSubject(!1),this.version=a.default.version,this.messages=new o.Subject,this.internalMessages$=new o.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,this.uneeqLocalStorage=new _.UneeqLocalStorage,h.logger.enabled=e.logging||!1,this.options=e,this.options.diagnostics=e.diagnostics||!1,this.options.micActivityMessages=e.micActivityMessages||!1,this.options.sendLocalVideo=void 0===e.sendLocalVideo||e.sendLocalVideo,this.options.sendLocalAudio=void 0===e.sendLocalAudio||e.sendLocalAudio,this.options.enableClientPerformanceMessage=e.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=e.enableTransparentBackground||!1,this.options.backgroundImageUrl=e.backgroundImageUrl||"",this.options.nameTagImageUrl=e.nameTagImageUrl||"",this.options.speechToTextLocales=f.LocaleDetector.validateOrDetectSpeechLocales(e),this.checkIfResumeSessionIsAvailable(),this.options.voiceInputMode=e.voiceInputMode||C.VoiceInputMode.PUSH_TO_TALK,this.api=new u.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:E.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new b.StreamManager,this.initDigitalHumanVideoElement(),this.metricsService=new v.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new l.DigitalHumanVideoPlayManager(this.messages,(()=>{this.unmuteDigitalHuman()}))}get sessionId(){return this.session?this.session.id:null}setLoggerEnabled(e){h.logger.enabled=e}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then((e=>{this.session=e,this.initialize()})).catch((e=>{this.sendServiceUnavailableMessage(e)}))}initWithToken(e){return n(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const t=y.ResumeSessionCheck.validate(this.options);!0===t.resumeSession&&(this.startSessionData.resumeSessionId=t.resumeSessionId),this.startSessionData.tokenId=e,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.id===this.startSessionData.resumeSessionId?(h.logger.log("UneeQ: Session was resumed."),this.sessionWasResumed=!0):h.logger.log("UneeQ: Session was not resumed."),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionId",this.session.id),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=O.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:O.SourceApp.UNKNOWN,this.initialize()}catch(e){this.sendServiceUnavailableMessage(e)}}))}setCamera(e){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(e)}setMic(e){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(e)}setSpeaker(e){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(e)}setVoiceInputMode(e){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(e)}enableMicrophone(e=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,e)}enableCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,this.options.sendLocalAudio)}enableMicrophoneAndCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,e)}sendTranscript(e){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(e))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new S.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new S.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new S.SessionResumedMessage),!0):(this.messages.next(new S.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(e){return this.api.setAvatarDebug(e)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}initDigitalHumanVideoElement(){const e=document.createElement("video");this.digitalHumanVideoElement=e,e.volume=1,e.controls=!1,e.autoplay=!1,e.setAttribute("playsinline","true"),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.play().catch((e=>{h.logger.log("UneeQ: Failed to play digital human video. Play() will be re-attempted when stream is ready.",e)}))}gatherWebRtcMetrics(){var e;null===(e=this.deviceManager)||void 0===e||e.mediaHandler.gatherWebRTCStats(((e,t)=>{this.metricsService.parseAndLogWebRtcStats(t)})),setTimeout((()=>{this.gatherWebRtcMetrics()}),5e3)}initMessaging(){this.messages.subscribe((e=>this.messageCallback(e))),this.messaging.state$.pipe(s.filter((e=>e===p.MessagingState.CONNECTED))).subscribe((()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new S.ReadyMessage),this.gatherWebRtcMetrics()})),this.messaging.messages$.subscribe((e=>this.internalMessages$.next(JSON.parse(e.body)))),this.messageHandler=new d.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe((e=>{h.logger.log("-- Msg -- ",e)}))}initDeviceManager(){this.voiceInputManager=new w.VoiceInputManager(this.options,this.api,this.messages,(e=>{this.enableMicrophone(e)})),this.deviceManager=new c.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager,voiceInputManager:this.voiceInputManager,digitalHumanVideoElement:this.digitalHumanVideoElement},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new S.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const e={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.sessionStarted=!0}}initAvatar(){this.ready.pipe(s.filter(Boolean),s.take(1)).subscribe((()=>{this.internalMessages$.pipe(s.filter((e=>"DevicePermissionAllowedInternal"===e.faceMeMessageType)),s.take(1)).subscribe((e=>{this.messages.next(new S.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()})),this.initDeviceManager()})),this.internalMessages$.pipe(s.filter((e=>"sessionLive"===e.faceMeMessageType)),s.take(1)).subscribe((e=>this.sessionLiveHandler())),this.internalMessages$.pipe(s.filter((e=>"sessionEnd"===e.faceMeMessageType))).subscribe((()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new S.SessionEndedMessage),this.messaging.disconnect()})),this.internalMessages$.pipe(s.filter((e=>"remoteVideoReadyToPlay"===e.faceMeMessageType))).subscribe((e=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement)}))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then((e=>{if(e.available>0){const e={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new S.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl,speechToTextLocales:this.options.speechToTextLocales}).catch((e=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",e),this.uneeqLocalStorage.removeItemSafely("uneeqResumeSessionId")}))}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new S.AvatarUnavailableMessage)),setTimeout((()=>{this.startAvatarWhenAvailable()}),1e3)}))}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const e={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new p.MessagingService(this.options.url+"/api/messaging",e),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(e){const t=new S.ServiceUnavailableMessage(e);this.messages.next(t),this.messageCallback(t)}serviceReadyCheck(e){return!!this.ready.value||(this.messages.next(new S.WarningMessage("Call to "+e+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.mediaDevices.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new m.OnlineStatusService(this.messages,(()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()}))}initPromMetricsListener(){const e=new g.Prom(this.options.url);this.internalMessages$.pipe(s.filter((e=>"prom"===e.faceMeMessageType))).subscribe((t=>{e.handleMessage(t.promMsg)}))}checkIfResumeSessionIsAvailable(){!0!==this.options.resumeSession||this.uneeqLocalStorage.available||(console.warn("UneeQ: Resuming session is unavailable in this browser because localStorage is not allowed."),this.messages.next(new S.ResumeSessionUnavailable),this.options.resumeSession=!1)}}},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},835:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ce});var n={};r.r(n),r.d(n,{fixNegotiationNeeded:()=>M,shimAddTrackRemoveTrack:()=>P,shimAddTrackRemoveTrackWithNative:()=>x,shimGetDisplayMedia:()=>w,shimGetSendersWithDtmf:()=>T,shimGetStats:()=>O,shimGetUserMedia:()=>_,shimMediaStream:()=>S,shimOnTrack:()=>E,shimPeerConnection:()=>R,shimSenderReceiverGetStats:()=>C});var i={};r.r(i),r.d(i,{shimAddTransceiver:()=>U,shimCreateAnswer:()=>V,shimCreateOffer:()=>W,shimGetDisplayMedia:()=>j,shimGetParameters:()=>B,shimGetUserMedia:()=>A,shimOnTrack:()=>k,shimPeerConnection:()=>I,shimRTCDataChannel:()=>F,shimReceiverGetStats:()=>N,shimRemoveStream:()=>L,shimSenderGetStats:()=>D});var o={};r.r(o),r.d(o,{shimAudioContext:()=>J,shimCallbacksAPI:()=>H,shimConstraints:()=>$,shimCreateOfferLegacy:()=>X,shimGetUserMedia:()=>G,shimLocalStreamsAPI:()=>q,shimRTCIceServerUrls:()=>Y,shimRemoteStreamsAPI:()=>z,shimTrackEventTransceiver:()=>K});var s={};r.r(s),r.d(s,{removeExtmapAllowMixed:()=>oe,shimAddIceCandidateNullOrEmpty:()=>se,shimConnectionState:()=>ie,shimMaxMessageSize:()=>re,shimParameterlessSetLocalDescription:()=>ae,shimRTCIceCandidate:()=>ee,shimRTCIceCandidateRelayProtocol:()=>te,shimSendThrowTypeError:()=>ne});let a=!0,u=!0;function c(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function l(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function f(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function h(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(u=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function d(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){u&&console.warn(e+" is deprecated, please use "+t+" instead.")}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e){return v(e)?Object.keys(e).reduce((function(t,r){const n=v(e[r]),i=n?m(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function g(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?g(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{g(e,e.get(t),r)}))})))}function y(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&g(e,r,i)}))})),i}const b=d;function _(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let s=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&r.length&&t.includes("back")&&(s=r[r.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),b("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return b("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function w(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function S(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function E(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else l(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function O(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function C(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function x(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function P(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return x(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((e=>e.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[r.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function R(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function M(e,t){l(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}function A(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){p("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function j(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function I(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function D(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function N(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function L(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){p("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function F(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function U(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const r=e.length>0;r&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function B(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function W(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function q(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function z(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function H(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=a,a=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=a,a=function(e,t,r){const n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=a}function G(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r($(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function $(e){return e&&void 0!==e.video?Object.assign({},e,{video:m(e.video)}):e}function Y(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];void 0===n.urls&&n.url?(p("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function K(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function X(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function J(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=r(7539),Q=r.n(Z);function ee(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Q().parseCandidate(e.candidate);for(const e in n)e in r||Object.defineProperty(r,e,{value:n[e]});return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,l(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function te(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||l(e,"icecandidate",(e=>{if(e.candidate){const t=Q().parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function re(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Q().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Q().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),r=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r}(e),n=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Q().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n}(arguments[0],e);let i;i=0===r&&0===n?Number.POSITIVE_INFINITY:0===r||0===n?Math.max(r,n):Math.min(r,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return r.apply(this,arguments)}}function ne(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},l(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function ie(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function oe(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function se(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ae(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?r.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>r.apply(this,[e])))})}const ue=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=d,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=c(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=c(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=c(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:a,commonShim:s,extractVersion:c,disableLog:f,disableWarnings:h,sdp:Z};switch(a.browser){case"chrome":if(!n||!R||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),u;if(null===a.version)return r("Chrome shim can not determine version, not shimming."),u;r("adapter.js shimming chrome."),u.browserShim=n,se(e,a),ae(e),_(e,a),S(e),R(e,a),E(e),P(e,a),T(e),O(e),C(e),M(e,a),ee(e),te(e),ie(e),re(e,a),ne(e),oe(e,a);break;case"firefox":if(!i||!I||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),u;r("adapter.js shimming firefox."),u.browserShim=i,se(e,a),ae(e),A(e,a),I(e,a),k(e),L(e),D(e),N(e),F(e),U(e),B(e),W(e),V(e),ee(e),ie(e),re(e,a),ne(e);break;case"safari":if(!o||!t.shimSafari)return r("Safari shim is not included in this adapter release."),u;r("adapter.js shimming safari."),u.browserShim=o,se(e,a),ae(e),Y(e),X(e),H(e),q(e),z(e),K(e),G(e),J(e),ee(e),te(e),re(e,a),ne(e),oe(e,a);break;default:r("Unsupported browser!")}return u}({window:"undefined"==typeof window?void 0:window}),ce=ue},2361:()=>{},4616:()=>{},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"uneeq-js","version":"2.46.6","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"npx tslint -p tsconfig.json --fix","docs":"npx typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^7.8.1","rxjs-compat":"^6.6.7","simple-peer":"^9.11.1","webrtc-adapter":"^8.2.3"},"devDependencies":{"@types/dom-mediacapture-record":"^1.0.16","@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^3.2.0","jasmine-class-mock":"^1.0.1","jasmine-core":"^3.3.0","karma":"^5.0.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^2.0.1","karma-jasmine-html-reporter":"^1.4.0","karma-requirejs":"^1.1.0","karma-safari-launcher":"^1.0.0","karma-typescript":"^5.5.4","karma-typescript-es6-transform":"^5.0.0","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^9.4.4","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^3.9.7","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(3607),i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
|
|
2
|
+
(()=>{var e={2541:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ActivationState:()=>a,Client:()=>f,CompatClient:()=>m,FrameImpl:()=>i,Parser:()=>o,Stomp:()=>g,StompConfig:()=>h,StompHeaders:()=>d,StompSocketState:()=>s,StompSubscription:()=>p,Versions:()=>u});const n="\n";class i{constructor(e){const{command:t,headers:r,body:n,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},r||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=n||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(e,t){const r={},n=e=>e.replace(/^\s+|\s+$/g,"");for(const o of e.headers.reverse()){o.indexOf(":");const s=n(o[0]);let a=n(o[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=i.hdrValueUnEscape(a)),r[s]=a}return new i({command:e.command,headers:r,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(e,this._binaryBody).buffer:e+this._body+"\0"}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const r=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${i.hdrValueEscape(`${r}`)}`):e.push(`${t}:${r}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(n)+n+n}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const r=(new TextEncoder).encode(e),n=new Uint8Array([0]),i=new Uint8Array(r.length+t.length+n.length);return i.set(r),i.set(t,r.length),i.set(n,r.length+t.length),i}static marshall(e){return new i(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let r;if(r=e instanceof ArrayBuffer?new Uint8Array(e):this._encoder.encode(e),t&&0!==r[r.length-1]){const e=new Uint8Array(r.length+1);e.set(r,0),e[r.length]=0,r=e}for(let e=0;e<r.length;e++){const t=r[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter((e=>"content-length"===e[0]))[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!=this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(s||(s={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(a||(a={}));class u{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map((e=>`v${e.replace(".","")}.stomp`))}}u.V1_0="1.0",u.V1_1="1.1",u.V1_2="1.2",u.default=new u([u.V1_0,u.V1_1,u.V1_2]);class c{constructor(e,t,r={}){this._client=e,this._webSocket=t,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===u.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,r=this._subscriptions[t]||this.onUnhandledMessage,n=e,i=this,o=this._connectedVersion===u.V1_2?n.headers.ack:n.headers["message-id"];n.ack=(e={})=>i.ack(o,t,e),n.nack=(e={})=>i.nack(o,t,e),r(n)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(r)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(e){Object.assign(this,e)}start(){const e=new o((e=>{const t=i.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`),(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)}),(()=>{this.debug("<<< PONG")}));this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug(`<<< ${e}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._onclose=e=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==u.V1_1&&e.version!==u.V1_2)return;if(!e["heart-beat"])return;const[t,r]=e["heart-beat"].split(",").map((e=>parseInt(e,10)));if(0!==this.heartbeatOutgoing&&0!==r){const e=Math.max(this.heartbeatOutgoing,r);this.debug(`send PING every ${e}ms`),this._pinger=setInterval((()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(n),this.debug(">>> PING"))}),e)}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval((()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())}),e)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var e,t;this._webSocket.terminate||(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;const r=new Date,n=this.onclose;this.onclose=e=>{const n=(new Date).getTime()-r.getTime();t(`Discarded socket closed after ${n}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),n.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:r,body:n,binaryBody:o,skipContentLengthHeader:s}=e,a=new i({command:t,headers:r,body:n,binaryBody:o,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let u=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${u}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&"string"==typeof u&&(u=(new TextEncoder).encode(u)),"string"==typeof u&&this.splitLargeFrames){let e=u;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(u)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,(e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)})),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(e){const{destination:t,headers:r,body:n,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},r);this._transmit({command:"SEND",headers:s,body:n,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,r={}){(r=Object.assign({},r)).id||(r.id="sub-"+this._counter++),r.destination=e,this._subscriptions[r.id]=t,this._transmit({command:"SUBSCRIBE",headers:r});const n=this;return{id:r.id,unsubscribe:e=>n.unsubscribe(r.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const r=this;return{id:t,commit(){r.commit(t)},abort(){r.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,r={}){r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"ACK",headers:r})}nack(e,t,r={}){return r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"NACK",headers:r})}}var l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class f{constructor(e={}){this.stompVersions=u.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=a.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===a.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}configure(e){Object.assign(this,e)}activate(){if(this.state===a.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(a.ACTIVE),this._connect())}_connect(){return l(this,void 0,void 0,(function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout((()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())}),this.connectionTimeout)),this.debug("Opening Web Socket...");const e=this._createWebSocket();this._stompHandler=new c(this,e,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}))}_createWebSocket(){let e;return e=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),e.binaryType="arraybuffer",e}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout((()=>{this._connect()}),this.reconnectDelay))}deactivate(){return l(this,void 0,void 0,(function*(){let e;return this.state!==a.ACTIVE?(this.debug(`Already ${a[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(a.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==s.CLOSED?(e=new Promise(((e,t)=>{this._resolveSocketClose=e})),this._disposeStompHandler(),e):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(e){this._stompHandler.publish(e)}watchForReceipt(e,t){this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,r={}){return this._stompHandler.subscribe(e,t,r)}unsubscribe(e,t={}){this._stompHandler.unsubscribe(e,t)}begin(e){return this._stompHandler.begin(e)}commit(e){this._stompHandler.commit(e)}abort(e){this._stompHandler.abort(e)}ack(e,t,r={}){this._stompHandler.ack(e,t,r)}nack(e,t,r={}){this._stompHandler.nack(e,t,r)}}class h{}class d{}class p{}class v{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class m extends f{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new v(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,r,n,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");return"function"==typeof e[1]?[i,r,n,t]=e:6===e.length?[i.login,i.passcode,r,n,t,i.host]=e:[i.login,i.passcode,r,n,t]=e,[i,r,n,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},r=""){const n=!1===(t=Object.assign({},t))["content-length"];n&&delete t["content-length"],this.publish({destination:e,headers:t,body:r,skipContentLengthHeader:n})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class g{static client(e,t){return null==t&&(t=u.default.protocolVersions()),new m((()=>new(g.WebSocketClass||WebSocket)(e,t)))}static over(e){let t;return"function"==typeof e?t=e:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),t=()=>e),new m(t)}}g.WebSocketClass=null},6551:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>J}),console.log("BUILD/SERIOUSLY.MODULE");let n,i,o,s,a,u,c,l={},f={},h={},d={},p=[],v={},m={},g={canvas:[],image:[],video:[]},y={},b=window.WeakMap&&new WeakMap,_=0,w=function(){},S={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},E=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,T=/^#(([0-9a-fA-F]{3,8}))/,O=["x","y","z","w"],C=["r","g","b","a"],x={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},P=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(e,t,r,n,i,o,s){s||(s=M.create());var a=t-e,u=n-r,c=o-i;return s[0]=2*i/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/u,s[6]=0,s[7]=0,s[8]=(t+e)/a,s[9]=(n+r)/u,s[10]=-(o+i)/c,s[11]=-1,s[12]=0,s[13]=0,s[14]=-o*i*2/c,s[15]=0,s},perspective:function(e,t,r,n,i){var o=r*Math.tan(e*Math.PI/360),s=o*t;return M.frustum(-s,s,-o,o,r,n,i)},multiply:function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=r[0],_=r[1],w=r[2],S=r[3];return e[0]=b*n+_*a+w*f+S*v,e[1]=b*i+_*u+w*h+S*m,e[2]=b*o+_*c+w*d+S*g,e[3]=b*s+_*l+w*p+S*y,b=r[4],_=r[5],w=r[6],S=r[7],e[4]=b*n+_*a+w*f+S*v,e[5]=b*i+_*u+w*h+S*m,e[6]=b*o+_*c+w*d+S*g,e[7]=b*s+_*l+w*p+S*y,b=r[8],_=r[9],w=r[10],S=r[11],e[8]=b*n+_*a+w*f+S*v,e[9]=b*i+_*u+w*h+S*m,e[10]=b*o+_*c+w*d+S*g,e[11]=b*s+_*l+w*p+S*y,b=r[12],_=r[13],w=r[14],S=r[15],e[12]=b*n+_*a+w*f+S*v,e[13]=b*i+_*u+w*h+S*m,e[14]=b*o+_*c+w*d+S*g,e[15]=b*s+_*l+w*p+S*y,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],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}},A=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){var t,r,n;return t=(new Date).getTime(),r=Math.max(0,16-(t-N)),n=window.setTimeout((function(){e(t+r)}),r),N=t+r,n}),j=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){window.cancelTimeout(e)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],I=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],D=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function L(e,t){var r,n;if("string"==typeof e)r=document.querySelector(e);else if(!e)return!1;return e.tagName&&(r=e),r?(n=r.tagName.toLowerCase(),t&&t.indexOf(n)<0?e:r):e}function F(e,t){var r,n;for(r in e.prototype&&t.prototype&&e.prototype!==t.prototype&&F(e.prototype,t.prototype),t)t.hasOwnProperty(r)&&((n=Object.getOwnPropertyDescriptor(t,r)).get||n.set?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:n.get,set:n.set}):e[r]=t[r]);return e}function U(e){var t;if(!console)return w;if("function"==typeof console[e])t=console[e];else{if("function"!=typeof console.log)return w;t=console.log}return t.bind?t.bind(console):function(){t.apply(console,arguments)}}function B(e,t){if(t||(t="HTMLElement"),e instanceof window[t])return!0;if(!e||"object"!=typeof e)return!1;for(;e;)if((e=Object.getPrototypeOf(e))&&e.constructor.name===t)return!0;return!1}function W(e,t,r,n,i){function o(e,t,r){return(r%=1)<0&&(r+=1),r<1/6?e+(t-e)*r*6:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var s,a;return s=2*r-(a=r<.5?r*(t+1):r+t-r*t),i||(i=[]),i[0]=o(s,a,e+1/3),i[1]=o(s,a,e),i[2]=o(s,a,e-1/3),i[3]=n,i}function V(e){var t,r,n,i="#",o=e[3]<1?4:3;for(t=0;t<o;t++)n=(r=Math.min(255,Math.round(255*e[t]||0))).toString(16),r<16&&(n="0"+n),i+=n;return i}function q(e){return Array.isArray(e)||e&&e.BYTES_PER_ELEMENT&&"length"in e}function z(e){if("function"!=typeof e)throw new Error("setTimeoutZero argument is not a function");p.push(e),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){p.length&&p.shift()()}),0)}function H(e,t){var r;try{r=window.WebGLDebugUtils&&t&&t.debugContext?window.WebGLDebugUtils.makeDebugContext(e.getContext("webgl",t)):e.getContext("webgl",t)}catch(e){}if(!r)try{r=e.getContext("experimental-webgl",t)}catch(e){}return r}function G(){var e;return n&&n.getError()===n.CONTEXT_LOST_WEBGL&&(n=void 0),n||!window.WebGLRenderingContext||o||(e=document.createElement("canvas"),n=H(e),n?e.addEventListener("webglcontextlost",(function t(r){r.preventDefault(),n&&n.canvas===this&&(n=void 0,e.removeEventListener("webglcontextlost",t,!1))}),!1):X.logger.warn("Unable to access WebGL.")),n}function $(e){var t,r,n;function i(e,n){var i,o;q(e)?(i=e[0],o=e[1]||i):i=e,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),r[i]=o,n||(t.firstValue=i)}function o(e){return e}for(n in e.inputs)if(e.inputs.hasOwnProperty(n)){if(e.reserved.indexOf(n)>=0||Object.prototype[n])throw new Error("Reserved input name: "+n);(t=e.inputs[n]).name=n,isNaN(t.min)&&(t.min=-1/0),isNaN(t.max)&&(t.max=1/0),isNaN(t.minCount)&&(t.minCount=-1/0),isNaN(t.maxCount)&&(t.maxCount=1/0),isNaN(t.step)&&(t.step=0),isNaN(t.mod)&&(t.mod=0),"enum"===t.type&&t.options&&q(t.options)&&t.options.length&&(r={},t.options.forEach(i),t.options=r),"vector"===t.type?t.dimensions<2?t.dimensions=2:t.dimensions>4||!t.dimensions||isNaN(t.dimensions)?t.dimensions=4:t.dimensions=Math.round(t.dimensions):t.dimensions=1,t.shaderDirty=!!t.shaderDirty,"function"!=typeof t.validate&&(t.validate=X.inputValidators[t.type]||o),e.defaultImageInput||"image"!==t.type||(e.defaultImageInput=n)}}function Y(e,t,r,n){var i,o,s,a;!0===n||n&&n.useFloat,this.type=e.UNSIGNED_BYTE,i=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,i),n&&n.texture?(this.texture=n.texture,e.bindTexture(e.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===e.FLOAT?(s=new Float32Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.FLOAT,s)):(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),this.type=e.UNSIGNED_BYTE)}catch(n){this.type=e.UNSIGNED_BYTE,s=new Uint8Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,s)}if(o=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0),(a=e.checkFramebufferStatus(e.FRAMEBUFFER))===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(a===e.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+a);e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this.gl=e,this.frameBuffer=i,this.renderBuffer=o,this.width=t,this.height=r}function K(e,t,r){var n,i,o,s,a,u,c,l,f="";function h(t,r){var n,i;if(n=r?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){for(t=t.split(/[\n\r]/),i=0;i<t.length;i++)t[i]=i+1+":\t"+t[i];throw t.unshift("Error compiling "+(r?"fragment":"vertex")+" shader:"),X.logger.error(t.join("\n")),new Error("Shader error: "+e.getShaderInfoLog(n))}return n}function d(t,r){if(t.type===e.SAMPLER_2D)return function(n){t.glTexture=e["TEXTURE"+n],e.uniform1i(r,n)};if(t.type===e.BOOL||t.type===e.INT)return t.size>1?function(t){e.uniform1iv(r,t)}:function(t){e.uniform1i(r,t)};if(t.type===e.FLOAT)return t.size>1?function(t){e.uniform1fv(r,t)}:function(t){e.uniform1f(r,t)};if(t.type===e.FLOAT_VEC2)return function(t){e.uniform2f(r,t[0],t[1])};if(t.type===e.FLOAT_VEC3)return function(t){e.uniform3f(r,t[0],t[1],t[2])};if(t.type===e.FLOAT_VEC4)return function(t){e.uniform4f(r,t[0],t[1],t[2],t[3])};if(t.type===e.FLOAT_MAT3)return function(t){e.uniformMatrix3fv(r,!1,t)};if(t.type===e.FLOAT_MAT4)return function(t){e.uniformMatrix4fv(r,!1,t)};throw new Error("Unknown shader uniform type: "+t.type)}function p(t){return function(){return e.getUniform(n,t)}}if(i=h(t),o=h(r,!0),n=e.createProgram(),e.attachShader(n,i),(s=e.getShaderInfoLog(i))&&(f+="Vertex shader error: "+s+"\n"),e.attachShader(n,o),(s=e.getShaderInfoLog(o))&&(f+="Fragment shader error: "+s+"\n"),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw f+=e.getProgramInfoLog(n),e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o),(c=R.exec(t)||R.exec(r))&&(f="Shader = "+c[1]+"\n"+f),P.forEach((function(t){f+="\n"+t+": "+e.getParameter(e[t])})),new Error("Could not initialize shader:\n"+f);for(e.useProgram(n),this.uniforms={},u=e.getProgramParameter(n,e.ACTIVE_UNIFORMS),a=0;a<u;++a)(l={info:e.getActiveUniform(n,a)}).name=l.info.name.replace(/\[0\]$/,""),l.loc=e.getUniformLocation(n,l.name),l.set=d(l.info,l.loc),l.get=p(l.loc),this.uniforms[l.name]=l,this[l.name]||(this[l.name]=l);for(this.attributes={},this.location={},u=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),a=0;a<u;++a)(l={info:e.getActiveAttrib(n,a)}).name=l.info.name,l.location=e.getAttribLocation(n,l.name),this.attributes[l.name]=l,this.location[l.name]=l.location;this.gl=e,this.program=n,this.destroy=function(){var t;for(t in e&&(e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o)),this)this.hasOwnProperty(t)&&delete this[t];n=null,i=null,o=null}}function X(e){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(e);var t,r,n,i,o,a,p,y,S,E,T,O,C,P,k,I=++_,N=this,U=[],W={},q=0,G=[],J=[],Z=[],Q=[],ee={},te=[],re=[],ne={},ie={},oe=!1,se=!1;function ae(e,t){var r,n,i;return!!t&&(r=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.STATIC_DRAW),r.size=3,n=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW),i=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,e.coords,t.STATIC_DRAW),i.size=2,{vertex:r,index:n,texCoord:i,length:e.indices.length,mode:e.mode||t.TRIANGLES})}function ue(e){var t={};return t.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),t.indices=new Uint16Array([0,1,2,0,2,3]),t.coords=new Float32Array([0,0,1,0,1,1,0,1]),ae(t,e)}function ce(e){var n,s;if(!r)if(e.canvas.addEventListener("webglcontextlost",fe,!1),e.canvas.addEventListener("webglcontextrestored",le,!1),e.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(r=e,t=e.canvas,i=ue(r),o=new K(r,"#define SHADER_NAME seriously.base\n"+u,"#define SHADER_NAME seriously.base\n"+c),n=0;n<Q.length;n++)(s=Q[n]).gl=r,s.initialize(),s.buildShader();for(n=0;n<G.length;n++)(s=G[n]).initialize();for(n=0;n<J.length;n++)(s=J[n]).model||(s.model=i,s.shader=o)}}function le(){var e,t,i,o;if(n&&!r){if(B(t=n.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(e=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:n.debugContext})){if(e.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ce(e),n.renderToTexture?n.frameBuffer=new Y(r,n.width,n.height,!1):n.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(o=U[i]).setDirty(),o.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function fe(e){var n,s;for(e&&(X.logger.warn("WebGL context lost"),e.preventDefault()),k&&(j(k),k=0),t&&t.removeEventListener("webglcontextlost",fe,!1),n=0;n<Q.length;n++)(s=Q[n]).gl=null,s.initialized=!1,s.baseShader=null,s.model=null,s.frameBuffer=null,s.texture=null,s.shader&&s.shader.destroy&&(s.shader.destroy(),s.effect.commonShader&&delete ie[s.hook]),s.shaderDirty=!0,s.shader=null,s.effect.lostContext&&s.effect.lostContext.call(s),e&&s.emit("webglcontextlost");for(n=0;n<G.length;n++)(s=G[n]).texture=null,s.initialized=!1,s.allowRefresh=!1,e&&s.emit("webglcontextlost");for(n=0;n<Z.length;n++)(s=Z[n]).frameBuffer=null,s.texture=null,e&&s.emit("webglcontextlost");for(n=0;n<J.length;n++)(s=J[n]).model=!1,s.frameBuffer=null,e&&s.emit("webglcontextlost");o&&o.destroy&&o.destroy(),r&&(r.deleteBuffer(i.vertex),r.deleteBuffer(i.texCoord),r.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,o=null,r=null,t=null}function he(e){var t,r,n=!1;if(k=0,te.length)for(n=!0,t=0;t<te.length;t++)te[t].call(N,e);if(G&&G.length)for(n=!0,t=0;t<G.length;t++)((r=G[t]).dirty||r.checkDirty&&r.checkDirty())&&(r.dirty=!1,r.setDirty());for(t=0;t<J.length;t++)(r=J[t]).auto&&r.dirty&&r.render();if(re.length)for(n=!0,t=0;t<re.length;t++)re[t].call(N);n&&!k&&(k=A(he))}function de(e,t,n,i,o,s){var a,u,c,l,f,h,d,v,m,g=0,b=o&&o.gl||r;if(b){for(a in o?(l=s&&s.width||o.width||b.canvas.width,f=s&&s.height||o.height||b.canvas.height):(l=s&&s.width||b.canvas.width,f=s&&s.height||b.canvas.height),e.use(),b.viewport(0,0,l,f),b.bindFramebuffer(b.FRAMEBUFFER,i),b.enableVertexAttribArray(e.location.position),b.enableVertexAttribArray(e.location.texCoord),t.texCoord&&(b.bindBuffer(b.ARRAY_BUFFER,t.texCoord),b.vertexAttribPointer(e.location.texCoord,t.texCoord.size,b.FLOAT,!1,0,0)),b.bindBuffer(b.ARRAY_BUFFER,t.vertex),b.vertexAttribPointer(e.location.position,t.vertex.size,b.FLOAT,!1,0,0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,t.index),s&&s.depth?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),s?void 0===s.blend||s.blend?(r.enable(r.BLEND),h=void 0===s.srcRGB?r.ONE:s.srcRGB,v=s.dstRGB||r.ZERO,d=void 0===s.srcAlpha?h:s.srcAlpha,m=void 0===s.dstAlpha?v:s.dstAlpha,r.blendFuncSeparate(h,v,d,m),r.blendEquation(s.blendEquation||r.FUNC_ADD)):r.disable(r.BLEND):(r.enable(r.BLEND),r.blendFunc(r.ONE,r.ZERO),r.blendEquation(r.FUNC_ADD)),n)n.hasOwnProperty(a)&&(u=n[a],(c=e.uniforms[a])&&(B(u,"WebGLTexture")?(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u),c.set(g),g++):u instanceof p||u instanceof y||u instanceof S?u.texture&&(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u.texture),c.set(g),g++):null!=u&&c.set(u)));s&&void 0!==s.clear&&!s.clear||(b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)),b.drawElements(t.mode,t.length,b.UNSIGNED_SHORT,0),r.enable(r.DEPTH_TEST)}}function pe(e,t,r){var n,i;if(("string"!=typeof e||!t&&0!==t)&&(r&&"object"==typeof r||(r=t),t=e),"string"==typeof e&&h[e]||(e=null),t instanceof p||t instanceof y||t instanceof S)n=t;else if(t instanceof T||t instanceof O||t instanceof C){if(!(n=W[t.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),i=0;i<G.length;i++)if(n=G[i],(!e||e===n.hook)&&n.compare&&n.compare(t,r))return n;n=new p(e,t,r)}return n}function ve(e,t){var r,n,i;if(!(e instanceof y||e instanceof S))return!1;if(e===t)return!0;for(r in i=e.sources)if(i.hasOwnProperty(r)&&((n=i[r])===t||ve(n,t)))return!0;return!1}(a=function(){this.ready=!1,this.width=1,this.height=1,this.gl=r,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=q,q++}).prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},a.prototype.setUnready=function(){var e;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setUnready()},a.prototype.setDirty=function(){var e;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setDirty()},a.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,e))},a.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},a.prototype.resize=function(){var e,t;this.source?(e=this.source.width,t=this.source.height):this.sources&&this.sources.source?(e=this.sources.source.width,t=this.sources.source.height):this.inputs&&this.inputs.width?(e=this.inputs.width,t=this.inputs.height||e):this.inputs&&this.inputs.height?e=t=this.inputs.height:(e=1,t=1),e=Math.floor(e),t=Math.floor(t),this.width===e&&this.height===t||(this.width=e,this.height=t,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=t),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,t)},a.prototype.on=function(e,t){var r,n=-1;e&&"function"==typeof t&&((r=this.listeners[e])?n=r.indexOf(t):r=this.listeners[e]=[],n<0&&r.push(t))},a.prototype.off=function(e,t){var r,n=-1;e&&"function"==typeof t&&(r=this.listeners[e])&&(n=r.indexOf(t))>=0&&r.splice(n,1)},a.prototype.emit=function(e){var t,r=this.listeners[e];if(r&&r.length)for(t=0;t<r.length;t++)z(r[t])},a.prototype.destroy=function(){var e,t;for(t in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];for(e in this.uniforms)this.uniforms.hasOwnProperty(e)&&delete this.uniforms[e];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(e=U.indexOf(this))>=0&&U.splice(e,1),delete W[this.id],this.isDestroyed=!0},T=function(e){var t,r=e;function n(e,t){var n,i,o;return o=r.effect.inputs[e],n=r.inputElements[e],"string"==typeof t&&isNaN(t)&&("enum"===o.type?o.options.hasOwnProperty(t)||(t=L(t,["select"])):"number"===o.type||"boolean"===o.type?t=L(t,["input","select"]):"image"===o.type&&(t=L(t,["canvas","img","video"]))),B(t,"HTMLInputElement")||B(t,"HTMLSelectElement")?(i=t.value,n&&n.element!==t&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e],n=null),n||(n={element:t,listener:function(e,n){return function(){var i,s;i="checkbox"===t.type?t.checked:n.value,s=r.setInput(e,i),"color"===o.type&&(s=V(s).substr(0,7)),s!==i&&(n.value=s)}}(e,t)},r.inputElements[e]=n,"range"===t.type?(t.addEventListener("input",n.listener,!0),t.addEventListener("change",n.listener,!0)):t.addEventListener("change",n.listener,!0)),n&&"checkbox"===t.type&&(i=t.checked)):(n&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e]),i=t),r.setInput(e,i),r.inputs[e]}function i(e){return function(t){var r=n(e,t);return r&&r.pub}}function o(e){return function(){var t=r.inputs[e];return t&&t.pub}}function s(e){return function(t){return n(e,t)}}function a(e){return function(){return r.inputs[e]}}for(t in r.effect.inputs)if(r.effect.inputs.hasOwnProperty(t)){if(void 0!==this[t])throw new Error("Cannot overwrite Seriously."+t);"image"===r.effect.inputs[t].type?Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:o(t),set:i(t)}):Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:a(t),set:s(t)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.effect.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}}}),this.render=function(){return r.render(),this},this.readPixels=function(e,t,n,i,o){return r.readPixels(e,t,n,i,o)},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.inputs=function(e){var t,n,i,o;if(i=r.effect.inputs,e)return(n=i[e])?(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t):null;for(o in t={},i)i.hasOwnProperty(o)&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.matte=function(e){r.matte(e)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},y=function(e,t){var n,i,o,u,c={};for(n in a.call(this,t),this.gl=r,this.effectRef=l[e],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=e,this.options=t,this.transform=null,this.effect=F({},this.effectRef),this.effectRef.definition&&F(this.effect,this.effectRef.definition.call(this,t)),$(this.effect),this.uniforms.transform=s,this.inputs={},u=ne[e],this.effect.inputs)this.effect.inputs.hasOwnProperty(n)&&(void 0!==(i=this.effect.inputs[n]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),o=i.validate.call(this,i.defaultValue,i),u&&void 0!==u[n]&&(o=i.validate.call(this,u[n],i,i.defaultValue,o),u[n]=o,"image"===i.type&&(c[n]=o)),this.inputs[n]=o,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(n in r&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new T(this),U.push(this),W[this.id]=this,Q.push(this),v[e].push(this),c)c.hasOwnProperty(n)&&this.setInput(n,c[n])},y.prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var e=this;this.baseShader=o,this.shape?this.model=ae(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){e.initFrameBuffer(!0)}),r):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize()},y.prototype.updateReady=function(){var e,t,r,n,i=!0;for(t in(r=this.effect).inputs)if(r.inputs.hasOwnProperty(t)&&"image"===this.effect.inputs[t].type&&(!this.sources[t]||!this.sources[t].ready)&&(!r.requires||r.requires.call(this,t,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),n=i?"setReady":"setUnready",this.targets))for(e=0;e<this.targets.length;e++)this.targets[e][n]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},y.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},y.prototype.removeSource=function(e){var t,r=e&&e.pub;for(t in this.inputs)!this.inputs.hasOwnProperty(t)||this.inputs[t]!==e&&this.inputs[t]!==r||(this.inputs[t]=null);for(t in this.sources)!this.sources.hasOwnProperty(t)||this.sources[t]!==e&&this.sources[t]!==r||(this.sources[t]=null)},y.prototype.buildShader=function(){var e,t=this.effect,n=this;function i(e){return R.test(e)?e:"#define SHADER_NAME seriously."+n.hook+"\n"+e}this.shaderDirty&&(t.commonShader&&ie[this.hook]?(this.shader||ie[this.hook].count++,this.shader=ie[this.hook].shader):t.shader?(this.shader&&!t.commonShader&&this.shader.destroy(),(e=t.shader.call(this,this.inputs,{vertex:u,fragment:c},X.util))instanceof K?this.shader=e:e&&e.vertex&&e.fragment?this.shader=new K(r,i(e.vertex),i(e.fragment)):this.shader=o,t.commonShader&&(ie[this.hook]={count:1,shader:this.shader})):this.shader=o,this.shaderDirty=!1)},y.prototype.render=function(){var e,t,n,i=this.effect,o=this;if(r){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(e in this.sources)!this.sources.hasOwnProperty(e)||i.requires&&!i.requires.call(this,e,this.inputs)||(n="function"==typeof this.inPlace?this.inPlace(e):this.inPlace,this.sources[e].render(!n));this.frameBuffer&&(t=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,t,(function(e,t,r,n,i,s){de(e,t,r,n,i||o,s)})),this.emit("render")):t&&(de(this.shader,this.model,this.uniforms,t,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(e,t){var r,n,i,o,a,u=this;if(this.effect.inputs.hasOwnProperty(e)){if("image"===(r=this.effect.inputs[e]).type){if(t){if((t=pe(t))!==this.sources[e]){if(function(){var t,r=u.sources[e];if(r){for(t in u.sources)if(t!==e&&u.sources.hasOwnProperty(t)&&u.sources[t]===r)return;r.removeTarget(u)}}(),ve(t,this))throw new Error("Attempt to make cyclical connection.");this.sources[e]=t,t.addTarget(this)}}else delete this.sources[e],t=!1;n=this.sources[e],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(o=this.sources[i[0]],this.uniforms.transform=o&&o.cumulativeMatrix||s):this.uniforms.transform=s}else a=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,n=t=r.validate.call(this,t,r,a,this.inputs[e]);return this.inputs[e]===t&&"color"!==r.type&&"vector"!==r.type||(this.inputs[e]=t,r.uniform&&(this.uniforms[r.uniform]=n),"image"===r.type?(this.resize(),this.updateReady()):r.updateSources&&this.updateReady(),r.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),r.update&&r.update.call(this,t)),t}},y.prototype.alias=function(e,t){var r=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),ee[t]={node:this,input:e},Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return r.inputs[e]},set:function(t){return r.setInput(e,t)}})),this},y.prototype.matte=function(e){var t,r,n,i,o,s,a,u=[],c=[],l={};function f(e){var t,r,n,i,o,s,a,l,f,h,d,p=[];if(!e.simple){for(t=0;t<e.edges.length;t++)for(n=e.edges[t],r=t+1;r<e.edges.length;r++)i=e.edges[r],v=n[0],m=n[1],g=i[0],void 0,void 0,void 0,S=void 0,E=void 0,b=((y=i[1]).x-g.x)*(v.y-g.y)-(y.y-g.y)*(v.x-g.x),_=(m.x-v.x)*(v.y-g.y)-(m.y-v.y)*(v.x-g.x),(o=!!((w=(y.y-g.y)*(m.x-v.x)-(y.x-g.x)*(m.y-v.y))&&(E=_/w,(S=b/w)>0&&S<=1&&E>0&&E<=1))&&{x:v.x+S*(m.x-v.x),y:v.y+S*(m.y-v.y)})&&(o.edge1=n,o.edge2=i,p.push(o));var v,m,g,y,b,_,w,S,E;if(p.length){for(f=[],t=0;t<p.length;t++)n=(o=p[t]).edge1,i=o.edge2,h={x:o.x,y:o.y,prev:n[0],next:i[1],id:c.length},e.vertices.push(h),c.push(h),d={x:o.x,y:o.y,prev:i[0],next:n[1],id:c.length},e.vertices.push(d),c.push(h),h.prev.next=h,h.next.prev=h,d.prev.next=d,d.next.prev=d;do{s={edges:[],vertices:[],simple:!0},f.push(s),a=l=e.vertices[0];do{t=e.vertices.indexOf(l),e.vertices.splice(t,1),s.edges.push([l,l.next]),s.vertices.push(l),l=l.next}while(l!==a)}while(e.vertices.length);for(t=u.indexOf(e),u.splice(t,1),t=0;t<f.length;t++)u.push(f[t])}else e.simple=!0}}function h(e){var t,r,n,i,o=e.vertices.length,s=0;for(t=o-1,r=0;r<o;t=r,r++)n=e.vertices[t],i=e.vertices[r],s+=n.x*i.y-i.x*n.y;return s>0}function d(e){var t,n,i,o,s,a,u,c,l,f,h,d=e.vertices,p=[],v=[];function m(e,t,r,n){var i,o,s,a,u,c,l,f,h,d,p,v;return i=r.x-t.x,o=r.y-t.y,s=e.x-r.x,a=e.y-r.y,u=t.x-e.x,c=t.y-e.y,l=n.x-e.x,f=n.y-e.y,h=n.x-t.x,d=n.y-t.y,p=n.x-r.x,v=n.y-r.y,i*d-o*h>=0&&s*v-a*p>=0&&u*f-c*l>=0}function g(e,t,r,n,i){var o,s,a,u;if(s=d[i[e]],a=d[i[t]],u=d[i[r]],0>(a.x-s.x)*(u.y-s.y)-(a.y-s.y)*(u.x-s.x))return!1;for(o=0;o<n;o++)if(o!==e&&o!==t&&o!==r&&m(s,a,u,d[i[o]]))return!1;return!0}if(n=d.length,e.clockWise)for(t=0;t<n;t++)p[t]=t;else for(t=0;t<n;t++)p[t]=n-1-t;for(o=2*(i=n),t=i-1;i>2;){if(o--<=0)return v;if(i<=(s=t)&&(s=0),i<=(t=s+1)&&(t=0),i<(a=t+1)&&(a=0),g(s,t,a,i,p)){for(u=p[s],c=p[t],l=p[a],e.clockWise?(v.push(d[u]),v.push(d[c]),v.push(d[l])):(v.push(d[l]),v.push(d[c]),v.push(d[u])),f=t,h=t+1;h<i;f++,h++)p[f]=p[h];o=2*--i}}r.indices=v}for(t=function(e){return e&&e.length&&Array.isArray(e)?Array.isArray(e[0])?Array.isArray(e[0])&&!isNaN(e[0][0])?[e]:e:[e]:[]}(e),n=0;n<t.length;n++){for(e=t[n],a=null,r={vertices:[],edges:[]},i=0;i<e.length;i++)"object"!=typeof(o=e[i])||isNaN(o.x)||isNaN(o.y)?o.length>=2&&!isNaN(o[0])&&!isNaN(o[1])&&(s={x:o[0],y:o[1],id:c.length}):s={x:o.x,y:o.y,id:c.length},s&&(a?(a.next=s,s.prev=a,s.next=r.vertices[0],r.vertices[0].prev=s):(r.head=s,s.next=s,s.prev=s),c.push(s),r.vertices.push(s),a=s);if(r.vertices.length>2)for(3===r.vertices.length&&(r.simple=!0),u.push(r),i=0;i<r.vertices.length;i++)s=r.vertices[i],r.edges.push([s,s.next])}for(n=u.length-1;n>=0;n--)f(r=u[n]);for(n=0;n<u.length;n++)(r=u[n]).clockWise=h(r),d(r);for(l.vertices=[],l.coords=[],n=0;n<c.length;n++)o=c[n],l.vertices.push(2*o.x-1),l.vertices.push(-2*o.y+1),l.vertices.push(-1),l.coords.push(o.x),l.coords.push(-1*o.y+1);for(l.vertices=new Float32Array(l.vertices),l.coords=new Float32Array(l.coords),l.indices=[],n=0;n<u.length;n++)for(r=u[n],i=0;i<r.indices.length;i++)o=r.indices[i],l.indices.push(o.id);l.indices=new Uint16Array(l.indices),this.shape=l,this.gl&&ae(l,this.gl)},y.prototype.destroy=function(){var e,t,r,n=this.hook;for(t in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,ie[n]&&(ie[n].count--,ie[n].count||delete ie[n]),this.shader&&this.shader.destroy&&this.shader!==o&&!ie[n]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(t)&&((r=this.inputElements[t]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(t in this.sources)this.sources.hasOwnProperty(t)&&((r=this.sources[t])&&r.removeTarget&&r.removeTarget(this),delete this.sources[t]);for(;this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Q.indexOf(this))>=0&&Q.splice(e,1),(e=v[n].indexOf(this))>=0&&v[n].splice(e,1),a.prototype.destroy.call(this)},O=function(e){var t=e;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return t.source}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}},width:{enumerable:!0,configurable:!0,get:function(){return t.width}},height:{enumerable:!0,configurable:!0,get:function(){return t.height}}}),this.render=function(){t.render()},this.update=function(){t.setDirty()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},p=function(e,t,n){var i,o,s=n||{},u=void 0===s.flip||s.flip,c=s.width,l=s.height,f=!1,d=this,p=!1;function v(e,t,r,n){var i=h[e];if(i.definition){if(!(i=i.definition.call(d,t,r,n)))return null;i=F(F({},h[e]),i)}return i}function m(e){return d.source===e}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(n&&"object"==typeof n||(n=t),t=e),"string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),"string"==typeof e&&h[e]&&(o=v(e,t,n,!0))&&(this.hook=e,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source)),!o&&B(t))"CANVAS"===t.tagName?(this.width=t.width,this.height=t.height,this.render=this.renderImageCanvas,p=!0,this.hook="canvas",this.compare=m):"IMG"===t.tagName&&(this.width=t.naturalWidth||1,this.height=t.naturalHeight||1,t.complete&&t.naturalWidth||(f=!0),t.addEventListener("load",(function(){d.isDestroyed||(d.width===t.naturalWidth&&d.height===t.naturalHeight||(d.width=t.naturalWidth,d.height=t.naturalHeight,d.resize()),d.setDirty(),d.setReady())}),!0),this.render=this.renderImageCanvas,p=!0,this.hook="image",this.compare=m);else if(!o&&B(t,"WebGLTexture")){if(r&&!r.isTexture(t))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(l)||(c=l):isNaN(l)&&(l=c),this.width=c,this.height=l,void 0===s.flip&&(u=!1),p=!0,this.texture=t,this.initialized=!0,this.hook="texture",this.compare=m,this.render=function(){}}if(!p&&!o)for(i in h)if(h.hasOwnProperty(i)&&h[i]&&(o=v(i,t,n,!1))){this.hook=i,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source);break}if(!p)throw new Error("Unknown source type");this.source=t,void 0===this.flip&&(this.flip=u),this.targets=[],f||d.setReady(),this.pub=new O(this),U.push(this),W[this.id]=this,G.push(this),g[this.hook].push(this),G.length&&!k&&he()},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,p.prototype.initialize=function(){var e;r&&!this.texture&&this.ready&&(e=r.createTexture(),r.bindTexture(r.TEXTURE_2D,e),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.bindTexture(r.TEXTURE_2D,null),this.texture=e,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},p.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,{texture:this.texture,useFloat:e}))},p.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},p.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},p.prototype.resize=function(){var e,t;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(e=0;e<this.targets.length;e++)(t=this.targets[e]).resize(),t.setTransformDirty&&t.setTransformDirty()},p.prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},p.prototype.render=function(){var e=this.source;r&&(e||0===e)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,r,de,i,o)&&(this.dirty=!1,this.emit("render")))},p.prototype.renderImageCanvas=function(){var e=this.source;if(r&&e&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){r.bindTexture(r.TEXTURE_2D,this.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),this.dirty=!1,this.emit("render"),!0}catch(e){e.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},p.prototype.destroy=function(){var e,t,n;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),r&&this.texture&&r.deleteTexture(this.texture);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in(e=G.indexOf(this))>=0&&G.splice(e,1),(e=g[this.hook].indexOf(this))>=0&&g[this.hook].splice(e,1),this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];a.prototype.destroy.call(this)},P=function(e){var t=e;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(t.source)return t.source.pub},set:function(e){t.setSource(e)}},original:{enumerable:!0,configurable:!0,get:function(){return t.target}},width:{enumerable:!0,configurable:!0,get:function(){return t.width},set:function(e){!isNaN(e)&&e>0&&t.width!==e&&(t.width=e,t.resize(),t.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return t.height},set:function(e){!isNaN(e)&&e>0&&t.height!==e&&(t.height=e,t.resize(),t.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}}}),this.render=function(){t.render()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.go=function(e){t.go(e)},this.stop=function(){t.stop()},this.getTexture=function(){return t.frameBuffer.texture},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.inputs=function(e){return{source:{type:"image"}}},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},E=function(e,t,s){var l,f,h,p,v,m,g,y,_,S=this,E=!1;function T(e,t,n,s){var a=d[e];if(a.definition){if(!(a=a.definition.call(S,t,n,s)))return null;a=F(F({},d[e]),a),S.hook=_,E=!0,S.plugin=a,S.compare=a.compare,a.target&&(t=a.target),a.gl&&!S.gl&&(S.gl=a.gl,r||ce(a.gl)),S.gl===r&&(S.model=i,S.shader=o)}return a}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(s&&"object"==typeof s||(s=t),t=e),f=void 0===(l=s||{}).flip||l.flip,h=parseInt(l.width,10),p=parseInt(l.height,10),m=l.debugContext,"string"==typeof e&&d[e]&&T(e,t,l,!0),this.renderToTexture=l.renderToTexture,B(t,"WebGLFramebuffer"))if(g=t,B(l,"HTMLCanvasElement"))t=l;else if(B(l,"WebGLRenderingContext"))t=l.canvas;else if(B(l.canvas,"HTMLCanvasElement"))t=l.canvas;else{if(!B(l.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");t=l.context.canvas}if(B(t,"HTMLCanvasElement")){if(h=t.width,p=t.height,(!r||r.canvas!==t&&l.allowSecondaryWebGL)&&(v=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:m})),v)r&&r!==v?(this.gl=v,this.frameBuffer={frameBuffer:g||null},this.shader=new K(this.gl,u,c),this.model=ue.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(r.TEXTURE_2D,this.texture),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(n||(n=this),r||ce(v),this.render=this.renderWebGL,l.renderToTexture?r&&(this.frameBuffer=new Y(r,h,p,!1)):this.frameBuffer={frameBuffer:g||null});else{if(!l.allowSecondaryWebGL&&r&&r.canvas!==t)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=w,X.logger.log("Unable to create WebGL context.")}E=!0}if(!E)for(_ in d)if(d.hasOwnProperty(_)&&d[_]&&T(_,t,l,!1))break;if(!E)throw new Error("Unknown target type");b&&((y=b.get(t))?X.logger.warn("Target already in use by another instance",t,Object.keys(y).map((function(e){return y[e]}))):(y={},b.set(t,y)),y[N.id]=N),this.target=t,this.transform=null,this.transformDirty=!0,this.flip=f,h&&(this.width=h),p&&(this.height=p),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==l.auto?this.auto=l.auto:this.auto=oe,this.frames=0,this.pub=new P(this),U.push(this),W[this.id]=this,J.push(this)},(E.prototype=Object.create(a.prototype)).constructor=E,E.prototype.setSource=function(e){var t;(t=pe(e))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&(this.resize(),t.ready?this.setReady():this.setUnready()),this.setDirty())},E.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=A(he))},E.prototype.resize=function(){B(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},E.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},E.prototype.go=function(){this.auto=!0,this.setDirty()},E.prototype.stop=function(){this.auto=!1},E.prototype.render=function(){r&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,de,o,i)},E.prototype.renderWebGL=function(){var e,t,n;if(this.resize(),r&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||s:this.transformDirty&&(e=this.transform,M.copy(e,this.source.cumulativeMatrix||s),t=this.source.width/this.width,n=this.source.height/this.height,e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=n,e[5]*=n,e[6]*=n,e[7]*=n,this.uniforms.transform=e,this.transformDirty=!1),de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this,x),this.emit("render"),this.dirty=!1}},E.prototype.renderSecondaryWebGL=function(){var e,t,r,n,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),e=this.source.width,t=this.source.height,this.pixels&&this.pixels.length===e*t*4||(this.pixels=new Uint8Array(e*t*4)),this.source.readPixels(0,0,e,t,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),e===this.width&&t===this.height?this.uniforms.transform=s:this.transformDirty&&(r=this.transform,M.copy(r,s),n=this.source.width/this.width,i=this.source.height/this.height,r[0]*=n,r[1]*=n,r[2]*=n,r[3]*=n,r[4]*=i,r[5]*=i,r[6]*=i,r[7]*=i,this.uniforms.transform=r,this.transformDirty=!1),this.uniforms.source=this.texture,de(this.shader,this.model,this.uniforms,null,this,x),this.dirty=!1)},E.prototype.removeSource=function(e){this.source!==e&&this.source!==e.pub||(this.source=null)},E.prototype.destroy=function(){var e,r;this.source&&this.source.removeTarget&&this.source.removeTarget(this),b&&(delete(r=b.get(this.target))[N.id],Object.keys(r).length||b.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(e=J.indexOf(this))>=0&&J.splice(e,1),a.prototype.destroy.call(this),this===n&&(t.removeEventListener("webglcontextrestored",le,!1),fe(),n=null)},C=function(e){var t,r=e,n=this;function i(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){return t.get.call(r)},set:function(n){!function(e,t,n){var i,o,s;i=r.inputElements[e],"string"==typeof n&&isNaN(n)&&("enum"===t.type?t.options.hasOwnProperty(n)||(n=L(n,["select"])):"number"===t.type||"boolean"===t.type?n=L(n,["input","select"]):"image"===t.type&&(n=L(n,["canvas","img","video"]))),B(n,"HTMLInputElement")||B(n,"HTMLSelectElement")?(o=n.value,i&&i.element!==n&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e],i=null),i||(i={element:n,listener:(s=n,function(){var t,i;t="checkbox"===n.type?n.checked:s.value,i=r.setInput(e,t),"color"===n.type&&(i=V(i)),i!==t&&(s.value=i)})},r.inputElements[e]=i,"range"===n.type?(n.addEventListener("input",i.listener,!0),n.addEventListener("change",i.listener,!0)):n.addEventListener("change",i.listener,!0)),i&&"checkbox"===n.type&&(o=n.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e]),o=n),r.setInput(e,o)}(e,t,n)}})}function o(e){return function(){e.apply(r,arguments)&&r.setTransformDirty()}}for(t in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.plugin.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}},source:{enumerable:!0,configurable:!0,get:function(){return r.source&&r.source.pub},set:function(e){r.setSource(e)}}}),r.methods)r.methods.hasOwnProperty(t)&&(this[t]=o(r.methods[t]));for(t in r.inputs)r.inputs.hasOwnProperty(t)&&i(t,r.inputs[t]);this.update=function(){r.setDirty()},this.inputs=function(e){var t,n,i,o;if(i=r.plugin.inputs,e)return!(n=i[e])||n.method?null:(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t);for(o in t={},i)i.hasOwnProperty(o)&&!i[o].method&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},S=function(e,t){var r,n,i,o,s;for(r in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=f[e],this.hook=e,this.id=q,q++,this.options=t,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=F({},this.transformRef),this.transformRef.definition&&F(this.plugin,this.transformRef.definition.call(this,t)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&((n=this.plugin.inputs[r]).method&&"function"==typeof n.method?this.methods[r]=n.method:"function"==typeof n.set&&"function"==typeof n.get&&(this.inputs[r]=n));for(r in $(this.plugin),s=ne[e],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&"function"==typeof(n=this.plugin.inputs[r]).set&&"function"==typeof n.get&&"function"!=typeof n.method&&(i=n.get.call(this),o=void 0===n.defaultValue?i:n.defaultValue,o=n.validate.call(this,o,n,i),s&&void 0!==s[r]&&(o=n.validate.call(this,s[r],n,n.defaultValue,o),s[r]=o),o!==i&&n.set.call(this,o));U.push(this),W[this.id]=this,this.pub=new C(this),Z.push(this),m[e].push(this)},S.prototype=Object.create(a.prototype),S.prototype.constructor=S,S.prototype.setDirty=function(){this.renderDirty=!0,a.prototype.setDirty.call(this)},S.prototype.setTransformDirty=function(){var e,t;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,e=0;e<this.targets.length;e++)(t=this.targets[e]).setTransformDirty?t.setTransformDirty():t.setDirty()},S.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty()},S.prototype.setSource=function(e){var t;if((t=pe(e))!==this.source){if(ve(t,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&t.ready?this.setReady():this.setUnready(),this.resize()}},S.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},S.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1),this.targets&&this.targets.length&&this.resize()},S.prototype.setInput=function(e,t){var r,n,i;if(this.plugin.inputs.hasOwnProperty(e))return r=this.plugin.inputs[e],n=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,i=r.get.call(this),void 0===n&&(n=i),t=r.validate.call(this,t,r,n,i),r.set.call(this,t)&&this.setTransformDirty(),r.get.call(this)},S.prototype.alias=function(e,t){var r,n,i=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),(r=this.inputs[e])?(n=i.inputs[e],Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return n.get.call(i)},set:function(e){n.set.call(i,e)&&i.setTransformDirty()}})):(r=this.methods[e])&&(n=r,N[t]=function(){n.apply(i,arguments)&&i.setTransformDirty()}),r&&(ee[t]={node:this,input:e})),this},S.prototype.render=function(e){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||s),this.transformDirty=!1),e&&r?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new Y(r,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||s,de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},S.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},S.prototype.destroy=function(){var e,t,r,n=this.hook;for(e in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(e)&&((r=this.inputElements[e]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Z.indexOf(this))>=0&&Z.splice(e,1),(e=m[n].indexOf(this))>=0&&m[n].splice(e,1),a.prototype.destroy.call(this)},S.prototype.setReady=a.prototype.setReady,S.prototype.setUnready=a.prototype.setUnready,S.prototype.on=a.prototype.on,S.prototype.off=a.prototype.off,S.prototype.emit=a.prototype.emit,(e=B(e,"HTMLCanvasElement")?{canvas:e}:e||{}).canvas,this.effect=function(e,t){if(!l[e])throw new Error("Unknown effect: "+e);return new y(e,t).pub},this.source=function(e,t,r){return pe(e,t,r).pub},this.transform=function(t,r){if("string"!=typeof t&&(r=t,t=!1),t){if(!f[t])throw new Error("Unknown transform: "+t)}else if(t=e&&e.defaultTransform||"2d",!f[t])throw new Error("No transform specified");return new S(t,r).pub},this.target=function(e,t,r){var n,i,o;for(e&&"string"==typeof e&&!d[e]&&(i=document.querySelector(e)),("string"!=typeof e||!t&&0!==t||i)&&(r&&"object"==typeof r||(r=t),t=i||e,e=null),"string"==typeof t&&isNaN(t)&&(t=document.querySelector(t)),o=0;o<J.length;o++)if(n=J[o],(!e||e===n.hook)&&(n.target===t||n.compare&&n.compare(t,r)))return n.pub;return(n=new E(e,t,r)).pub},this.aliases=function(){return Object.keys(ee)},this.removeAlias=function(e){ee[e]&&(delete this[e],delete ee[e])},this.defaults=function(e,t){var r;if(e)if("object"!=typeof e)null===t?delete ne[e]:"object"==typeof t&&(ne[e]=F({},t));else for(r in e)e.hasOwnProperty(r)&&this.defaults(r,e[r]);else if(null===e)for(r in ne)ne.hasOwnProperty(r)&&delete ne[r]},this.go=function(e,t){var r;for("function"==typeof e&&te.indexOf(e)<0&&te.push(e),"function"==typeof t&&re.indexOf(t)<0&&re.push(t),oe=!0,r=0;r<J.length;r++)J[r].go();k||!te.length&&!re.length||he()},this.stop=function(){te.length=0,re.length=0,j(k),k=0},this.render=function(){var t;for(t=0;t<J.length;t++)J[t].render(e)},this.destroy=function(){for(var e,t;U.length;)U[0].pub.destroy();for(e in this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w);N=null,G=[],J=[],Q=[],U=[],te.length=0,re.length=0,j(k),k=0,se=!0},this.isDestroyed=function(){return se},this.incompatible=function(e){var t,r,n;if(n=X.incompatible(e))return n;if(!e){for(t in v)if(v.hasOwnProperty(t)&&v[t].length&&(r=l[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"plugin-"+t;for(t in g)if(g.hasOwnProperty(t)&&g[t].length&&(r=h[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"source-"+t}return!1},this.isNode=function(e){var t;return!(!e||!(t=W[e.id])||t.isDestroyed)},this.isSource=function(e){return this.isNode(e)&&e instanceof O},this.isEffect=function(e){return this.isNode(e)&&e instanceof T},this.isTransform=function(e){return this.isNode(e)&&e instanceof C},this.isTarget=function(e){return this.isNode(e)&&e instanceof P},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return I}}}),this.defaults(e.defaults)}window.addEventListener("message",(function(e){e.source===window&&"seriously-timeout-message"===e.data&&(e.stopPropagation(),p.length>0&&p.shift()())}),!0),Y.prototype.resize=function(e,t){var r=this.gl;this.width===e&&this.height===t||(this.width=e,this.height=t,r&&(r.bindTexture(r.TEXTURE_2D,this.texture),r.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,this.renderBuffer),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,t,0,r.RGBA,r.UNSIGNED_BYTE,null),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,e,t),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.texture,0),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,null)))},Y.prototype.destroy=function(){var e=this.gl;e&&(e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&e.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},K.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(e){var t,r,n;if(void 0===o&&((t=document.createElement("canvas"))&&t.getContext?window.WebGLRenderingContext?(r=G())||(o="context"):o="webgl":o="canvas"),o)return o;if(e){if((n=l[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"plugin-"+e;if((n=h[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"source-"+e}return!1},X.plugin=function(e,t,r){var n;if(l[e])X.logger.warn("Effect ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=k,n.inputs&&$(n),n.title||(n.title=e),l[e]=n,v[e]=[],n},X.removePlugin=function(e){var t;if(!e)return this;if(!l[e])return this;if(t=v[e]){for(;t.length;)t.shift().destroy();delete v[e]}return delete l[e],this},X.source=function(e,t,r){var n;if(h[e])X.logger.warn("Source ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),h[e]=n,g[e]=[],n},X.removeSource=function(e){var t;if(!e)return this;if(!h[e])return this;if(t=g[e]){for(;t.length;)t.shift().destroy();delete g[e]}return delete h[e],this},X.transform=function(e,t,r){var n;if(f[e])X.logger.warn("Transform ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=I,n.inputs&&$(n),n.title||(n.title=e),f[e]=n,m[e]=[],n},X.removeTransform=function(e){var t;if(!e)return this;if(!f[e])return this;if(t=m[e]){for(;t.length;)t.shift().destroy();delete m[e]}return delete f[e],this},X.target=function(e,t,r){var n;if(d[e])X.logger.warn("Target ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),d[e]=n,y[e]=[],n},X.removeTarget=function(e){var t;if(!e)return this;if(!d[e])return this;if(t=y[e]){for(;t.length;)t.shift().destroy();delete y[e]}return delete d[e],this},X.inputValidators={color:function(e,t,r,n){var o,s,a,u;if(s=n||[],"string"==typeof e){if((a=E.exec(e))&&a.length){if(a.length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(s[3]=1,u=0;u<3;u++)s[u]=parseFloat(a[u+2])/255;return isNaN(a[6])||(s[3]=parseFloat(a[6])),"hsl"===a[1].toLowerCase()?W(s[0],s[1],s[2],s[3],s):s}if((a=T.exec(e))&&a.length)return 3===(o=a[1]).length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=1):4===o.length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=parseInt(o[3],16)/15):6===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=1):8===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=parseInt(o.substr(6,2),16)/255):s[0]=s[1]=s[2]=s[3]=0,s;if(a=S[e.toLowerCase()]){for(u=0;u<4;u++)s[u]=a[u];return s}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=e,(o=i.fillStyle)&&"#000000"!==o?X.inputValidators.color(o,t,r,n):(s[0]=s[1]=s[2]=s[3]=0,s)}if(q(e)){if((s=e).length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(u=0;u<3;u++)if(isNaN(s[u]))return s[0]=s[1]=s[2]=s[3]=0,s;return s.length<4&&s.push(1),s}if("number"==typeof e)return s[0]=s[1]=s[2]=e,s[3]=1,s;if("object"==typeof e){for(u=0;u<4;u++)null===e[o=C[u]]||isNaN(e[o])?s[u]=3===u?1:0:s[u]=e[o];return s}return s[0]=s[1]=s[2]=s[3]=0,s},number:function(e,t,r){return e=parseFloat(e),isNaN(e)?r||0:(t.mod&&(e-=t.mod*Math.floor(e/t.mod)),e<t.min?t.min:e>t.max?t.max:t.step?Math.round(e/t.step)*t.step:e)},enum:function(e,t,r){var n=t.options||[];return"string"==typeof e?e=e.toLowerCase():"number"==typeof e?e=e.toString():e||(e=""),n.hasOwnProperty(e)?e:r||""},vector:function(e,t,r,n){var i,o,s,a=t.dimensions||4;if(i=n||[],q(e)){for(o=0;o<a;o++)i[o]=e[o]||0;return i}if("object"==typeof e){for(o=0;o<a;o++)void 0===e[s=O[o]]&&(s=C[o]),i[o]=e[s]||0;return i}for(e=parseFloat(e)||0,o=0;o<a;o++)i[o]=e;return i},boolean:function(e){return!(!e||e&&e.toLowerCase&&"false"===e.toLowerCase())},string:function(e){return"string"==typeof e?e:0===e||e?e.toString?e.toString():String(e):""}},X.prototype.effects=X.effects=function(){var e,t,r,n,i,o={};for(e in l)if(l.hasOwnProperty(e)){for(i in r={title:(t=l[e]).title||e,description:t.description||"",inputs:{}},t.inputs)t.inputs.hasOwnProperty(i)&&(n=t.inputs[i],r.inputs[i]={type:n.type,defaultValue:n.defaultValue,step:n.step,min:n.min,max:n.max,mod:n.mod,minCount:n.minCount,maxCount:n.maxCount,dimensions:n.dimensions,title:n.title||i,description:n.description||"",options:n.options||[]});o[e]=r}return o},window.Float32Array&&(s=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var e;for(e in window.Seriously)window.Seriously.hasOwnProperty(e)&&"plugin"!==e&&"object"==typeof window.Seriously[e]&&X.plugin(e,window.Seriously[e])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(e){var t,r,n,i;if(!(t=L(e,["img","canvas","video"])))return!1;if(!(r=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===t.naturalWidth&&"IMG"===t.tagName)return X.logger.warn("Image not loaded"),!1;if(0===t.readyState&&0===t.videoWidth&&"VIDEO"===t.tagName)return X.logger.warn("Video not loaded"),!1;if(n=G()){(i=n.createTexture())||X.logger.error("Test WebGL context has been lost"),n.bindTexture(n.TEXTURE_2D,i);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+e.message),n.deleteTexture(i),!1}n.deleteTexture(i)}else{n=r.getContext("2d");try{n.drawImage(t,0,0),n.getImageData(0,0,1,1)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+e.message),!1}}return!0},hslToRgb:W,colors:S,setTimeoutZero:z,ShaderProgram:K,FrameBuffer:Y,requestAnimationFrame:A,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",(function(e,t,r){var n,i,o=this,s=!1,u=!1,c=!1,l=0;function f(){e.removeEventListener("loadedmetadata",f,!0),s||(e.videoWidth?(o.width===e.videoWidth&&o.height===e.videoHeight||(o.width=e.videoWidth,o.height=e.videoHeight,o.resize()),u&&o.setReady()):(u=!0,setTimeout(f,50)))}function h(){c=!0}function d(){c=!1,o.setDirty()}if(B(e,"HTMLVideoElement"))return e.readyState?f():(u=!0,e.addEventListener("loadedmetadata",f,!0)),e.addEventListener("seeking",h,!1),e.addEventListener("seeked",d,!1),{deferTexture:u,source:e,render:function t(r){var s;if(l=e.currentTime,!e.videoHeight||!e.videoWidth)return!1;a?(i||(i=document.createElement("canvas").getContext("2d"),(n=i.canvas).width=o.width,n.height=o.height),s=n,i.drawImage(e,0,0,o.width,o.height)):s=e,r.bindTexture(r.TEXTURE_2D,o.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,o.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,s),void 0===a){if(r.getError()===r.INVALID_VALUE)return a=!0,t(r);a=!1}return!0}catch(e){e.code===window.DOMException.SECURITY_ERR?(o.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",e)}return!1},checkDirty:function(){return!c&&e.currentTime!==l},compare:function(e){return o.source===e},destroy:function(){s=!0,e.removeEventListener("seeking",h,!1),e.removeEventListener("seeked",d,!1),e.removeEventListener("loadedmetadata",f,!0)}}}),{title:"Video"}),X.transform("2d",(function(e){var t=this,r=!(e&&e.radians),n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0;function h(){var e,h,d,p,v,m,g,y,b,_,w,S=t.matrix;function E(e,t){S[12]=S[0]*e+S[4]*t+S[12],S[13]=S[1]*e+S[5]*t+S[13],S[14]=S[2]*e+S[6]*t+S[14],S[15]=S[3]*e+S[7]*t+S[15]}a||u||c||l||f||1!==o||1!==s?(M.identity(S),E(a+n,u+i),l&&(S[4]=l/t.width),f&&(S[1]=f/t.height),c&&(p=S[0],v=S[1],m=S[2],g=S[3],y=S[4],b=S[5],_=S[6],w=S[7],e=-(r?c*Math.PI/180:c),h=Math.sin(e),d=Math.cos(e),S[0]=p*d+y*h,S[1]=v*d+b*h,S[2]=m*d+_*h,S[3]=g*d+w*h,S[4]=y*d-p*h,S[5]=b*d-v*h,S[6]=_*d-m*h,S[7]=w*d-g*h),1!==o&&(S[0]*=o,S[1]*=o,S[2]*=o,S[3]*=o),1!==s&&(S[4]*=s,S[5]*=s,S[6]*=s,S[7]*=s),E(-n,-i),t.transformed=!0):t.transformed=!1}return{inputs:{reset:{method:function(){return n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0,!!t.transformed&&(t.transformed=!1,!0)}},translate:{method:function(e,t){return isNaN(e)&&(e=a),isNaN(t)&&(t=u),(e!==a||t!==u)&&(a=e,u=t,h(),!0)},type:["number","number"]},translateX:{get:function(){return a},set:function(e){return e!==a&&(a=e,h(),!0)},type:"number"},translateY:{get:function(){return u},set:function(e){return e!==u&&(u=e,h(),!0)},type:"number"},rotation:{get:function(){return c},set:function(e){return e!==c&&(c=parseFloat(e),h(),!0)},type:"number"},center:{method:function(e,t){return isNaN(e)&&(e=n),isNaN(t)&&(t=i),(e!==n||t!==i)&&(n=e,i=t,h(),!0)},type:["number","number"]},centerX:{get:function(){return n},set:function(e){return e!==n&&(n=e,h(),!0)},type:"number"},centerY:{get:function(){return i},set:function(e){return e!==i&&(i=e,h(),!0)},type:"number"},skew:{method:function(e,t){return isNaN(e)&&(e=l),isNaN(t)&&(t=f),(e!==l||t!==f)&&(l=e,f=t,h(),!0)},type:["number","number"]},skewX:{get:function(){return l},set:function(e){return e!==l&&(l=e,h(),!0)},type:"number"},skewY:{get:function(){return f},set:function(e){return e!==f&&(f=e,h(),!0)},type:"number"},scale:{method:function(e,t){var r,n;if(r=isNaN(e)?o:e,isNaN(t)){if(isNaN(e))return!1;n=r}else n=t;return(r!==o||n!==s)&&(o=r,s=n,h(),!0)},type:["number","number"]},scaleX:{get:function(){return o},set:function(e){return e!==o&&(o=e,h(),!0)},type:"number"},scaleY:{get:function(){return s},set:function(e){return e!==s&&(s=e,h(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var e=this,t=!0;function r(){var r=e.matrix;t?(r[0]=-1,r[5]=1):(r[0]=1,r[5]=-1)}return M.identity(e.matrix),r(),e.transformDirty=!0,e.transformed=!0,{inputs:{direction:{get:function(){return t?"horizontal":"vertical"},set:function(e){var n;return(n="vertical"!==e)!==t&&(t=n,r(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var e,t,r=this,n="contain";function i(){var i,o,s,a,u=r.matrix,c=e||r.width,l=t||r.height,f=r.source,h=f&&f.width||1,d=f&&f.height||1;"distort"===n||c===h&&l===d?r.transformed=!1:(s=h/d,a=c/l,"none"===n?(i=h/c,o=d/l):"width"===n||"contain"===n&&a<=s?(i=1,o=a/s):"height"===n||"contain"===n&&a>s?(i=s/a,o=1):a>s?(i=1,o=a/s):(i=s/a,o=1),1!==i||1!==o?(M.identity(u),1!==i&&(u[0]*=i,u[1]*=i,u[2]*=i,u[3]*=i),1!==o&&(u[4]*=o,u[5]*=o,u[6]*=o,u[7]*=o),r.transformed=!0):r.transformed=!1)}function o(){return e||r.source&&r.source.width||1}function s(){return t||r.source&&r.source.height||1}return this.resize=function(){var e,t=o(),r=s();if(this.width!==t||this.height!==r)for(this.width=t,this.height=r,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=r),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,r),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty(),i()},{inputs:{width:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},height:{get:s,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},mode:{get:function(){return n},set:function(e){return e!==n&&(n=e,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),u=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n";const J=X},6303:(e,t,r)=>{"use strict";r.r(t),r(6551).default.plugin("chroma",{shader:function(e,t){return t.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),t.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),t},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|v(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return Y(G(t,e.length-r),e,r,n)}function S(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return Y($(t),e,r,n)}function T(e,t,r,n){return Y(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.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===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){o=c[e],s=l[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function M(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function A(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function j(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function B(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function q(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},1227:(e,t,r)=>{var n=r(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},2114:e=>{"use strict";function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(r){n.message=e.message,n.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=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 i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){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,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8806:function(e,t,r){!function(e){function t(){}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===i.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function n(e){for(var t=0,r=Math.min(65536,e.length+1),n=new Uint16Array(r),i=[],o=0;;){var s=t<e.length;if(!s||o>=r-1){if(i.push(String.fromCharCode.apply(null,n.subarray(0,o))),!s)return i.join("");e=e.subarray(t),o=t=0}if(0==(128&(s=e[t++])))n[o++]=s;else if(192==(224&s)){var a=63&e[t++];n[o++]=(31&s)<<6|a}else if(224==(240&s)){a=63&e[t++];var u=63&e[t++];n[o++]=(31&s)<<12|a<<6|u}else 240==(248&s)&&(65535<(s=(7&s)<<18|(a=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++])&&(s-=65536,n[o++]=s>>>10&1023|55296,s=56320|1023&s),n[o++]=s)}}if(e.TextEncoder&&e.TextDecoder)return!1;var i=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var r=e.length,n=0,i=Math.max(32,r+(r>>>1)+7),o=new Uint8Array(i>>>3<<3);t<r;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<r){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(n+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[n++]=s;else{if(0==(4294965248&s))o[n++]=s>>>6&31|192;else if(0==(4294901760&s))o[n++]=s>>>12&15|224,o[n++]=s>>>6&63|128;else{if(0!=(4292870144&s))continue;o[n++]=s>>>18&7|240,o[n++]=s>>>12&63|128,o[n++]=s>>>6&63|128}o[n++]=63&s|128}}return o.slice?o.slice(0,n):o.subarray(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1});var o=n;"function"==typeof Buffer&&Buffer.from?o=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(e){try{var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"})),r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(),r.responseText}catch(t){return n(e)}finally{t&&URL.revokeObjectURL(t)}}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),o(e)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==r.g?r.g:this)},5177:e=>{e.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*v}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6486:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",S="[object Map]",E="[object Number]",T="[object Object]",O="[object Promise]",C="[object RegExp]",x="[object Set]",P="[object String]",R="[object Symbol]",M="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",k="[object Float32Array]",I="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",W="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,$=RegExp(H.source),Y=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",xe="\\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",Pe="["+we+"]",Re="["+xe+"]",Me="["+Se+"]",Ae="\\d+",je="["+Ee+"]",ke="["+Te+"]",Ie="[^"+we+xe+Ae+Ee+Te+Oe+"]",De="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Oe+"]",Be="\\u200d",We="(?:"+ke+"|"+Ie+")",Ve="(?:"+Ue+"|"+Ie+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Me+"|"+De+")?",Ge="["+Ce+"]?",$e=Ge+He+"(?:"+Be+"(?:"+[Ne,Le,Fe].join("|")+")"+Ge+He+")*",Ye="(?:"+[je,Le,Fe].join("|")+")"+$e,Ke="(?:"+[Ne+Me+"?",Me,Le,Fe,Pe].join("|")+")",Xe=RegExp("['’]","g"),Je=RegExp(Me,"g"),Ze=RegExp(De+"(?="+De+")|"+Ke+$e,"g"),Qe=RegExp([Ue+"?"+ke+"+"+qe+"(?="+[Re,Ue,"$"].join("|")+")",Ve+"+"+ze+"(?="+[Re,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+qe,Ue+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ye].join("|"),"g"),et=RegExp("["+Be+we+Se+Ce+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[k]=it[I]=it[D]=it[N]=it[L]=it[F]=it[U]=it[B]=it[W]=!0,it[v]=it[m]=it[A]=it[g]=it[j]=it[y]=it[b]=it[_]=it[S]=it[E]=it[T]=it[C]=it[x]=it[P]=it[M]=!1;var ot={};ot[v]=ot[m]=ot[A]=ot[j]=ot[g]=ot[y]=ot[k]=ot[I]=ot[D]=ot[N]=ot[L]=ot[S]=ot[E]=ot[T]=ot[C]=ot[x]=ot[P]=ot[R]=ot[F]=ot[U]=ot[B]=ot[W]=!0,ot[b]=ot[_]=ot[M]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ut=parseInt,ct="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ct||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,vt=pt&&ct.process,mt=function(){try{return dt&&dt.require&&dt.require("util").types||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Tt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function xt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Pt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Rt(e,t){return!(null==e||!e.length)&&Ut(e,t,0)>-1}function Mt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function jt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function kt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function It(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Dt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=qt("length");function Lt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Wt,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Wt(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:h}function qt(e){return function(t){return null==t?i:t[e]}}function zt(e){return function(t){return null==e?i:e[t]}}function Ht(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function $t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,fr(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return At(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var er=zt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function cr(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):Nt(e)}function lr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hr=zt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dr=function e(t){var r,n=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ee=t.Math,Te=t.Object,Oe=t.RegExp,Ce=t.String,xe=t.TypeError,Pe=n.prototype,Re=Se.prototype,Me=Te.prototype,Ae=t["__core-js_shared__"],je=Re.toString,ke=Me.hasOwnProperty,Ie=0,De=(r=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ne=Me.toString,Le=je.call(Te),Fe=ft._,Ue=Oe("^"+je.call(ke).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:i,We=t.Symbol,Ve=t.Uint8Array,qe=Be?Be.allocUnsafe:i,ze=or(Te.getPrototypeOf,Te),He=Te.create,Ge=Me.propertyIsEnumerable,$e=Pe.splice,Ye=We?We.isConcatSpreadable:i,Ke=We?We.iterator:i,Ze=We?We.toStringTag:i,et=function(){try{var e=uo(Te,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=Ee.ceil,dt=Ee.floor,vt=Te.getOwnPropertySymbols,mt=Be?Be.isBuffer:i,Nt=t.isFinite,zt=Pe.join,pr=or(Te.keys,Te),vr=Ee.max,mr=Ee.min,gr=ie.now,yr=t.parseInt,br=Ee.random,_r=Pe.reverse,wr=uo(t,"DataView"),Sr=uo(t,"Map"),Er=uo(t,"Promise"),Tr=uo(t,"Set"),Or=uo(t,"WeakMap"),Cr=uo(Te,"create"),xr=Or&&new Or,Pr={},Rr=Lo(wr),Mr=Lo(Sr),Ar=Lo(Er),jr=Lo(Tr),kr=Lo(Or),Ir=We?We.prototype:i,Dr=Ir?Ir.valueOf:i,Nr=Ir?Ir.toString:i;function Lr(e){if(ea(e)&&!qs(e)&&!(e instanceof Wr)){if(e instanceof Br)return e;if(ke.call(e,"__wrapped__"))return Fo(e)}return new Br(e)}var Fr=function(){function e(){}return function(t){if(!Qs(t))return{};if(He)return He(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Ur(){}function Br(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Wr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new zr;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new qr(e);this.size=t.size}function $r(e,t){var r=qs(e),n=!r&&Vs(e),i=!r&&!n&&$s(e),o=!r&&!n&&!i&&ua(e),s=r||n||i||o,a=s?$t(e.length,Ce):[],u=a.length;for(var c in e)!t&&!ke.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,u))||a.push(c);return a}function Yr(e){var t=e.length;return t?e[Hn(0,t-1)]:i}function Kr(e,t){return jo(Ci(e),on(t,0,e.length))}function Xr(e){return jo(Ci(e))}function Jr(e,t,r){(r!==i&&!Us(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];ke.call(e,t)&&Us(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Qr(e,t){for(var r=e.length;r--;)if(Us(e[r][0],t))return r;return-1}function en(e,t,r,n){return ln(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&xi(t,Ma(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Oa(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,u=1&t,c=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Qs(e))return e;var f=qs(e);if(f){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return Ci(e,a)}else{var h=fo(e),d=h==_||h==w;if($s(e))return _i(e,u);if(h==T||h==v||d&&!o){if(a=c||d?{}:po(e),!u)return c?function(e,t){return xi(e,lo(e),t)}(e,function(e,t){return e&&xi(t,Aa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,tn(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case A:return wi(e);case g:case y:return new i(+e);case j:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case k:case I:case D:case N:case L:case F:case U:case B:case W:return Si(e,r);case S:return new i;case E:case P: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 x:return new i;case R:return n=e,Dr?Te(Dr.call(n)):{}}}(e,h,u)}}s||(s=new Gr);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var m=f?i:(l?c?to:eo:c?Aa:Ma)(e);return Ot(m||e,(function(n,i){m&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Te(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function un(e,t,r){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,r)}),t)}function cn(e,t,r,n){var i=-1,o=Rt,s=!0,a=e.length,u=[],c=t.length;if(!a)return u;r&&(t=At(t,Kt(r))),n?(o=Mt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Hr(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var h=c;h--;)if(t[h]===f)continue e;u.push(l)}else o(t,f,n)||u.push(l)}return u}Lr.templateSettings={escape:K,evaluate:X,interpolate:J,variable:"",imports:{_:Lr}},Lr.prototype=Ur.prototype,Lr.prototype.constructor=Lr,Br.prototype=Fr(Ur.prototype),Br.prototype.constructor=Br,Wr.prototype=Fr(Ur.prototype),Wr.prototype.constructor=Wr,Vr.prototype.clear=function(){this.__data__=Cr?Cr(null):{},this.size=0},Vr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vr.prototype.get=function(e){var t=this.__data__;if(Cr){var r=t[e];return r===s?i:r}return ke.call(t,e)?t[e]:i},Vr.prototype.has=function(e){var t=this.__data__;return Cr?t[e]!==i:ke.call(t,e)},Vr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cr&&t===i?s:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=Qr(t,e);return!(r<0||(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,0))},qr.prototype.get=function(e){var t=this.__data__,r=Qr(t,e);return r<0?i:t[r][1]},qr.prototype.has=function(e){return Qr(this.__data__,e)>-1},qr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Vr,map:new(Sr||qr),string:new Vr}},zr.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},zr.prototype.get=function(e){return so(this,e).get(e)},zr.prototype.has=function(e){return so(this,e).has(e)},zr.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,s),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new qr,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!Sr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(e,t),this.size=r.size,this};var ln=Mi(yn),fn=Mi(bn,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function dn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(u===i?a==a&&!aa(a):r(a,u)))var u=a,c=s}return c}function pn(e,t){var r=[];return ln(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function vn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=vo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?vn(a,t-1,r,n,i):jt(i,a):n||(i[i.length]=a)}return i}var mn=Ai(),gn=Ai(!0);function yn(e,t){return e&&mn(e,t,Ma)}function bn(e,t){return e&&gn(e,t,Ma)}function _n(e,t){return Pt(t,(function(t){return Xs(e[t])}))}function wn(e,t){for(var r=0,n=(t=mi(t,e)).length;null!=e&&r<n;)e=e[No(t[r++])];return r&&r==n?e:i}function Sn(e,t,r){var n=t(e);return qs(e)?n:jt(n,r(e))}function En(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Te(e)?function(e){var t=ke.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=Ne.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return Ne.call(e)}(e)}function Tn(e,t){return e>t}function On(e,t){return null!=e&&ke.call(e,t)}function Cn(e,t){return null!=e&&t in Te(e)}function xn(e,t,r){for(var o=r?Mt:Rt,s=e[0].length,a=e.length,u=a,c=n(a),l=1/0,f=[];u--;){var h=e[u];u&&t&&(h=At(h,Kt(t))),l=mr(h.length,l),c[u]=!r&&(t||s>=120&&h.length>=120)?new Hr(u&&h):i}h=e[0];var d=-1,p=c[0];e:for(;++d<s&&f.length<l;){var v=h[d],m=t?t(v):v;if(v=r||0!==v?v:0,!(p?Jt(p,m):o(f,m,r))){for(u=a;--u;){var g=c[u];if(!(g?Jt(g,m):o(e[u],m,r)))continue e}p&&p.push(m),f.push(v)}}return f}function Pn(e,t,r){var n=null==(e=Oo(e,t=mi(t,e)))?e:e[No(Ko(t))];return null==n?i:Et(n,e,r)}function Rn(e){return ea(e)&&En(e)==v}function Mn(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=qs(e),u=qs(t),c=a?m:fo(e),l=u?m:fo(t),f=(c=c==v?T:c)==T,h=(l=l==v?T:l)==T,d=c==l;if(d&&$s(e)){if(!$s(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Gr),a||ua(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case y:case E:return Us(+e,+t);case b:return e.name==t.name&&e.message==t.message;case C:case P:return e==t+"";case S:var a=ir;case x:var u=1&n;if(a||(a=ar),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var l=Zi(a(e),a(t),n,i,o,s);return s.delete(e),l;case R:if(Dr)return Dr.call(e)==Dr.call(t)}return!1}(e,t,c,r,n,o,s);if(!(1&r)){var p=f&&ke.call(e,"__wrapped__"),_=h&&ke.call(t,"__wrapped__");if(p||_){var w=p?e.value():e,O=_?t.value():t;return s||(s=new Gr),o(w,O,r,n,s)}}return!!d&&(s||(s=new Gr),function(e,t,r,n,o,s){var a=1&r,u=eo(e),c=u.length;if(c!=eo(t).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in t:ke.call(t,f)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=a;++l<c;){var m=e[f=u[l]],g=t[f];if(n)var y=a?n(g,m,f,t,e,s):n(m,g,f,e,t,s);if(!(y===i?m===g||o(m,g,r,n,s):y)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,r,n,o,s))}(e,t,r,n,Mn,o))}function An(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Te(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=r[o])[0],l=e[c],f=u[1];if(a&&u[2]){if(l===i&&!(c in e))return!1}else{var h=new Gr;if(n)var d=n(l,f,c,e,t,h);if(!(d===i?Mn(f,l,3,n,h):d))return!1}}return!0}function jn(e){return!(!Qs(e)||(t=e,De&&De in t))&&(Xs(e)?Ue:ve).test(Lo(e));var t}function kn(e){return"function"==typeof e?e:null==e?ru:"object"==typeof e?qs(e)?Fn(e[0],e[1]):Ln(e):fu(e)}function In(e){if(!wo(e))return pr(e);var t=[];for(var r in Te(e))ke.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Dn(e,t){return e<t}function Nn(e,t){var r=-1,i=Hs(e)?n(e.length):[];return ln(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Ln(e){var t=ao(e);return 1==t.length&&t[0][2]?Eo(t[0][0],t[0][1]):function(r){return r===e||An(r,e,t)}}function Fn(e,t){return yo(e)&&So(t)?Eo(No(e),t):function(r){var n=Oa(r,e);return n===i&&n===t?Ca(r,e):Mn(t,n,3)}}function Un(e,t,r,n,o){e!==t&&mn(t,(function(s,a){if(o||(o=new Gr),Qs(s))!function(e,t,r,n,o,s,a){var u=Co(e,r),c=Co(t,r),l=a.get(c);if(l)Jr(e,r,l);else{var f=s?s(u,c,r+"",e,t,a):i,h=f===i;if(h){var d=qs(c),p=!d&&$s(c),v=!d&&!p&&ua(c);f=c,d||p||v?qs(u)?f=u:Gs(u)?f=Ci(u):p?(h=!1,f=_i(c,!0)):v?(h=!1,f=Si(c,!0)):f=[]:na(c)||Vs(c)?(f=u,Vs(u)?f=ma(u):Qs(u)&&!Xs(u)||(f=po(c))):h=!1}h&&(a.set(c,f),o(f,c,n,s,a),a.delete(c)),Jr(e,r,f)}}(e,t,a,r,Un,n,o);else{var u=n?n(Co(e,a),s,a+"",e,t,o):i;u===i&&(u=s),Jr(e,a,u)}}),Aa)}function Bn(e,t){var r=e.length;if(r)return mo(t+=t<0?r:0,r)?e[t]:i}function Wn(e,t,r){t=t.length?At(t,(function(e){return qs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[ru];var n=-1;t=At(t,Kt(oo()));var i=Nn(e,(function(e,r,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var u=Ei(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Vn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Xn(o,mi(s,e),a)}return o}function qn(e,t,r,n){var i=n?Bt:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Ci(t)),r&&(a=At(e,Kt(r)));++o<s;)for(var u=0,c=t[o],l=r?r(c):c;(u=i(a,l,u,n))>-1;)a!==e&&$e.call(a,u,1),$e.call(e,u,1);return e}function zn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;mo(i)?$e.call(e,i,1):ui(e,i)}}return e}function Hn(e,t){return e+dt(br()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function $n(e,t){return Ro(To(e,t,ru),e+"")}function Yn(e){return Yr(Ua(e))}function Kn(e,t){var r=Ua(e);return jo(r,on(t,0,r.length))}function Xn(e,t,r,n){if(!Qs(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,u=e;null!=u&&++o<s;){var c=No(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];(l=n?n(f,c,u):i)===i&&(l=Qs(f)?f:mo(t[o+1])?[]:{})}Zr(u,c,l),u=u[c]}return e}var Jn=xr?function(e,t){return xr.set(e,t),e}:ru,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qa(t),writable:!0})}:ru;function Qn(e){return jo(Ua(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return ln(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,ru,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,u=null===t,c=aa(t),l=t===i;o<s;){var f=dt((o+s)/2),h=r(e[f]),d=h!==i,p=null===h,v=h==h,m=aa(h);if(a)var g=n||v;else g=l?v&&(n||d):u?v&&d&&(n||!p):c?v&&d&&!p&&(n||!m):!p&&!m&&(n?h<=t:h<t);g?o=f+1:s=f}return mr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Us(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(qs(e))return At(e,si)+"";if(aa(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Rt,o=e.length,s=!0,a=[],u=a;if(r)s=!1,i=Mt;else if(o>=200){var c=t?null:Gi(e);if(c)return ar(c);s=!1,i=Jt,u=new Hr}else u=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue e;t&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function ui(e,t){return null==(e=Oo(e,t=mi(t,e)))||delete e[No(Ko(t))]}function ci(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function li(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Wr&&(r=r.value()),kt(t,(function(e,t){return t.func.apply(t.thisArg,jt([e],t.args))}),r)}function hi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],u=-1;++u<i;)u!=o&&(s[o]=cn(s[o]||a,e[u],t,r));return ai(vn(s,1),t,r)}function di(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var u=n<s?t[n]:i;r(a,e[n],u)}return a}function pi(e){return Gs(e)?e:[]}function vi(e){return"function"==typeof e?e:ru}function mi(e,t){return qs(e)?e:yo(e,t)?[e]:Do(ga(e))}var gi=$n;function yi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var bi=st||function(e){return ft.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=qe?qe(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ei(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,u=null===t,c=t==t,l=aa(t);if(!u&&!l&&!s&&e>t||s&&a&&c&&!u&&!l||n&&a&&c||!r&&c||!o)return 1;if(!n&&!s&&!l&&e<t||l&&r&&o&&!n&&!s||u&&r&&o||!a&&o||!c)return-1}return 0}function Ti(e,t,r,i){for(var o=-1,s=e.length,a=r.length,u=-1,c=t.length,l=vr(s-a,0),f=n(c+l),h=!i;++u<c;)f[u]=t[u];for(;++o<a;)(h||o<s)&&(f[r[o]]=e[o]);for(;l--;)f[u++]=e[o++];return f}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=-1,u=r.length,c=-1,l=t.length,f=vr(s-u,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++c<l;)h[p+c]=t[c];for(;++a<u;)(d||o<s)&&(h[p+r[a]]=e[o++]);return h}function Ci(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function xi(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var u=t[s],c=n?n(r[u],e[u],u,r,e):i;c===i&&(c=e[u]),o?rn(r,u,c):Zr(r,u,c)}return r}function Pi(e,t){return function(r,n){var i=qs(r)?Tt:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Ri(e){return $n((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&go(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Te(t);++n<o;){var u=r[n];u&&e(t,u,n,s)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Hs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Te(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ai(e){return function(t,r,n){for(var i=-1,o=Te(t),s=n(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===r(o[u],u,o))break}return t}}function ji(e){return function(t){var r=nr(t=ga(t))?lr(t):i,n=r?r[0]:t.charAt(0),o=r?yi(r,1).join(""):t.slice(1);return n[e]()+o}}function ki(e){return function(t){return kt(Xa(Va(t).replace(Xe,"")),e,"")}}function Ii(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Qs(n)?n:r}}function Di(e){return function(t,r,n){var o=Te(t);if(!Hs(t)){var s=oo(r,3);t=Ma(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function Ni(e){return Qi((function(t){var r=t.length,n=r,s=Br.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new xe(o);if(s&&!u&&"wrapper"==no(a))var u=new Br([],!0)}for(n=u?n:r;++n<r;){var c=no(a=t[n]),l="wrapper"==c?ro(a):i;u=l&&bo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[no(l[0])].apply(u,l[3]):1==a.length&&bo(a)?u[c]():u.thru(a)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&qs(n))return u.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Li(e,t,r,o,s,a,u,l,f,h){var d=t&c,p=1&t,v=2&t,m=24&t,g=512&t,y=v?i:Ii(e);return function c(){for(var b=arguments.length,_=n(b),w=b;w--;)_[w]=arguments[w];if(m)var S=io(c),E=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,S);if(o&&(_=Ti(_,o,s,m)),a&&(_=Oi(_,a,u,m)),b-=E,m&&b<h){var T=sr(_,S);return zi(e,t,Li,c.placeholder,r,_,T,l,f,h-b)}var O=p?r:this,C=v?O[e]:e;return b=_.length,l?_=function(e,t){for(var r=e.length,n=mr(t.length,r),o=Ci(e);n--;){var s=t[n];e[n]=mo(s,r)?o[s]:i}return e}(_,l):g&&b>1&&_.reverse(),d&&f<b&&(_.length=f),this&&this!==ft&&this instanceof c&&(C=y||Ii(C)),C.apply(O,_)}}function Fi(e,t){return function(r,n){return function(e,t,r,n){return yn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Ui(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Bi(e){return Qi((function(t){return t=At(t,Kt(oo())),$n((function(r){var n=this;return e(t,(function(e){return Et(e,n,r)}))}))}))}function Wi(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Gn(t,e):t;var n=Gn(t,ht(e/cr(t)));return nr(t)?yi(lr(n),0,e).join(""):n.slice(0,e)}function Vi(e){return function(t,r,o){return o&&"number"!=typeof o&&go(t,r,o)&&(r=o=i),t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r,i){for(var o=-1,s=vr(ht((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:ha(o),e)}}function qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=va(t),r=va(r)),e(t,r)}}function zi(e,t,r,n,o,s,a,c,l,f){var h=8&t;t|=h?u:64,4&(t&=~(h?64:u))||(t&=-4);var d=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,l,f],p=r.apply(i,d);return bo(e)&&xo(p,d),p.placeholder=n,Mo(p,e,t)}function Hi(e){var t=Ee[e];return function(e,r){if(e=va(e),(r=null==r?0:mr(da(r),292))&&Nt(e)){var n=(ga(e)+"e").split("e");return+((n=(ga(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Gi=Tr&&1/ar(new Tr([,-0]))[1]==l?function(e){return new Tr(e)}:au;function $i(e){return function(t){var r=fo(t);return r==S?ir(t):r==x?ur(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Yi(e,t,r,s,l,f,h,d){var p=2&t;if(!p&&"function"!=typeof e)throw new xe(o);var v=s?s.length:0;if(v||(t&=-97,s=l=i),h=h===i?h:vr(da(h),0),d=d===i?d:da(d),v-=l?l.length:0,64&t){var m=s,g=l;s=l=i}var y=p?i:ro(e),b=[e,t,r,s,l,m,g,f,h,d];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==c&&8==r||n==c&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?Ti(l,u,t[4]):u,e[4]=l?sr(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Oi(l,u,t[6]):u,e[6]=l?sr(e[5],a):t[6]),(u=t[7])&&(e[7]=u),n&c&&(e[8]=null==e[8]?t[8]:mr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],r=b[2],s=b[3],l=b[4],!(d=b[9]=b[9]===i?p?0:e.length:vr(b[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Ii(e);return function s(){for(var a=arguments.length,u=n(a),c=a,l=io(s);c--;)u[c]=arguments[c];var f=a<3&&u[0]!==l&&u[a-1]!==l?[]:sr(u,l);return(a-=f.length)<r?zi(e,t,Li,s.placeholder,i,u,f,i,i,r-a):Et(this&&this!==ft&&this instanceof s?o:e,this,u)}}(e,t,d):t!=u&&33!=t||l.length?Li.apply(i,b):function(e,t,r,i){var o=1&t,s=Ii(e);return function t(){for(var a=-1,u=arguments.length,c=-1,l=i.length,f=n(l+u),h=this&&this!==ft&&this instanceof t?s:e;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++a];return Et(h,o?r:this,f)}}(e,t,r,s);else var _=function(e,t,r){var n=1&t,i=Ii(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Mo((y?Jn:xo)(_,b),e,t)}function Ki(e,t,r,n){return e===i||Us(e,Me[r])&&!ke.call(n,r)?t:e}function Xi(e,t,r,n,o,s){return Qs(e)&&Qs(t)&&(s.set(t,e),Un(e,t,i,Xi,s),s.delete(t)),e}function Ji(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&r?new Hr:i;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],m=t[h];if(n)var g=a?n(m,v,h,t,e,s):n(v,m,h,e,t,s);if(g!==i){if(g)continue;d=!1;break}if(p){if(!Dt(t,(function(e,t){if(!Jt(p,t)&&(v===e||o(v,e,r,n,s)))return p.push(t)}))){d=!1;break}}else if(v!==m&&!o(v,m,r,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Qi(e){return Ro(To(e,i,zo),e+"")}function eo(e){return Sn(e,Ma,co)}function to(e){return Sn(e,Aa,lo)}var ro=xr?function(e){return xr.get(e)}:au;function no(e){for(var t=e.name+"",r=Pr[t],n=ke.call(Pr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(ke.call(Lr,"placeholder")?Lr:e).placeholder}function oo(){var e=Lr.iteratee||nu;return e=e===nu?kn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ma(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return jn(r)?r:i}var co=vt?function(e){return null==e?[]:(e=Te(e),Pt(vt(e),(function(t){return Ge.call(e,t)})))}:pu,lo=vt?function(e){for(var t=[];e;)jt(t,co(e)),e=ze(e);return t}:pu,fo=En;function ho(e,t,r){for(var n=-1,i=(t=mi(t,e)).length,o=!1;++n<i;){var s=No(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&mo(s,i)&&(qs(e)||Vs(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fr(ze(e))}function vo(e){return qs(e)||Vs(e)||!!(Ye&&e&&e[Ye])}function mo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function go(e,t,r){if(!Qs(r))return!1;var n=typeof t;return!!("number"==n?Hs(r)&&mo(t,r.length):"string"==n&&t in r)&&Us(r[t],e)}function yo(e,t){if(qs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||Q.test(e)||!Z.test(e)||null!=t&&e in Te(t)}function bo(e){var t=no(e),r=Lr[t];if("function"!=typeof r||!(t in Wr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=j||Sr&&fo(new Sr)!=S||Er&&fo(Er.resolve())!=O||Tr&&fo(new Tr)!=x||Or&&fo(new Or)!=M)&&(fo=function(e){var t=En(e),r=t==T?e.constructor:i,n=r?Lo(r):"";if(n)switch(n){case Rr:return j;case Mr:return S;case Ar:return O;case jr:return x;case kr:return M}return t});var _o=Ae?Xs:vu;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function So(e){return e==e&&!Qs(e)}function Eo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Te(r))}}function To(e,t,r){return t=vr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=vr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=n(t+1);++o<t;)u[o]=i[o];return u[t]=r(a),Et(e,this,u)}}function Oo(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function Co(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Ao(Jn),Po=lt||function(e,t){return ft.setTimeout(e,t)},Ro=Ao(Zn);function Mo(e,t,r){var n=t+"";return Ro(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ot(p,(function(r){var n="_."+r[0];t&r[1]&&!Rt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Ao(e){var t=0,r=0;return function(){var n=gr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function jo(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=Hn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var ko,Io,Do=(ko=ks((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)})),t}),(function(e){return 500===Io.size&&Io.clear(),e})),Io=ko.cache,ko);function No(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Wr)return e.clone();var t=new Br(e.__wrapped__,e.__chain__);return t.__actions__=Ci(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Uo=$n((function(e,t){return Gs(e)?cn(e,vn(t,1,Gs,!0)):[]})),Bo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),oo(r,2)):[]})),Wo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),i,r):[]}));function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ft(e,oo(t,3),i)}function qo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=da(r),o=r<0?vr(n+o,0):mr(o,n-1)),Ft(e,oo(t,3),o,!0)}function zo(e){return null!=e&&e.length?vn(e,1):[]}function Ho(e){return e&&e.length?e[0]:i}var Go=$n((function(e){var t=At(e,pi);return t.length&&t[0]===e[0]?xn(t):[]})),$o=$n((function(e){var t=Ko(e),r=At(e,pi);return t===Ko(r)?t=i:r.pop(),r.length&&r[0]===e[0]?xn(r,oo(t,2)):[]})),Yo=$n((function(e){var t=Ko(e),r=At(e,pi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?xn(r,i,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=$n(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qn(e,t):e}var Zo=Qi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return zn(e,At(t,(function(e){return mo(e,r)?+e:e})).sort(Ei)),n}));function Qo(e){return null==e?e:_r.call(e)}var es=$n((function(e){return ai(vn(e,1,Gs,!0))})),ts=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),ai(vn(e,1,Gs,!0),oo(t,2))})),rs=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,ai(vn(e,1,Gs,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Gs(e))return t=vr(e.length,t),!0})),$t(t,(function(t){return At(e,qt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:At(r,(function(e){return Et(t,i,e)}))}var os=$n((function(e,t){return Gs(e)?cn(e,t):[]})),ss=$n((function(e){return hi(Pt(e,Gs))})),as=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),hi(Pt(e,Gs),oo(t,2))})),us=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,hi(Pt(e,Gs),i,t)})),cs=$n(ns),ls=$n((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function fs(e){var t=Lr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Qi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Wr&&mo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Br(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Pi((function(e,t,r){ke.call(e,r)?++e[r]:rn(e,r,1)})),vs=Di(Vo),ms=Di(qo);function gs(e,t){return(qs(e)?Ot:ln)(e,oo(t,3))}function ys(e,t){return(qs(e)?Ct:fn)(e,oo(t,3))}var bs=Pi((function(e,t,r){ke.call(e,r)?e[r].push(t):rn(e,r,[t])})),_s=$n((function(e,t,r){var i=-1,o="function"==typeof t,s=Hs(e)?n(e.length):[];return ln(e,(function(e){s[++i]=o?Et(t,e,r):Pn(e,t,r)})),s})),ws=Pi((function(e,t,r){rn(e,r,t)}));function Ss(e,t){return(qs(e)?At:Nn)(e,oo(t,3))}var Es=Pi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ts=$n((function(e,t){if(null==e)return[];var r=t.length;return r>1&&go(e,t[0],t[1])?t=[]:r>2&&go(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,vn(t,1),[])})),Os=ct||function(){return ft.Date.now()};function Cs(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Yi(e,c,i,i,i,i,t)}function xs(e,t){var r;if("function"!=typeof t)throw new xe(o);return e=da(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ps=$n((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ps));n|=u}return Yi(e,n,t,r,i)})),Rs=$n((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Rs));n|=u}return Yi(t,n,e,r,i)}));function Ms(e,t,r){var n,s,a,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new xe(o);function v(t){var r=n,o=s;return n=s=i,f=t,u=e.apply(o,r)}function m(e){var r=e-l;return l===i||r>=t||r<0||d&&e-f>=a}function g(){var e=Os();if(m(e))return y(e);c=Po(g,function(e){var r=t-(e-l);return d?mr(r,a-(e-f)):r}(e))}function y(e){return c=i,p&&n?v(e):(n=s=i,u)}function b(){var e=Os(),r=m(e);if(n=arguments,s=this,l=e,r){if(c===i)return function(e){return f=e,c=Po(g,t),h?v(e):u}(l);if(d)return bi(c),c=Po(g,t),v(l)}return c===i&&(c=Po(g,t)),u}return t=va(t)||0,Qs(r)&&(h=!!r.leading,a=(d="maxWait"in r)?vr(va(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),b.cancel=function(){c!==i&&bi(c),f=0,n=l=s=c=i},b.flush=function(){return c===i?u:y(Os())},b}var As=$n((function(e,t){return un(e,1,t)})),js=$n((function(e,t,r){return un(e,va(t)||0,r)}));function ks(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(ks.Cache||zr),r}function Is(e){if("function"!=typeof e)throw new xe(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)}}ks.Cache=zr;var Ds=gi((function(e,t){var r=(t=1==t.length&&qs(t[0])?At(t[0],Kt(oo())):At(vn(t,1),Kt(oo()))).length;return $n((function(n){for(var i=-1,o=mr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Et(e,this,n)}))})),Ns=$n((function(e,t){var r=sr(t,io(Ns));return Yi(e,u,i,t,r)})),Ls=$n((function(e,t){var r=sr(t,io(Ls));return Yi(e,64,i,t,r)})),Fs=Qi((function(e,t){return Yi(e,256,i,i,i,t)}));function Us(e,t){return e===t||e!=e&&t!=t}var Bs=qi(Tn),Ws=qi((function(e,t){return e>=t})),Vs=Rn(function(){return arguments}())?Rn:function(e){return ea(e)&&ke.call(e,"callee")&&!Ge.call(e,"callee")},qs=n.isArray,zs=gt?Kt(gt):function(e){return ea(e)&&En(e)==A};function Hs(e){return null!=e&&Zs(e.length)&&!Xs(e)}function Gs(e){return ea(e)&&Hs(e)}var $s=mt||vu,Ys=yt?Kt(yt):function(e){return ea(e)&&En(e)==y};function Ks(e){if(!ea(e))return!1;var t=En(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Xs(e){if(!Qs(e))return!1;var t=En(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==da(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Kt(bt):function(e){return ea(e)&&fo(e)==S};function ra(e){return"number"==typeof e||ea(e)&&En(e)==E}function na(e){if(!ea(e)||En(e)!=T)return!1;var t=ze(e);if(null===t)return!0;var r=ke.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==Le}var ia=_t?Kt(_t):function(e){return ea(e)&&En(e)==C},oa=wt?Kt(wt):function(e){return ea(e)&&fo(e)==x};function sa(e){return"string"==typeof e||!qs(e)&&ea(e)&&En(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&En(e)==R}var ua=St?Kt(St):function(e){return ea(e)&&Zs(e.length)&&!!it[En(e)]},ca=qi(Dn),la=qi((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(Hs(e))return sa(e)?lr(e):Ci(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=fo(e);return(t==S?ir:t==x?ar:Ua)(e)}function ha(e){return e?(e=va(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),r=t%1;return t==t?r?t-r:t:0}function pa(e){return e?on(da(e),0,d):0}function va(e){if("number"==typeof e)return e;if(aa(e))return h;if(Qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=pe.test(e);return r||me.test(e)?ut(e.slice(2),r?2:8):de.test(e)?h:+e}function ma(e){return xi(e,Aa(e))}function ga(e){return null==e?"":si(e)}var ya=Ri((function(e,t){if(wo(t)||Hs(t))xi(t,Ma(t),e);else for(var r in t)ke.call(t,r)&&Zr(e,r,t[r])})),ba=Ri((function(e,t){xi(t,Aa(t),e)})),_a=Ri((function(e,t,r,n){xi(t,Aa(t),e,n)})),wa=Ri((function(e,t,r,n){xi(t,Ma(t),e,n)})),Sa=Qi(nn),Ea=$n((function(e,t){e=Te(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&go(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Aa(s),u=-1,c=a.length;++u<c;){var l=a[u],f=e[l];(f===i||Us(f,Me[l])&&!ke.call(e,l))&&(e[l]=s[l])}return e})),Ta=$n((function(e){return e.push(i,Xi),Et(ka,i,e)}));function Oa(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ca(e,t){return null!=e&&ho(e,t,Cn)}var xa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),Qa(ru)),Pa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ke.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Ra=$n(Pn);function Ma(e){return Hs(e)?$r(e):In(e)}function Aa(e){return Hs(e)?$r(e,!0):function(e){if(!Qs(e))return function(e){var t=[];if(null!=e)for(var r in Te(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&ke.call(e,n))&&r.push(n);return r}(e)}var ja=Ri((function(e,t,r){Un(e,t,r)})),ka=Ri((function(e,t,r,n){Un(e,t,r,n)})),Ia=Qi((function(e,t){var r={};if(null==e)return r;var n=!1;t=At(t,(function(t){return t=mi(t,e),n||(n=t.length>1),t})),xi(e,to(e),r),n&&(r=sn(r,7,Ji));for(var i=t.length;i--;)ui(r,t[i]);return r})),Da=Qi((function(e,t){return null==e?{}:function(e,t){return Vn(e,t,(function(t,r){return Ca(e,r)}))}(e,t)}));function Na(e,t){if(null==e)return{};var r=At(to(e),(function(e){return[e]}));return t=oo(t),Vn(e,r,(function(e,r){return t(e,r[0])}))}var La=$i(Ma),Fa=$i(Aa);function Ua(e){return null==e?[]:Xt(e,Ma(e))}var Ba=ki((function(e,t,r){return t=t.toLowerCase(),e+(r?Wa(t):t)}));function Wa(e){return Ka(ga(e).toLowerCase())}function Va(e){return(e=ga(e))&&e.replace(ye,er).replace(Je,"")}var qa=ki((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),za=ki((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ha=ji("toLowerCase"),Ga=ki((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),$a=ki((function(e,t,r){return e+(r?" ":"")+Ka(t)})),Ya=ki((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ka=ji("toUpperCase");function Xa(e,t,r){return e=ga(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=$n((function(e,t){try{return Et(e,i,t)}catch(e){return Ks(e)?e:new we(e)}})),Za=Qi((function(e,t){return Ot(t,(function(t){t=No(t),rn(e,t,Ps(e[t],e))})),e}));function Qa(e){return function(){return e}}var eu=Ni(),tu=Ni(!0);function ru(e){return e}function nu(e){return kn("function"==typeof e?e:sn(e,1))}var iu=$n((function(e,t){return function(r){return Pn(r,e,t)}})),ou=$n((function(e,t){return function(r){return Pn(e,r,t)}}));function su(e,t,r){var n=Ma(t),i=_n(t,n);null!=r||Qs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ma(t)));var o=!(Qs(r)&&"chain"in r&&!r.chain),s=Xs(e);return Ot(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ci(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function au(){}var uu=Bi(At),cu=Bi(xt),lu=Bi(Dt);function fu(e){return yo(e)?qt(No(e)):function(e){return function(t){return wn(t,e)}}(e)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var mu,gu=Ui((function(e,t){return e+t}),0),yu=Hi("ceil"),bu=Ui((function(e,t){return e/t}),1),_u=Hi("floor"),wu=Ui((function(e,t){return e*t}),1),Su=Hi("round"),Eu=Ui((function(e,t){return e-t}),0);return Lr.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=Cs,Lr.assign=ya,Lr.assignIn=ba,Lr.assignInWith=_a,Lr.assignWith=wa,Lr.at=Sa,Lr.before=xs,Lr.bind=Ps,Lr.bindAll=Za,Lr.bindKey=Rs,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Lr.chain=fs,Lr.chunk=function(e,t,r){t=(r?go(e,t,r):t===i)?1:vr(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,u=n(ht(o/t));s<o;)u[a++]=ei(e,s,s+=t);return u},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return jt(qs(r)?Ci(r):[r],vn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[r(e[0]),e[1]]})):[],$n((function(r){for(var n=-1;++n<t;){var i=e[n];if(Et(i[0],this,r))return Et(i[1],this,r)}}))},Lr.conforms=function(e){return function(e){var t=Ma(e);return function(r){return an(r,e,t)}}(sn(e,1))},Lr.constant=Qa,Lr.countBy=ps,Lr.create=function(e,t){var r=Fr(e);return null==t?r:tn(r,t)},Lr.curry=function e(t,r,n){var o=Yi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.curryRight=function e(t,r,n){var o=Yi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.debounce=Ms,Lr.defaults=Ea,Lr.defaultsDeep=Ta,Lr.defer=As,Lr.delay=js,Lr.difference=Uo,Lr.differenceBy=Bo,Lr.differenceWith=Wo,Lr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:da(t))<0?0:t,n):[]},Lr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:da(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Lr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&go(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=da(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:da(n))<0&&(n+=o),n=r>n?0:pa(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Lr.filter=function(e,t){return(qs(e)?Pt:pn)(e,oo(t,3))},Lr.flatMap=function(e,t){return vn(Ss(e,t),1)},Lr.flatMapDeep=function(e,t){return vn(Ss(e,t),l)},Lr.flatMapDepth=function(e,t,r){return r=r===i?1:da(r),vn(Ss(e,t),r)},Lr.flatten=zo,Lr.flattenDeep=function(e){return null!=e&&e.length?vn(e,l):[]},Lr.flattenDepth=function(e,t){return null!=e&&e.length?vn(e,t=t===i?1:da(t)):[]},Lr.flip=function(e){return Yi(e,512)},Lr.flow=eu,Lr.flowRight=tu,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Lr.functions=function(e){return null==e?[]:_n(e,Ma(e))},Lr.functionsIn=function(e){return null==e?[]:_n(e,Aa(e))},Lr.groupBy=bs,Lr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Lr.intersection=Go,Lr.intersectionBy=$o,Lr.intersectionWith=Yo,Lr.invert=xa,Lr.invertBy=Pa,Lr.invokeMap=_s,Lr.iteratee=nu,Lr.keyBy=ws,Lr.keys=Ma,Lr.keysIn=Aa,Lr.map=Ss,Lr.mapKeys=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Lr.mapValues=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Lr.matches=function(e){return Ln(sn(e,1))},Lr.matchesProperty=function(e,t){return Fn(e,sn(t,1))},Lr.memoize=ks,Lr.merge=ja,Lr.mergeWith=ka,Lr.method=iu,Lr.methodOf=ou,Lr.mixin=su,Lr.negate=Is,Lr.nthArg=function(e){return e=da(e),$n((function(t){return Bn(t,e)}))},Lr.omit=Ia,Lr.omitBy=function(e,t){return Na(e,Is(oo(t)))},Lr.once=function(e){return xs(2,e)},Lr.orderBy=function(e,t,r,n){return null==e?[]:(qs(t)||(t=null==t?[]:[t]),qs(r=n?i:r)||(r=null==r?[]:[r]),Wn(e,t,r))},Lr.over=uu,Lr.overArgs=Ds,Lr.overEvery=cu,Lr.overSome=lu,Lr.partial=Ns,Lr.partialRight=Ls,Lr.partition=Es,Lr.pick=Da,Lr.pickBy=Na,Lr.property=fu,Lr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Lr.pull=Xo,Lr.pullAll=Jo,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,oo(r,2)):e},Lr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,i,r):e},Lr.pullAt=Zo,Lr.range=hu,Lr.rangeRight=du,Lr.rearg=Fs,Lr.reject=function(e,t){return(qs(e)?Pt:pn)(e,Is(oo(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return zn(e,i),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return $n(e,t=t===i?t:da(t))},Lr.reverse=Qo,Lr.sampleSize=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),(qs(e)?Kr:Kn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Lr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Xn(e,t,r,n)},Lr.shuffle=function(e){return(qs(e)?Xr:Qn)(e)},Lr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&go(e,t,r)?(t=0,r=n):(t=null==t?0:da(t),r=r===i?n:da(r)),ei(e,t,r)):[]},Lr.sortBy=Ts,Lr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Lr.split=function(e,t,r){return r&&"number"!=typeof r&&go(e,t,r)&&(t=r=i),(r=r===i?d:r>>>0)?(e=ga(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?yi(lr(e),0,r):e.split(t,r):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:vr(da(t),0),$n((function(r){var n=r[t],i=yi(r,0,t);return n&&jt(i,n),Et(e,this,i)}))},Lr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Lr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:da(t))<0?0:t):[]},Lr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:da(t)))<0?0:t,n):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new xe(o);return Qs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ms(e,t,{leading:n,maxWait:t,trailing:i})},Lr.thru=hs,Lr.toArray=fa,Lr.toPairs=La,Lr.toPairsIn=Fa,Lr.toPath=function(e){return qs(e)?At(e,No):aa(e)?[e]:Ci(Do(ga(e)))},Lr.toPlainObject=ma,Lr.transform=function(e,t,r){var n=qs(e),i=n||$s(e)||ua(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qs(e)&&Xs(o)?Fr(ze(e)):{}}return(i?Ot:yn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Lr.unary=function(e){return Cs(e,1)},Lr.union=es,Lr.unionBy=ts,Lr.unionWith=rs,Lr.uniq=function(e){return e&&e.length?ai(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Lr.unset=function(e,t){return null==e||ui(e,t)},Lr.unzip=ns,Lr.unzipWith=is,Lr.update=function(e,t,r){return null==e?e:ci(e,t,vi(r))},Lr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ci(e,t,vi(r),n)},Lr.values=Ua,Lr.valuesIn=function(e){return null==e?[]:Xt(e,Aa(e))},Lr.without=os,Lr.words=Xa,Lr.wrap=function(e,t){return Ns(vi(t),e)},Lr.xor=ss,Lr.xorBy=as,Lr.xorWith=us,Lr.zip=cs,Lr.zipObject=function(e,t){return di(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return di(e||[],t||[],Xn)},Lr.zipWith=ls,Lr.entries=La,Lr.entriesIn=Fa,Lr.extend=ba,Lr.extendWith=_a,su(Lr,Lr),Lr.add=gu,Lr.attempt=Ja,Lr.camelCase=Ba,Lr.capitalize=Wa,Lr.ceil=yu,Lr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=va(r))==r?r:0),t!==i&&(t=(t=va(t))==t?t:0),on(va(e),t,r)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Ma(t))},Lr.deburr=Va,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=bu,Lr.endsWith=function(e,t,r){e=ga(e),t=si(t);var n=e.length,o=r=r===i?n:on(da(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Lr.eq=Us,Lr.escape=function(e){return(e=ga(e))&&Y.test(e)?e.replace(G,tr):e},Lr.escapeRegExp=function(e){return(e=ga(e))&&re.test(e)?e.replace(te,"\\$&"):e},Lr.every=function(e,t,r){var n=qs(e)?xt:hn;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.find=vs,Lr.findIndex=Vo,Lr.findKey=function(e,t){return Lt(e,oo(t,3),yn)},Lr.findLast=ms,Lr.findLastIndex=qo,Lr.findLastKey=function(e,t){return Lt(e,oo(t,3),bn)},Lr.floor=_u,Lr.forEach=gs,Lr.forEachRight=ys,Lr.forIn=function(e,t){return null==e?e:mn(e,oo(t,3),Aa)},Lr.forInRight=function(e,t){return null==e?e:gn(e,oo(t,3),Aa)},Lr.forOwn=function(e,t){return e&&yn(e,oo(t,3))},Lr.forOwnRight=function(e,t){return e&&bn(e,oo(t,3))},Lr.get=Oa,Lr.gt=Bs,Lr.gte=Ws,Lr.has=function(e,t){return null!=e&&ho(e,t,On)},Lr.hasIn=Ca,Lr.head=Ho,Lr.identity=ru,Lr.includes=function(e,t,r,n){e=Hs(e)?e:Ua(e),r=r&&!n?da(r):0;var i=e.length;return r<0&&(r=vr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ut(e,t,i)},Lr.inRange=function(e,t,r){return t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r){return e>=mr(t,r)&&e<vr(t,r)}(e=va(e),t,r)},Lr.invoke=Ra,Lr.isArguments=Vs,Lr.isArray=qs,Lr.isArrayBuffer=zs,Lr.isArrayLike=Hs,Lr.isArrayLikeObject=Gs,Lr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&En(e)==g},Lr.isBuffer=$s,Lr.isDate=Ys,Lr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(qs(e)||"string"==typeof e||"function"==typeof e.splice||$s(e)||ua(e)||Vs(e)))return!e.length;var t=fo(e);if(t==S||t==x)return!e.size;if(wo(e))return!In(e).length;for(var r in e)if(ke.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return Mn(e,t)},Lr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Mn(e,t,i,r):!!n},Lr.isError=Ks,Lr.isFinite=function(e){return"number"==typeof e&&Nt(e)},Lr.isFunction=Xs,Lr.isInteger=Js,Lr.isLength=Zs,Lr.isMap=ta,Lr.isMatch=function(e,t){return e===t||An(e,t,ao(t))},Lr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,An(e,t,ao(t),r)},Lr.isNaN=function(e){return ra(e)&&e!=+e},Lr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jn(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=ra,Lr.isObject=Qs,Lr.isObjectLike=ea,Lr.isPlainObject=na,Lr.isRegExp=ia,Lr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=f},Lr.isSet=oa,Lr.isString=sa,Lr.isSymbol=aa,Lr.isTypedArray=ua,Lr.isUndefined=function(e){return e===i},Lr.isWeakMap=function(e){return ea(e)&&fo(e)==M},Lr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==En(e)},Lr.join=function(e,t){return null==e?"":zt.call(e,t)},Lr.kebabCase=qa,Lr.last=Ko,Lr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=da(r))<0?vr(n+o,0):mr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ft(e,Wt,o,!0)},Lr.lowerCase=za,Lr.lowerFirst=Ha,Lr.lt=ca,Lr.lte=la,Lr.max=function(e){return e&&e.length?dn(e,ru,Tn):i},Lr.maxBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Tn):i},Lr.mean=function(e){return Vt(e,ru)},Lr.meanBy=function(e,t){return Vt(e,oo(t,2))},Lr.min=function(e){return e&&e.length?dn(e,ru,Dn):i},Lr.minBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Dn):i},Lr.stubArray=pu,Lr.stubFalse=vu,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=wu,Lr.nth=function(e,t){return e&&e.length?Bn(e,da(t)):i},Lr.noConflict=function(){return ft._===this&&(ft._=Fe),this},Lr.noop=au,Lr.now=Os,Lr.pad=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(dt(i),r)+e+Wi(ht(i),r)},Lr.padEnd=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?e+Wi(t-n,r):e},Lr.padStart=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?Wi(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),yr(ga(e).replace(ne,""),t||0)},Lr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&go(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=br();return mr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Hn(e,t)},Lr.reduce=function(e,t,r){var n=qs(e)?kt:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,ln)},Lr.reduceRight=function(e,t,r){var n=qs(e)?It:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,fn)},Lr.repeat=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),Gn(ga(e),t)},Lr.replace=function(){var e=arguments,t=ga(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,r){var n=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[No(t[n])];s===i&&(n=o,s=r),e=Xs(s)?s.call(e):s}return e},Lr.round=Su,Lr.runInContext=e,Lr.sample=function(e){return(qs(e)?Yr:Yn)(e)},Lr.size=function(e){if(null==e)return 0;if(Hs(e))return sa(e)?cr(e):e.length;var t=fo(e);return t==S||t==x?e.size:In(e).length},Lr.snakeCase=Ga,Lr.some=function(e,t,r){var n=qs(e)?Dt:ti;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.sortedIndex=function(e,t){return ri(e,t)},Lr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&Us(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(Us(e[r],t))return r}return-1},Lr.startCase=$a,Lr.startsWith=function(e,t,r){return e=ga(e),r=null==r?0:on(da(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Lr.subtract=Eu,Lr.sum=function(e){return e&&e.length?Gt(e,ru):0},Lr.sumBy=function(e,t){return e&&e.length?Gt(e,oo(t,2)):0},Lr.template=function(e,t,r){var n=Lr.templateSettings;r&&go(e,t,r)&&(t=i),e=ga(e),t=_a({},t,n,Ki);var o,s,a=_a({},t.imports,n.imports,Ki),u=Ma(a),c=Xt(a,u),l=0,f=t.interpolate||be,h="__p += '",d=Oe((t.escape||be).source+"|"+f.source+"|"+(f===J?fe:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(ke.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,a,u){return n||(n=i),h+=e.slice(l,u).replace(_e,rr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),h+="';\n";var v=ke.call(t,"variable")&&t.variable;if(v){if(ce.test(v))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(q,"$1").replace(z,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(u,p+"return "+h).apply(i,c)}));if(m.source=h,Ks(m))throw m;return m},Lr.times=function(e,t){if((e=da(e))<1||e>f)return[];var r=d,n=mr(e,d);t=oo(t),e-=d;for(var i=$t(n,t);++r<e;)t(r);return i},Lr.toFinite=ha,Lr.toInteger=da,Lr.toLength=pa,Lr.toLower=function(e){return ga(e).toLowerCase()},Lr.toNumber=va,Lr.toSafeInteger=function(e){return e?on(da(e),-9007199254740991,f):0===e?e:0},Lr.toString=ga,Lr.toUpper=function(e){return ga(e).toUpperCase()},Lr.trim=function(e,t,r){if((e=ga(e))&&(r||t===i))return Yt(e);if(!e||!(t=si(t)))return e;var n=lr(e),o=lr(t);return yi(n,Zt(n,o),Qt(n,o)+1).join("")},Lr.trimEnd=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.slice(0,fr(e)+1);if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,0,Qt(n,lr(t))+1).join("")},Lr.trimStart=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,Zt(n,lr(t))).join("")},Lr.truncate=function(e,t){var r=30,n="...";if(Qs(t)){var o="separator"in t?t.separator:o;r="length"in t?da(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=ga(e)).length;if(nr(e)){var a=lr(e);s=a.length}if(r>=s)return e;var u=r-cr(n);if(u<1)return n;var c=a?yi(a,0,u).join(""):e.slice(0,u);if(o===i)return c+n;if(a&&(u+=c.length-u),ia(o)){if(e.slice(u).search(o)){var l,f=c;for(o.global||(o=Oe(o.source,ga(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(e.indexOf(si(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+n},Lr.unescape=function(e){return(e=ga(e))&&$.test(e)?e.replace(H,hr):e},Lr.uniqueId=function(e){var t=++Ie;return ga(e)+t},Lr.upperCase=Ya,Lr.upperFirst=Ka,Lr.each=gs,Lr.eachRight=ys,Lr.first=Ho,su(Lr,(mu={},yn(Lr,(function(e,t){ke.call(Lr.prototype,t)||(mu[t]=e)})),mu),{chain:!1}),Lr.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Lr[e].placeholder=Lr})),Ot(["drop","take"],(function(e,t){Wr.prototype[e]=function(r){r=r===i?1:vr(da(r),0);var n=this.__filtered__&&!t?new Wr(this):this.clone();return n.__filtered__?n.__takeCount__=mr(r,n.__takeCount__):n.__views__.push({size:mr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Wr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Wr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Wr.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Wr.prototype[e]=function(){return this.__filtered__?new Wr(this):this[r](1)}})),Wr.prototype.compact=function(){return this.filter(ru)},Wr.prototype.find=function(e){return this.filter(e).head()},Wr.prototype.findLast=function(e){return this.reverse().find(e)},Wr.prototype.invokeMap=$n((function(e,t){return"function"==typeof e?new Wr(this):this.map((function(r){return Pn(r,e,t)}))})),Wr.prototype.reject=function(e){return this.filter(Is(oo(e)))},Wr.prototype.slice=function(e,t){e=da(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Wr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=da(t))<0?r.dropRight(-t):r.take(t-e)),r)},Wr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wr.prototype.toArray=function(){return this.take(d)},yn(Wr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Lr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,u=t instanceof Wr,c=a[0],l=u||qs(t),f=function(e){var t=o.apply(Lr,jt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,v=u&&!d;if(!s&&l){t=v?t:new Wr(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[f],thisArg:i}),new Br(m,h)}return p&&v?e.apply(this,a):(m=this.thru(f),p?n?m.value()[0]:m.value():m)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(qs(i)?i:[],e)}return this[r]((function(r){return t.apply(qs(r)?r:[],e)}))}})),yn(Wr.prototype,(function(e,t){var r=Lr[t];if(r){var n=r.name+"";ke.call(Pr,n)||(Pr[n]=[]),Pr[n].push({name:t,func:r})}})),Pr[Li(i,2).name]=[{name:"wrapper",func:i}],Wr.prototype.clone=function(){var e=new Wr(this.__wrapped__);return e.__actions__=Ci(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ci(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ci(this.__views__),e},Wr.prototype.reverse=function(){if(this.__filtered__){var e=new Wr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=qs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=mr(t,e+s);break;case"takeRight":e=vr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=n?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=mr(u,this.__takeCount__);if(!r||!n&&i==u&&d==u)return fi(e,this.__actions__);var p=[];e:for(;u--&&h<d;){for(var v=-1,m=e[c+=t];++v<f;){var g=l[v],y=g.iteratee,b=g.type,_=y(m);if(2==b)m=_;else if(!_){if(1==b)continue e;break e}}p[h++]=m}return p},Lr.prototype.at=ds,Lr.prototype.chain=function(){return fs(this)},Lr.prototype.commit=function(){return new Br(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,r=this;r instanceof Ur;){var n=Fo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wr){var t=e;return this.__actions__.length&&(t=new Wr(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Qo],thisArg:i}),new Br(t,this.__chain__)}return this.thru(Qo)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Ke&&(Lr.prototype[Ke]=function(){return this}),Lr}();ft._=dr,(n=function(){return dr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},7824:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},3399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;var n=r(6486),i=r(3701);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data=[]}var t,r;return t=e,(r=[{key:"get",value:function(e){return(0,i.findExistingMetric)(e,this.data)}},{key:"set",value:function(e,t){var r=(0,i.findExistingMetric)(t,this.data);return r?r.value=e:this.data.push({labels:t,value:e}),this}},{key:"collect",value:function(e){return(0,n.filter)(this.data,(function(t){return(0,n.matches)(e)(t.labels)}))}},{key:"resetAll",value:function(){var e=this;return(0,n.each)(this.data,(function(t){e.reset(t.labels)})),this}}])&&o(t.prototype,r),e}();t.Collector=s},4486:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(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&&s(e,t)}(t,e),r=t,(a=[{key:"inc",value:function(e){return this.add(1,e),this}},{key:"add",value:function(e,t){if(e<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(e));var r=this.get(t);return this.set(r?r.value+e:e,t),this}},{key:"reset",value:function(e){this.set(0,e)}}])&&i(r.prototype,a),t}(r(3399).Collector);t.Counter=a},1993:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Gauge=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(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&&s(e,t)}(t,e),r=t,(a=[{key:"dec",value:function(e){var t=this.get(e);return this.set(t?t.value-1:0,e),this}},{key:"sub",value:function(e,t){var r=this.get(t);return this.set(r?r.value-e:0,t),this}}])&&i(r.prototype,a),t}(r(4486).Counter);t.Gauge=a},8215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Histogram=void 0;var n=r(6486);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e){return{entries:(0,n.reduce)(e,(function(e,t){return e[t.toString()]=0,e}),{"+Inf":0}),sum:0,count:0,raw:[]}}var l=function(e){function t(){var e,r,n,o,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?a(e):t}(this,s(t).call(this)),o=void 0,(n="buckets")in(r=a(e))?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,e.buckets=u.sort((function(e,t){return e>t?1:-1})),e.set(c(e.buckets)),e.observe=e.observe.bind(a(e)),e}var r,l;return function(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&&u(e,t)}(t,e),r=t,l=[{key:"observe",value:function(e,t){var r=this.get(t);null==r&&(r=this.set(c(this.buckets),t).get(t)),r.value.raw.push(e),r.value.entries["+Inf"]+=1;var i=function(e,t){if(t<e[e.length-1])for(var r=0;r<e.length;r+=1)if(t<=e[r])return r}(this.buckets,e);if(null!=i)for(var o=i;o<this.buckets.length;o+=1){var s=r.value.entries[this.buckets[o].toString()];r.value.entries[this.buckets[o].toString()]=s+1}return r.value.sum=(0,n.sum)(r.value.raw),r.value.count+=1,this}},{key:"reset",value:function(e){this.set(c(this.buckets),e)}}],l&&o(r.prototype,l),t}(r(3399).Collector);t.Histogram=l},4427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default=void 0;var i=r(4961),o=r(5262);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=function(){return new i.Registry}},4961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;var n=r(6486),i=r(4486),o=r(1993),s=r(8215),a=r(3701);function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data={counter:{},gauge:{},histogram:{}}}var t,r;return t=e,r=[{key:"validateInput",value:function(e,t,r,i){if(""===String(t))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(e))throw new Error("Unknown metric type ".concat(e));if("string"!=typeof r&&null!=r)throw new Error("help must be string or undefined/null");if((0,n.has)(this.data,"".concat(e,".").concat(t)))throw new Error("A metric with the name '".concat(t,"' already exists for type '").concat(e,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(e,t,n,a),"counter"===e?(r=new i.Counter,this.data.counter[t]={help:n,instance:r,type:e}):"gauge"===e?(r=new o.Gauge,this.data.gauge[t]={help:n,instance:r,type:e}):(r=new s.Histogram(a),this.data.histogram[t]={help:n,instance:r,type:e}),r}},{key:"metrics",value:function(){return(0,n.reduce)(this.data,(function(e,t,r){return e+(0,n.reduce)(t,(function(e,t,i){var o=t.instance.collect(),s=e;return t.help.length>0&&(s+="# HELP ".concat(i," ").concat(t.help,"\n")),(s+="# TYPE ".concat(i," ").concat(r,"\n"))+(0,n.reduce)(o,(function(e,t){return e+("histogram"===r?(0,a.formatHistogramOrSummary)(i,t):(0,a.formatCounterOrGauge)(i,t))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,n.each)(this.data,(function(e){(0,n.each)(e,(function(e){e.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(e,t){var r=(null!=e?[this.data[e]]:(0,n.valuesIn)(this.data)).find((function(e){return(0,n.has)(e,t)}));return null!=r?r[t].instance:void 0}}],r&&u(t.prototype,r),e}();t.Registry=c},5262:()=>{},3701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatHistogramOrSummary=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",o=function(e){var t=(0,n.map)(e.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return 0===t.length?"":"".concat(t.join(","))}(t);return o.length>0?(i+="".concat(e,"_count{").concat(o,"} ").concat(t.value.count,"\n"),i+="".concat(e,"_sum{").concat(o,"} ").concat(t.value.sum,"\n")):(i+="".concat(e,"_count ").concat(t.value.count,"\n"),i+="".concat(e,"_sum ").concat(t.value.sum,"\n")),(0,n.reduce)(t.value.entries,(function(t,n,s){return o.length>0?i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'",').concat(o,"} ").concat(n,"\n"):i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'"} ').concat(n,"\n"),i}),i)},t.findExistingMetric=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e?(0,n.find)(t,(function(t){return(0,n.isEqual)(t.labels,e)})):t[0]},t.formatCounterOrGauge=function(e,t){var r=" ".concat(t.value.toString());if(null==t.labels||0===Object.keys(t.labels).length)return"".concat(e).concat(r,"\n");var i=(0,n.map)(t.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return"".concat(e,"{").concat(i.join(","),"}").concat(r,"\n")};var n=r(6486)},4375:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},1798:(e,t,r)=>{"use strict";var n=r(4155),i=65536,o=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var a=0;a<e;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4281:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"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,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),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"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(9481),s=r(4229);r(5717)(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,r)=>{"use strict";e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var n,i=r(4155);e.exports=O,O.ReadableState=T,r(7187).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,d,p=r(7327),v=r(1195),m=r(2457).getHighWaterMark,g=r(4281).q,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(O,a);var S=v.errorOrDestroy,E=["error","close","destroy","pause","resume"];function T(e,t,i){n=n||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(2553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r(6753),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function C(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?S(e,new w):x(e,a,t,!0);else if(a.ended)S(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):j(e,a)):x(e,a,t,!1)}else n||(a.reading=!1,j(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),j(e,t)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=v.destroy,O.prototype._undestroy=v.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},O.prototype.unshift=function(e){return C(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){f||(f=r(2553).s);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var P=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(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 M(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(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,L(e)}function j(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(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?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(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 r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function W(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}O.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):M(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?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),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){S(this,new _("_read()"))},O.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",f),l=!0,!n.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&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",c);var l=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==W(n.pipes,e))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),v(),e.removeListener("error",h),0===s(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",d),v()}function v(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=W(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?M(this):n.reading||i.nextTick(D,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(I,this),r},O.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(I,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},O.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},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5850)),h(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=F,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===d&&(d=r(5167)),d(O,e,t)})},4605:(e,t,r)=>{"use strict";e.exports=l;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=O,O.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,d=r(4281).q,p=d.ERR_INVALID_ARG_TYPE,v=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,g=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function T(e,t,s){n=n||r(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),A(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?i.nextTick(x,e,r,s,o):x(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function O(e){var t=this instanceof(n=n||r(6753));if(!t&&!s.call(O,this))return new O(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function C(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,C(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(C(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(M,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(O,u),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===O&&e&&e._writableState instanceof T}})):s=function(e){return e instanceof this},O.prototype.pipe=function(){S(this,new g)},O.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new _;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,n,i,o);return u}(this,o,a,e,t,r)),s},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new v("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function v(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[u]=null,t(p(r,!1)))}}function m(e){i.nextTick(v,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(y,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[u]=null,e(p(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[f]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",m.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(8764).Buffer,a=r(2361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?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 1===this.length?this.head=this.tail=null:this.head=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,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},1195:(e,t,r)=>{"use strict";var n=r(4155);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},v=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?v():t.on("request",v)):a&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&h.forEach(u),o||(h.forEach(u),f(l))}))}));return t.reduce(c)}},2457:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},2872:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(2419);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(9518);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(2801);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var u=r(9106);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return u.animationFrames}});var c=r(3032);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return c.Subject}});var l=r(5240);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var f=r(3274);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return f.ReplaySubject}});var h=r(280);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return h.AsyncSubject}});var d=r(580);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var p=r(2445);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var v=r(8615);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return v.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return v.queueScheduler}});var m=r(3660);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(4123);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var y=r(218);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return y.Scheduler}});var b=r(3865);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return b.Subscription}});var _=r(5125);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=r(3104);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var S=r(9985);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return S.pipe}});var E=r(2576);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return E.noop}});var T=r(4781);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return T.identity}});var O=r(8386);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return O.isObservable}});var C=r(9309);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return C.lastValueFrom}});var x=r(8182);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return x.firstValueFrom}});var P=r(2351);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return P.ArgumentOutOfRangeError}});var R=r(9474);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return R.EmptyError}});var M=r(8598);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return M.NotFoundError}});var A=r(2642);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return A.ObjectUnsubscribedError}});var j=r(6156);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return j.SequenceError}});var k=r(4173);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var I=r(4805);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return I.UnsubscriptionError}});var D=r(3050);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return D.bindCallback}});var N=r(8130);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var L=r(9258);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return L.combineLatest}});var F=r(2239);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return F.concat}});var U=r(2873);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return U.connectable}});var B=r(7885);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return B.defer}});var W=r(6332);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return W.empty}});var V=r(7245);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return V.forkJoin}});var q=r(5432);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return q.from}});var z=r(3267);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return z.fromEvent}});var H=r(470);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return H.fromEventPattern}});var G=r(4303);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return G.generate}});var $=r(1757);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return $.iif}});var Y=r(8990);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return Y.interval}});var K=r(1846);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return K.merge}});var X=r(1339);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return X.never}});var J=r(5726);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var Z=r(724);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return Z.onErrorResumeNext}});var Q=r(4380);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(7273);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(5182);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(322);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(2098);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(7513);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(2962);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(7654);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(5207);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ue=r(6332);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ue.EMPTY}});var ce=r(1339);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ce.NEVER}}),i(r(8433),t);var le=r(3280);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var fe=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return fe.audit}});var he=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return he.auditTime}});var de=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return de.buffer}});var pe=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var ve=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return ve.bufferTime}});var me=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ye=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ye.catchError}});var be=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return be.combineAll}});var _e=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var Se=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return Se.concatAll}});var Ee=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Ee.concatMap}});var Te=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Te.concatMapTo}});var Oe=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Oe.concatWith}});var Ce=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Ce.connect}});var xe=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return xe.count}});var Pe=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Pe.debounce}});var Re=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Re.debounceTime}});var Me=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Me.defaultIfEmpty}});var Ae=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Ae.delay}});var je=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return je.delayWhen}});var ke=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var Ie=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ie.distinct}});var De=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return De.distinctUntilChanged}});var Ne=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Ne.distinctUntilKeyChanged}});var Le=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return Le.elementAt}});var Fe=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Fe.endWith}});var Ue=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Ue.every}});var Be=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Be.exhaust}});var We=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return We.exhaustAll}});var Ve=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return Ve.exhaustMap}});var qe=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return qe.expand}});var ze=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return ze.filter}});var He=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return He.finalize}});var Ge=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return Ge.find}});var $e=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return $e.findIndex}});var Ye=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return Ye.first}});var Ke=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ke.groupBy}});var Xe=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Xe.ignoreElements}});var Je=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Ze=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Ze.last}});var Qe=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ut=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ut.mergeWith}});var ct=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ct.min}});var lt=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var ft=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return ft.observeOn}});var ht=r(7582);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ht.onErrorResumeNextWith}});var dt=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return dt.pairwise}});var pt=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var vt=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return vt.publish}});var mt=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var yt=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return yt.publishReplay}});var bt=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return bt.raceWith}});var _t=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var St=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return St.repeatWhen}});var Et=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Et.retry}});var Tt=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return Tt.retryWhen}});var Ot=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ot.refCount}});var Ct=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ct.sample}});var xt=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return xt.sampleTime}});var Pt=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Pt.scan}});var Rt=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Rt.sequenceEqual}});var Mt=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Mt.share}});var At=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return At.shareReplay}});var jt=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return jt.single}});var kt=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var It=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return It.skipLast}});var Dt=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Dt.skipUntil}});var Nt=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return Nt.skipWhile}});var Lt=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Lt.startWith}});var Ft=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ft.subscribeOn}});var Ut=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ut.switchAll}});var Bt=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Bt.switchMap}});var Wt=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Wt.switchMapTo}});var Vt=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Vt.switchScan}});var qt=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return qt.take}});var zt=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return zt.takeLast}});var Ht=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ht.takeUntil}});var Gt=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Gt.takeWhile}});var $t=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $t.tap}});var Yt=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Yt.throttle}});var Kt=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Kt.throttleTime}});var Xt=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Xt.throwIfEmpty}});var Jt=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Zt=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Zt.timeout}});var Qt=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var ur=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return ur.zipAll}});var cr=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return cr.zipWith}})},280:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(3032).Subject);t.AsyncSubject=o},5240:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(3032).Subject);t.BehaviorSubject=o},3104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n,i=r(6332),o=r(5726),s=r(2098),a=r(3005);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C";var u=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return a.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,a="N"===t?o.of(r):"E"===t?s.throwError((function(){return n})):"C"===t?i.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,u=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,u):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=u,t.observeNotification=c},7286:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},2419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(5125),i=r(3865),o=r(2801),s=r(9985),a=r(3280),u=r(3005),c=r(6110),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&u.isFunction(e.next)&&u.isFunction(e.error)&&u.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return c.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},3274:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(3032),s=r(7950),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(7950),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},3032:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(2419),a=r(3865),u=r(2642),c=r(6967),l=r(6110),f=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new h(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new u.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,c.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new h(e,t)},t}(s.Observable);t.Subject=f;var h=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(f);t.AnonymousSubject=h},5125:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(3005),s=r(3865),a=r(3280),u=r(7968),c=r(2576),l=r(7286),f=r(4590),h=r(6110),d=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?b(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?b(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?b(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=d;var p=Function.prototype.bind;function v(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),g=function(e){function t(t,r,n){var i,s,u=e.call(this)||this;return o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:u&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&v(t.next,s),error:t.error&&v(t.error,s),complete:t.complete&&v(t.complete,s)}):i=t,u.destination=new m(i),u}return i(t,e),t}(d);function y(e){a.config.useDeprecatedSynchronousErrorHandling?h.captureError(e):u.reportUnhandledError(e)}function b(e,t){var r=a.config.onStoppedNotification;r&&f.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:c.noop,error:function(e){throw e},complete:c.noop}},3865:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(3005),a=r(4805),u=r(6967),c=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,u,c;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=n(f),d=h.next();!d.done;d=h.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else f.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){c=e instanceof a.UnsubscriptionError?e.errors:[e]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var m=n(v),g=m.next();!g.done;g=m.next()){var y=g.value;try{l(y)}catch(e){c=null!=c?c:[],e instanceof a.UnsubscriptionError?c=o(o([],i(c)),i(e.errors)):c.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(u=m.return)&&u.call(m)}finally{if(r)throw r.error}}}if(c)throw new a.UnsubscriptionError(c)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&u.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&u.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=c,t.EMPTY_SUBSCRIPTION=c.EMPTY,t.isSubscription=function(e){return e instanceof c||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(9474),i=r(5125);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},9309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(9474);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},9518:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(2419),s=r(3865),a=r(8739),u=r(4990),c=r(4935),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,c.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(u.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},3050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(9592);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},9592:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(9016),s=r(2419),a=r(276),u=r(1914),c=r(1184),l=r(280);t.bindCallbackInternals=function e(t,r,f,h){if(f){if(!o.isScheduler(f))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,h).apply(this,n).pipe(u.mapOneOrManyArgs(f))};h=f}return h?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(h),c.observeOn(h))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=new l.AsyncSubject,c=!0;return new s.Observable((function(s){var a=u.subscribe(s);if(c){c=!1;var l=!1,f=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void u.error(n)}u.next(1<e.length?e:e[0]),f=!0,l&&u.complete()}])),f&&u.complete(),l=!0}return a}))}}},8130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(9592);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},9258:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(2419),i=r(1203),o=r(5432),s=r(4781),a=r(1914),u=r(2433),c=r(641),l=r(4990),f=r(7738);function h(e,t,r){return void 0===r&&(r=s.identity),function(n){d(t,(function(){for(var i=e.length,s=new Array(i),a=i,u=i,c=function(i){d(t,(function(){var c=o.from(e[i],t),f=!1;c.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,f||(f=!0,u--),u||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},f=0;f<i;f++)c(f)}),n)}}function d(e,t,r){e?f.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popResultSelector(e),f=i.argsArgArrayOrObject(e),d=f.args,p=f.keys;if(0===d.length)return o.from([],r);var v=new n.Observable(h(d,r,p?function(e){return c.createObject(p,e)}:s.identity));return l?v.pipe(a.mapOneOrManyArgs(l)):v},t.combineLatestInit=h},2239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(4413),i=r(2433),o=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},2873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(3032),i=r(2419),o=r(7885),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,u=void 0===a||a,c=n(),l=new i.Observable((function(e){return c.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(c),u&&r.add((function(){return c=n()}))),r},l}},7885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(2419),i=r(7103);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},9106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(2419),i=r(6813),o=r(505);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(2419);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},7245:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(2419),i=r(1203),o=r(7103),s=r(2433),a=r(4990),u=r(1914),c=r(641);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),f=l.args,h=l.keys,d=new n.Observable((function(e){var t=f.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(f[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(h?c.createObject(h,r):r),e.complete())})))},u=0;u<t;u++)s(u);else e.complete()}));return r?d.pipe(u.mapOneOrManyArgs(r)):d}},5432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(5207),i=r(7103);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},3267:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(7103),o=r(2419),s=r(9475),a=r(3909),u=r(3005),c=r(1914),l=["addListener","removeListener"],f=["addEventListener","removeEventListener"],h=["on","off"];function d(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,v){if(u.isFunction(p)&&(v=p,p=void 0),v)return e(t,r,p).pipe(c.mapOneOrManyArgs(v));var m=n(function(e){return u.isFunction(e.addEventListener)&&u.isFunction(e.removeEventListener)}(t)?f.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return u.isFunction(e.addListener)&&u.isFunction(e.removeListener)}(t)?l.map(d(t,r)):function(e){return u.isFunction(e.on)&&u.isFunction(e.off)}(t)?h.map(d(t,r)):[],2),g=m[0],y=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}},470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(2419),i=r(3005),o=r(1914);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(2419);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},4303:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(4781),o=r(9016),s=r(7885),a=r(1297);t.generate=function(e,t,r,u,c){var l,f,h,d;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=d,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,h(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(d=(l=e).initialState,t=l.condition,r=l.iterate,f=l.resultSelector,h=void 0===f?i.identity:f,c=l.scheduler):(d=e,!u||o.isScheduler(u)?(h=i.identity,c=u):h=u),s.defer(c?function(){return a.scheduleIterable(p(),c)}:p)}},1757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(7885);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},7103:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(3909),u=r(6018),c=r(2419),l=r(9500),f=r(9595),h=r(9906),d=r(2743),p=r(7823),v=r(3005),m=r(7968),g=r(2801);function y(e){return new c.Observable((function(t){var r=e[g.observable]();if(v.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function b(e){return new c.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new c.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new c.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function S(e){return new c.Observable((function(t){(function(e,t){var r,s,a,u;return n(this,void 0,void 0,(function(){var n,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=i.sent(),a={error:c},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(u=r.return)?[4,u.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function E(e){return S(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof c.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return y(e);if(a.isArrayLike(e))return b(e);if(u.isPromise(e))return _(e);if(f.isAsyncIterable(e))return S(e);if(d.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return E(e)}throw h.createInvalidObservableTypeError(e)},t.fromInteropObservable=y,t.fromArrayLike=b,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=S,t.fromReadableStreamLike=E},8990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(2445),i=r(7513);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(3783),i=r(7103),o=r(6332),s=r(2433),a=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),u=s.popNumber(e,1/0),c=e;return c.length?1===c.length?i.innerFrom(c[0]):n.mergeAll(u)(a.from(c,r)):o.EMPTY}},1339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(2419),i=r(2576);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},5726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(2433),i=r(5432);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(2419),i=r(5498),o=r(4990),s=r(2576),a=r(7103);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var u=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(u),u.add(n)}else e.complete()};n()}))}},4380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(5432);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},7273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154),o=r(7103);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},5182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(2419),i=r(7103),o=r(5498),s=r(4990);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(2419),i=r(6332);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},2098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(2419),i=r(3005);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},7513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(2419),i=r(2445),o=r(9016),s=r(1677);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},2962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(2419),i=r(7103),o=r(6332);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},7654:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(2419),s=r(7103),a=r(5498),u=r(6332),c=r(4990),l=r(2433);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),f=a.argsOrArgArray(e);return f.length?new o.Observable((function(e){var t=f.map((function(){return[]})),o=f.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(f[a]).subscribe(c.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var u=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(u))):u),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},u=0;!e.closed&&u<f.length;u++)a(u);return function(){t=o=null}})):u.EMPTY}},4990:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(5125);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},6474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(4935),i=r(7103),o=r(4990);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,u=!1,c=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}u&&r.complete()},l=function(){a=null,u&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,c,l))}),(function(){u=!0,(!n||!a||a.closed)&&r.complete()})))}))}},5382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(2445),i=r(6474),o=r(7513);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},9715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},3814:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(4935),o=r(4990),s=r(6967);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],u=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,c,l,f,h=null;u++%t==0&&a.push([]);try{for(var d=n(a),p=d.next();!p.done;p=d.next())(g=p.value).push(r),e<=g.length&&(h=null!=h?h:[]).push(g)}catch(e){o={error:e}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(o)throw o.error}}if(h)try{for(var v=n(h),m=v.next();!m.done;m=v.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7211:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(3865),o=r(4935),s=r(4990),a=r(6967),u=r(2445),c=r(2433),l=r(7738);t.bufferTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:u.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return o.operate((function(t,r){var o=[],u=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),u&&f()},f=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,d,(function(){return c(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):u=!0,f();var h=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var u=a.value,l=u.buffer;l.push(e),v<=l.length&&c(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==h||h.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(h)}))}},4943:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(3865),o=r(4935),s=r(7103),a=r(4990),u=r(2576),c=r(6967);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){c.arrRemove(l,r),o.next(r),n.unsubscribe()}),u.noop)))}),u.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},1240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,u=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,u,i.noop))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},9548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(7103),i=r(4990),o=r(4935);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,u=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):u=!0}))),u&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(3240);t.combineAll=n.combineLatestAll},6318:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(9258),s=r(4935),a=r(5498),u=r(1914),c=r(9985),l=r(2433);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var f=l.popResultSelector(t);return f?c.pipe(e.apply(void 0,i([],n(t))),u.mapOneOrManyArgs(f)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},3240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(9258),i=r(2069);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},5024:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(6318);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},4919:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(4935),s=r(4413),a=r(2433),u=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(u.from(i([t],n(e)),r)).subscribe(o)}))}},4413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(3783);t.concatAll=function(){return n.mergeAll(1)}},7498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(9475),i=r(3005);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},6109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(7498),i=r(3005);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},9664:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(4919);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},1995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(3032),i=r(7103),o=r(4935),s=r(851),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(122);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,u=null,c=function(){if(null==u||u.unsubscribe(),u=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==u||u.unsubscribe(),n=!0,a=t,u=o.createOperatorSubscriber(r,c,i.noop),s.innerFrom(e(t)).subscribe(u)}),(function(){c(),r.complete()}),void 0,(function(){a=u=null})))}))}},1385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(2445),i=r(4935),o=r(4990);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function c(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);u()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(c,e),n.add(i))}),(function(){u(),n.complete()}),void 0,(function(){s=i=null})))}))}},1658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(4935),i=r(4990);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},5841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(2445),i=r(8798),o=r(7513);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},8798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(2239),i=r(4783),o=r(9438),s=r(8313),a=r(9475),u=r(7103);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return u.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},1080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},3054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(4935),i=r(4990),o=r(2576),s=r(7103);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},8737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(4781),i=r(4935),o=r(4990);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},7957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(8737);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},8633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(2351),i=r(9154),o=r(1779),s=r(1658),a=r(4783);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(u){return u.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},911:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(2239),s=r(5726);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},2096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(4935),i=r(4990);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},67:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(5337);t.exhaust=n.exhaustAll},5337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(5635),i=r(4781);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},5635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(4990);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},9745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(4935),i=r(7788);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},9154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(4935),i=r(4990);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},9283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(4935);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},7119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(4935),i=r(4990);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},4706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(4935),i=r(7119);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(9474),i=r(9154),o=r(4783),s=r(1658),a=r(1779),u=r(4781);t.first=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},1788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(9475);t.flatMap=n.mergeMap},9749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(2419),i=r(7103),o=r(3032),s=r(4935),a=r(4990);t.groupBy=function(e,t,r,u){return s.operate((function(s,c){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,u=t.connector):l=t;var f=new Map,h=function(e){f.forEach(e),e(c)},d=function(e){return h((function(t){return t.error(e)}))},p=0,v=!1,m=new a.OperatorSubscriber(c,(function(t){try{var s=e(t),h=f.get(s);if(!h){f.set(s,h=u?u():new o.Subject);var g=(b=s,_=h,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&v&&m.unsubscribe()}}))).key=b,w);if(c.next(g),r){var y=a.createOperatorSubscriber(h,(function(){h.complete(),null==y||y.unsubscribe()}),void 0,void 0,(function(){return f.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(y))}}h.next(l?l(t):t)}catch(e){d(e)}var b,_,w}),(function(){return h((function(e){return e.complete()}))}),d,(function(){return f.clear()}),(function(){return v=!0,0===p}));s.subscribe(m)}))}},9438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(4935),i=r(4990),o=r(2576);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},8515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(4935),i=r(4990);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(4781),i=r(1914),o=r(9985),s=r(9475),a=r(2);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},2435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(9474),i=r(9154),o=r(1980),s=r(1779),a=r(1658),u=r(4781);t.last=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},7291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(4935),i=r(4990);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},8313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(7291);t.mapTo=function(e){return n.map((function(){return e}))}},3209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},2620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(122),i=r(3005);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},9821:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(4935),s=r(5498),a=r(3783),u=r(2433),c=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(c.from(i([t],n(e)),r)).subscribe(o)}))}},3783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(9475),i=r(4781);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},7788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(7103),i=r(7738),o=r(4990);t.mergeInternals=function(e,t,r,s,a,u,c,l){var f=[],h=0,d=0,p=!1,v=function(){!p||f.length||h||t.complete()},m=function(e){return h<s?g(e):f.push(e)},g=function(e){u&&t.next(e),h++;var l=!1;n.innerFrom(r(e,d++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{h--;for(var e=function(){var e=f.shift();c?i.executeSchedule(t,c,(function(){return g(e)})):g(e)};f.length&&h<s;)e();v()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,v()}))),function(){null==l||l()}}},9475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(7788),a=r(3005);t.mergeMap=function e(t,r,u){return void 0===u&&(u=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),u):("number"==typeof r&&(u=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,u)})))}},1211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(9475),i=r(3005);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},7267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(4935),i=r(7788);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},9303:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(9821);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},9714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(122),i=r(3005);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},3848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(9518),i=r(3005),o=r(1995);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},1184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(7738),i=r(4935),o=r(4990);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},7582:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(5498),s=r(724);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},2731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(4935),i=r(4990);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},5649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},4691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(7291);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},4474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(3032),i=r(3848),o=r(1995);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},52:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(5240),i=r(9518);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},2110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(280),i=r(9518);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},9864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(3274),i=r(3848),o=r(3005);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},9764:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(5498),s=r(179);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},179:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(5182),s=r(4935),a=r(4781);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(8345),i=r(4935);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},8739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(4935),i=r(4990);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},5313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(6332),i=r(4935),o=r(4990),s=r(7103),a=r(7513);t.repeat=function(e){var t,r,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,r=e.delay):u=e),u<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,c=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),u=o.createOperatorSubscriber(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<u?n?c():r=!0:t.complete()}))),r&&c()};l()}))}},4068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=!1,l=!1,f=function(){return l&&c&&(r.complete(),!0)},h=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!f()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?h():u=!0}),(function(){c=!0,f()})))),a).next()}))),u&&(o.unsubscribe(),o=null,u=!1,h())};h()}))}},64:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(4935),i=r(4990),o=r(4781),s=r(7513),a=r(7103);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,u=void 0===r?1/0:r,c=t.delay,l=t.resetOnSuccess,f=void 0!==l&&l;return u<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){f&&(n=0),t.next(e)}),void 0,(function(e){if(n++<u){var f=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=c){var h="number"==typeof c?s.timer(c):a.innerFrom(c(e,n)),d=i.createOperatorSubscriber(t,(function(){d.unsubscribe(),f()}),(function(){t.complete()}));h.subscribe(d)}else f()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},1188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?c():u=!0})))),a&&a.next(t)}))),u&&(o.unsubscribe(),o=null,u=!1,c())};c()}))}},4193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(7103),i=r(4935),o=r(2576),s=r(4990);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},6170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(2445),i=r(4193),o=r(8990);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},5876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(4935),i=r(8345);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},8345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(4990);t.scanInternals=function(e,t,r,i,o){return function(s,a){var u=r,c=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;c=u?e(c,t,r):(u=!0,t),i&&a.next(c)}),o&&function(){u&&a.next(c),a.complete()}))}}},1791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(4935),i=r(4990),o=r(7103);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},u=function(e){n.next(e),n.complete()},c=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?u(!1):e.buffer.push(n):!t(n,i.shift())&&u(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&u(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(c(s,a)),o.innerFrom(e).subscribe(c(a,s))}))}},5137:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(7103),s=r(3032),a=r(5125),u=r(4935);function c(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var u=new a.SafeSubscriber({next:function(){u.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(u)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,f=void 0===l||l,h=e.resetOnRefCountZero,d=void 0===h||h;return function(e){var t,n,s,l=0,h=!1,p=!1,v=function(){null==n||n.unsubscribe(),n=void 0},m=function(){v(),t=s=void 0,h=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return u.operate((function(e,u){l++,p||h||v();var y=s=null!=s?s:r();u.add((function(){0!=--l||p||h||(n=c(g,d))})),y.subscribe(u),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return y.next(e)},error:function(e){p=!0,v(),n=c(m,i,e),y.error(e)},complete:function(){h=!0,v(),n=c(m,f),y.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},1348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(3274),i=r(5137);t.shareReplay=function(e,t,r){var o,s,a,u,c=!1;return e&&"object"==typeof e?(o=e.bufferSize,u=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},8242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(9474),i=r(6156),o=r(8598),s=r(4935),a=r(4990);t.single=function(e){return s.operate((function(t,r){var s,u=!1,c=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){c=!0,e&&!e(n,l++,t)||(u&&r.error(new i.SequenceError("Too many matching values")),u=!0,s=n)}),(function(){u?(r.next(s),r.complete()):r.error(c?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},3169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(9154);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},2454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(4781),i=r(4935),o=r(4990);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},6931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},7913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(4935),i=r(4990);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(2239),i=r(2433),o=r(4935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(4935);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},9253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(8518),i=r(4781);t.switchAll=function(){return n.switchMap(i.identity)}},8518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(7103),i=r(4935),o=r(4990);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,u=!1,c=function(){return u&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var u=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,u++):e)}),(function(){s=null,c()})))}),(function(){u=!0,c()})))}))}},1173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(8518),i=r(3005);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},3855:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(8518),i=r(4935);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},4783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(6332),i=r(4935),o=r(4990);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},1980:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(6332),o=r(4935),s=r(4990);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},9845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},6060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(4935),i=r(4990);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},1138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(3005),i=r(4935),o=r(4990),s=r(4781);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},7306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(4935),i=r(4990),o=r(7103);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,u=void 0===a||a,c=s.trailing,l=void 0!==c&&c,f=!1,h=null,d=null,p=!1,v=function(){null==d||d.unsubscribe(),d=null,l&&(y(),p&&n.complete())},m=function(){d=null,p&&n.complete()},g=function(t){return d=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,v,m))},y=function(){if(f){f=!1;var e=h;h=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){f=!0,h=e,(!d||d.closed)&&(u?y():g(e))}),(function(){p=!0,(!(l&&f&&d)||d.closed)&&n.complete()})))}))}},8968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(2445),i=r(7306),o=r(7513);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},1779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(9474),i=r(4935),o=r(4990);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},8005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(2445),i=r(4935),o=r(4990);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},4173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(2445),i=r(1677),o=r(4935),s=r(7103),a=r(7029),u=r(4990),c=r(7738);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,f=r.each,h=r.with,d=void 0===h?l:h,p=r.scheduler,v=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==f)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=c.executeSchedule(t,v,(function(){try{r.unsubscribe(),s.innerFrom(d({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(u.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),f>0&&l(f)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-v.now():f)}))}},7223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(2445),i=r(1677),o=r(4173);t.timeoutWith=function(e,t,r){var s,a,u;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(u=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:u})}},8975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(7950),i=r(7291);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(122),i=r(4935),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},2826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(2576),a=r(7103);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var u=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),u)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,u)),function(){null==i||i.unsubscribe(),i=null}}))}},7526:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(3032),o=r(4935),s=r(4990);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],u=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,c;try{for(var l=n(a),f=l.next();!f.done;f=l.next())f.value.next(t)}catch(e){s={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}var h=u-e+1;if(h>=0&&h%r==0&&a.shift().complete(),++u%r==0){var d=new i.Subject;a.push(d),o.next(d.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(3032),i=r(2445),o=r(3865),s=r(4935),a=r(4990),u=r(6967),c=r(2433),l=r(7738);t.windowTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,c=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),u.arrRemove(i,e),s&&f()},f=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,d,(function(){return c(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):s=!0,f();var h=function(e){return i.slice().forEach(e)},m=function(e){h((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){h((function(t){t.window.next(e),v<=++t.seen&&c(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},1883:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(3032),o=r(3865),s=r(4935),a=r(7103),u=r(4990),c=r(2576),l=r(6967);t.windowToggle=function(e,t){return s.operate((function(r,s){var f=[],h=function(e){for(;0<f.length;)f.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(u.createOperatorSubscriber(s,(function(e){var r=new i.Subject;f.push(r);var n,d=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void h(e)}s.next(r.asObservable()),d.add(n.subscribe(u.createOperatorSubscriber(s,(function(){l.arrRemove(f,r),r.complete(),d.unsubscribe()}),c.noop,h)))}),c.noop)),r.subscribe(u.createOperatorSubscriber(s,(function(e){var t,r,i=f.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<f.length;)f.shift().complete();s.complete()}),h,(function(){for(;0<f.length;)f.shift().unsubscribe()})))}))}},4309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(7103);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,u=function(e){i.error(e),r.error(e)},c=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void u(e)}t.subscribe(a=o.createOperatorSubscriber(r,c,c,u))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),u,(function(){null==a||a.unsubscribe(),i=null})))}))}},3041:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(4935),s=r(4990),a=r(7103),u=r(4781),c=r(2576),l=r(2433);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,f=new Array(l),h=e.map((function(){return!1})),d=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){f[t]=e,d||h[t]||(h[t]=!0,(d=h.every(u.identity))&&(h=null))}),c.noop))},v=0;v<l;v++)p(v);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(d){var t=i([e],n(f));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},4400:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(7654),s=r(4935);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},8593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(7654),i=r(2069);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},8096:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(4400);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},7631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(2419);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},8489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(2419),i=r(7738);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},1297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(2419),i=r(3725),o=r(3005),s=r(7738);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},4001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(7103),i=r(1184),o=r(276);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},5143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(7103),i=r(1184),o=r(276);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},3676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(8489),i=r(7823);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},5207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(4001),i=r(5143),o=r(7631),s=r(1297),a=r(8489),u=r(9500),c=r(6018),l=r(3909),f=r(2743),h=r(9595),d=r(9906),p=r(7823),v=r(3676);t.scheduled=function(e,t){if(null!=e){if(u.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(c.isPromise(e))return i.schedulePromise(e,t);if(h.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(f.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return v.scheduleReadableStreamLike(e,t)}throw d.createInvalidObservableTypeError(e)}},1986:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(3865).Subscription);t.Action=o},7574:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(9702),s=r(505),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},2934:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AnimationFrameScheduler=o},2189:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(9702),s=r(8908),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},5523:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AsapScheduler=o},9702:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(1986),s=r(8203),a=r(6967),u=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),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=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=u},3643:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(218),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},6201:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(9702).AsyncAction);t.QueueAction=o},5860:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(3643).AsyncScheduler);t.QueueScheduler=o},4123:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(9702),s=r(3865),a=function(e){function t(t,r){void 0===t&&(t=u),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(3643).AsyncScheduler);t.VirtualTimeScheduler=a;var u=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},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}(o.AsyncAction);t.VirtualAction=u},3660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(7574),i=r(2934);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},505:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(3865);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(2189),i=r(5523);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},2445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(9702),i=r(3643);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},8908:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(7629),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},8203:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},8615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(6201),i=r(5860);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},4590:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},3725:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},2801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(7029);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(7029);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},8598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(7029);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},2642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(7029);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},6156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(7029);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(7029);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},2433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(3005),i=r(9016);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},7029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},6110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(3280),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},4781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},3909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},9595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(3005);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},3005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},9500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(2801),i=r(3005);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},2743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(3725),i=r(3005);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},8386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(2419),i=r(3005);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},6018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(3005);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},7823:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(c,l):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function c(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),s.shift(),s.length&&u(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(3005);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(3005);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},4935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(3005);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1914:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(7291),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},2576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},9985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(4781);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(3280),i=r(4590);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},9906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},4857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var u=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return u.bufferToggle}});var c=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return c.bufferWhen}});var l=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var f=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return f.combineAll}});var h=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return h.combineLatestAll}});var d=r(6318);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return d.combineLatest}});var p=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var v=r(4919);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return v.concat}});var m=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var y=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return y.concatMapTo}});var b=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return b.concatWith}});var _=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var S=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return S.debounce}});var E=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return E.debounceTime}});var T=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return T.defaultIfEmpty}});var O=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return O.delay}});var C=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return C.delayWhen}});var x=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return x.dematerialize}});var P=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return P.distinct}});var R=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return R.distinctUntilChanged}});var M=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return M.distinctUntilKeyChanged}});var A=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return A.elementAt}});var j=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return j.endWith}});var k=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var I=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return I.exhaust}});var D=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return D.exhaustAll}});var N=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return N.exhaustMap}});var L=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return L.expand}});var F=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return F.filter}});var U=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return U.finalize}});var B=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return B.find}});var W=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return W.findIndex}});var V=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return V.first}});var q=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return q.groupBy}});var z=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return z.ignoreElements}});var H=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return H.isEmpty}});var G=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return G.last}});var $=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return $.map}});var Y=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return Y.mapTo}});var K=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return K.materialize}});var X=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return X.max}});var J=r(9821);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var Z=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return Z.mergeAll}});var Q=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(7582);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ue=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ue.pairwise}});var ce=r(5649);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ce.partition}});var le=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var fe=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return fe.publish}});var he=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return he.publishBehavior}});var de=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return de.publishLast}});var pe=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var ve=r(9764);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return ve.race}});var me=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ye=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ye.repeat}});var be=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return be.repeatWhen}});var _e=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var Se=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Se.refCount}});var Ee=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ee.sample}});var Te=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Te.sampleTime}});var Oe=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Oe.scan}});var Ce=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Ce.sequenceEqual}});var xe=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return xe.share}});var Pe=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Pe.shareReplay}});var Re=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Re.single}});var Me=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Me.skip}});var Ae=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Ae.skipLast}});var je=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return je.skipUntil}});var ke=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var Ie=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ie.startWith}});var De=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return De.subscribeOn}});var Ne=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ne.switchAll}});var Le=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Le.switchMap}});var Fe=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Fe.switchMapTo}});var Ue=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ue.switchScan}});var Be=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Be.take}});var We=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return We.takeLast}});var Ve=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ve.takeUntil}});var qe=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return qe.takeWhile}});var ze=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return ze.tap}});var He=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return He.throttle}});var Ge=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Ge.throttleTime}});var $e=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return $e.throwIfEmpty}});var Ye=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Ye.timeInterval}});var Ke=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ke.timeout}});var Xe=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Xe.timeoutWith}});var Je=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Ze=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Ze.toArray}});var Qe=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(4400);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},9509:(e,t,r)=>{var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7539:e=>{"use strict";const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const n=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let u;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===a&&(u=c[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&u&&(t.rtx={ssrc:u}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&a&&r.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=l}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;return i=e||t.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t},8853:(e,t,r)=>{const n=r(1227)("simple-peer"),i=r(5177),o=r(1798),s=r(8473),a=r(4375),u=r(2114),{Buffer:c}=r(8764),l=65536;function f(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class h extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||h.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},h.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?u(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):u(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(u(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(u(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(u(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(u(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?("Ignoring unsupported ICE candidate.",console.warn("Ignoring unsupported ICE candidate.")):this.destroy(u(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(u(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const r=this._senderMap.get(e)||new Map;let n=r.get(t);if(n)throw n.removed?u(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):u(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");n=this._pc.addTrack(e,t),r.set(t,n),this._senderMap.set(e,r),this._needsNegotiation()}replaceTrack(e,t,r){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const n=this._senderMap.get(e),i=n?n.get(r):null;if(!i)throw u(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,n),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(u(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const r=this._senderMap.get(e),n=r?r.get(t):null;if(!n)throw u(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(u(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(u(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=l),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(u(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,r){if(this.destroyed)return r(u(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(u(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>l?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=r):r(null)}else this._debug("write before connect"),this._chunk=e,this._cb=r}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(u(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(u(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(u(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((r=>{const n=[];r.forEach((e=>{n.push(t(e))})),e(null,n)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((r=>{if(this.destroyed)return;const n=[];r.result().forEach((e=>{const r={};e.names().forEach((t=>{r[t]=e.stat(t)})),r.id=e.id,r.type=e.type,r.timestamp=e.timestamp,n.push(t(r))})),e(null,n)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,r)=>{if(this.destroyed)return;t&&(r=[]);const n={},i={},o={};let s=!1;r.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(n[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(i[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)}));const a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let r=n[e.remoteCandidateId];r&&(r.ip||r.address)?(this.remoteAddress=r.ip||r.address,this.remotePort=Number(r.port)):r&&r.ipAddress?(this.remoteAddress=r.ipAddress,this.remotePort=Number(r.portNumber)):"string"==typeof e.googRemoteAddress&&(r=e.googRemoteAddress.split(":"),this.remoteAddress=r[0],this.remotePort=Number(r[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(r.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),s||Object.keys(o).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(u(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>l||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}h.WEBRTC_SUPPORT=!!i(),h.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},h.channelConfig={},e.exports=h},2553:(e,t,r)=>{"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r: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 r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},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}},3607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0,r(8806);const a=o(r(835)),u=r(6123);s(r(8512),t);var c=r(6123);Object.defineProperty(t,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),s(r(835),t),window.AdapterJS=a,window.Uneeq=u.Uneeq},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoundMeter=void 0;const n=r(2872),i=r(7501);t.SoundMeter=class{constructor(e){this.instant$=new n.BehaviorSubject(0),this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);const t=this;this.script.onaudioprocess=e=>{const r=e.inputBuffer.getChannelData(0);let n,i=0,o=0;for(n=0;n<r.length;++n)i+=r[n]*r[n],Math.abs(r[n])>.99&&(o+=1);t.instant=Math.sqrt(i/r.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/r.length,t.instant$.next(parseFloat(t.instant.toFixed(2)))}}connectToSource(e,t){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(e){console.error(e),void 0!==t&&t(e)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},4518:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoEditor=void 0;const s=o(r(6551));t.VideoEditor=class{constructor(){}applyChromaKeyEffect(e,t){try{r(6303);const n=s.default();let i,o,a;i=n.transform("reformat"),i.source=t,i.width=e.width,i.height=e.height,a=n.target(e),o=n.effect("chroma"),o.source=i,a.source=o,n.go()}catch(e){console.error(e)}}}},1181:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.API=void 0,t.API=class{set callId(e){this._callId=e}get authToken(){return this.xAuthToken}constructor(e,t="",r=(()=>{})){this.xAuthToken="",this.apiUrl=e,this.apiKey=t,this.loggedOutHandler=r}startSession(e){return this.postRequest("/api/v1/customers/",e,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",e)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:e})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(e){return this.postRequest("/api/v2/clients/start-session",e,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(e){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:e})}sendMediaUnavailable(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",e)}getEdgeNodeId(e){let t=e.replace("turn:","http://");t=t.replace("turns:","https://");const r=new Request(t,{method:"GET"});return this.makeRequest(r)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(e){return r(this,void 0,void 0,(function*(){const t=yield fetch(e);if(!t.ok){401===t.status&&this.loggedOutHandler();const e=yield t.json();throw{status:t.status,body:e}}return 204===t.status?Promise.resolve():(this.xAuthToken=t.headers.get("x-auth-token")||this.xAuthToken,yield t.json())}))}getRequest(e){const t=new Request(this.apiUrl+e,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(t)}postRequest(e,t={},r={},n={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},n),body:JSON.stringify(t)},o=new Request(this.apiUrl+e,Object.assign(i,r));return this.makeRequest(o)}putRequest(e,t={},r={}){const n={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(t)},i=new Request(this.apiUrl+e,Object.assign(n,r));return this.makeRequest(i)}}},2958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasService=void 0,t.CanvasService=class{constructor(e){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=e}createCanvas(){const e=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(e),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.height=this.canvasHeight,e.width=this.canvasWidth,e}}},1546:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;const i=r(3607),o=r(1929);t.DeviceManager=class{set edgeNodeId(e){this.mediaHandler.setEdgeNodeId(e),this.getDevices(!0)}constructor(e,t){this.options=e,this.api=t,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new o.MediaHandler(this.options,(()=>this.remoteVideoReady())),this.initMediaConstraints(),this.getDevices(!1)}enableLocalDevices(e,t){const r=this.options.uneeqOptions.sendLocalVideo!==e,n=this.options.uneeqOptions.sendLocalAudio!==t;(r||n)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=e,this.options.uneeqOptions.sendLocalAudio=t,r&&!1===e&&this.publishStream.getVideoTracks().forEach((e=>e.stop())),n&&!1===t&&this.publishStream.getAudioTracks().forEach((e=>e.stop())),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(e=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const t=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then((t=>n(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),e){if(this.options.uneeqOptions.sendLocalVideo){const e=t.getVideoTracks();e.length>0&&(this.publishStream.getVideoTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}if(this.options.uneeqOptions.sendLocalAudio){const e=t.getAudioTracks();e.length>0&&(this.publishStream.getAudioTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})))).catch((e=>{t.options.userMessages.next(new i.DeviceErrorMessage(e)),console.error("device error: ",e),this.sendMediaUnavailableInfo("NotAllowedError"===e.name),this.revertMediaOptions()}))}setMicDevice(e,t=!0){const r=this.devices.audioInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredMicrophoneId=e,this.audioConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(e));else{const t="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setCamDevice(e,t=!0){const r=this.devices.videoInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredCameraId=e,this.videoConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(e));else{const t="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setAvatarSpeakerDevice(e){if(this.mediaHandler.avatarVideoElement){const t=this.devices.audioOutput.filter((t=>t.deviceId===e));if(t&&t.length>0)this.options.uneeqOptions.preferredSpeakerId=e,this.mediaHandler.avatarVideoElement.setSinkId(e).then((()=>{this.speakerConstraints.deviceId=e,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(e))})).catch((t=>{const r="Uneeq setSpeaker: Error setting device. "+t.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(r,e))}));else{const t="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getMediaDevices(),r={audioInputs:t.audioInput.length,videoInputs:t.videoInput.length,hasUserDeniedPermission:e};return this.api.sendMediaUnavailable(r)}))}getMediaDevices(){return n(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t={audioInput:[],audioOutput:[],videoInput:[]};return t.audioInput=e.filter((e=>"audioinput"===e.kind)),t.audioOutput=e.filter((e=>"audiooutput"===e.kind)),t.videoInput=e.filter((e=>"videoinput"===e.kind)),t}))}initDeviceList(){return n(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=e=>{this.initDeviceList()};const e=yield this.getMediaDevices();JSON.stringify(e)!==JSON.stringify(this.devices)&&(this.devices=e,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))}))}}},6886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanVideoPlayManager=void 0;const n=r(8512),i=r(7501);t.DigitalHumanVideoPlayManager=class{constructor(e,t){this.messages=e,this.publicUnmuteDigitalHumanMethod=t,this.remoteVideoPlayCount=0}play(e){this.video=e,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new n.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=e=>{this.messages.next(new n.DigitalHumanVideoError(e))},this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})).catch((()=>{this.digitalHumanFailedToPlayUnmuted()})))}digitalHumanFailedToPlayUnmuted(){this.messages.next(new n.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then((()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new n.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",(()=>{this.publicUnmuteDigitalHumanMethod()}),{once:!0})})).catch((e=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",e),this.playRemoteVideoWithExponentialBackoff()}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})),this.remoteVideoPlayCount++,setTimeout((()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()}),100*(this.remoteVideoPlayCount-1)))}}},7789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocaleDetector=void 0;class r{static validateOrDetectSpeechLocales(e){let t=e.speechToTextLocales;t&&t.length>0&&(t.split(":").forEach((e=>{this.sttSupportedLocales[e]||(console.error(`UneeQ: Speech to text not supported for: ${e}. Defaulting to en-US`),t=this.defaultLocale)})),"undefined"!==t&&"null"!==t||(t=this.defaultLocale));const r=(window.navigator.languages||[window.navigator.language]).map((e=>((e.length<5||"zh-CN"===e)&&(e=this.localeMappings[e]||null),e&&!this.sttSupportedLocales[e]&&(console.warn(`UneeQ: Speech to text not supported for one of the detected languages: ${e}. Replacing with en-US.`),e=this.defaultLocale),e))).slice(0,4).filter(n).filter(((e,t,r)=>r.indexOf(e)===t));let i=r.join(":").replace(/:\s*$/,"");return i&&0!==i.length||(i=this.defaultLocale),t&&t.length>0?console.debug(`UneeQ: Configured speech to text languages: ${t}`):console.warn(`UneeQ: Detected speechToText languages from browser: ${i}`),t||i}}function n(e){return null!=e}t.LocaleDetector=r,r.defaultLocale="en-US",r.localeMappings={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP",de:"de-DE",ko:"ko-KR",zh:"cmn-Hans-CN",it:"it-IT",pt:"pt-PT",nl:"nl-NL",sv:"sv-SE",da:"da-DK",no:"no-NO",fi:"fi-FI",ru:"ru-RU",pl:"pl-PL",tr:"tr-TR",ar:"ar-SA",th:"th-TH",id:"id-ID",cs:"cs-CZ",hu:"hu-HU",ro:"ro-RO",he:"he-IL",vi:"vi-VN",uk:"uk-UA",hi:"hi-IN","zh-CN":"cmn-Hans-CN"},r.sttSupportedLocales={"af-ZA":!0,"sq-AL":!0,"am-ET":!0,"ar-DZ":!0,"ar-BH":!0,"ar-EG":!0,"ar-IQ":!0,"ar-IL":!0,"ar-JO":!0,"ar-KW":!0,"ar-LB":!0,"ar-MR":!0,"ar-MA":!0,"ar-OM":!0,"ar-QA":!0,"ar-SA":!0,"ar-PS":!0,"ar-TN":!0,"ar-AE":!0,"ar-YE":!0,"hy-AM":!0,"az-AZ":!0,"eu-ES":!0,"bn-BD":!0,"bn-IN":!0,"bs-BA":!0,"bg-BG":!0,"my-MM":!0,"ca-ES":!0,"yue-Hant-HK":!0,"cmn-Hans-CN":!0,"cmn-Hant-TW":!0,"hr-HR":!0,"cs-CZ":!0,"da-DK":!0,"nl-BE":!0,"nl-NL":!0,"en-AU":!0,"en-CA":!0,"en-GH":!0,"en-HK":!0,"en-IN":!0,"en-IE":!0,"en-KE":!0,"en-NZ":!0,"en-NG":!0,"en-PK":!0,"en-PH":!0,"en-SG":!0,"en-ZA":!0,"en-TZ":!0,"en-GB":!0,"en-US":!0,"et-EE":!0,"fil-PH":!0,"fi-FI":!0,"fr-BE":!0,"fr-CA":!0,"fr-FR":!0,"fr-CH":!0,"gl-ES":!0,"ka-GE":!0,"de-AT":!0,"de-DE":!0,"de-CH":!0,"el-GR":!0,"gu-IN":!0,"iw-IL":!0,"hi-IN":!0,"hu-HU":!0,"is-IS":!0,"id-ID":!0,"it-IT":!0,"it-CH":!0,"ja-JP":!0,"jv-ID":!0,"kn-IN":!0,"kk-KZ":!0,"km-KH":!0,"ko-KR":!0,"lo-LA":!0,"lv-LV":!0,"lt-LT":!0,"mk-MK":!0,"ms-MY":!0,"ml-IN":!0,"mr-IN":!0,"mn-MN":!0,"ne-NP":!0,"no-NO":!0,"fa-IR":!0,"pl-PL":!0,"pt-BR":!0,"pt-PT":!0,"pa-Guru-IN":!0,"ro-RO":!0,"ru-RU":!0,"rw-RW":!0,"sr-RS":!0,"si-LK":!0,"sk-SK":!0,"sl-SI":!0,"ss-latn-za":!0,"st-ZA":!0,"es-AR":!0,"es-BO":!0,"es-CL":!0,"es-CO":!0,"es-CR":!0,"es-DO":!0,"es-EC":!0,"es-SV":!0,"es-GT":!0,"es-HN":!0,"es-MX":!0,"es-NI":!0,"es-PA":!0,"es-PY":!0,"es-PE":!0,"es-PR":!0,"es-ES":!0,"es-US":!0,"es-UY":!0,"es-VE":!0,"su-ID":!0,"sw-KE":!0,"sw-TZ":!0,"sv-SE":!0,"ta-IN":!0,"ta-MY":!0,"ta-SG":!0,"ta-LK":!0,"te-IN":!0,"th-TH":!0,"tn-latn-za":!0,"tr-TR":!0,"ts-ZA":!0,"uk-UA":!0,"ur-IN":!0,"ur-PK":!0,"uz-UZ":!0,"ve-ZA":!0,"vi-VN":!0,"xh-ZA":!0,"zu-ZA":!0}},7501:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=t.LogType=void 0,function(e){e.debug="debug",e.log="log",e.warn="warn",e.error="error"}(r||(t.LogType=r={}));class n{constructor(){this.enabled=!1}log(e,...t){this.emitLogMessage(r.log,e,t)}warn(e,...t){this.emitLogMessage(r.warn,e,t)}error(e,...t){this.emitLogMessage(r.error,e,t)}debug(e,...t){this.emitLogMessage(r.debug,e,t)}emitLogMessage(e,t,n){(this.enabled||e===r.error)&&(n.length>0?console[e](t,n):console[e](t))}}t.Logger=n,t.logger=new n},1929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHandler=void 0;const n=r(2872),i=r(4857),o=r(3607),s=r(4518),a=r(7563),u=r(2958),c=r(7501),l=r(8477);t.MediaHandler=class{constructor(e,t){this.options=e,this.remoteVideoReady=t,this.remoteStream$=new n.BehaviorSubject(null),this.localStream$=new n.BehaviorSubject(null),this.publishState$=new n.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.pipe((0,i.filter)((e=>null!==e))).subscribe((r=>{this.avatarVideoElement=this.options.digitalHumanVideoElement,this.avatarVideoElement.srcObject=r,e.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",e.uneeqOptions.avatarVideoContainerElement.innerHTML="",e.uneeqOptions.avatarVideoContainerElement.appendChild(this.avatarVideoElement),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(this.avatarVideoElement),t()})),this.localStream$.pipe((0,i.filter)((e=>null!==e))).subscribe((t=>{const r=document.createElement("video");this.localVideoElement=r,r.srcObject=t,r.autoplay=!0,r.muted=!0,r.setAttribute("playsinline","true"),r.setAttribute("style","width: 100%; height: 100%;"),e.uneeqOptions.localVideoContainerElement.innerHTML="",e.uneeqOptions.localVideoContainerElement.appendChild(r),this.options.voiceInputManager&&this.options.voiceInputManager.initMicActivity(t),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()})),this.options.internalMessages$.pipe((0,i.filter)((e=>"AnswerMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(e)})),this.options.internalMessages$.pipe((0,i.filter)((e=>"IceCandidateMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(e)}))}setEdgeNodeId(e){this.options.session.edgeNodeId=e,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){c.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),t&&t.getTracks().forEach((e=>e.enabled=!1)),e&&e.getTracks().forEach((e=>e.enabled=!1))}resume(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();t&&t.getTracks().forEach((e=>e.enabled=!0)),e&&e.getTracks().forEach((e=>e.enabled=!0)),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const e=this.localStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const e=this.remoteStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.options.voiceInputManager&&this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(e){this.webRTC&&this.webRTC.sendDataMessage(e)}gatherWebRTCStats(e){var t;null===(t=this.webRTC)||void 0===t||t.getStats(e)}publishVideo(){const e=this.options.session.streamId,t=this.options.session.avatarStreamId,r=this.options.session.turnServerAddresses,n=this.options.session.turnUsername,i=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,f=this.remoteStream$,h=this.localStream$.getValue();if(!h||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let d=0;c.logger.log("UserSession | publishVideo - stream:",h,"publishStreamName:",e),c.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new l.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:e,subscribeStreamName:t,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:e=>{c.logger.log("WEBRTC: onAddStream "+e.stream),f.next(e.stream)},forceTurnServerUse:s,iceServers:[{urls:r,username:n,credential:i}],onConnect:()=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),u.getValue()===a.PublishSubscribeState.CONNECTING&&u.next(a.PublishSubscribeState.CONNECTED)},onError:e=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",d),d<3?(d++,this.performWebRTCConnection(h),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(c.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(h)):this.webRTC.updateStreamTracks(h)}performWebRTCConnection(e){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(e))}initTransparentBackground(e){const t=new u.CanvasService(this.options.uneeqOptions).createCanvas();(new s.VideoEditor).applyChromaKeyEffect(t,e),this.avatarVideoElement.style.display="none"}}},4887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;const n=r(4857),i=r(3607),o=r(4050);t.MessageHandler=class{constructor(e,t){this.internalMessages$=e,this.messages=t,this.deviceManager={getDevices:(e,t)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe((e=>{const t={type:o.PromMessageType.QuestionMessageReceived,value:{id:e.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarQuestionMessage(e.question,e.id))})),this.getMessagesOfType("AvatarAnswerText").subscribe((e=>{const t={type:o.PromMessageType.AnswerMessageReceived,value:{id:e.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarAnswerMessage(e.answer,e.answerAvatar,e.answerSpeech,e.questionId))})),this.getMessagesOfType("AvatarAnswerHTML").subscribe((e=>{this.messages.next(new i.AvatarAnswerContentMessage(e.html,e.messageId,e.hasDisplayHtml)),this.messages.next(new i.InstructionsMessage(e.instructions))})),this.getMessagesOfType("AvatarTextInputStarted").subscribe((e=>this.messages.next(new i.StartedSpeakingMessage))),this.getMessagesOfType("AvatarTextInputFinished").subscribe((e=>{this.messages.next(new i.FinishedSpeakingMessage),this.messages.next(new i.AvatarTextInputFinishedMessage)})),this.getMessagesOfType("AvatarStarting").subscribe((e=>{this.deviceManager.edgeNodeId=e.edgeNodeId})),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe((e=>{this.messages.next(new i.ClientMediaStreamUpdateMessage(e.clientStreamingAudio,e.clientStreamingVideo,e.serverStreamingAudio,e.serverStreamingVideo)),e.clientStreamingAudio&&e.clientStreamingVideo&&e.serverStreamingAudio&&e.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))})),this.getMessagesOfType("SessionErrorMessage").subscribe((e=>{console.error(e.error),this.messages.next(new i.SessionErrorMessage(e.error))})),this.getMessagesOfType("SessionInfoMessage").subscribe((e=>{this.messages.next(new i.SessionInfoMessage(e.info))})),this.getMessagesOfType("SessionEndedMessage").subscribe((()=>{const e={type:o.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})})),this.getMessagesOfType("AvatarRequestCompleted").subscribe((e=>{this.messages.next(new i.AvatarRequestCompleted(e.reason))})),this.getMessagesOfType("AvatarRequestIgnored").subscribe((e=>{this.messages.next(new i.AvatarRequestIgnored(e.reason))}))}setDeviceManager(e){this.deviceManager=e}getMessagesOfType(e){return this.internalMessages$.pipe((0,n.filter)((t=>t.faceMeMessageType===e)))}}},8957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=t.MessagingService=void 0;const n=r(8637);Object.defineProperty(t,"MessagingService",{enumerable:!0,get:function(){return n.MessagingService}});const i=r(7229);Object.defineProperty(t,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},8637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const n=r(2541),i=r(2872),o=r(7501),s=r(7229);t.MessagingService=class{constructor(e,t){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=e,this.options=Object.assign(this.options,t),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new i.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const r={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new n.Client(r),this.stompClient.onConnect=e=>this.onStompConnected(e),this.stompClient.onDisconnect=e=>{o.logger.log("Stomp client disconnected",e)},this.stompClient.onStompError=e=>{o.logger.log("Stomp client error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketError=e=>{o.logger.log("Stomp client web socket error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketClose=e=>{o.logger.log("Stomp client web socket closed",e),this.onStompClientConnectionClosed(e)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const e=this.state$.getValue();if(e===s.MessagingState.CONNECTED||e===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.options.autoReconnect=!1,this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(e){console.error("MessagingService | disconnect: error",e),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(e,t){o.logger.log("MessagingService | send:",e,t);const r={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},n=JSON.stringify(t);this.stompClient.publish({destination:e,body:n,headers:r})}getTopic(e){o.logger.log("MessagingService | subscribeToTopic: "+e);const t=this.subscriptions[e];if(t)return o.logger.log("existing subscription... not re-subscribing to topic"),t;const r=new i.Subject;return this.stompClient.subscribe(e,(e=>{r.next(e),this.messages$.next(e)})),this.subscriptions[e]=r,r}onStompConnected(e){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(e){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout((()=>{this.connect()}),this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription"),this.stompClient.subscribe("/",(e=>{this.messages$.next(e)}))}}},7229:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=void 0,function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(r||(t.MessagingState=r={}))},2694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsService=void 0;const n=r(3607),i=r(9824),o=r(4050);t.MetricsService=class{constructor(e,t,r){this.uneeqOptions=e,this.internalMessages=t,this.messages=r,this.clientPerformanceStats={},this.options=e,this.internalMessages$=t,this.messages$=r}parseAndLogWebRtcStats(e){try{e.forEach((e=>{var t,r;if("inbound-rtp"===e.type&&"video"===e.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",e.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",e.frameWidth);const n=e.framesDropped,o=n?n-(null===(t=this.clientPerformanceStats.totalFramesDropped)||void 0===t?void 0:t.value):0;this.clientPerformanceStats.newFramesDropped=o?new i.ClientPerformanceStat("New Frames Dropped",o):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=n?new i.ClientPerformanceStat("Total Frames Dropped",n):new i.ClientPerformanceStat;const s=e.packetsLost,a=s?s-(null===(r=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===r?void 0:r.value):0;this.clientPerformanceStats.inboundNewPacketsLost=a?new i.ClientPerformanceStat("New packets lost",a):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=s?new i.ClientPerformanceStat("Total packets lost",s):new i.ClientPerformanceStat;const u=e.framesPerSecond;this.clientPerformanceStats.framesPerSec=u?new i.ClientPerformanceStat("Frames per second",u):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===e.type&&"video"===e.kind){const t=e.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=t?new i.ClientPerformanceStat("Round Trip Time",t):new i.ClientPerformanceStat}else if("outbound-rtp"===e.type&&"video"===e.kind){const t=e.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",t)}})),this.options.enableClientPerformanceMessage&&this.messages$.next(new n.ClientPerformanceMessage(this.clientPerformanceStats));const t={type:o.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t})}catch(e){console.warn("Unable to parseAndLogWebRTCStats",e)}}}},6400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineStatusService=void 0;const n=r(3607);t.OnlineStatusService=class{constructor(e,t){this.messages=e,this.offlineTimeoutLimitHandler=t,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",(()=>this.handleOffline())),window.addEventListener("online",(()=>this.handleOnline()))}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout((()=>{this.offlineTimeoutLimitHandler()}),this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new n.OnlineStatusUpdateMessage(this.online))}}},4050:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Prom=t.PromMessageType=void 0;const i=n(r(4427));var o;!function(e){e[e.SessionStart=0]="SessionStart",e[e.WebRtcPerformance=1]="WebRtcPerformance",e[e.AvailabilityCheck=2]="AvailabilityCheck",e[e.QuestionMessageReceived=3]="QuestionMessageReceived",e[e.AnswerMessageReceived=4]="AnswerMessageReceived",e[e.SessionEnded=5]="SessionEnded"}(o||(t.PromMessageType=o={})),t.Prom=class{constructor(e){this.apiUrl=e,this.prom_prefix="client_sdk_",this.registry=(0,i.default)(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.metricsIntervalId=setInterval((()=>{this.sendMetrics()}),1e4)}handleMessage(e){var t,r,n,i,s,a,u;const c=Object.assign(e.labels||{},{platform:"js"});switch(e.type){case o.SessionStart:this.sessionStartTime.observe(e.value,c);break;case o.QuestionMessageReceived:this.messageTimings.push(e.value);break;case o.AnswerMessageReceived:const l=this.calculateConversationRtt(e);l>0&&this.conversationRoundTripTime.observe(l,c);break;case o.WebRtcPerformance:const f=e.value;f.outboundQualityLimitationReason?c.qualityLimitationReason=null===(t=f.outboundQualityLimitationReason)||void 0===t?void 0:t.value:c.qualityLimitationReason="unknown",f.newFramesDropped&&this.webRtcFramesDropped.observe(null===(r=f.newFramesDropped)||void 0===r?void 0:r.value,c),f.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(n=f.framesPerSec)||void 0===n?void 0:n.value,c),f.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=f.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),f.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(s=f.inboundRoundTripTime)||void 0===s?void 0:s.value,c),f.frameHeight&&this.webRtcFrameHeight.observe(null===(a=f.frameHeight)||void 0===a?void 0:a.value,c),f.frameWidth&&this.webRtcFrameWidth.observe(null===(u=f.frameWidth)||void 0===u?void 0:u.value,c);break;case o.AvailabilityCheck:this.availabilityCheckTime.observe(e.value,c);break;case o.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(e){if(e.value&&this.messageTimings){const t=this.messageTimings.find((t=>t.id===e.value.id));if(t){const r=t.receivedOn;if(r){const n=(e.value.receivedOn-r)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(t),1),n}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const e=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(e),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},8591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeSessionCheck=void 0;const n=r(7501),i=r(39);class o{static validate(e){const t=new i.UneeqLocalStorage;let r=void 0!==e.resumeSession&&e.resumeSession;t.getItemSafely("uneeqResumeSessionPersonaId")===e.conversationId||(n.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),r=!1);const s=o.browserTabIsActive();if(r&&!s&&(n.logger.log("UneeQ: Browser tab is not active so unable to resume"),r=!1),r){const e=t.getItemSafely("uneeqResumeSessionId");if(null!==e)return{resumeSession:!0,resumeSessionId:e}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}t.ResumeSessionCheck=o},1116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.StreamManager=class{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(e){return e.getVideoTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.canvasVideoTrack),e}addSilentAudioTrackToStream(e){return e.getAudioTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.silentAudioTrack),e}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){const e=document.createElement("canvas");return e.width=40,e.height=30,e.getContext("2d"),e.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){const e=new window.AudioContext;this.audioContextInstance=e,this.audioSourceDestination=e.createMediaStreamDestination()}return this.audioSourceDestination.stream.getAudioTracks()[0]}}},39:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqLocalStorage=void 0;const n=r(7501);t.UneeqLocalStorage=class{constructor(){}get available(){return void 0===this.localStorageAvailable&&(this.localStorageAvailable=this.checkIfLocalStorageAvailable()),this.localStorageAvailable}setItemSafely(e,t){this.available?localStorage.setItem(e,t):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}getItemSafely(e){return this.available?localStorage.getItem(e):void n.logger.log("UneeQ: unable to access localStorage because it is not available.")}removeItemSafely(e){this.available?localStorage.removeItem(e):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}checkIfLocalStorageAvailable(){const e="UneeqLocalStoreCheck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}}},8477:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqWebRTC=void 0;const i=n(r(8853)),o=n(r(835)),s=r(3607),a=r(7501);t.UneeqWebRTC=class{constructor(e){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(e,t)=>{this.options.userMessages.next(new s.WebRtcStatsMessage(t)),this.statTimer=window.setTimeout((()=>{this.client&&this.client.getStats&&this.client.getStats(this.onStats)}),2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},e),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(e){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:e,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",(e=>{this.log("error",e),void 0!==this.options.onError&&this.options.onError(e)})),this.client.on("signal",(e=>{const t={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in e&&"offer"===e.type)t.payload=JSON.stringify({type:"offer",sdp:e.sdp}),t.type="OfferMessage",this.log("Offer payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t);else if("candidate"in e){const r=JSON.stringify(e.candidate);this.options.forceTurnServerUse&&!r.match(/typ relay/)||r.match(/::/)||(t.payload=r,t.type="IceCandidate",this.log("IC payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(e))})),this.client.on("connect",(()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()})),this.client.on("data",(e=>{this.log("data: "+e),void 0!==this.options.onData&&this.options.onData(e),this.options.userMessages.next(new s.WebRtcDataMessage(e))})),this.client.on("close",(()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()})),this.client.on("stream",(e=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:e})}))}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);return this.log("got answer: ",t),this.client.signal(t),!0}return this.log("ignoring answer: ",e),!1}handleIceCandidate(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);if("candidate"in t&&""===t.candidate){if("edge"===o.default.browserDetails.browser){const e=this.client._pc;e.remoteDescription&&e.remoteDescription.type&&e.addIceCandidate(null)}}else this.client.signal({candidate:t});return!0}return!1}sendDataMessage(e){this.client.send(e)}getStats(e){return this.client&&this.client.getStats(e)}updateStreamTracks(e){e.getTracks().forEach((e=>{this.client._pc.getSenders().find((t=>e.kind===t.track.kind)).replaceTrack(e).then((()=>{a.logger.log("Updated publish media stream track for "+e.kind)})).catch((t=>{a.logger.error("Error: updating publish media stream track failed for "+e.kind,t)}))}))}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client&&this.client.getStats&&this.client.getStats(this.onStats)}isMessageForUs(e){return e.requestUniqueId===this.uniqueId}log(e,...t){a.logger.log("UneeqWebRTC: "+e,t)}warn(e,...t){a.logger.warn("UneeqWebRTC: "+e,t)}}},4333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputManager=void 0;const n=r(4857),i=r(881),o=r(8512),s=r(608),a=r(7501);t.VoiceInputManager=class{constructor(e,t,r,n){this.options=e,this.api=t,this.messages=r,this.enableMicrophone=n,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(e.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(e){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(e){e===s.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=s.VoiceInputMode.PUSH_TO_TALK:e===s.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=s.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new o.WarningMessage("Invalid voice input mode selected: "+e))}startRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){a.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(e){this.stream=e,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(e,(e=>this.micActivityConnected(e)))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new o.MicActivityNotSupportedMessage),this.messages.next(new o.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(s.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe((e=>{switch(e.uneeqMessageType){case o.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case o.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1}}))}requestNotSupportedInVoiceActivityMode(e){this.messages.next(new o.WarningMessage("Request not supported in voice activity mode: "+e))}apiStartRecording(){this.recording=!0,this.messages.next(new o.RecordingStartedMessage),this.api.avatarStartRecording().catch((()=>{this.recording=!1,this.messages.next(new o.RecordingStoppedMessage)}))}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording(),this.messages.next(new o.RecordingStoppedMessage)}micActivityConnected(e){e?this.messages.next(new o.MicActivityErrorMessage(e)):this.soundMeter&&this.soundMeter.instant$.pipe((0,n.distinctUntilChanged)()).subscribe((e=>{this.handleVoiceActivity(e)}))}handleVoiceActivity(e){this.options.micActivityMessages&&this.messages.next(new o.MicActivityMessage(e)),this.options.voiceInputMode!==s.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(e>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):e<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout((()=>{this.recording&&this.apiStopRecording()}),this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},9824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientPerformanceStat=void 0,t.ClientPerformanceStat=class{constructor(e="",t=0){this.label=e,this.value=t}}},8512:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanUnmuted=t.DigitalHumanPlayedInMutedModeSuccess=t.DigitalHumanFailedToPlay=t.DigitalHumanVideoError=t.ClientPerformanceMessage=t.ClientMediaStreamUpdateMessage=t.OnlineStatusUpdateMessage=t.SessionInfoMessage=t.AvatarRequestIgnored=t.AvatarRequestCompleted=t.SessionErrorMessage=t.WebRtcStatsMessage=t.WebRtcDataMessage=t.SessionLiveMessage=t.WarningMessage=t.RecordingStoppedMessage=t.RecordingStartedMessage=t.DevicePermissionAllowedMessage=t.AvatarTextInputFinishedMessage=t.FinishedSpeakingMessage=t.StartedSpeakingMessage=t.AvatarQuestionMessage=t.InstructionsMessage=t.AvatarAnswerContentMessage=t.AvatarAnswerMessage=t.ResumeSessionUnavailable=t.ConnectionLostMessage=t.VoiceActivityInputModeNotSupportedMessage=t.MicActivityNotSupportedMessage=t.MicActivityMessage=t.MicActivityErrorMessage=t.ServiceUnavailableMessage=t.AvatarUnavailableMessage=t.AvatarAvailableMessage=t.SessionEndedMessage=t.SessionResumedMessage=t.SessionPausedMessage=t.DeviceListUpdatedMessage=t.DeviceErrorMessage=t.SetSpeakerSuccessMessage=t.SetMicSuccessMessage=t.SetCameraSuccessMessage=t.DeviceNotFoundErrorMessage=t.ReadyMessage=t.UneeqMessageType=void 0,function(e){e.Ready="Ready",e.DeviceNotFoundError="DeviceNotFoundError",e.SetCameraSuccess="SetCameraSuccess",e.SetMicSuccess="SetMicSuccess",e.SetSpeakerSuccess="SetSpeakerSuccess",e.SessionPaused="SessionPaused",e.SessionResumed="SessionResumed",e.SessionEnded="SessionEnded",e.AvatarAvailable="AvatarAvailable",e.AvatarUnavailable="AvatarUnavailable",e.ConnectionLost="ConnectionLost",e.ResumeSessionUnavailable="ResumeSessionUnavailable",e.ServiceUnavailable="ServiceUnavailable",e.OnlineStatusUpdate="OnlineStatusUpdate",e.MicActivityNotSupported="MicActivityNotSupported",e.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",e.MicActivityError="MicActivityError",e.MicActivity="MicActivity",e.DeviceError="DeviceError",e.DeviceListUpdated="DeviceListUpdated",e.AvatarAnswer="AvatarAnswer",e.AvatarAnswerContent="AvatarAnswerContent",e.Instructions="Instructions",e.StartedSpeaking="StartedSpeaking",e.FinishedSpeaking="FinishedSpeaking",e.AvatarTextInputFinished="AvatarTextInputFinished",e.AvatarQuestionText="AvatarQuestionText",e.DevicePermissionAllowed="DevicePermissionAllowed",e.RecordingStarted="RecordingStarted",e.RecordingStopped="RecordingStopped",e.Warning="Warning",e.SessionLive="SessionLive",e.WebRtcData="WebRtcData",e.WebRtcStats="WebRtcStats",e.SessionError="SessionError",e.SessionInfo="SessionInfo",e.AvatarRequestCompleted="AvatarRequestCompleted",e.AvatarRequestIgnored="AvatarRequestIgnored",e.ClientMediaStreamUpdate="ClientMediaStreamUpdate",e.ClientPerformanceMessage="ClientPerformanceMessage",e.DigitalHumanVideoError="DigitalHumanVideoError",e.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",e.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",e.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r||(t.UneeqMessageType=r={})),t.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}},t.DeviceNotFoundErrorMessage=class{constructor(e,t){this.msg=e,this.deviceId=t,this.uneeqMessageType=r.DeviceNotFoundError}},t.SetCameraSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetCameraSuccess}},t.SetMicSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetMicSuccess}},t.SetSpeakerSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetSpeakerSuccess}},t.DeviceErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.DeviceError}},t.DeviceListUpdatedMessage=class{constructor(e){this.devices=e,this.uneeqMessageType=r.DeviceListUpdated}},t.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}},t.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}},t.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}},t.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}},t.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}},t.ServiceUnavailableMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.ServiceUnavailable}},t.MicActivityErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.MicActivityError}},t.MicActivityMessage=class{constructor(e){this.level=e,this.uneeqMessageType=r.MicActivity}},t.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}},t.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}},t.ConnectionLostMessage=class{constructor(e){this.connectionState=e,this.uneeqMessageType=r.ConnectionLost}},t.ResumeSessionUnavailable=class{constructor(){this.uneeqMessageType=r.ResumeSessionUnavailable}},t.AvatarAnswerMessage=class{constructor(e,t,n,i){this.answer=e,this.answerAvatar=t,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}},t.AvatarAnswerContentMessage=class{constructor(e,t,n=!1){this.content=e,this.transcriptId=t,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}},t.InstructionsMessage=class{constructor(e){this.instructions=e,this.uneeqMessageType=r.Instructions}},t.AvatarQuestionMessage=class{constructor(e,t){this.question=e,this.transcriptId=t,this.uneeqMessageType=r.AvatarQuestionText}},t.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}},t.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}},t.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}},t.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}},t.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}},t.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}},t.WarningMessage=class{constructor(e){this.msg=e,this.uneeqMessageType=r.Warning}},t.SessionLiveMessage=class{constructor(e,t){this.showLogo=e,this.sessionResumed=t,this.uneeqMessageType=r.SessionLive}},t.WebRtcDataMessage=class{constructor(e){this.data=e,this.uneeqMessageType=r.WebRtcData}},t.WebRtcStatsMessage=class{constructor(e){this.stats=e,this.uneeqMessageType=r.WebRtcStats}},t.SessionErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.SessionError}},t.AvatarRequestCompleted=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestCompleted}},t.AvatarRequestIgnored=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestIgnored}},t.SessionInfoMessage=class{constructor(e){this.info=e,this.uneeqMessageType=r.SessionInfo}},t.OnlineStatusUpdateMessage=class{constructor(e){this.online=e,this.uneeqMessageType=r.OnlineStatusUpdate}},t.ClientMediaStreamUpdateMessage=class{constructor(e,t,n,i){this.clientStreamingAudio=e,this.clientStreamingVideo=t,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}},t.ClientPerformanceMessage=class{constructor(e){this.clientPerformance=e,this.uneeqMessageType=r.ClientPerformanceMessage}},t.DigitalHumanVideoError=class{constructor(e){this.error=e,this.uneeqMessageType=r.DigitalHumanVideoError}},t.DigitalHumanFailedToPlay=class{constructor(){this.uneeqMessageType=r.DigitalHumanFailedToPlay,this.msg="Digital Human failed to play with sound. This most likely occurred because the user has not yet interacted with the page and was blocked due to the browser's autoplay policy. Video will automatically be muted and attempted to be played again."}},t.DigitalHumanPlayedInMutedModeSuccess=class{constructor(){this.uneeqMessageType=r.DigitalHumanPlayedInMutedModeSuccess,this.msg="Digital Human was successfully played in muted mode. After the user interacts with the page you will need to call unmuteDigitalHuman() to unmute the video."}},t.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},7636:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SessionType=void 0,function(e){e[e.WEB=0]="WEB"}(r||(t.SessionType=r={}))},7563:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PublishSubscribeState=void 0,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.FAILED="FAILED"}(r||(t.PublishSubscribeState=r={}))},9794:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SourceApp=void 0,function(e){e.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",e.SHOWCASE="SHOWCASE",e.SPLIT_SCREEN="SPLIT_SCREEN",e.INTERACTIONS="INTERACTIONS",e.UNKNOWN="UNKNOWN"}(r||(t.SourceApp=r={}))},608:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputMode=void 0,function(e){e.PUSH_TO_TALK="PUSH_TO_TALK",e.VOICE_ACTIVITY="VOICE_ACTIVITY",e.SPEECH_RECOGNITION="SPEECH_RECOGNITION"}(r||(t.VoiceInputMode=r={}))},6123:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0;const o=r(2872),s=r(4857),a=i(r(4147)),u=r(1181),c=r(1546),l=r(6886),f=r(7789),h=r(7501),d=r(4887),p=r(8957),v=r(2694),m=r(6400),g=r(4050),y=r(8591),b=r(1116),_=r(39),w=r(4333),S=r(8512),E=r(7636),T=r(7563),O=r(9794),C=r(608);t.Uneeq=class{get sessionId(){return this.session?this.session.id:null}constructor(e){this.ready=new o.BehaviorSubject(!1),this.version=a.default.version,this.messages=new o.Subject,this.internalMessages$=new o.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,this.uneeqLocalStorage=new _.UneeqLocalStorage,h.logger.enabled=e.logging||!1,this.options=e,this.options.diagnostics=e.diagnostics||!1,this.options.micActivityMessages=e.micActivityMessages||!1,this.options.sendLocalVideo=void 0===e.sendLocalVideo||e.sendLocalVideo,this.options.sendLocalAudio=void 0===e.sendLocalAudio||e.sendLocalAudio,this.options.enableClientPerformanceMessage=e.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=e.enableTransparentBackground||!1,this.options.backgroundImageUrl=e.backgroundImageUrl||"",this.options.nameTagImageUrl=e.nameTagImageUrl||"",this.options.speechToTextLocales=f.LocaleDetector.validateOrDetectSpeechLocales(e),this.checkIfResumeSessionIsAvailable(),this.options.voiceInputMode=e.voiceInputMode||C.VoiceInputMode.PUSH_TO_TALK,this.api=new u.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:E.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new b.StreamManager,this.initDigitalHumanVideoElement(),this.metricsService=new v.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new l.DigitalHumanVideoPlayManager(this.messages,(()=>{this.unmuteDigitalHuman()}))}setLoggerEnabled(e){h.logger.enabled=e}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then((e=>{this.session=e,this.initialize()})).catch((e=>{this.sendServiceUnavailableMessage(e)}))}initWithToken(e){return n(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const t=y.ResumeSessionCheck.validate(this.options);!0===t.resumeSession&&(this.startSessionData.resumeSessionId=t.resumeSessionId),this.startSessionData.tokenId=e,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.id===this.startSessionData.resumeSessionId?(h.logger.log("UneeQ: Session was resumed."),this.sessionWasResumed=!0):h.logger.log("UneeQ: Session was not resumed."),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionId",this.session.id),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=O.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:O.SourceApp.UNKNOWN,this.initialize()}catch(e){this.sendServiceUnavailableMessage(e)}}))}setCamera(e){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(e)}setMic(e){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(e)}setSpeaker(e){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(e)}setVoiceInputMode(e){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(e)}enableMicrophone(e=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,e)}enableCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,this.options.sendLocalAudio)}enableMicrophoneAndCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,e)}sendTranscript(e){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(e))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new S.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new S.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new S.SessionResumedMessage),!0):(this.messages.next(new S.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(e){return this.api.setAvatarDebug(e)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}initDigitalHumanVideoElement(){const e=document.createElement("video");this.digitalHumanVideoElement=e,e.volume=1,e.controls=!1,e.autoplay=!1,e.setAttribute("playsinline","true"),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.play().catch((e=>{h.logger.log("UneeQ: Failed to play digital human video. Play() will be re-attempted when stream is ready.",e)}))}gatherWebRtcMetrics(){var e;null===(e=this.deviceManager)||void 0===e||e.mediaHandler.gatherWebRTCStats(((e,t)=>{this.metricsService.parseAndLogWebRtcStats(t)})),setTimeout((()=>{this.gatherWebRtcMetrics()}),5e3)}initMessaging(){this.messages.subscribe((e=>this.messageCallback(e))),this.messaging.state$.pipe((0,s.filter)((e=>e===p.MessagingState.CONNECTED))).subscribe((()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new S.ReadyMessage),this.gatherWebRtcMetrics()})),this.messaging.messages$.subscribe((e=>this.internalMessages$.next(JSON.parse(e.body)))),this.messageHandler=new d.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe((e=>{h.logger.log("-- Msg -- ",e)}))}initDeviceManager(){this.voiceInputManager=new w.VoiceInputManager(this.options,this.api,this.messages,(e=>{this.enableMicrophone(e)})),this.deviceManager=new c.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager,voiceInputManager:this.voiceInputManager,digitalHumanVideoElement:this.digitalHumanVideoElement},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new S.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const e={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.sessionStarted=!0}}initAvatar(){this.ready.pipe((0,s.filter)(Boolean),(0,s.take)(1)).subscribe((()=>{this.internalMessages$.pipe((0,s.filter)((e=>"DevicePermissionAllowedInternal"===e.faceMeMessageType)),(0,s.take)(1)).subscribe((e=>{this.messages.next(new S.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()})),this.initDeviceManager()})),this.internalMessages$.pipe((0,s.filter)((e=>"sessionLive"===e.faceMeMessageType)),(0,s.take)(1)).subscribe((e=>this.sessionLiveHandler())),this.internalMessages$.pipe((0,s.filter)((e=>"sessionEnd"===e.faceMeMessageType))).subscribe((()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new S.SessionEndedMessage),this.messaging.disconnect()})),this.internalMessages$.pipe((0,s.filter)((e=>"remoteVideoReadyToPlay"===e.faceMeMessageType))).subscribe((e=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement)}))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then((e=>{if(e.available>0){const e={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new S.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl,speechToTextLocales:this.options.speechToTextLocales}).catch((e=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",e),this.uneeqLocalStorage.removeItemSafely("uneeqResumeSessionId")}))}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new S.AvatarUnavailableMessage)),setTimeout((()=>{this.startAvatarWhenAvailable()}),1e3)}))}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const e={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new p.MessagingService(this.options.url+"/api/messaging",e),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(e){const t=new S.ServiceUnavailableMessage(e);this.messages.next(t),this.messageCallback(t)}serviceReadyCheck(e){return!!this.ready.value||(this.messages.next(new S.WarningMessage("Call to "+e+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.mediaDevices.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new m.OnlineStatusService(this.messages,(()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()}))}initPromMetricsListener(){const e=new g.Prom(this.options.url);this.internalMessages$.pipe((0,s.filter)((e=>"prom"===e.faceMeMessageType))).subscribe((t=>{e.handleMessage(t.promMsg)}))}checkIfResumeSessionIsAvailable(){!0!==this.options.resumeSession||this.uneeqLocalStorage.available||(console.warn("UneeQ: Resuming session is unavailable in this browser because localStorage is not allowed."),this.messages.next(new S.ResumeSessionUnavailable),this.options.resumeSession=!1)}}},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},835:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ce});var n={};r.r(n),r.d(n,{fixNegotiationNeeded:()=>M,shimAddTrackRemoveTrack:()=>P,shimAddTrackRemoveTrackWithNative:()=>x,shimGetDisplayMedia:()=>w,shimGetSendersWithDtmf:()=>T,shimGetStats:()=>O,shimGetUserMedia:()=>_,shimMediaStream:()=>S,shimOnTrack:()=>E,shimPeerConnection:()=>R,shimSenderReceiverGetStats:()=>C});var i={};r.r(i),r.d(i,{shimAddTransceiver:()=>U,shimCreateAnswer:()=>V,shimCreateOffer:()=>W,shimGetDisplayMedia:()=>j,shimGetParameters:()=>B,shimGetUserMedia:()=>A,shimOnTrack:()=>k,shimPeerConnection:()=>I,shimRTCDataChannel:()=>F,shimReceiverGetStats:()=>N,shimRemoveStream:()=>L,shimSenderGetStats:()=>D});var o={};r.r(o),r.d(o,{shimAudioContext:()=>J,shimCallbacksAPI:()=>H,shimConstraints:()=>$,shimCreateOfferLegacy:()=>X,shimGetUserMedia:()=>G,shimLocalStreamsAPI:()=>q,shimRTCIceServerUrls:()=>Y,shimRemoteStreamsAPI:()=>z,shimTrackEventTransceiver:()=>K});var s={};r.r(s),r.d(s,{removeExtmapAllowMixed:()=>oe,shimAddIceCandidateNullOrEmpty:()=>se,shimConnectionState:()=>ie,shimMaxMessageSize:()=>re,shimParameterlessSetLocalDescription:()=>ae,shimRTCIceCandidate:()=>ee,shimRTCIceCandidateRelayProtocol:()=>te,shimSendThrowTypeError:()=>ne});let a=!0,u=!0;function c(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function l(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function f(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function h(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(u=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function d(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){u&&console.warn(e+" is deprecated, please use "+t+" instead.")}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e){return v(e)?Object.keys(e).reduce((function(t,r){const n=v(e[r]),i=n?m(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function g(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?g(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{g(e,e.get(t),r)}))})))}function y(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&g(e,r,i)}))})),i}const b=d;function _(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let s=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&r.length&&t.includes("back")&&(s=r[r.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),b("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return b("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function w(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function S(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function E(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else l(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function O(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function C(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function x(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function P(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return x(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((e=>e.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[r.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function R(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function M(e,t){l(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}function A(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){p("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function j(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function I(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function D(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function N(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function L(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){p("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function F(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function U(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const r=e.length>0;r&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function B(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function W(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function q(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function z(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function H(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=a,a=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=a,a=function(e,t,r){const n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=a}function G(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r($(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function $(e){return e&&void 0!==e.video?Object.assign({},e,{video:m(e.video)}):e}function Y(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];void 0===n.urls&&n.url?(p("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function K(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function X(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function J(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=r(7539),Q=r.n(Z);function ee(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Q().parseCandidate(e.candidate);for(const e in n)e in r||Object.defineProperty(r,e,{value:n[e]});return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,l(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function te(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||l(e,"icecandidate",(e=>{if(e.candidate){const t=Q().parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function re(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Q().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Q().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),r=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r}(e),n=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Q().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n}(arguments[0],e);let i;i=0===r&&0===n?Number.POSITIVE_INFINITY:0===r||0===n?Math.max(r,n):Math.min(r,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return r.apply(this,arguments)}}function ne(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},l(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function ie(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function oe(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function se(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ae(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?r.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>r.apply(this,[e])))})}const ue=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=d,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=c(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=c(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=c(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:a,commonShim:s,extractVersion:c,disableLog:f,disableWarnings:h,sdp:Z};switch(a.browser){case"chrome":if(!n||!R||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),u;if(null===a.version)return r("Chrome shim can not determine version, not shimming."),u;r("adapter.js shimming chrome."),u.browserShim=n,se(e,a),ae(e),_(e,a),S(e),R(e,a),E(e),P(e,a),T(e),O(e),C(e),M(e,a),ee(e),te(e),ie(e),re(e,a),ne(e),oe(e,a);break;case"firefox":if(!i||!I||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),u;r("adapter.js shimming firefox."),u.browserShim=i,se(e,a),ae(e),A(e,a),I(e,a),k(e),L(e),D(e),N(e),F(e),U(e),B(e),W(e),V(e),ee(e),ie(e),re(e,a),ne(e);break;case"safari":if(!o||!t.shimSafari)return r("Safari shim is not included in this adapter release."),u;r("adapter.js shimming safari."),u.browserShim=o,se(e,a),ae(e),Y(e),X(e),H(e),q(e),z(e),K(e),G(e),J(e),ee(e),te(e),re(e,a),ne(e),oe(e,a);break;default:r("Unsupported browser!")}return u}({window:"undefined"==typeof window?void 0:window}),ce=ue},2361:()=>{},4616:()=>{},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"uneeq-js","version":"2.46.7","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"npx tslint -p tsconfig.json --fix","docs":"npx typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^7.8.1","rxjs-compat":"^6.6.7","simple-peer":"^9.11.1","webrtc-adapter":"^8.2.3"},"devDependencies":{"@types/dom-mediacapture-record":"^1.0.16","@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^5.1.0","jasmine-core":"^5.1.0","karma":"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-requirejs":"^1.1.0","karma-typescript":"^5.5.4","karma-typescript-es6-transform":"^5.5.4","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^9.4.4","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^5.1.6","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(3607),i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
|