@formant/data-sdk 0.0.144 → 0.0.145
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/data-sdk.es.js +569 -517
- package/dist/data-sdk.umd.js +21 -21
- package/dist/types/data-sdk/src/App.d.ts +8 -0
- package/dist/types/data-sdk/src/Authentication.d.ts +2 -52
- package/dist/types/data-sdk/src/Device.d.ts +2 -2
- package/dist/types/data-sdk/src/Fleet.d.ts +1 -1
- package/dist/types/data-sdk/src/main.d.ts +1 -0
- package/dist/types/data-sdk/src/model/AccessLevel.d.ts +1 -1
- package/dist/types/data-sdk/src/model/AnalyticsAggregateType.d.ts +1 -1
- package/dist/types/data-sdk/src/model/AnalyticsChartType.d.ts +1 -1
- package/dist/types/data-sdk/src/model/DeviceType.d.ts +1 -1
- package/dist/types/data-sdk/src/model/EventType.d.ts +1 -1
- package/dist/types/data-sdk/src/model/HealthStatus.d.ts +1 -1
- package/dist/types/data-sdk/src/model/Severity.d.ts +1 -1
- package/dist/types/data-sdk/src/model/VideoMimeType.d.ts +1 -1
- package/dist/types/data-sdk/src/stores/AuthenticationStore.d.ts +56 -0
- package/dist/types/data-sdk/src/stores/IAuthenticationStore.d.ts +57 -0
- package/dist/types/data-sdk/src/utils/aggregateFunctionUtils.d.ts +2 -2
- package/package.json +20 -8
package/dist/data-sdk.umd.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Ve,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("date-fns")):typeof define=="function"&&define.amd?define(["exports","date-fns"],e):(Ve=typeof globalThis<"u"?globalThis:Ve||self,e(Ve.FormantDataSDK={},Ve.dateFns))})(this,function(exports,dateFns){"use strict";var sn=Object.defineProperty;var ln=(Ve,e,t)=>e in Ve?sn(Ve,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):Ve[e]=t;var Re=(Ve,e,t)=>(ln(Ve,typeof e!="symbol"?e+"":e,t),t);function _interopNamespaceDefault(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const dateFns__namespace=_interopNamespaceDefault(dateFns),global$1=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)lookup[t]=e[t],revLookup[e.charCodeAt(t)]=t;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63}function toByteArray(e){inited||init();var t,n,r,i,s,l,o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=e[o-2]==="="?2:e[o-1]==="="?1:0,l=new Arr(o*3/4-s),r=s>0?o-4:o;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)i=revLookup[e.charCodeAt(t)]<<18|revLookup[e.charCodeAt(t+1)]<<12|revLookup[e.charCodeAt(t+2)]<<6|revLookup[e.charCodeAt(t+3)],l[c++]=i>>16&255,l[c++]=i>>8&255,l[c++]=i&255;return s===2?(i=revLookup[e.charCodeAt(t)]<<2|revLookup[e.charCodeAt(t+1)]>>4,l[c++]=i&255):s===1&&(i=revLookup[e.charCodeAt(t)]<<10|revLookup[e.charCodeAt(t+1)]<<4|revLookup[e.charCodeAt(t+2)]>>2,l[c++]=i>>8&255,l[c++]=i&255),l}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var r,i=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(tripletToBase64(r));return i.join("")}function fromByteArray(e){inited||init();for(var t,n=e.length,r=n%3,i="",s=[],l=16383,o=0,c=n-r;o<c;o+=l)s.push(encodeChunk(e,o,o+l>c?c:o+l));return r===1?(t=e[n-1],i+=lookup[t>>2],i+=lookup[t<<4&63],i+="=="):r===2&&(t=(e[n-2]<<8)+e[n-1],i+=lookup[t>>10],i+=lookup[t>>4&63],i+=lookup[t<<2&63],i+="="),s.push(i),s.join("")}function read(e,t,n,r,i){var s,l,o=i*8-r-1,c=(1<<o)-1,u=c>>1,f=-7,E=n?i-1:0,w=n?-1:1,h=e[t+E];for(E+=w,s=h&(1<<-f)-1,h>>=-f,f+=o;f>0;s=s*256+e[t+E],E+=w,f-=8);for(l=s&(1<<-f)-1,s>>=-f,f+=r;f>0;l=l*256+e[t+E],E+=w,f-=8);if(s===0)s=1-u;else{if(s===c)return l?NaN:(h?-1:1)*(1/0);l=l+Math.pow(2,r),s=s-u}return(h?-1:1)*l*Math.pow(2,s-r)}function write(e,t,n,r,i,s){var l,o,c,u=s*8-i-1,f=(1<<u)-1,E=f>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,g=r?1:-1,b=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,l=f):(l=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-l))<1&&(l--,c*=2),l+E>=1?t+=w/c:t+=w*Math.pow(2,1-E),t*c>=2&&(l++,c/=2),l+E>=f?(o=0,l=f):l+E>=1?(o=(t*c-1)*Math.pow(2,i),l=l+E):(o=t*Math.pow(2,E-1)*Math.pow(2,i),l=0));i>=8;e[n+h]=o&255,h+=g,o/=256,i-=8);for(l=l<<i|o,u+=i;u>0;e[n+h]=l&255,h+=g,l/=256,u-=8);e[n+h-g]|=b*128}var toString={}.toString,isArray$1=Array.isArray||function(e){return toString.call(e)=="[object Array]"};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==void 0?global$1.TYPED_ARRAY_SUPPORT:!0,kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=Buffer.prototype):(e===null&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,n){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,n)}Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e};function from(e,t,n,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?fromArrayBuffer(e,t,n,r):typeof t=="string"?fromString(e,t,n):fromObject(e,t)}Buffer.from=function(e,t,n){return from(null,e,t,n)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array);function assertSize(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function alloc(e,t,n,r){return assertSize(t),t<=0?createBuffer(e,t):n!==void 0?typeof r=="string"?createBuffer(e,t).fill(n,r):createBuffer(e,t).fill(n):createBuffer(e,t)}Buffer.alloc=function(e,t,n){return alloc(null,e,t,n)};function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:checked(t)|0),!Buffer.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,n){if((typeof n!="string"||n==="")&&(n="utf8"),!Buffer.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=byteLength(t,n)|0;e=createBuffer(e,r);var i=e.write(t,n);return i!==r&&(e=e.slice(0,i)),e}function fromArrayLike(e,t){var n=t.length<0?0:checked(t.length)|0;e=createBuffer(e,n);for(var r=0;r<n;r+=1)e[r]=t[r]&255;return e}function fromArrayBuffer(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return n===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,n):t=new Uint8Array(t,n,r),Buffer.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=Buffer.prototype):e=fromArrayLike(e,t),e}function fromObject(e,t){if(internalIsBuffer(t)){var n=checked(t.length)|0;return e=createBuffer(e,n),e.length===0||t.copy(e,0,0,n),e}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||isnan(t.length)?createBuffer(e,0):fromArrayLike(e,t);if(t.type==="Buffer"&&isArray$1(t.data))return fromArrayLike(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return e|0}Buffer.isBuffer=isBuffer;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function(t,n){if(!internalIsBuffer(t)||!internalIsBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,i=n.length,s=0,l=Math.min(r,i);s<l;++s)if(t[s]!==n[s]){r=t[s],i=n[s];break}return r<i?-1:i<r?1:0},Buffer.isEncoding=function(t){switch(String(t).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}},Buffer.concat=function(t,n){if(!isArray$1(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return Buffer.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<t.length;++r)n+=t[r].length;var i=Buffer.allocUnsafe(n),s=0;for(r=0;r<t.length;++r){var l=t[r];if(!internalIsBuffer(l))throw new TypeError('"list" argument must be an Array of Buffers');l.copy(i,s),s+=l.length}return i};function byteLength(e,t){if(internalIsBuffer(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),r=!0}}Buffer.byteLength=byteLength;function slowToString(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,n);case"utf8":case"utf-8":return utf8Slice(this,t,n);case"ascii":return asciiSlice(this,t,n);case"latin1":case"binary":return latin1Slice(this,t,n);case"base64":return base64Slice(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}Buffer.prototype._isBuffer=!0;function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}Buffer.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)swap(this,n,n+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)swap(this,n,n+3),swap(this,n+1,n+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)swap(this,n,n+7),swap(this,n+1,n+6),swap(this,n+2,n+5),swap(this,n+3,n+4);return this},Buffer.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:Buffer.compare(this,t)===0},Buffer.prototype.inspect=function(){var t="",n=INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,n,r,i,s){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),n<0||r>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&n>=r)return 0;if(i>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var l=s-i,o=r-n,c=Math.min(l,o),u=this.slice(i,s),f=t.slice(n,r),E=0;E<c;++E)if(u[E]!==f[E]){l=u[E],o=f[E];break}return l<o?-1:o<l?1:0};function bidirectionalIndexOf(e,t,n,r,i){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t=="string"&&(t=Buffer.from(t,r)),internalIsBuffer(t))return t.length===0?-1:arrayIndexOf(e,t,n,r,i);if(typeof t=="number")return t=t&255,Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):arrayIndexOf(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,n,r,i){var s=1,l=e.length,o=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;s=2,l/=2,o/=2,n/=2}function c(h,g){return s===1?h[g]:h.readUInt16BE(g*s)}var u;if(i){var f=-1;for(u=n;u<l;u++)if(c(e,u)===c(t,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===o)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(n+o>l&&(n=l-o),u=n;u>=0;u--){for(var E=!0,w=0;w<o;w++)if(c(e,u+w)!==c(t,w)){E=!1;break}if(E)return u}return-1}Buffer.prototype.includes=function(t,n,r){return this.indexOf(t,n,r)!==-1},Buffer.prototype.indexOf=function(t,n,r){return bidirectionalIndexOf(this,t,n,r,!0)},Buffer.prototype.lastIndexOf=function(t,n,r){return bidirectionalIndexOf(this,t,n,r,!1)};function hexWrite(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var l=0;l<r;++l){var o=parseInt(t.substr(l*2,2),16);if(isNaN(o))return l;e[n+l]=o}return l}function utf8Write(e,t,n,r){return blitBuffer(utf8ToBytes(t,e.length-n),e,n,r)}function asciiWrite(e,t,n,r){return blitBuffer(asciiToBytes(t),e,n,r)}function latin1Write(e,t,n,r){return asciiWrite(e,t,n,r)}function base64Write(e,t,n,r){return blitBuffer(base64ToBytes(t),e,n,r)}function ucs2Write(e,t,n,r){return blitBuffer(utf16leToBytes(t,e.length-n),e,n,r)}Buffer.prototype.write=function(t,n,r,i){if(n===void 0)i="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")i=n,r=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-n;if((r===void 0||r>s)&&(r=s),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return hexWrite(this,t,n,r);case"utf8":case"utf-8":return utf8Write(this,t,n,r);case"ascii":return asciiWrite(this,t,n,r);case"latin1":case"binary":return latin1Write(this,t,n,r);case"base64":return base64Write(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,n,r);default:if(l)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),l=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,n){return t===0&&n===e.length?fromByteArray(e):fromByteArray(e.slice(t,n))}function utf8Slice(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var s=e[i],l=null,o=s>239?4:s>223?3:s>191?2:1;if(i+o<=n){var c,u,f,E;switch(o){case 1:s<128&&(l=s);break;case 2:c=e[i+1],(c&192)===128&&(E=(s&31)<<6|c&63,E>127&&(l=E));break;case 3:c=e[i+1],u=e[i+2],(c&192)===128&&(u&192)===128&&(E=(s&15)<<12|(c&63)<<6|u&63,E>2047&&(E<55296||E>57343)&&(l=E));break;case 4:c=e[i+1],u=e[i+2],f=e[i+3],(c&192)===128&&(u&192)===128&&(f&192)===128&&(E=(s&15)<<18|(c&63)<<12|(u&63)<<6|f&63,E>65535&&E<1114112&&(l=E))}}l===null?(l=65533,o=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|l&1023),r.push(l),i+=o}return decodeCodePointsArray(r)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=MAX_ARGUMENTS_LENGTH));return n}function asciiSlice(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function latin1Slice(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function hexSlice(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=t;s<n;++s)i+=toHex(e[s]);return i}function utf16leSlice(e,t,n){for(var r=e.slice(t,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+r[s+1]*256);return i}Buffer.prototype.slice=function(t,n){var r=this.length;t=~~t,n=n===void 0?r:~~n,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<t&&(n=t);var i;if(Buffer.TYPED_ARRAY_SUPPORT)i=this.subarray(t,n),i.__proto__=Buffer.prototype;else{var s=n-t;i=new Buffer(s,void 0);for(var l=0;l<s;++l)i[l]=this[l+t]}return i};function checkOffset(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=this[t],s=1,l=0;++l<n&&(s*=256);)i+=this[t+l]*s;return i},Buffer.prototype.readUIntBE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=this[t+--n],s=1;n>0&&(s*=256);)i+=this[t+--n]*s;return i},Buffer.prototype.readUInt8=function(t,n){return n||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,n){return n||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,n){return n||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,n){return n||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},Buffer.prototype.readUInt32BE=function(t,n){return n||checkOffset(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=this[t],s=1,l=0;++l<n&&(s*=256);)i+=this[t+l]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*n)),i},Buffer.prototype.readIntBE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=n,s=1,l=this[t+--i];i>0&&(s*=256);)l+=this[t+--i]*s;return s*=128,l>=s&&(l-=Math.pow(2,8*n)),l},Buffer.prototype.readInt8=function(t,n){return n||checkOffset(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},Buffer.prototype.readInt16LE=function(t,n){n||checkOffset(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},Buffer.prototype.readInt16BE=function(t,n){n||checkOffset(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},Buffer.prototype.readInt32LE=function(t,n){return n||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,n){return n||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,n){return n||checkOffset(t,4,this.length),read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,n){return n||checkOffset(t,4,this.length),read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,n){return n||checkOffset(t,8,this.length),read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,n){return n||checkOffset(t,8,this.length),read(this,t,!1,52,8)};function checkInt(e,t,n,r,i,s){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function(t,n,r,i){if(t=+t,n=n|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;checkInt(this,t,n,r,s,0)}var l=1,o=0;for(this[n]=t&255;++o<r&&(l*=256);)this[n+o]=t/l&255;return n+r},Buffer.prototype.writeUIntBE=function(t,n,r,i){if(t=+t,n=n|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;checkInt(this,t,n,r,s,0)}var l=r-1,o=1;for(this[n+l]=t&255;--l>=0&&(o*=256);)this[n+l]=t/o&255;return n+r},Buffer.prototype.writeUInt8=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1};function objectWriteUInt16(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i<s;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}Buffer.prototype.writeUInt16LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):objectWriteUInt16(this,t,n,!0),n+2},Buffer.prototype.writeUInt16BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):objectWriteUInt16(this,t,n,!1),n+2};function objectWriteUInt32(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i<s;++i)e[n+i]=t>>>(r?i:3-i)*8&255}Buffer.prototype.writeUInt32LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):objectWriteUInt32(this,t,n,!0),n+4},Buffer.prototype.writeUInt32BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):objectWriteUInt32(this,t,n,!1),n+4},Buffer.prototype.writeIntLE=function(t,n,r,i){if(t=+t,n=n|0,!i){var s=Math.pow(2,8*r-1);checkInt(this,t,n,r,s-1,-s)}var l=0,o=1,c=0;for(this[n]=t&255;++l<r&&(o*=256);)t<0&&c===0&&this[n+l-1]!==0&&(c=1),this[n+l]=(t/o>>0)-c&255;return n+r},Buffer.prototype.writeIntBE=function(t,n,r,i){if(t=+t,n=n|0,!i){var s=Math.pow(2,8*r-1);checkInt(this,t,n,r,s-1,-s)}var l=r-1,o=1,c=0;for(this[n+l]=t&255;--l>=0&&(o*=256);)t<0&&c===0&&this[n+l+1]!==0&&(c=1),this[n+l]=(t/o>>0)-c&255;return n+r},Buffer.prototype.writeInt8=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},Buffer.prototype.writeInt16LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):objectWriteUInt16(this,t,n,!0),n+2},Buffer.prototype.writeInt16BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):objectWriteUInt16(this,t,n,!1),n+2},Buffer.prototype.writeInt32LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):objectWriteUInt32(this,t,n,!0),n+4},Buffer.prototype.writeInt32BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):objectWriteUInt32(this,t,n,!1),n+4};function checkIEEE754(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){return i||checkIEEE754(e,t,n,4),write(e,t,n,r,23,4),n+4}Buffer.prototype.writeFloatLE=function(t,n,r){return writeFloat(this,t,n,!0,r)},Buffer.prototype.writeFloatBE=function(t,n,r){return writeFloat(this,t,n,!1,r)};function writeDouble(e,t,n,r,i){return i||checkIEEE754(e,t,n,8),write(e,t,n,r,52,8),n+8}Buffer.prototype.writeDoubleLE=function(t,n,r){return writeDouble(this,t,n,!0,r)},Buffer.prototype.writeDoubleBE=function(t,n,r){return writeDouble(this,t,n,!1,r)},Buffer.prototype.copy=function(t,n,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),n>=t.length&&(n=t.length),n||(n=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-n<i-r&&(i=t.length-n+r);var s=i-r,l;if(this===t&&r<n&&n<i)for(l=s-1;l>=0;--l)t[l+n]=this[l+r];else if(s<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(l=0;l<s;++l)t[l+n]=this[l+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),n);return s},Buffer.prototype.fill=function(t,n,r,i){if(typeof t=="string"){if(typeof n=="string"?(i=n,n=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Buffer.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var l;if(typeof t=="number")for(l=n;l<r;++l)this[l]=t;else{var o=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,i).toString()),c=o.length;for(l=0;l<r-n;++l)this[l+n]=o[l%c]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){if(e=stringtrim(e).replace(INVALID_BASE64_RE,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){t=t||1/0;for(var n,r=e.length,i=null,s=[],l=0;l<r;++l){if(n=e.charCodeAt(l),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(l+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function asciiToBytes(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function utf16leToBytes(e,t){for(var n,r,i,s=[],l=0;l<e.length&&!((t-=2)<0);++l)n=e.charCodeAt(l),r=n>>8,i=n%256,s.push(i),s.push(r);return s}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&isFastBuffer(e.slice(0,0))}var distExports={},dist={get exports(){return distExports},set exports(e){distExports=e}};/*! For license information please see index.js.LICENSE.txt */(function(module,exports){(function(e,t){module.exports=t()})(window,function(){return function(e){function t(u){for(var f,E,w=u[0],h=u[1],g=0,b=[];g<w.length;g++)E=w[g],Object.prototype.hasOwnProperty.call(r,E)&&r[E]&&b.push(r[E][0]),r[E]=0;for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&(e[f]=h[f]);for(c&&c(u);b.length;)b.shift()()}var n={},r={0:0};function i(u){if(n[u])return n[u].exports;var f=n[u]={i:u,l:!1,exports:{}};return e[u].call(f.exports,f,f.exports,i),f.l=!0,f.exports}i.e=function(){return Promise.resolve()},i.m=e,i.c=n,i.d=function(u,f,E){i.o(u,f)||Object.defineProperty(u,f,{enumerable:!0,get:E})},i.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},i.t=function(u,f){if(1&f&&(u=i(u)),8&f||4&f&&typeof u=="object"&&u&&u.__esModule)return u;var E=Object.create(null);if(i.r(E),Object.defineProperty(E,"default",{enumerable:!0,value:u}),2&f&&typeof u!="string")for(var w in u)i.d(E,w,function(h){return u[h]}.bind(null,w));return E},i.n=function(u){var f=u&&u.__esModule?function(){return u.default}:function(){return u};return i.d(f,"a",f),f},i.o=function(u,f){return Object.prototype.hasOwnProperty.call(u,f)},i.p="",i.oe=function(u){throw console.error(u),u};var s=window.webpackJsonpFormantRealtimeSDK=window.webpackJsonpFormantRealtimeSDK||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var o=0;o<s.length;o++)t(s[o]);var c=l;return i(i.s=228)}([function(e,t,n){n.d(t,"a",function(){return G});function r(T,k){if(k.length<T)throw new TypeError(T+" argument"+(T>1?"s":"")+" required, but only "+k.length+" present")}function i(T){if(T===null||T===!0||T===!1)return NaN;var k=Number(T);return isNaN(k)?k:k<0?Math.ceil(k):Math.floor(k)}var s={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},l=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,o=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,c=/^([+-])(\d{2})(?::?(\d{2}))?$/;function u(T){var k,J={},K=T.split(s.dateTimeDelimiter);if(K.length>2)return J;if(/:/.test(K[0])?k=K[0]:(J.date=K[0],k=K[1],s.timeZoneDelimiter.test(J.date)&&(J.date=T.split(s.timeZoneDelimiter)[0],k=T.substr(J.date.length,T.length))),k){var re=s.timezone.exec(k);re?(J.time=k.replace(re[1],""),J.timezone=re[1]):J.time=k}return J}function f(T,k){var J=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+k)+"})|(\\d{2}|[+-]\\d{"+(2+k)+"})$)"),K=T.match(J);if(!K)return{year:NaN,restDateString:""};var re=K[1]?parseInt(K[1]):null,se=K[2]?parseInt(K[2]):null;return{year:se===null?re:100*se,restDateString:T.slice((K[1]||K[2]).length)}}function E(T,k){if(k===null)return new Date(NaN);var J=T.match(l);if(!J)return new Date(NaN);var K=!!J[4],re=w(J[1]),se=w(J[2])-1,fe=w(J[3]),ve=w(J[4]),Ce=w(J[5])-1;if(K)return function(Ie,Te,Oe){return Te>=1&&Te<=53&&Oe>=0&&Oe<=6}(0,ve,Ce)?function(Ie,Te,Oe){var De=new Date(0);De.setUTCFullYear(Ie,0,4);var Ye=De.getUTCDay()||7,nt=7*(Te-1)+Oe+1-Ye;return De.setUTCDate(De.getUTCDate()+nt),De}(k,ve,Ce):new Date(NaN);var Se=new Date(0);return function(Ie,Te,Oe){return Te>=0&&Te<=11&&Oe>=1&&Oe<=(R[Te]||(j(Ie)?29:28))}(k,se,fe)&&function(Ie,Te){return Te>=1&&Te<=(j(Ie)?366:365)}(k,re)?(Se.setUTCFullYear(k,se,Math.max(re,fe)),Se):new Date(NaN)}function w(T){return T?parseInt(T):1}function h(T){var k=T.match(o);if(!k)return NaN;var J=g(k[1]),K=g(k[2]),re=g(k[3]);return function(se,fe,ve){return se===24?fe===0&&ve===0:ve>=0&&ve<60&&fe>=0&&fe<60&&se>=0&&se<25}(J,K,re)?36e5*J+6e4*K+1e3*re:NaN}function g(T){return T&&parseFloat(T.replace(",","."))||0}function b(T){if(T==="Z")return 0;var k=T.match(c);if(!k)return 0;var J=k[1]==="+"?-1:1,K=parseInt(k[2]),re=k[3]&&parseInt(k[3])||0;return function(se,fe){return fe>=0&&fe<=59}(0,re)?J*(36e5*K+6e4*re):NaN}var R=[31,null,31,30,31,30,31,31,30,31,30,31];function j(T){return T%400==0||T%4==0&&T%100!=0}function F(T){return r(1,arguments),T instanceof Date||typeof T=="object"&&Object.prototype.toString.call(T)==="[object Date]"}function M(T){r(1,arguments);var k=Object.prototype.toString.call(T);return T instanceof Date||typeof T=="object"&&k==="[object Date]"?new Date(T.getTime()):typeof T=="number"||k==="[object Number]"?new Date(T):(typeof T!="string"&&k!=="[object String]"||typeof console>"u"||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function A(T){const k=function(J,K){var re;r(1,arguments);var se=i((re=K==null?void 0:K.additionalDigits)!==null&&re!==void 0?re:2);if(se!==2&&se!==1&&se!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(typeof J!="string"&&Object.prototype.toString.call(J)!=="[object String]")return new Date(NaN);var fe,ve=u(J);if(ve.date){var Ce=f(ve.date,se);fe=E(Ce.restDateString,Ce.year)}if(!fe||isNaN(fe.getTime()))return new Date(NaN);var Se,Ie=fe.getTime(),Te=0;if(ve.time&&(Te=h(ve.time),isNaN(Te)))return new Date(NaN);if(!ve.timezone){var Oe=new Date(Ie+Te),De=new Date(0);return De.setFullYear(Oe.getUTCFullYear(),Oe.getUTCMonth(),Oe.getUTCDate()),De.setHours(Oe.getUTCHours(),Oe.getUTCMinutes(),Oe.getUTCSeconds(),Oe.getUTCMilliseconds()),De}return Se=b(ve.timezone),isNaN(Se)?new Date(NaN):new Date(Ie+Te+Se)}(T);if(!function(J){if(r(1,arguments),!F(J)&&typeof J!="number")return!1;var K=M(J);return!isNaN(Number(K))}(k))throw new Error(`Invalid ISO 8601 date string (${T})`);return k}const d=Math.pow(2,20),C=d;var $=n(14),q=n.n($),y=n(18),m=n(56),I=n(19),_=n(4),L=n(34);function W(T){return q()(T,{cycles:!0})}var B=function(T,k){var J={};for(var K in T)Object.prototype.hasOwnProperty.call(T,K)&&k.indexOf(K)<0&&(J[K]=T[K]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var re=0;for(K=Object.getOwnPropertySymbols(T);re<K.length;re++)k.indexOf(K[re])<0&&Object.prototype.propertyIsEnumerable.call(T,K[re])&&(J[K[re]]=T[K[re]])}return J};function N(T,k={}){const J=ve=>k.redacted!==!1?Object(L.a)(ve):ve;if(!T.stack)return{message:W(J(T))};const{name:K,message:re,stack:se}=T,fe=B(T,["name","message","stack"]);return{name:K,message:re!==void 0?re:W(J(T)),stack:se,meta:fe&&Object.keys(fe).length===0?void 0:J(fe)}}function P(T,k={}){const{message:J,stack:K,meta:re}=N(T,k);return`${K||J||""}${re&&Object.keys(re).length>0?` -- ${W(re)}`:""}`}var z=n(39),O=n(103),p=n.n(O),U=function(T,k,J,K){return new(J||(J=Promise))(function(re,se){function fe(Se){try{Ce(K.next(Se))}catch(Ie){se(Ie)}}function ve(Se){try{Ce(K.throw(Se))}catch(Ie){se(Ie)}}function Ce(Se){var Ie;Se.done?re(Se.value):(Ie=Se.value,Ie instanceof J?Ie:new J(function(Te){Te(Ie)})).then(fe,ve)}Ce((K=K.apply(T,k||[])).next())})},V=function(T,k){var J={};for(var K in T)Object.prototype.hasOwnProperty.call(T,K)&&k.indexOf(K)<0&&(J[K]=T[K]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var re=0;for(K=Object.getOwnPropertySymbols(T);re<K.length;re++)k.indexOf(K[re])<0&&Object.prototype.propertyIsEnumerable.call(T,K[re])&&(J[K[re]]=T[K[re]])}return J};class Q extends p.a{constructor(k,J){super(),this.endpoint=k,this.metadata=J,this.logClient=this.getLogClient()}getLogClient(){return U(this,void 0,void 0,function*(){const{LogClient:k}=yield Promise.resolve().then(n.bind(null,231));return new k(this.endpoint)})}log(k,J){return U(this,void 0,void 0,function*(){const{level:K,message:re,error:se}=k,fe=V(k,["level","message","error"]);this.emit("logged");try{yield(yield this.logClient).log([{timestamp:new Date().toISOString(),level:K,message:`${re}`.substring(0,1e3),error:se!==void 0?N(se):void 0,meta:Object.assign(Object.assign({},fe),this.metadata)}])}catch(ve){console.error(`Failed to log to log-api: ${P(ve)}`)}J()})}}var ee=function(T,k){var J={};for(var K in T)Object.prototype.hasOwnProperty.call(T,K)&&k.indexOf(K)<0&&(J[K]=T[K]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var re=0;for(K=Object.getOwnPropertySymbols(T);re<K.length;re++)k.indexOf(K[re])<0&&Object.prototype.propertyIsEnumerable.call(T,K[re])&&(J[K[re]]=T[K[re]])}return J};const ne={app:_.a,namespace:_.i,buildTag:_.b,instanceId:z.a},Y=_.e?I.format.printf(T=>{var{timestamp:k,level:J,message:K,error:re}=T,se=ee(T,["timestamp","level","message","error"]);const fe=Object.assign(Object.assign({timestamp:k?A(k).getTime():new Date().getTime(),level:J.toUpperCase(),message:K},re?{error:N(re)}:{}),{meta:Object.assign(Object.assign({},ne),se)});return q()(fe,{cycles:!0})}):I.format.printf(T=>{var{timestamp:k,level:J,message:K,error:re}=T,se=ee(T,["timestamp","level","message","error"]);let fe=`${k||new Date().toISOString()} ${J.toUpperCase()}: ${K} `;return Object.keys(se).length>0&&(fe+=q()(se,{cycles:!0})),re&&(fe+=`
|
|
7
|
-
${P(re)}`),fe}),G=Object(I.createLogger)({level:_.f});if(G.add(new I.transports.Console({format:Y,level:"debug"})),G.transports.forEach(T=>{T.silent=!_.g}),_.d&&G.add(new Q(_.d,ne)),_.h){const T=m.resolve(y.tmpdir(),`silly-${_.a}.log`);G.debug("Logging silly logs to file",{filename:T}),G.add(new I.transports.File({filename:T,maxsize:1*C,maxFiles:10,format:I.format.combine((S="silly",Object(I.format)(k=>k.level===S&&k)()),Y),level:"silly"}))}var S},function(e,t,n){n.d(t,"a",function(){return r});const r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}},function(e,t){var n,r,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function o(R){if(n===setTimeout)return setTimeout(R,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(R,0);try{return n(R,0)}catch{try{return n.call(null,R,0)}catch{return n.call(this,R,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:s}catch{n=s}try{r=typeof clearTimeout=="function"?clearTimeout:l}catch{r=l}})();var c,u=[],f=!1,E=-1;function w(){f&&c&&(f=!1,c.length?u=c.concat(u):E=-1,u.length&&h())}function h(){if(!f){var R=o(w);f=!0;for(var j=u.length;j;){for(c=u,u=[];++E<j;)c&&c[E].run();E=-1,j=u.length}c=null,f=!1,function(F){if(r===clearTimeout)return clearTimeout(F);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(F);try{r(F)}catch{try{return r.call(null,F)}catch{return r.call(this,F)}}}(R)}}function g(R,j){this.fun=R,this.array=j}function b(){}i.nextTick=function(R){var j=new Array(arguments.length-1);if(arguments.length>1)for(var F=1;F<arguments.length;F++)j[F-1]=arguments[F];u.push(new g(R,j)),u.length!==1||f||o(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(R){return[]},i.binding=function(R){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(R){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")}),Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")}),Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")}),Object.defineProperty(t,"configs",{value:n(118)})},function(e,t,n){(function(r){n.d(t,"a",function(){return l}),n.d(t,"i",function(){return o}),n.d(t,"j",function(){return c}),n.d(t,"b",function(){return u}),n.d(t,"f",function(){return f}),n.d(t,"e",function(){return E}),n.d(t,"g",function(){return w}),n.d(t,"d",function(){return h}),n.d(t,"c",function(){return g}),n.d(t,"h",function(){return b});var i=n(102);const s=i.from({ENVIRONMENT:r.env.ENV,AGGREGATE_LEVEL:r.env.AGGREGATE_LEVEL,API_ENDPOINT:r.env.API_ENDPOINT,APP:"realtime-sdk",APP_PATH:r.env.APP_PATH,BUILD_TAG:r.env.BUILD_TAG,ENABLE_SELF_SERVE:r.env.ENABLE_SELF_SERVE,ENABLE_SENTRY:r.env.ENABLE_SENTRY,ENABLE_SENTRY_PROFILING:r.env.ENABLE_SENTRY_PROFILING,GIT_COMMIT:r.env.GIT_COMMIT,JEST_WORKER_ID:r.env.JEST_WORKER_ID,LOG_API_ENDPOINT:r.env.LOG_API_ENDPOINT,LOG_JSON:"false",LOG_LEVEL:r.env.LOG_LEVEL,LOG_TO_CONSOLE:r.env.LOG_TO_CONSOLE,LOG_TO_FILE:r.env.LOG_TO_FILE,NAMESPACE:"production",SENTRY_DSN:r.env.SENTRY_DSN,SHEET_EXPORT_MAX_ROW_COUNT:r.env.SHEET_EXPORT_MAX_ROW_COUNT,STABLE_AGENT_VERSION:r.env.STABLE_AGENT_VERSION,VERSION:r.env.VERSION}),l=(s.get("ENVIRONMENT").default("").asString(),s.get("APP").default("").asString()),o=(s.get("APP_PATH").default("").asString(),s.get("API_ENDPOINT").default("").asString(),s.get("NAMESPACE").default("").asString()),c=s.get("VERSION").default("").asString(),u=s.get("BUILD_TAG").default("").asString(),f=(s.get("GIT_COMMIT").default("").asString(),s.get("ENABLE_SENTRY").default("false").asBool(),s.get("ENABLE_SENTRY_PROFILING").default("false").asBool(),s.get("SENTRY_DSN").default("").asString(),s.get("LOG_LEVEL").default("debug").asString()),E=s.get("LOG_JSON").default("true").asBool(),w=s.get("LOG_TO_CONSOLE").default("true").asBool(),h=(s.get("STABLE_AGENT_VERSION").default("").asString(),s.get("LOG_API_ENDPOINT").asString()),g=s.get("JEST_WORKER_ID").asString(),b=(s.get("SHEET_EXPORT_MAX_ROW_COUNT").default("10000").asIntPositive(),s.get("LOG_TO_FILE").default("false").asBoolStrict());s.get("ENABLE_SELF_SERVE").default("true").asBoolStrict(),s.get("AGGREGATE_LEVEL").default("hour").asEnum(["day","hour","minute"])}).call(this,n(2))},function(e,t,n){(function(r){var i=n(126),s=n(127),l=n(42);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(S,T){if(o()<T)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(S=new Uint8Array(T)).__proto__=u.prototype:(S===null&&(S=new u(T)),S.length=T),S}function u(S,T,k){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(S,T,k);if(typeof S=="number"){if(typeof T=="string")throw new Error("If encoding is specified then the first argument must be a string");return w(this,S)}return f(this,S,T,k)}function f(S,T,k,J){if(typeof T=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&T instanceof ArrayBuffer?function(K,re,se,fe){if(re.byteLength,se<0||re.byteLength<se)throw new RangeError("'offset' is out of bounds");if(re.byteLength<se+(fe||0))throw new RangeError("'length' is out of bounds");return re=se===void 0&&fe===void 0?new Uint8Array(re):fe===void 0?new Uint8Array(re,se):new Uint8Array(re,se,fe),u.TYPED_ARRAY_SUPPORT?(K=re).__proto__=u.prototype:K=h(K,re),K}(S,T,k,J):typeof T=="string"?function(K,re,se){if(typeof se=="string"&&se!==""||(se="utf8"),!u.isEncoding(se))throw new TypeError('"encoding" must be a valid string encoding');var fe=0|b(re,se),ve=(K=c(K,fe)).write(re,se);return ve!==fe&&(K=K.slice(0,ve)),K}(S,T,k):function(K,re){if(u.isBuffer(re)){var se=0|g(re.length);return(K=c(K,se)).length===0||re.copy(K,0,0,se),K}if(re){if(typeof ArrayBuffer<"u"&&re.buffer instanceof ArrayBuffer||"length"in re)return typeof re.length!="number"||(fe=re.length)!=fe?c(K,0):h(K,re);if(re.type==="Buffer"&&l(re.data))return h(K,re.data)}var fe;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(S,T)}function E(S){if(typeof S!="number")throw new TypeError('"size" argument must be a number');if(S<0)throw new RangeError('"size" argument must not be negative')}function w(S,T){if(E(T),S=c(S,T<0?0:0|g(T)),!u.TYPED_ARRAY_SUPPORT)for(var k=0;k<T;++k)S[k]=0;return S}function h(S,T){var k=T.length<0?0:0|g(T.length);S=c(S,k);for(var J=0;J<k;J+=1)S[J]=255&T[J];return S}function g(S){if(S>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|S}function b(S,T){if(u.isBuffer(S))return S.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(S)||S instanceof ArrayBuffer))return S.byteLength;typeof S!="string"&&(S=""+S);var k=S.length;if(k===0)return 0;for(var J=!1;;)switch(T){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":case void 0:return ne(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Y(S).length;default:if(J)return ne(S).length;T=(""+T).toLowerCase(),J=!0}}function R(S,T,k){var J=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(T>>>=0))return"";for(S||(S="utf8");;)switch(S){case"hex":return W(this,T,k);case"utf8":case"utf-8":return I(this,T,k);case"ascii":return _(this,T,k);case"latin1":case"binary":return L(this,T,k);case"base64":return m(this,T,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,T,k);default:if(J)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),J=!0}}function j(S,T,k){var J=S[T];S[T]=S[k],S[k]=J}function F(S,T,k,J,K){if(S.length===0)return-1;if(typeof k=="string"?(J=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,isNaN(k)&&(k=K?0:S.length-1),k<0&&(k=S.length+k),k>=S.length){if(K)return-1;k=S.length-1}else if(k<0){if(!K)return-1;k=0}if(typeof T=="string"&&(T=u.from(T,J)),u.isBuffer(T))return T.length===0?-1:M(S,T,k,J,K);if(typeof T=="number")return T&=255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(S,T,k):Uint8Array.prototype.lastIndexOf.call(S,T,k):M(S,[T],k,J,K);throw new TypeError("val must be string, number or Buffer")}function M(S,T,k,J,K){var re,se=1,fe=S.length,ve=T.length;if(J!==void 0&&((J=String(J).toLowerCase())==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(S.length<2||T.length<2)return-1;se=2,fe/=2,ve/=2,k/=2}function Ce(Oe,De){return se===1?Oe[De]:Oe.readUInt16BE(De*se)}if(K){var Se=-1;for(re=k;re<fe;re++)if(Ce(S,re)===Ce(T,Se===-1?0:re-Se)){if(Se===-1&&(Se=re),re-Se+1===ve)return Se*se}else Se!==-1&&(re-=re-Se),Se=-1}else for(k+ve>fe&&(k=fe-ve),re=k;re>=0;re--){for(var Ie=!0,Te=0;Te<ve;Te++)if(Ce(S,re+Te)!==Ce(T,Te)){Ie=!1;break}if(Ie)return re}return-1}function A(S,T,k,J){k=Number(k)||0;var K=S.length-k;J?(J=Number(J))>K&&(J=K):J=K;var re=T.length;if(re%2!=0)throw new TypeError("Invalid hex string");J>re/2&&(J=re/2);for(var se=0;se<J;++se){var fe=parseInt(T.substr(2*se,2),16);if(isNaN(fe))return se;S[k+se]=fe}return se}function d(S,T,k,J){return G(ne(T,S.length-k),S,k,J)}function C(S,T,k,J){return G(function(K){for(var re=[],se=0;se<K.length;++se)re.push(255&K.charCodeAt(se));return re}(T),S,k,J)}function $(S,T,k,J){return C(S,T,k,J)}function q(S,T,k,J){return G(Y(T),S,k,J)}function y(S,T,k,J){return G(function(K,re){for(var se,fe,ve,Ce=[],Se=0;Se<K.length&&!((re-=2)<0);++Se)se=K.charCodeAt(Se),fe=se>>8,ve=se%256,Ce.push(ve),Ce.push(fe);return Ce}(T,S.length-k),S,k,J)}function m(S,T,k){return T===0&&k===S.length?i.fromByteArray(S):i.fromByteArray(S.slice(T,k))}function I(S,T,k){k=Math.min(S.length,k);for(var J=[],K=T;K<k;){var re,se,fe,ve,Ce=S[K],Se=null,Ie=Ce>239?4:Ce>223?3:Ce>191?2:1;if(K+Ie<=k)switch(Ie){case 1:Ce<128&&(Se=Ce);break;case 2:(192&(re=S[K+1]))==128&&(ve=(31&Ce)<<6|63&re)>127&&(Se=ve);break;case 3:re=S[K+1],se=S[K+2],(192&re)==128&&(192&se)==128&&(ve=(15&Ce)<<12|(63&re)<<6|63&se)>2047&&(ve<55296||ve>57343)&&(Se=ve);break;case 4:re=S[K+1],se=S[K+2],fe=S[K+3],(192&re)==128&&(192&se)==128&&(192&fe)==128&&(ve=(15&Ce)<<18|(63&re)<<12|(63&se)<<6|63&fe)>65535&&ve<1114112&&(Se=ve)}Se===null?(Se=65533,Ie=1):Se>65535&&(Se-=65536,J.push(Se>>>10&1023|55296),Se=56320|1023&Se),J.push(Se),K+=Ie}return function(Te){var Oe=Te.length;if(Oe<=4096)return String.fromCharCode.apply(String,Te);for(var De="",Ye=0;Ye<Oe;)De+=String.fromCharCode.apply(String,Te.slice(Ye,Ye+=4096));return De}(J)}t.Buffer=u,t.SlowBuffer=function(S){return+S!=S&&(S=0),u.alloc(+S)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=r.TYPED_ARRAY_SUPPORT!==void 0?r.TYPED_ARRAY_SUPPORT:function(){try{var S=new Uint8Array(1);return S.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},S.foo()===42&&typeof S.subarray=="function"&&S.subarray(1,1).byteLength===0}catch{return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(S){return S.__proto__=u.prototype,S},u.from=function(S,T,k){return f(null,S,T,k)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(S,T,k){return function(J,K,re,se){return E(K),K<=0?c(J,K):re!==void 0?typeof se=="string"?c(J,K).fill(re,se):c(J,K).fill(re):c(J,K)}(null,S,T,k)},u.allocUnsafe=function(S){return w(null,S)},u.allocUnsafeSlow=function(S){return w(null,S)},u.isBuffer=function(S){return!(S==null||!S._isBuffer)},u.compare=function(S,T){if(!u.isBuffer(S)||!u.isBuffer(T))throw new TypeError("Arguments must be Buffers");if(S===T)return 0;for(var k=S.length,J=T.length,K=0,re=Math.min(k,J);K<re;++K)if(S[K]!==T[K]){k=S[K],J=T[K];break}return k<J?-1:J<k?1:0},u.isEncoding=function(S){switch(String(S).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(S,T){if(!l(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return u.alloc(0);var k;if(T===void 0)for(T=0,k=0;k<S.length;++k)T+=S[k].length;var J=u.allocUnsafe(T),K=0;for(k=0;k<S.length;++k){var re=S[k];if(!u.isBuffer(re))throw new TypeError('"list" argument must be an Array of Buffers');re.copy(J,K),K+=re.length}return J},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var S=this.length;if(S%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var T=0;T<S;T+=2)j(this,T,T+1);return this},u.prototype.swap32=function(){var S=this.length;if(S%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var T=0;T<S;T+=4)j(this,T,T+3),j(this,T+1,T+2);return this},u.prototype.swap64=function(){var S=this.length;if(S%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var T=0;T<S;T+=8)j(this,T,T+7),j(this,T+1,T+6),j(this,T+2,T+5),j(this,T+3,T+4);return this},u.prototype.toString=function(){var S=0|this.length;return S===0?"":arguments.length===0?I(this,0,S):R.apply(this,arguments)},u.prototype.equals=function(S){if(!u.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S||u.compare(this,S)===0},u.prototype.inspect=function(){var S="",T=t.INSPECT_MAX_BYTES;return this.length>0&&(S=this.toString("hex",0,T).match(/.{2}/g).join(" "),this.length>T&&(S+=" ... ")),"<Buffer "+S+">"},u.prototype.compare=function(S,T,k,J,K){if(!u.isBuffer(S))throw new TypeError("Argument must be a Buffer");if(T===void 0&&(T=0),k===void 0&&(k=S?S.length:0),J===void 0&&(J=0),K===void 0&&(K=this.length),T<0||k>S.length||J<0||K>this.length)throw new RangeError("out of range index");if(J>=K&&T>=k)return 0;if(J>=K)return-1;if(T>=k)return 1;if(this===S)return 0;for(var re=(K>>>=0)-(J>>>=0),se=(k>>>=0)-(T>>>=0),fe=Math.min(re,se),ve=this.slice(J,K),Ce=S.slice(T,k),Se=0;Se<fe;++Se)if(ve[Se]!==Ce[Se]){re=ve[Se],se=Ce[Se];break}return re<se?-1:se<re?1:0},u.prototype.includes=function(S,T,k){return this.indexOf(S,T,k)!==-1},u.prototype.indexOf=function(S,T,k){return F(this,S,T,k,!0)},u.prototype.lastIndexOf=function(S,T,k){return F(this,S,T,k,!1)},u.prototype.write=function(S,T,k,J){if(T===void 0)J="utf8",k=this.length,T=0;else if(k===void 0&&typeof T=="string")J=T,k=this.length,T=0;else{if(!isFinite(T))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");T|=0,isFinite(k)?(k|=0,J===void 0&&(J="utf8")):(J=k,k=void 0)}var K=this.length-T;if((k===void 0||k>K)&&(k=K),S.length>0&&(k<0||T<0)||T>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");for(var re=!1;;)switch(J){case"hex":return A(this,S,T,k);case"utf8":case"utf-8":return d(this,S,T,k);case"ascii":return C(this,S,T,k);case"latin1":case"binary":return $(this,S,T,k);case"base64":return q(this,S,T,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,S,T,k);default:if(re)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),re=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(S,T,k){var J="";k=Math.min(S.length,k);for(var K=T;K<k;++K)J+=String.fromCharCode(127&S[K]);return J}function L(S,T,k){var J="";k=Math.min(S.length,k);for(var K=T;K<k;++K)J+=String.fromCharCode(S[K]);return J}function W(S,T,k){var J=S.length;(!T||T<0)&&(T=0),(!k||k<0||k>J)&&(k=J);for(var K="",re=T;re<k;++re)K+=ee(S[re]);return K}function B(S,T,k){for(var J=S.slice(T,k),K="",re=0;re<J.length;re+=2)K+=String.fromCharCode(J[re]+256*J[re+1]);return K}function N(S,T,k){if(S%1!=0||S<0)throw new RangeError("offset is not uint");if(S+T>k)throw new RangeError("Trying to access beyond buffer length")}function P(S,T,k,J,K,re){if(!u.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>K||T<re)throw new RangeError('"value" argument is out of bounds');if(k+J>S.length)throw new RangeError("Index out of range")}function z(S,T,k,J){T<0&&(T=65535+T+1);for(var K=0,re=Math.min(S.length-k,2);K<re;++K)S[k+K]=(T&255<<8*(J?K:1-K))>>>8*(J?K:1-K)}function O(S,T,k,J){T<0&&(T=4294967295+T+1);for(var K=0,re=Math.min(S.length-k,4);K<re;++K)S[k+K]=T>>>8*(J?K:3-K)&255}function p(S,T,k,J,K,re){if(k+J>S.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function U(S,T,k,J,K){return K||p(S,0,k,4),s.write(S,T,k,J,23,4),k+4}function V(S,T,k,J,K){return K||p(S,0,k,8),s.write(S,T,k,J,52,8),k+8}u.prototype.slice=function(S,T){var k,J=this.length;if((S=~~S)<0?(S+=J)<0&&(S=0):S>J&&(S=J),(T=T===void 0?J:~~T)<0?(T+=J)<0&&(T=0):T>J&&(T=J),T<S&&(T=S),u.TYPED_ARRAY_SUPPORT)(k=this.subarray(S,T)).__proto__=u.prototype;else{var K=T-S;k=new u(K,void 0);for(var re=0;re<K;++re)k[re]=this[re+S]}return k},u.prototype.readUIntLE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=this[S],K=1,re=0;++re<T&&(K*=256);)J+=this[S+re]*K;return J},u.prototype.readUIntBE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=this[S+--T],K=1;T>0&&(K*=256);)J+=this[S+--T]*K;return J},u.prototype.readUInt8=function(S,T){return T||N(S,1,this.length),this[S]},u.prototype.readUInt16LE=function(S,T){return T||N(S,2,this.length),this[S]|this[S+1]<<8},u.prototype.readUInt16BE=function(S,T){return T||N(S,2,this.length),this[S]<<8|this[S+1]},u.prototype.readUInt32LE=function(S,T){return T||N(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+16777216*this[S+3]},u.prototype.readUInt32BE=function(S,T){return T||N(S,4,this.length),16777216*this[S]+(this[S+1]<<16|this[S+2]<<8|this[S+3])},u.prototype.readIntLE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=this[S],K=1,re=0;++re<T&&(K*=256);)J+=this[S+re]*K;return J>=(K*=128)&&(J-=Math.pow(2,8*T)),J},u.prototype.readIntBE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=T,K=1,re=this[S+--J];J>0&&(K*=256);)re+=this[S+--J]*K;return re>=(K*=128)&&(re-=Math.pow(2,8*T)),re},u.prototype.readInt8=function(S,T){return T||N(S,1,this.length),128&this[S]?-1*(255-this[S]+1):this[S]},u.prototype.readInt16LE=function(S,T){T||N(S,2,this.length);var k=this[S]|this[S+1]<<8;return 32768&k?4294901760|k:k},u.prototype.readInt16BE=function(S,T){T||N(S,2,this.length);var k=this[S+1]|this[S]<<8;return 32768&k?4294901760|k:k},u.prototype.readInt32LE=function(S,T){return T||N(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},u.prototype.readInt32BE=function(S,T){return T||N(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},u.prototype.readFloatLE=function(S,T){return T||N(S,4,this.length),s.read(this,S,!0,23,4)},u.prototype.readFloatBE=function(S,T){return T||N(S,4,this.length),s.read(this,S,!1,23,4)},u.prototype.readDoubleLE=function(S,T){return T||N(S,8,this.length),s.read(this,S,!0,52,8)},u.prototype.readDoubleBE=function(S,T){return T||N(S,8,this.length),s.read(this,S,!1,52,8)},u.prototype.writeUIntLE=function(S,T,k,J){S=+S,T|=0,k|=0,J||P(this,S,T,k,Math.pow(2,8*k)-1,0);var K=1,re=0;for(this[T]=255&S;++re<k&&(K*=256);)this[T+re]=S/K&255;return T+k},u.prototype.writeUIntBE=function(S,T,k,J){S=+S,T|=0,k|=0,J||P(this,S,T,k,Math.pow(2,8*k)-1,0);var K=k-1,re=1;for(this[T+K]=255&S;--K>=0&&(re*=256);)this[T+K]=S/re&255;return T+k},u.prototype.writeUInt8=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,1,255,0),u.TYPED_ARRAY_SUPPORT||(S=Math.floor(S)),this[T]=255&S,T+1},u.prototype.writeUInt16LE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[T]=255&S,this[T+1]=S>>>8):z(this,S,T,!0),T+2},u.prototype.writeUInt16BE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>8,this[T+1]=255&S):z(this,S,T,!1),T+2},u.prototype.writeUInt32LE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[T+3]=S>>>24,this[T+2]=S>>>16,this[T+1]=S>>>8,this[T]=255&S):O(this,S,T,!0),T+4},u.prototype.writeUInt32BE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>24,this[T+1]=S>>>16,this[T+2]=S>>>8,this[T+3]=255&S):O(this,S,T,!1),T+4},u.prototype.writeIntLE=function(S,T,k,J){if(S=+S,T|=0,!J){var K=Math.pow(2,8*k-1);P(this,S,T,k,K-1,-K)}var re=0,se=1,fe=0;for(this[T]=255&S;++re<k&&(se*=256);)S<0&&fe===0&&this[T+re-1]!==0&&(fe=1),this[T+re]=(S/se>>0)-fe&255;return T+k},u.prototype.writeIntBE=function(S,T,k,J){if(S=+S,T|=0,!J){var K=Math.pow(2,8*k-1);P(this,S,T,k,K-1,-K)}var re=k-1,se=1,fe=0;for(this[T+re]=255&S;--re>=0&&(se*=256);)S<0&&fe===0&&this[T+re+1]!==0&&(fe=1),this[T+re]=(S/se>>0)-fe&255;return T+k},u.prototype.writeInt8=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,1,127,-128),u.TYPED_ARRAY_SUPPORT||(S=Math.floor(S)),S<0&&(S=255+S+1),this[T]=255&S,T+1},u.prototype.writeInt16LE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[T]=255&S,this[T+1]=S>>>8):z(this,S,T,!0),T+2},u.prototype.writeInt16BE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>8,this[T+1]=255&S):z(this,S,T,!1),T+2},u.prototype.writeInt32LE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[T]=255&S,this[T+1]=S>>>8,this[T+2]=S>>>16,this[T+3]=S>>>24):O(this,S,T,!0),T+4},u.prototype.writeInt32BE=function(S,T,k){return S=+S,T|=0,k||P(this,S,T,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>24,this[T+1]=S>>>16,this[T+2]=S>>>8,this[T+3]=255&S):O(this,S,T,!1),T+4},u.prototype.writeFloatLE=function(S,T,k){return U(this,S,T,!0,k)},u.prototype.writeFloatBE=function(S,T,k){return U(this,S,T,!1,k)},u.prototype.writeDoubleLE=function(S,T,k){return V(this,S,T,!0,k)},u.prototype.writeDoubleBE=function(S,T,k){return V(this,S,T,!1,k)},u.prototype.copy=function(S,T,k,J){if(k||(k=0),J||J===0||(J=this.length),T>=S.length&&(T=S.length),T||(T=0),J>0&&J<k&&(J=k),J===k||S.length===0||this.length===0)return 0;if(T<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("sourceStart out of bounds");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),S.length-T<J-k&&(J=S.length-T+k);var K,re=J-k;if(this===S&&k<T&&T<J)for(K=re-1;K>=0;--K)S[K+T]=this[K+k];else if(re<1e3||!u.TYPED_ARRAY_SUPPORT)for(K=0;K<re;++K)S[K+T]=this[K+k];else Uint8Array.prototype.set.call(S,this.subarray(k,k+re),T);return re},u.prototype.fill=function(S,T,k,J){if(typeof S=="string"){if(typeof T=="string"?(J=T,T=0,k=this.length):typeof k=="string"&&(J=k,k=this.length),S.length===1){var K=S.charCodeAt(0);K<256&&(S=K)}if(J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!u.isEncoding(J))throw new TypeError("Unknown encoding: "+J)}else typeof S=="number"&&(S&=255);if(T<0||this.length<T||this.length<k)throw new RangeError("Out of range index");if(k<=T)return this;var re;if(T>>>=0,k=k===void 0?this.length:k>>>0,S||(S=0),typeof S=="number")for(re=T;re<k;++re)this[re]=S;else{var se=u.isBuffer(S)?S:ne(new u(S,J).toString()),fe=se.length;for(re=0;re<k-T;++re)this[re+T]=se[re%fe]}return this};var Q=/[^+\/0-9A-Za-z-_]/g;function ee(S){return S<16?"0"+S.toString(16):S.toString(16)}function ne(S,T){var k;T=T||1/0;for(var J=S.length,K=null,re=[],se=0;se<J;++se){if((k=S.charCodeAt(se))>55295&&k<57344){if(!K){if(k>56319){(T-=3)>-1&&re.push(239,191,189);continue}if(se+1===J){(T-=3)>-1&&re.push(239,191,189);continue}K=k;continue}if(k<56320){(T-=3)>-1&&re.push(239,191,189),K=k;continue}k=65536+(K-55296<<10|k-56320)}else K&&(T-=3)>-1&&re.push(239,191,189);if(K=null,k<128){if((T-=1)<0)break;re.push(k)}else if(k<2048){if((T-=2)<0)break;re.push(k>>6|192,63&k|128)}else if(k<65536){if((T-=3)<0)break;re.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((T-=4)<0)break;re.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return re}function Y(S){return i.toByteArray(function(T){if((T=function(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}(T).replace(Q,"")).length<2)return"";for(;T.length%4!=0;)T+="=";return T}(S))}function G(S,T,k,J){for(var K=0;K<J&&!(K+k>=T.length||K>=S.length);++K)T[K+k]=S[K];return K}}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){r&&(n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(n,r){if(r){n.super_=r;var i=function(){};i.prototype=r.prototype,n.prototype=new i,n.prototype.constructor=n}}},function(e,t,n){n.d(t,"a",function(){return r});const r=i=>new Promise(s=>setTimeout(s,i||0))},function(e,t,n){var r=n(99),i=r,s=Function("return this")(),l=n(98);i.object.extend(proto,l),i.exportSymbol("proto.v1.signaling.api.CreatePeerRequest",null,s),i.exportSymbol("proto.v1.signaling.api.CreatePeerResponse",null,s),i.exportSymbol("proto.v1.signaling.api.DeletePeerRequest",null,s),i.exportSymbol("proto.v1.signaling.api.DeletePeerResponse",null,s),i.exportSymbol("proto.v1.signaling.api.GetHealthRequest",null,s),i.exportSymbol("proto.v1.signaling.api.GetHealthResponse",null,s),i.exportSymbol("proto.v1.signaling.api.GetIceServersRequest",null,s),i.exportSymbol("proto.v1.signaling.api.GetIceServersResponse",null,s),i.exportSymbol("proto.v1.signaling.api.GetPeersRequest",null,s),i.exportSymbol("proto.v1.signaling.api.GetPeersResponse",null,s),i.exportSymbol("proto.v1.signaling.api.Peer",null,s),i.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamRequest",null,s),i.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamResponse",null,s),i.exportSymbol("proto.v1.signaling.api.RefreshPeerRequest",null,s),i.exportSymbol("proto.v1.signaling.api.RefreshPeerResponse",null,s),i.exportSymbol("proto.v1.signaling.api.SendSignalRequest",null,s),i.exportSymbol("proto.v1.signaling.api.SendSignalResponse",null,s),i.exportSymbol("proto.v1.signaling.api.SessionType",null,s),i.exportSymbol("proto.v1.signaling.api.Signal",null,s),proto.v1.signaling.api.Peer=function(o){r.Message.initialize(this,o,0,-1,proto.v1.signaling.api.Peer.repeatedFields_,null)},i.inherits(proto.v1.signaling.api.Peer,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Peer.displayName="proto.v1.signaling.api.Peer"),proto.v1.signaling.api.Signal=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.Signal,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Signal.displayName="proto.v1.signaling.api.Signal"),proto.v1.signaling.api.GetHealthRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetHealthRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthRequest.displayName="proto.v1.signaling.api.GetHealthRequest"),proto.v1.signaling.api.GetHealthResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetHealthResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthResponse.displayName="proto.v1.signaling.api.GetHealthResponse"),proto.v1.signaling.api.CreatePeerRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.CreatePeerRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerRequest.displayName="proto.v1.signaling.api.CreatePeerRequest"),proto.v1.signaling.api.CreatePeerResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.CreatePeerResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerResponse.displayName="proto.v1.signaling.api.CreatePeerResponse"),proto.v1.signaling.api.DeletePeerRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.DeletePeerRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerRequest.displayName="proto.v1.signaling.api.DeletePeerRequest"),proto.v1.signaling.api.DeletePeerResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.DeletePeerResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerResponse.displayName="proto.v1.signaling.api.DeletePeerResponse"),proto.v1.signaling.api.RefreshPeerRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.RefreshPeerRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerRequest.displayName="proto.v1.signaling.api.RefreshPeerRequest"),proto.v1.signaling.api.RefreshPeerResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.RefreshPeerResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerResponse.displayName="proto.v1.signaling.api.RefreshPeerResponse"),proto.v1.signaling.api.GetPeersRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetPeersRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersRequest.displayName="proto.v1.signaling.api.GetPeersRequest"),proto.v1.signaling.api.GetPeersResponse=function(o){r.Message.initialize(this,o,0,-1,proto.v1.signaling.api.GetPeersResponse.repeatedFields_,null)},i.inherits(proto.v1.signaling.api.GetPeersResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersResponse.displayName="proto.v1.signaling.api.GetPeersResponse"),proto.v1.signaling.api.GetIceServersRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetIceServersRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersRequest.displayName="proto.v1.signaling.api.GetIceServersRequest"),proto.v1.signaling.api.GetIceServersResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetIceServersResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersResponse.displayName="proto.v1.signaling.api.GetIceServersResponse"),proto.v1.signaling.api.SendSignalRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.SendSignalRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalRequest.displayName="proto.v1.signaling.api.SendSignalRequest"),proto.v1.signaling.api.SendSignalResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.SendSignalResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalResponse.displayName="proto.v1.signaling.api.SendSignalResponse"),proto.v1.signaling.api.ReceiveSignalStreamRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.ReceiveSignalStreamRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.displayName="proto.v1.signaling.api.ReceiveSignalStreamRequest"),proto.v1.signaling.api.ReceiveSignalStreamResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.ReceiveSignalStreamResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.displayName="proto.v1.signaling.api.ReceiveSignalStreamResponse"),proto.v1.signaling.api.Peer.repeatedFields_=[5],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Peer.prototype.toObject=function(o){return proto.v1.signaling.api.Peer.toObject(o,this)},proto.v1.signaling.api.Peer.toObject=function(o,c){var u,f={peerId:r.Message.getFieldWithDefault(c,1,""),organizationId:r.Message.getFieldWithDefault(c,2,""),userId:(u=c.getUserId())&&l.StringValue.toObject(o,u),deviceId:(u=c.getDeviceId())&&l.StringValue.toObject(o,u),sessionIdsList:(u=r.Message.getRepeatedField(c,5))==null?void 0:u,peerCreatedTimestamp:(u=c.getPeerCreatedTimestamp())&&l.Int64Value.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.Peer.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.Peer;return proto.v1.signaling.api.Peer.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.Peer.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setPeerId(u);break;case 2:u=c.readString(),o.setOrganizationId(u);break;case 3:u=new l.StringValue,c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setUserId(u);break;case 4:u=new l.StringValue,c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setDeviceId(u);break;case 5:u=c.readString(),o.addSessionIds(u);break;case 6:u=new l.Int64Value,c.readMessage(u,l.Int64Value.deserializeBinaryFromReader),o.setPeerCreatedTimestamp(u);break;default:c.skipField()}return o},proto.v1.signaling.api.Peer.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.Peer.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.Peer.serializeBinaryToWriter=function(o,c){var u=void 0;(u=o.getPeerId()).length>0&&c.writeString(1,u),(u=o.getOrganizationId()).length>0&&c.writeString(2,u),(u=o.getUserId())!=null&&c.writeMessage(3,u,l.StringValue.serializeBinaryToWriter),(u=o.getDeviceId())!=null&&c.writeMessage(4,u,l.StringValue.serializeBinaryToWriter),(u=o.getSessionIdsList()).length>0&&c.writeRepeatedString(5,u),(u=o.getPeerCreatedTimestamp())!=null&&c.writeMessage(6,u,l.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.Peer.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.Peer.prototype.setPeerId=function(o){return r.Message.setProto3StringField(this,1,o)},proto.v1.signaling.api.Peer.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.Peer.prototype.setOrganizationId=function(o){return r.Message.setProto3StringField(this,2,o)},proto.v1.signaling.api.Peer.prototype.getUserId=function(){return r.Message.getWrapperField(this,l.StringValue,3)},proto.v1.signaling.api.Peer.prototype.setUserId=function(o){return r.Message.setWrapperField(this,3,o)},proto.v1.signaling.api.Peer.prototype.clearUserId=function(){return this.setUserId(void 0)},proto.v1.signaling.api.Peer.prototype.hasUserId=function(){return r.Message.getField(this,3)!=null},proto.v1.signaling.api.Peer.prototype.getDeviceId=function(){return r.Message.getWrapperField(this,l.StringValue,4)},proto.v1.signaling.api.Peer.prototype.setDeviceId=function(o){return r.Message.setWrapperField(this,4,o)},proto.v1.signaling.api.Peer.prototype.clearDeviceId=function(){return this.setDeviceId(void 0)},proto.v1.signaling.api.Peer.prototype.hasDeviceId=function(){return r.Message.getField(this,4)!=null},proto.v1.signaling.api.Peer.prototype.getSessionIdsList=function(){return r.Message.getRepeatedField(this,5)},proto.v1.signaling.api.Peer.prototype.setSessionIdsList=function(o){return r.Message.setField(this,5,o||[])},proto.v1.signaling.api.Peer.prototype.addSessionIds=function(o,c){return r.Message.addToRepeatedField(this,5,o,c)},proto.v1.signaling.api.Peer.prototype.clearSessionIdsList=function(){return this.setSessionIdsList([])},proto.v1.signaling.api.Peer.prototype.getPeerCreatedTimestamp=function(){return r.Message.getWrapperField(this,l.Int64Value,6)},proto.v1.signaling.api.Peer.prototype.setPeerCreatedTimestamp=function(o){return r.Message.setWrapperField(this,6,o)},proto.v1.signaling.api.Peer.prototype.clearPeerCreatedTimestamp=function(){return this.setPeerCreatedTimestamp(void 0)},proto.v1.signaling.api.Peer.prototype.hasPeerCreatedTimestamp=function(){return r.Message.getField(this,6)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Signal.prototype.toObject=function(o){return proto.v1.signaling.api.Signal.toObject(o,this)},proto.v1.signaling.api.Signal.toObject=function(o,c){var u,f={sessionId:(u=c.getSessionId())&&l.StringValue.toObject(o,u),sessionCreatedTimestamp:(u=c.getSessionCreatedTimestamp())&&l.Int64Value.toObject(o,u),senderId:r.Message.getFieldWithDefault(c,3,""),receiverId:r.Message.getFieldWithDefault(c,4,""),payload:r.Message.getFieldWithDefault(c,5,""),iceServers:r.Message.getFieldWithDefault(c,6,""),iceTransportPolicy:r.Message.getFieldWithDefault(c,7,""),sessionType:r.Message.getFieldWithDefault(c,8,0)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.Signal.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.Signal;return proto.v1.signaling.api.Signal.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.Signal.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new l.StringValue;c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setSessionId(u);break;case 2:u=new l.Int64Value,c.readMessage(u,l.Int64Value.deserializeBinaryFromReader),o.setSessionCreatedTimestamp(u);break;case 3:u=c.readString(),o.setSenderId(u);break;case 4:u=c.readString(),o.setReceiverId(u);break;case 5:u=c.readString(),o.setPayload(u);break;case 6:u=c.readString(),o.setIceServers(u);break;case 7:u=c.readString(),o.setIceTransportPolicy(u);break;case 8:u=c.readEnum(),o.setSessionType(u);break;default:c.skipField()}return o},proto.v1.signaling.api.Signal.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.Signal.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.Signal.serializeBinaryToWriter=function(o,c){var u=void 0;(u=o.getSessionId())!=null&&c.writeMessage(1,u,l.StringValue.serializeBinaryToWriter),(u=o.getSessionCreatedTimestamp())!=null&&c.writeMessage(2,u,l.Int64Value.serializeBinaryToWriter),(u=o.getSenderId()).length>0&&c.writeString(3,u),(u=o.getReceiverId()).length>0&&c.writeString(4,u),(u=o.getPayload()).length>0&&c.writeString(5,u),(u=o.getIceServers()).length>0&&c.writeString(6,u),(u=o.getIceTransportPolicy()).length>0&&c.writeString(7,u),(u=o.getSessionType())!==0&&c.writeEnum(8,u)},proto.v1.signaling.api.Signal.prototype.getSessionId=function(){return r.Message.getWrapperField(this,l.StringValue,1)},proto.v1.signaling.api.Signal.prototype.setSessionId=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.Signal.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.Signal.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,l.Int64Value,2)},proto.v1.signaling.api.Signal.prototype.setSessionCreatedTimestamp=function(o){return r.Message.setWrapperField(this,2,o)},proto.v1.signaling.api.Signal.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},proto.v1.signaling.api.Signal.prototype.getSenderId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.Signal.prototype.setSenderId=function(o){return r.Message.setProto3StringField(this,3,o)},proto.v1.signaling.api.Signal.prototype.getReceiverId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.Signal.prototype.setReceiverId=function(o){return r.Message.setProto3StringField(this,4,o)},proto.v1.signaling.api.Signal.prototype.getPayload=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.Signal.prototype.setPayload=function(o){return r.Message.setProto3StringField(this,5,o)},proto.v1.signaling.api.Signal.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,6,"")},proto.v1.signaling.api.Signal.prototype.setIceServers=function(o){return r.Message.setProto3StringField(this,6,o)},proto.v1.signaling.api.Signal.prototype.getIceTransportPolicy=function(){return r.Message.getFieldWithDefault(this,7,"")},proto.v1.signaling.api.Signal.prototype.setIceTransportPolicy=function(o){return r.Message.setProto3StringField(this,7,o)},proto.v1.signaling.api.Signal.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,8,0)},proto.v1.signaling.api.Signal.prototype.setSessionType=function(o){return r.Message.setProto3EnumField(this,8,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthRequest.prototype.toObject=function(o){return proto.v1.signaling.api.GetHealthRequest.toObject(o,this)},proto.v1.signaling.api.GetHealthRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetHealthRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetHealthRequest;return proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.GetHealthRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthResponse.prototype.toObject=function(o){return proto.v1.signaling.api.GetHealthResponse.toObject(o,this)},proto.v1.signaling.api.GetHealthResponse.toObject=function(o,c){var u={version:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetHealthResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetHealthResponse;return proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setVersion(u);break;default:c.skipField()}return o},proto.v1.signaling.api.GetHealthResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getVersion()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.GetHealthResponse.prototype.getVersion=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetHealthResponse.prototype.setVersion=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerRequest.prototype.toObject=function(o){return proto.v1.signaling.api.CreatePeerRequest.toObject(o,this)},proto.v1.signaling.api.CreatePeerRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.CreatePeerRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.CreatePeerRequest;return proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.CreatePeerRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerResponse.prototype.toObject=function(o){return proto.v1.signaling.api.CreatePeerResponse.toObject(o,this)},proto.v1.signaling.api.CreatePeerResponse.toObject=function(o,c){var u,f={peer:(u=c.getPeer())&&proto.v1.signaling.api.Peer.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.CreatePeerResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.CreatePeerResponse;return proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Peer;c.readMessage(u,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),o.setPeer(u);break;default:c.skipField()}return o},proto.v1.signaling.api.CreatePeerResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeer())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.CreatePeerResponse.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.CreatePeerResponse.prototype.setPeer=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.CreatePeerResponse.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.CreatePeerResponse.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerRequest.prototype.toObject=function(o){return proto.v1.signaling.api.DeletePeerRequest.toObject(o,this)},proto.v1.signaling.api.DeletePeerRequest.toObject=function(o,c){var u={peerId:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.DeletePeerRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.DeletePeerRequest;return proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setPeerId(u);break;default:c.skipField()}return o},proto.v1.signaling.api.DeletePeerRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeerId()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.DeletePeerRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.DeletePeerRequest.prototype.setPeerId=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerResponse.prototype.toObject=function(o){return proto.v1.signaling.api.DeletePeerResponse.toObject(o,this)},proto.v1.signaling.api.DeletePeerResponse.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.DeletePeerResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.DeletePeerResponse;return proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.DeletePeerResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerRequest.prototype.toObject=function(o){return proto.v1.signaling.api.RefreshPeerRequest.toObject(o,this)},proto.v1.signaling.api.RefreshPeerRequest.toObject=function(o,c){var u,f={peer:(u=c.getPeer())&&proto.v1.signaling.api.Peer.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.RefreshPeerRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.RefreshPeerRequest;return proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Peer;c.readMessage(u,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),o.setPeer(u);break;default:c.skipField()}return o},proto.v1.signaling.api.RefreshPeerRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeer())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.RefreshPeerRequest.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.RefreshPeerRequest.prototype.setPeer=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.RefreshPeerRequest.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.RefreshPeerRequest.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerResponse.prototype.toObject=function(o){return proto.v1.signaling.api.RefreshPeerResponse.toObject(o,this)},proto.v1.signaling.api.RefreshPeerResponse.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.RefreshPeerResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.RefreshPeerResponse;return proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.RefreshPeerResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersRequest.prototype.toObject=function(o){return proto.v1.signaling.api.GetPeersRequest.toObject(o,this)},proto.v1.signaling.api.GetPeersRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetPeersRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetPeersRequest;return proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.GetPeersRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter=function(o,c){},proto.v1.signaling.api.GetPeersResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersResponse.prototype.toObject=function(o){return proto.v1.signaling.api.GetPeersResponse.toObject(o,this)},proto.v1.signaling.api.GetPeersResponse.toObject=function(o,c){var u={peersList:r.Message.toObjectList(c.getPeersList(),proto.v1.signaling.api.Peer.toObject,o)};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetPeersResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetPeersResponse;return proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Peer;c.readMessage(u,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),o.addPeers(u);break;default:c.skipField()}return o},proto.v1.signaling.api.GetPeersResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeersList()).length>0&&c.writeRepeatedMessage(1,u,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.GetPeersResponse.prototype.getPeersList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.GetPeersResponse.prototype.setPeersList=function(o){return r.Message.setRepeatedWrapperField(this,1,o)},proto.v1.signaling.api.GetPeersResponse.prototype.addPeers=function(o,c){return r.Message.addToRepeatedWrapperField(this,1,o,proto.v1.signaling.api.Peer,c)},proto.v1.signaling.api.GetPeersResponse.prototype.clearPeersList=function(){return this.setPeersList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersRequest.prototype.toObject=function(o){return proto.v1.signaling.api.GetIceServersRequest.toObject(o,this)},proto.v1.signaling.api.GetIceServersRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetIceServersRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetIceServersRequest;return proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.GetIceServersRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersResponse.prototype.toObject=function(o){return proto.v1.signaling.api.GetIceServersResponse.toObject(o,this)},proto.v1.signaling.api.GetIceServersResponse.toObject=function(o,c){var u={iceServers:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetIceServersResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetIceServersResponse;return proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setIceServers(u);break;default:c.skipField()}return o},proto.v1.signaling.api.GetIceServersResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getIceServers()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.GetIceServersResponse.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetIceServersResponse.prototype.setIceServers=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalRequest.prototype.toObject=function(o){return proto.v1.signaling.api.SendSignalRequest.toObject(o,this)},proto.v1.signaling.api.SendSignalRequest.toObject=function(o,c){var u,f={signal:(u=c.getSignal())&&proto.v1.signaling.api.Signal.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.SendSignalRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.SendSignalRequest;return proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Signal;c.readMessage(u,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),o.setSignal(u);break;default:c.skipField()}return o},proto.v1.signaling.api.SendSignalRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getSignal())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalRequest.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.SendSignalRequest.prototype.setSignal=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.SendSignalRequest.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.SendSignalRequest.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalResponse.prototype.toObject=function(o){return proto.v1.signaling.api.SendSignalResponse.toObject(o,this)},proto.v1.signaling.api.SendSignalResponse.toObject=function(o,c){var u,f={sessionId:(u=c.getSessionId())&&l.StringValue.toObject(o,u),sessionCreatedTimestamp:(u=c.getSessionCreatedTimestamp())&&l.Int64Value.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.SendSignalResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.SendSignalResponse;return proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new l.StringValue;c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setSessionId(u);break;case 2:u=new l.Int64Value,c.readMessage(u,l.Int64Value.deserializeBinaryFromReader),o.setSessionCreatedTimestamp(u);break;default:c.skipField()}return o},proto.v1.signaling.api.SendSignalResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter=function(o,c){var u=void 0;(u=o.getSessionId())!=null&&c.writeMessage(1,u,l.StringValue.serializeBinaryToWriter),(u=o.getSessionCreatedTimestamp())!=null&&c.writeMessage(2,u,l.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionId=function(){return r.Message.getWrapperField(this,l.StringValue,1)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionId=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,l.Int64Value,2)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionCreatedTimestamp=function(o){return r.Message.setWrapperField(this,2,o)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.toObject=function(o){return proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject(o,this)},proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject=function(o,c){var u={peerId:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.ReceiveSignalStreamRequest;return proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setPeerId(u);break;default:c.skipField()}return o},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeerId()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.setPeerId=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.toObject=function(o){return proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject(o,this)},proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject=function(o,c){var u,f={signal:(u=c.getSignal())&&proto.v1.signaling.api.Signal.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.ReceiveSignalStreamResponse;return proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Signal;c.readMessage(u,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),o.setSignal(u);break;default:c.skipField()}return o},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getSignal())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.setSignal=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SessionType={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3},i.object.extend(t,proto.v1.signaling.api)},function(e,t,n){n.d(t,"a",function(){return i});var r=n(34);class i extends Error{constructor(l,o,c,u,f={},E){super(`Unexpected response (${c}) for ${l} ${o}: ${JSON.stringify(E?Object(r.a)([...E.entries()].reduce((w,[h,g])=>(w[h]=g,w),{})):{})} -- ${JSON.stringify(Object(r.a)(u))}`),this.method=l,this.url=o,this.statusCode=c,this.body=u,this.validationErrors=f,this.headers=E}}},function(e,t,n){function r(i,s,l=()=>!0){if(function(o,c,u=()=>!0){return o instanceof c&&u(o)}(i,s,l))return i;throw i}n.d(t,"a",function(){return r})},function(e,t,n){function r(w){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(w)}function i(w,h){return!h||r(h)!=="object"&&typeof h!="function"?s(w):h}function s(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function l(w){var h=typeof Map=="function"?new Map:void 0;return(l=function(g){if(g===null||(b=g,Function.toString.call(b).indexOf("[native code]")===-1))return g;var b;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(h!==void 0){if(h.has(g))return h.get(g);h.set(g,R)}function R(){return o(g,arguments,f(this).constructor)}return R.prototype=Object.create(g.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),u(R,g)})(w)}function o(w,h,g){return(o=c()?Reflect.construct:function(b,R,j){var F=[null];F.push.apply(F,R);var M=new(Function.bind.apply(b,F));return j&&u(M,j.prototype),M}).apply(null,arguments)}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function u(w,h){return(u=Object.setPrototypeOf||function(g,b){return g.__proto__=b,g})(w,h)}function f(w){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)})(w)}var E=function(w){(function(j,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");j.prototype=Object.create(F&&F.prototype,{constructor:{value:j,writable:!0,configurable:!0}}),F&&u(j,F)})(R,w);var h,g,b=(h=R,g=c(),function(){var j,F=f(h);if(g){var M=f(this).constructor;j=Reflect.construct(F,arguments,M)}else j=F.apply(this,arguments);return i(this,j)});function R(j){var F;return function(M,A){if(!(M instanceof A))throw new TypeError("Cannot call a class as a function")}(this,R),F=b.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
6
|
+
*/var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==void 0?global$1.TYPED_ARRAY_SUPPORT:!0,kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=Buffer.prototype):(e===null&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,n){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,n)}Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e};function from(e,t,n,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?fromArrayBuffer(e,t,n,r):typeof t=="string"?fromString(e,t,n):fromObject(e,t)}Buffer.from=function(e,t,n){return from(null,e,t,n)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array);function assertSize(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function alloc(e,t,n,r){return assertSize(t),t<=0?createBuffer(e,t):n!==void 0?typeof r=="string"?createBuffer(e,t).fill(n,r):createBuffer(e,t).fill(n):createBuffer(e,t)}Buffer.alloc=function(e,t,n){return alloc(null,e,t,n)};function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:checked(t)|0),!Buffer.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,n){if((typeof n!="string"||n==="")&&(n="utf8"),!Buffer.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=byteLength(t,n)|0;e=createBuffer(e,r);var i=e.write(t,n);return i!==r&&(e=e.slice(0,i)),e}function fromArrayLike(e,t){var n=t.length<0?0:checked(t.length)|0;e=createBuffer(e,n);for(var r=0;r<n;r+=1)e[r]=t[r]&255;return e}function fromArrayBuffer(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return n===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,n):t=new Uint8Array(t,n,r),Buffer.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=Buffer.prototype):e=fromArrayLike(e,t),e}function fromObject(e,t){if(internalIsBuffer(t)){var n=checked(t.length)|0;return e=createBuffer(e,n),e.length===0||t.copy(e,0,0,n),e}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||isnan(t.length)?createBuffer(e,0):fromArrayLike(e,t);if(t.type==="Buffer"&&isArray$1(t.data))return fromArrayLike(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return e|0}Buffer.isBuffer=isBuffer;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function(t,n){if(!internalIsBuffer(t)||!internalIsBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,i=n.length,s=0,l=Math.min(r,i);s<l;++s)if(t[s]!==n[s]){r=t[s],i=n[s];break}return r<i?-1:i<r?1:0},Buffer.isEncoding=function(t){switch(String(t).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}},Buffer.concat=function(t,n){if(!isArray$1(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return Buffer.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<t.length;++r)n+=t[r].length;var i=Buffer.allocUnsafe(n),s=0;for(r=0;r<t.length;++r){var l=t[r];if(!internalIsBuffer(l))throw new TypeError('"list" argument must be an Array of Buffers');l.copy(i,s),s+=l.length}return i};function byteLength(e,t){if(internalIsBuffer(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),r=!0}}Buffer.byteLength=byteLength;function slowToString(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,n);case"utf8":case"utf-8":return utf8Slice(this,t,n);case"ascii":return asciiSlice(this,t,n);case"latin1":case"binary":return latin1Slice(this,t,n);case"base64":return base64Slice(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}Buffer.prototype._isBuffer=!0;function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}Buffer.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)swap(this,n,n+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)swap(this,n,n+3),swap(this,n+1,n+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)swap(this,n,n+7),swap(this,n+1,n+6),swap(this,n+2,n+5),swap(this,n+3,n+4);return this},Buffer.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:Buffer.compare(this,t)===0},Buffer.prototype.inspect=function(){var t="",n=INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,n,r,i,s){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),n<0||r>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&n>=r)return 0;if(i>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var l=s-i,o=r-n,c=Math.min(l,o),u=this.slice(i,s),f=t.slice(n,r),E=0;E<c;++E)if(u[E]!==f[E]){l=u[E],o=f[E];break}return l<o?-1:o<l?1:0};function bidirectionalIndexOf(e,t,n,r,i){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t=="string"&&(t=Buffer.from(t,r)),internalIsBuffer(t))return t.length===0?-1:arrayIndexOf(e,t,n,r,i);if(typeof t=="number")return t=t&255,Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):arrayIndexOf(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,n,r,i){var s=1,l=e.length,o=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;s=2,l/=2,o/=2,n/=2}function c(h,g){return s===1?h[g]:h.readUInt16BE(g*s)}var u;if(i){var f=-1;for(u=n;u<l;u++)if(c(e,u)===c(t,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===o)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(n+o>l&&(n=l-o),u=n;u>=0;u--){for(var E=!0,w=0;w<o;w++)if(c(e,u+w)!==c(t,w)){E=!1;break}if(E)return u}return-1}Buffer.prototype.includes=function(t,n,r){return this.indexOf(t,n,r)!==-1},Buffer.prototype.indexOf=function(t,n,r){return bidirectionalIndexOf(this,t,n,r,!0)},Buffer.prototype.lastIndexOf=function(t,n,r){return bidirectionalIndexOf(this,t,n,r,!1)};function hexWrite(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var l=0;l<r;++l){var o=parseInt(t.substr(l*2,2),16);if(isNaN(o))return l;e[n+l]=o}return l}function utf8Write(e,t,n,r){return blitBuffer(utf8ToBytes(t,e.length-n),e,n,r)}function asciiWrite(e,t,n,r){return blitBuffer(asciiToBytes(t),e,n,r)}function latin1Write(e,t,n,r){return asciiWrite(e,t,n,r)}function base64Write(e,t,n,r){return blitBuffer(base64ToBytes(t),e,n,r)}function ucs2Write(e,t,n,r){return blitBuffer(utf16leToBytes(t,e.length-n),e,n,r)}Buffer.prototype.write=function(t,n,r,i){if(n===void 0)i="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")i=n,r=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-n;if((r===void 0||r>s)&&(r=s),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return hexWrite(this,t,n,r);case"utf8":case"utf-8":return utf8Write(this,t,n,r);case"ascii":return asciiWrite(this,t,n,r);case"latin1":case"binary":return latin1Write(this,t,n,r);case"base64":return base64Write(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,n,r);default:if(l)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),l=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,n){return t===0&&n===e.length?fromByteArray(e):fromByteArray(e.slice(t,n))}function utf8Slice(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var s=e[i],l=null,o=s>239?4:s>223?3:s>191?2:1;if(i+o<=n){var c,u,f,E;switch(o){case 1:s<128&&(l=s);break;case 2:c=e[i+1],(c&192)===128&&(E=(s&31)<<6|c&63,E>127&&(l=E));break;case 3:c=e[i+1],u=e[i+2],(c&192)===128&&(u&192)===128&&(E=(s&15)<<12|(c&63)<<6|u&63,E>2047&&(E<55296||E>57343)&&(l=E));break;case 4:c=e[i+1],u=e[i+2],f=e[i+3],(c&192)===128&&(u&192)===128&&(f&192)===128&&(E=(s&15)<<18|(c&63)<<12|(u&63)<<6|f&63,E>65535&&E<1114112&&(l=E))}}l===null?(l=65533,o=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|l&1023),r.push(l),i+=o}return decodeCodePointsArray(r)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=MAX_ARGUMENTS_LENGTH));return n}function asciiSlice(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function latin1Slice(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function hexSlice(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=t;s<n;++s)i+=toHex(e[s]);return i}function utf16leSlice(e,t,n){for(var r=e.slice(t,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+r[s+1]*256);return i}Buffer.prototype.slice=function(t,n){var r=this.length;t=~~t,n=n===void 0?r:~~n,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<t&&(n=t);var i;if(Buffer.TYPED_ARRAY_SUPPORT)i=this.subarray(t,n),i.__proto__=Buffer.prototype;else{var s=n-t;i=new Buffer(s,void 0);for(var l=0;l<s;++l)i[l]=this[l+t]}return i};function checkOffset(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=this[t],s=1,l=0;++l<n&&(s*=256);)i+=this[t+l]*s;return i},Buffer.prototype.readUIntBE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=this[t+--n],s=1;n>0&&(s*=256);)i+=this[t+--n]*s;return i},Buffer.prototype.readUInt8=function(t,n){return n||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,n){return n||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,n){return n||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,n){return n||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},Buffer.prototype.readUInt32BE=function(t,n){return n||checkOffset(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=this[t],s=1,l=0;++l<n&&(s*=256);)i+=this[t+l]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*n)),i},Buffer.prototype.readIntBE=function(t,n,r){t=t|0,n=n|0,r||checkOffset(t,n,this.length);for(var i=n,s=1,l=this[t+--i];i>0&&(s*=256);)l+=this[t+--i]*s;return s*=128,l>=s&&(l-=Math.pow(2,8*n)),l},Buffer.prototype.readInt8=function(t,n){return n||checkOffset(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},Buffer.prototype.readInt16LE=function(t,n){n||checkOffset(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},Buffer.prototype.readInt16BE=function(t,n){n||checkOffset(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},Buffer.prototype.readInt32LE=function(t,n){return n||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,n){return n||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,n){return n||checkOffset(t,4,this.length),read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,n){return n||checkOffset(t,4,this.length),read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,n){return n||checkOffset(t,8,this.length),read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,n){return n||checkOffset(t,8,this.length),read(this,t,!1,52,8)};function checkInt(e,t,n,r,i,s){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function(t,n,r,i){if(t=+t,n=n|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;checkInt(this,t,n,r,s,0)}var l=1,o=0;for(this[n]=t&255;++o<r&&(l*=256);)this[n+o]=t/l&255;return n+r},Buffer.prototype.writeUIntBE=function(t,n,r,i){if(t=+t,n=n|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;checkInt(this,t,n,r,s,0)}var l=r-1,o=1;for(this[n+l]=t&255;--l>=0&&(o*=256);)this[n+l]=t/o&255;return n+r},Buffer.prototype.writeUInt8=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1};function objectWriteUInt16(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i<s;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}Buffer.prototype.writeUInt16LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):objectWriteUInt16(this,t,n,!0),n+2},Buffer.prototype.writeUInt16BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):objectWriteUInt16(this,t,n,!1),n+2};function objectWriteUInt32(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i<s;++i)e[n+i]=t>>>(r?i:3-i)*8&255}Buffer.prototype.writeUInt32LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):objectWriteUInt32(this,t,n,!0),n+4},Buffer.prototype.writeUInt32BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):objectWriteUInt32(this,t,n,!1),n+4},Buffer.prototype.writeIntLE=function(t,n,r,i){if(t=+t,n=n|0,!i){var s=Math.pow(2,8*r-1);checkInt(this,t,n,r,s-1,-s)}var l=0,o=1,c=0;for(this[n]=t&255;++l<r&&(o*=256);)t<0&&c===0&&this[n+l-1]!==0&&(c=1),this[n+l]=(t/o>>0)-c&255;return n+r},Buffer.prototype.writeIntBE=function(t,n,r,i){if(t=+t,n=n|0,!i){var s=Math.pow(2,8*r-1);checkInt(this,t,n,r,s-1,-s)}var l=r-1,o=1,c=0;for(this[n+l]=t&255;--l>=0&&(o*=256);)t<0&&c===0&&this[n+l+1]!==0&&(c=1),this[n+l]=(t/o>>0)-c&255;return n+r},Buffer.prototype.writeInt8=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},Buffer.prototype.writeInt16LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):objectWriteUInt16(this,t,n,!0),n+2},Buffer.prototype.writeInt16BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):objectWriteUInt16(this,t,n,!1),n+2},Buffer.prototype.writeInt32LE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):objectWriteUInt32(this,t,n,!0),n+4},Buffer.prototype.writeInt32BE=function(t,n,r){return t=+t,n=n|0,r||checkInt(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):objectWriteUInt32(this,t,n,!1),n+4};function checkIEEE754(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){return i||checkIEEE754(e,t,n,4),write(e,t,n,r,23,4),n+4}Buffer.prototype.writeFloatLE=function(t,n,r){return writeFloat(this,t,n,!0,r)},Buffer.prototype.writeFloatBE=function(t,n,r){return writeFloat(this,t,n,!1,r)};function writeDouble(e,t,n,r,i){return i||checkIEEE754(e,t,n,8),write(e,t,n,r,52,8),n+8}Buffer.prototype.writeDoubleLE=function(t,n,r){return writeDouble(this,t,n,!0,r)},Buffer.prototype.writeDoubleBE=function(t,n,r){return writeDouble(this,t,n,!1,r)},Buffer.prototype.copy=function(t,n,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),n>=t.length&&(n=t.length),n||(n=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-n<i-r&&(i=t.length-n+r);var s=i-r,l;if(this===t&&r<n&&n<i)for(l=s-1;l>=0;--l)t[l+n]=this[l+r];else if(s<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(l=0;l<s;++l)t[l+n]=this[l+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),n);return s},Buffer.prototype.fill=function(t,n,r,i){if(typeof t=="string"){if(typeof n=="string"?(i=n,n=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Buffer.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var l;if(typeof t=="number")for(l=n;l<r;++l)this[l]=t;else{var o=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,i).toString()),c=o.length;for(l=0;l<r-n;++l)this[l+n]=o[l%c]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){if(e=stringtrim(e).replace(INVALID_BASE64_RE,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){t=t||1/0;for(var n,r=e.length,i=null,s=[],l=0;l<r;++l){if(n=e.charCodeAt(l),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(l+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function asciiToBytes(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function utf16leToBytes(e,t){for(var n,r,i,s=[],l=0;l<e.length&&!((t-=2)<0);++l)n=e.charCodeAt(l),r=n>>8,i=n%256,s.push(i),s.push(r);return s}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&isFastBuffer(e.slice(0,0))}var dist={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(module,exports){(function(e,t){module.exports=t()})(window,function(){return function(e){function t(u){for(var f,E,w=u[0],h=u[1],g=0,b=[];g<w.length;g++)E=w[g],Object.prototype.hasOwnProperty.call(r,E)&&r[E]&&b.push(r[E][0]),r[E]=0;for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&(e[f]=h[f]);for(c&&c(u);b.length;)b.shift()()}var n={},r={0:0};function i(u){if(n[u])return n[u].exports;var f=n[u]={i:u,l:!1,exports:{}};return e[u].call(f.exports,f,f.exports,i),f.l=!0,f.exports}i.e=function(){return Promise.resolve()},i.m=e,i.c=n,i.d=function(u,f,E){i.o(u,f)||Object.defineProperty(u,f,{enumerable:!0,get:E})},i.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},i.t=function(u,f){if(1&f&&(u=i(u)),8&f||4&f&&typeof u=="object"&&u&&u.__esModule)return u;var E=Object.create(null);if(i.r(E),Object.defineProperty(E,"default",{enumerable:!0,value:u}),2&f&&typeof u!="string")for(var w in u)i.d(E,w,function(h){return u[h]}.bind(null,w));return E},i.n=function(u){var f=u&&u.__esModule?function(){return u.default}:function(){return u};return i.d(f,"a",f),f},i.o=function(u,f){return Object.prototype.hasOwnProperty.call(u,f)},i.p="",i.oe=function(u){throw console.error(u),u};var s=window.webpackJsonpFormantRealtimeSDK=window.webpackJsonpFormantRealtimeSDK||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var o=0;o<s.length;o++)t(s[o]);var c=l;return i(i.s=228)}([function(e,t,n){n.d(t,"a",function(){return G});function r(T,k){if(k.length<T)throw new TypeError(T+" argument"+(T>1?"s":"")+" required, but only "+k.length+" present")}function i(T){if(T===null||T===!0||T===!1)return NaN;var k=Number(T);return isNaN(k)?k:k<0?Math.ceil(k):Math.floor(k)}var s={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},l=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,o=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,c=/^([+-])(\d{2})(?::?(\d{2}))?$/;function u(T){var k,J={},K=T.split(s.dateTimeDelimiter);if(K.length>2)return J;if(/:/.test(K[0])?k=K[0]:(J.date=K[0],k=K[1],s.timeZoneDelimiter.test(J.date)&&(J.date=T.split(s.timeZoneDelimiter)[0],k=T.substr(J.date.length,T.length))),k){var re=s.timezone.exec(k);re?(J.time=k.replace(re[1],""),J.timezone=re[1]):J.time=k}return J}function f(T,k){var J=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+k)+"})|(\\d{2}|[+-]\\d{"+(2+k)+"})$)"),K=T.match(J);if(!K)return{year:NaN,restDateString:""};var re=K[1]?parseInt(K[1]):null,se=K[2]?parseInt(K[2]):null;return{year:se===null?re:100*se,restDateString:T.slice((K[1]||K[2]).length)}}function E(T,k){if(k===null)return new Date(NaN);var J=T.match(l);if(!J)return new Date(NaN);var K=!!J[4],re=w(J[1]),se=w(J[2])-1,fe=w(J[3]),ve=w(J[4]),Ce=w(J[5])-1;if(K)return function(Ie,Te,Oe){return Te>=1&&Te<=53&&Oe>=0&&Oe<=6}(0,ve,Ce)?function(Ie,Te,Oe){var De=new Date(0);De.setUTCFullYear(Ie,0,4);var qe=De.getUTCDay()||7,tt=7*(Te-1)+Oe+1-qe;return De.setUTCDate(De.getUTCDate()+tt),De}(k,ve,Ce):new Date(NaN);var Se=new Date(0);return function(Ie,Te,Oe){return Te>=0&&Te<=11&&Oe>=1&&Oe<=(R[Te]||(j(Ie)?29:28))}(k,se,fe)&&function(Ie,Te){return Te>=1&&Te<=(j(Ie)?366:365)}(k,re)?(Se.setUTCFullYear(k,se,Math.max(re,fe)),Se):new Date(NaN)}function w(T){return T?parseInt(T):1}function h(T){var k=T.match(o);if(!k)return NaN;var J=g(k[1]),K=g(k[2]),re=g(k[3]);return function(se,fe,ve){return se===24?fe===0&&ve===0:ve>=0&&ve<60&&fe>=0&&fe<60&&se>=0&&se<25}(J,K,re)?36e5*J+6e4*K+1e3*re:NaN}function g(T){return T&&parseFloat(T.replace(",","."))||0}function b(T){if(T==="Z")return 0;var k=T.match(c);if(!k)return 0;var J=k[1]==="+"?-1:1,K=parseInt(k[2]),re=k[3]&&parseInt(k[3])||0;return function(se,fe){return fe>=0&&fe<=59}(0,re)?J*(36e5*K+6e4*re):NaN}var R=[31,null,31,30,31,30,31,31,30,31,30,31];function j(T){return T%400==0||T%4==0&&T%100!=0}function F(T){return r(1,arguments),T instanceof Date||typeof T=="object"&&Object.prototype.toString.call(T)==="[object Date]"}function M(T){r(1,arguments);var k=Object.prototype.toString.call(T);return T instanceof Date||typeof T=="object"&&k==="[object Date]"?new Date(T.getTime()):typeof T=="number"||k==="[object Number]"?new Date(T):(typeof T!="string"&&k!=="[object String]"||typeof console>"u"||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function A(T){const k=function(J,K){var re;r(1,arguments);var se=i((re=K==null?void 0:K.additionalDigits)!==null&&re!==void 0?re:2);if(se!==2&&se!==1&&se!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(typeof J!="string"&&Object.prototype.toString.call(J)!=="[object String]")return new Date(NaN);var fe,ve=u(J);if(ve.date){var Ce=f(ve.date,se);fe=E(Ce.restDateString,Ce.year)}if(!fe||isNaN(fe.getTime()))return new Date(NaN);var Se,Ie=fe.getTime(),Te=0;if(ve.time&&(Te=h(ve.time),isNaN(Te)))return new Date(NaN);if(!ve.timezone){var Oe=new Date(Ie+Te),De=new Date(0);return De.setFullYear(Oe.getUTCFullYear(),Oe.getUTCMonth(),Oe.getUTCDate()),De.setHours(Oe.getUTCHours(),Oe.getUTCMinutes(),Oe.getUTCSeconds(),Oe.getUTCMilliseconds()),De}return Se=b(ve.timezone),isNaN(Se)?new Date(NaN):new Date(Ie+Te+Se)}(T);if(!function(J){if(r(1,arguments),!F(J)&&typeof J!="number")return!1;var K=M(J);return!isNaN(Number(K))}(k))throw new Error(`Invalid ISO 8601 date string (${T})`);return k}const d=Math.pow(2,20),C=d;var $=n(14),q=n.n($),y=n(18),m=n(56),I=n(19),_=n(4),L=n(34);function W(T){return q()(T,{cycles:!0})}var B=function(T,k){var J={};for(var K in T)Object.prototype.hasOwnProperty.call(T,K)&&k.indexOf(K)<0&&(J[K]=T[K]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var re=0;for(K=Object.getOwnPropertySymbols(T);re<K.length;re++)k.indexOf(K[re])<0&&Object.prototype.propertyIsEnumerable.call(T,K[re])&&(J[K[re]]=T[K[re]])}return J};function N(T,k={}){const J=ve=>k.redacted!==!1?Object(L.a)(ve):ve;if(!T.stack)return{message:W(J(T))};const{name:K,message:re,stack:se}=T,fe=B(T,["name","message","stack"]);return{name:K,message:re!==void 0?re:W(J(T)),stack:se,meta:fe&&Object.keys(fe).length===0?void 0:J(fe)}}function D(T,k={}){const{message:J,stack:K,meta:re}=N(T,k);return`${K||J||""}${re&&Object.keys(re).length>0?` -- ${W(re)}`:""}`}var z=n(39),O=n(103),p=n.n(O),U=function(T,k,J,K){return new(J||(J=Promise))(function(re,se){function fe(Se){try{Ce(K.next(Se))}catch(Ie){se(Ie)}}function ve(Se){try{Ce(K.throw(Se))}catch(Ie){se(Ie)}}function Ce(Se){var Ie;Se.done?re(Se.value):(Ie=Se.value,Ie instanceof J?Ie:new J(function(Te){Te(Ie)})).then(fe,ve)}Ce((K=K.apply(T,k||[])).next())})},V=function(T,k){var J={};for(var K in T)Object.prototype.hasOwnProperty.call(T,K)&&k.indexOf(K)<0&&(J[K]=T[K]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var re=0;for(K=Object.getOwnPropertySymbols(T);re<K.length;re++)k.indexOf(K[re])<0&&Object.prototype.propertyIsEnumerable.call(T,K[re])&&(J[K[re]]=T[K[re]])}return J};class Q extends p.a{constructor(k,J){super(),this.endpoint=k,this.metadata=J,this.logClient=this.getLogClient()}getLogClient(){return U(this,void 0,void 0,function*(){const{LogClient:k}=yield Promise.resolve().then(n.bind(null,231));return new k(this.endpoint)})}log(k,J){return U(this,void 0,void 0,function*(){const{level:K,message:re,error:se}=k,fe=V(k,["level","message","error"]);this.emit("logged");try{yield(yield this.logClient).log([{timestamp:new Date().toISOString(),level:K,message:`${re}`.substring(0,1e3),error:se!==void 0?N(se):void 0,meta:Object.assign(Object.assign({},fe),this.metadata)}])}catch(ve){console.error(`Failed to log to log-api: ${D(ve)}`)}J()})}}var ee=function(T,k){var J={};for(var K in T)Object.prototype.hasOwnProperty.call(T,K)&&k.indexOf(K)<0&&(J[K]=T[K]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var re=0;for(K=Object.getOwnPropertySymbols(T);re<K.length;re++)k.indexOf(K[re])<0&&Object.prototype.propertyIsEnumerable.call(T,K[re])&&(J[K[re]]=T[K[re]])}return J};const ne={app:_.a,namespace:_.i,buildTag:_.b,instanceId:z.a},Y=_.e?I.format.printf(T=>{var{timestamp:k,level:J,message:K,error:re}=T,se=ee(T,["timestamp","level","message","error"]);const fe=Object.assign(Object.assign({timestamp:k?A(k).getTime():new Date().getTime(),level:J.toUpperCase(),message:K},re?{error:N(re)}:{}),{meta:Object.assign(Object.assign({},ne),se)});return q()(fe,{cycles:!0})}):I.format.printf(T=>{var{timestamp:k,level:J,message:K,error:re}=T,se=ee(T,["timestamp","level","message","error"]);let fe=`${k||new Date().toISOString()} ${J.toUpperCase()}: ${K} `;return Object.keys(se).length>0&&(fe+=q()(se,{cycles:!0})),re&&(fe+=`
|
|
7
|
+
${D(re)}`),fe}),G=Object(I.createLogger)({level:_.f});if(G.add(new I.transports.Console({format:Y,level:"debug"})),G.transports.forEach(T=>{T.silent=!_.g}),_.d&&G.add(new Q(_.d,ne)),_.h){const T=m.resolve(y.tmpdir(),`silly-${_.a}.log`);G.debug("Logging silly logs to file",{filename:T}),G.add(new I.transports.File({filename:T,maxsize:1*C,maxFiles:10,format:I.format.combine((S="silly",Object(I.format)(k=>k.level===S&&k)()),Y),level:"silly"}))}var S},function(e,t,n){n.d(t,"a",function(){return r});const r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}},function(e,t){var n,r,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function o(R){if(n===setTimeout)return setTimeout(R,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(R,0);try{return n(R,0)}catch{try{return n.call(null,R,0)}catch{return n.call(this,R,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:s}catch{n=s}try{r=typeof clearTimeout=="function"?clearTimeout:l}catch{r=l}})();var c,u=[],f=!1,E=-1;function w(){f&&c&&(f=!1,c.length?u=c.concat(u):E=-1,u.length&&h())}function h(){if(!f){var R=o(w);f=!0;for(var j=u.length;j;){for(c=u,u=[];++E<j;)c&&c[E].run();E=-1,j=u.length}c=null,f=!1,function(F){if(r===clearTimeout)return clearTimeout(F);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(F);try{r(F)}catch{try{return r.call(null,F)}catch{return r.call(this,F)}}}(R)}}function g(R,j){this.fun=R,this.array=j}function b(){}i.nextTick=function(R){var j=new Array(arguments.length-1);if(arguments.length>1)for(var F=1;F<arguments.length;F++)j[F-1]=arguments[F];u.push(new g(R,j)),u.length!==1||f||o(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(R){return[]},i.binding=function(R){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(R){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")}),Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")}),Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")}),Object.defineProperty(t,"configs",{value:n(118)})},function(e,t,n){(function(r){n.d(t,"a",function(){return l}),n.d(t,"i",function(){return o}),n.d(t,"j",function(){return c}),n.d(t,"b",function(){return u}),n.d(t,"f",function(){return f}),n.d(t,"e",function(){return E}),n.d(t,"g",function(){return w}),n.d(t,"d",function(){return h}),n.d(t,"c",function(){return g}),n.d(t,"h",function(){return b});var i=n(102);const s=i.from({ENVIRONMENT:r.env.ENV,AGGREGATE_LEVEL:r.env.AGGREGATE_LEVEL,API_ENDPOINT:r.env.API_ENDPOINT,APP:"realtime-sdk",APP_PATH:r.env.APP_PATH,BUILD_TAG:r.env.BUILD_TAG,ENABLE_SELF_SERVE:r.env.ENABLE_SELF_SERVE,ENABLE_SENTRY:r.env.ENABLE_SENTRY,ENABLE_SENTRY_PROFILING:r.env.ENABLE_SENTRY_PROFILING,GIT_COMMIT:r.env.GIT_COMMIT,JEST_WORKER_ID:r.env.JEST_WORKER_ID,LOG_API_ENDPOINT:r.env.LOG_API_ENDPOINT,LOG_JSON:"false",LOG_LEVEL:r.env.LOG_LEVEL,LOG_TO_CONSOLE:r.env.LOG_TO_CONSOLE,LOG_TO_FILE:r.env.LOG_TO_FILE,NAMESPACE:"production",SENTRY_DSN:r.env.SENTRY_DSN,SHEET_EXPORT_MAX_ROW_COUNT:r.env.SHEET_EXPORT_MAX_ROW_COUNT,STABLE_AGENT_VERSION:r.env.STABLE_AGENT_VERSION,VERSION:r.env.VERSION}),l=(s.get("ENVIRONMENT").default("").asString(),s.get("APP").default("").asString()),o=(s.get("APP_PATH").default("").asString(),s.get("API_ENDPOINT").default("").asString(),s.get("NAMESPACE").default("").asString()),c=s.get("VERSION").default("").asString(),u=s.get("BUILD_TAG").default("").asString(),f=(s.get("GIT_COMMIT").default("").asString(),s.get("ENABLE_SENTRY").default("false").asBool(),s.get("ENABLE_SENTRY_PROFILING").default("false").asBool(),s.get("SENTRY_DSN").default("").asString(),s.get("LOG_LEVEL").default("debug").asString()),E=s.get("LOG_JSON").default("true").asBool(),w=s.get("LOG_TO_CONSOLE").default("true").asBool(),h=(s.get("STABLE_AGENT_VERSION").default("").asString(),s.get("LOG_API_ENDPOINT").asString()),g=s.get("JEST_WORKER_ID").asString(),b=(s.get("SHEET_EXPORT_MAX_ROW_COUNT").default("10000").asIntPositive(),s.get("LOG_TO_FILE").default("false").asBoolStrict());s.get("ENABLE_SELF_SERVE").default("true").asBoolStrict(),s.get("AGGREGATE_LEVEL").default("hour").asEnum(["day","hour","minute"])}).call(this,n(2))},function(e,t,n){(function(r){var i=n(126),s=n(127),l=n(42);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(S,T){if(o()<T)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(S=new Uint8Array(T)).__proto__=u.prototype:(S===null&&(S=new u(T)),S.length=T),S}function u(S,T,k){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(S,T,k);if(typeof S=="number"){if(typeof T=="string")throw new Error("If encoding is specified then the first argument must be a string");return w(this,S)}return f(this,S,T,k)}function f(S,T,k,J){if(typeof T=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&T instanceof ArrayBuffer?function(K,re,se,fe){if(re.byteLength,se<0||re.byteLength<se)throw new RangeError("'offset' is out of bounds");if(re.byteLength<se+(fe||0))throw new RangeError("'length' is out of bounds");return re=se===void 0&&fe===void 0?new Uint8Array(re):fe===void 0?new Uint8Array(re,se):new Uint8Array(re,se,fe),u.TYPED_ARRAY_SUPPORT?(K=re).__proto__=u.prototype:K=h(K,re),K}(S,T,k,J):typeof T=="string"?function(K,re,se){if(typeof se=="string"&&se!==""||(se="utf8"),!u.isEncoding(se))throw new TypeError('"encoding" must be a valid string encoding');var fe=0|b(re,se),ve=(K=c(K,fe)).write(re,se);return ve!==fe&&(K=K.slice(0,ve)),K}(S,T,k):function(K,re){if(u.isBuffer(re)){var se=0|g(re.length);return(K=c(K,se)).length===0||re.copy(K,0,0,se),K}if(re){if(typeof ArrayBuffer<"u"&&re.buffer instanceof ArrayBuffer||"length"in re)return typeof re.length!="number"||(fe=re.length)!=fe?c(K,0):h(K,re);if(re.type==="Buffer"&&l(re.data))return h(K,re.data)}var fe;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(S,T)}function E(S){if(typeof S!="number")throw new TypeError('"size" argument must be a number');if(S<0)throw new RangeError('"size" argument must not be negative')}function w(S,T){if(E(T),S=c(S,T<0?0:0|g(T)),!u.TYPED_ARRAY_SUPPORT)for(var k=0;k<T;++k)S[k]=0;return S}function h(S,T){var k=T.length<0?0:0|g(T.length);S=c(S,k);for(var J=0;J<k;J+=1)S[J]=255&T[J];return S}function g(S){if(S>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|S}function b(S,T){if(u.isBuffer(S))return S.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(S)||S instanceof ArrayBuffer))return S.byteLength;typeof S!="string"&&(S=""+S);var k=S.length;if(k===0)return 0;for(var J=!1;;)switch(T){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":case void 0:return ne(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*k;case"hex":return k>>>1;case"base64":return Y(S).length;default:if(J)return ne(S).length;T=(""+T).toLowerCase(),J=!0}}function R(S,T,k){var J=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0)<=(T>>>=0))return"";for(S||(S="utf8");;)switch(S){case"hex":return W(this,T,k);case"utf8":case"utf-8":return I(this,T,k);case"ascii":return _(this,T,k);case"latin1":case"binary":return L(this,T,k);case"base64":return m(this,T,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,T,k);default:if(J)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),J=!0}}function j(S,T,k){var J=S[T];S[T]=S[k],S[k]=J}function F(S,T,k,J,K){if(S.length===0)return-1;if(typeof k=="string"?(J=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,isNaN(k)&&(k=K?0:S.length-1),k<0&&(k=S.length+k),k>=S.length){if(K)return-1;k=S.length-1}else if(k<0){if(!K)return-1;k=0}if(typeof T=="string"&&(T=u.from(T,J)),u.isBuffer(T))return T.length===0?-1:M(S,T,k,J,K);if(typeof T=="number")return T&=255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(S,T,k):Uint8Array.prototype.lastIndexOf.call(S,T,k):M(S,[T],k,J,K);throw new TypeError("val must be string, number or Buffer")}function M(S,T,k,J,K){var re,se=1,fe=S.length,ve=T.length;if(J!==void 0&&((J=String(J).toLowerCase())==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(S.length<2||T.length<2)return-1;se=2,fe/=2,ve/=2,k/=2}function Ce(Oe,De){return se===1?Oe[De]:Oe.readUInt16BE(De*se)}if(K){var Se=-1;for(re=k;re<fe;re++)if(Ce(S,re)===Ce(T,Se===-1?0:re-Se)){if(Se===-1&&(Se=re),re-Se+1===ve)return Se*se}else Se!==-1&&(re-=re-Se),Se=-1}else for(k+ve>fe&&(k=fe-ve),re=k;re>=0;re--){for(var Ie=!0,Te=0;Te<ve;Te++)if(Ce(S,re+Te)!==Ce(T,Te)){Ie=!1;break}if(Ie)return re}return-1}function A(S,T,k,J){k=Number(k)||0;var K=S.length-k;J?(J=Number(J))>K&&(J=K):J=K;var re=T.length;if(re%2!=0)throw new TypeError("Invalid hex string");J>re/2&&(J=re/2);for(var se=0;se<J;++se){var fe=parseInt(T.substr(2*se,2),16);if(isNaN(fe))return se;S[k+se]=fe}return se}function d(S,T,k,J){return G(ne(T,S.length-k),S,k,J)}function C(S,T,k,J){return G(function(K){for(var re=[],se=0;se<K.length;++se)re.push(255&K.charCodeAt(se));return re}(T),S,k,J)}function $(S,T,k,J){return C(S,T,k,J)}function q(S,T,k,J){return G(Y(T),S,k,J)}function y(S,T,k,J){return G(function(K,re){for(var se,fe,ve,Ce=[],Se=0;Se<K.length&&!((re-=2)<0);++Se)se=K.charCodeAt(Se),fe=se>>8,ve=se%256,Ce.push(ve),Ce.push(fe);return Ce}(T,S.length-k),S,k,J)}function m(S,T,k){return T===0&&k===S.length?i.fromByteArray(S):i.fromByteArray(S.slice(T,k))}function I(S,T,k){k=Math.min(S.length,k);for(var J=[],K=T;K<k;){var re,se,fe,ve,Ce=S[K],Se=null,Ie=Ce>239?4:Ce>223?3:Ce>191?2:1;if(K+Ie<=k)switch(Ie){case 1:Ce<128&&(Se=Ce);break;case 2:(192&(re=S[K+1]))==128&&(ve=(31&Ce)<<6|63&re)>127&&(Se=ve);break;case 3:re=S[K+1],se=S[K+2],(192&re)==128&&(192&se)==128&&(ve=(15&Ce)<<12|(63&re)<<6|63&se)>2047&&(ve<55296||ve>57343)&&(Se=ve);break;case 4:re=S[K+1],se=S[K+2],fe=S[K+3],(192&re)==128&&(192&se)==128&&(192&fe)==128&&(ve=(15&Ce)<<18|(63&re)<<12|(63&se)<<6|63&fe)>65535&&ve<1114112&&(Se=ve)}Se===null?(Se=65533,Ie=1):Se>65535&&(Se-=65536,J.push(Se>>>10&1023|55296),Se=56320|1023&Se),J.push(Se),K+=Ie}return function(Te){var Oe=Te.length;if(Oe<=4096)return String.fromCharCode.apply(String,Te);for(var De="",qe=0;qe<Oe;)De+=String.fromCharCode.apply(String,Te.slice(qe,qe+=4096));return De}(J)}t.Buffer=u,t.SlowBuffer=function(S){return+S!=S&&(S=0),u.alloc(+S)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=r.TYPED_ARRAY_SUPPORT!==void 0?r.TYPED_ARRAY_SUPPORT:function(){try{var S=new Uint8Array(1);return S.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},S.foo()===42&&typeof S.subarray=="function"&&S.subarray(1,1).byteLength===0}catch{return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(S){return S.__proto__=u.prototype,S},u.from=function(S,T,k){return f(null,S,T,k)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(S,T,k){return function(J,K,re,se){return E(K),K<=0?c(J,K):re!==void 0?typeof se=="string"?c(J,K).fill(re,se):c(J,K).fill(re):c(J,K)}(null,S,T,k)},u.allocUnsafe=function(S){return w(null,S)},u.allocUnsafeSlow=function(S){return w(null,S)},u.isBuffer=function(S){return!(S==null||!S._isBuffer)},u.compare=function(S,T){if(!u.isBuffer(S)||!u.isBuffer(T))throw new TypeError("Arguments must be Buffers");if(S===T)return 0;for(var k=S.length,J=T.length,K=0,re=Math.min(k,J);K<re;++K)if(S[K]!==T[K]){k=S[K],J=T[K];break}return k<J?-1:J<k?1:0},u.isEncoding=function(S){switch(String(S).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(S,T){if(!l(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return u.alloc(0);var k;if(T===void 0)for(T=0,k=0;k<S.length;++k)T+=S[k].length;var J=u.allocUnsafe(T),K=0;for(k=0;k<S.length;++k){var re=S[k];if(!u.isBuffer(re))throw new TypeError('"list" argument must be an Array of Buffers');re.copy(J,K),K+=re.length}return J},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var S=this.length;if(S%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var T=0;T<S;T+=2)j(this,T,T+1);return this},u.prototype.swap32=function(){var S=this.length;if(S%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var T=0;T<S;T+=4)j(this,T,T+3),j(this,T+1,T+2);return this},u.prototype.swap64=function(){var S=this.length;if(S%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var T=0;T<S;T+=8)j(this,T,T+7),j(this,T+1,T+6),j(this,T+2,T+5),j(this,T+3,T+4);return this},u.prototype.toString=function(){var S=0|this.length;return S===0?"":arguments.length===0?I(this,0,S):R.apply(this,arguments)},u.prototype.equals=function(S){if(!u.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S||u.compare(this,S)===0},u.prototype.inspect=function(){var S="",T=t.INSPECT_MAX_BYTES;return this.length>0&&(S=this.toString("hex",0,T).match(/.{2}/g).join(" "),this.length>T&&(S+=" ... ")),"<Buffer "+S+">"},u.prototype.compare=function(S,T,k,J,K){if(!u.isBuffer(S))throw new TypeError("Argument must be a Buffer");if(T===void 0&&(T=0),k===void 0&&(k=S?S.length:0),J===void 0&&(J=0),K===void 0&&(K=this.length),T<0||k>S.length||J<0||K>this.length)throw new RangeError("out of range index");if(J>=K&&T>=k)return 0;if(J>=K)return-1;if(T>=k)return 1;if(this===S)return 0;for(var re=(K>>>=0)-(J>>>=0),se=(k>>>=0)-(T>>>=0),fe=Math.min(re,se),ve=this.slice(J,K),Ce=S.slice(T,k),Se=0;Se<fe;++Se)if(ve[Se]!==Ce[Se]){re=ve[Se],se=Ce[Se];break}return re<se?-1:se<re?1:0},u.prototype.includes=function(S,T,k){return this.indexOf(S,T,k)!==-1},u.prototype.indexOf=function(S,T,k){return F(this,S,T,k,!0)},u.prototype.lastIndexOf=function(S,T,k){return F(this,S,T,k,!1)},u.prototype.write=function(S,T,k,J){if(T===void 0)J="utf8",k=this.length,T=0;else if(k===void 0&&typeof T=="string")J=T,k=this.length,T=0;else{if(!isFinite(T))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");T|=0,isFinite(k)?(k|=0,J===void 0&&(J="utf8")):(J=k,k=void 0)}var K=this.length-T;if((k===void 0||k>K)&&(k=K),S.length>0&&(k<0||T<0)||T>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");for(var re=!1;;)switch(J){case"hex":return A(this,S,T,k);case"utf8":case"utf-8":return d(this,S,T,k);case"ascii":return C(this,S,T,k);case"latin1":case"binary":return $(this,S,T,k);case"base64":return q(this,S,T,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,S,T,k);default:if(re)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),re=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(S,T,k){var J="";k=Math.min(S.length,k);for(var K=T;K<k;++K)J+=String.fromCharCode(127&S[K]);return J}function L(S,T,k){var J="";k=Math.min(S.length,k);for(var K=T;K<k;++K)J+=String.fromCharCode(S[K]);return J}function W(S,T,k){var J=S.length;(!T||T<0)&&(T=0),(!k||k<0||k>J)&&(k=J);for(var K="",re=T;re<k;++re)K+=ee(S[re]);return K}function B(S,T,k){for(var J=S.slice(T,k),K="",re=0;re<J.length;re+=2)K+=String.fromCharCode(J[re]+256*J[re+1]);return K}function N(S,T,k){if(S%1!=0||S<0)throw new RangeError("offset is not uint");if(S+T>k)throw new RangeError("Trying to access beyond buffer length")}function D(S,T,k,J,K,re){if(!u.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>K||T<re)throw new RangeError('"value" argument is out of bounds');if(k+J>S.length)throw new RangeError("Index out of range")}function z(S,T,k,J){T<0&&(T=65535+T+1);for(var K=0,re=Math.min(S.length-k,2);K<re;++K)S[k+K]=(T&255<<8*(J?K:1-K))>>>8*(J?K:1-K)}function O(S,T,k,J){T<0&&(T=4294967295+T+1);for(var K=0,re=Math.min(S.length-k,4);K<re;++K)S[k+K]=T>>>8*(J?K:3-K)&255}function p(S,T,k,J,K,re){if(k+J>S.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function U(S,T,k,J,K){return K||p(S,0,k,4),s.write(S,T,k,J,23,4),k+4}function V(S,T,k,J,K){return K||p(S,0,k,8),s.write(S,T,k,J,52,8),k+8}u.prototype.slice=function(S,T){var k,J=this.length;if((S=~~S)<0?(S+=J)<0&&(S=0):S>J&&(S=J),(T=T===void 0?J:~~T)<0?(T+=J)<0&&(T=0):T>J&&(T=J),T<S&&(T=S),u.TYPED_ARRAY_SUPPORT)(k=this.subarray(S,T)).__proto__=u.prototype;else{var K=T-S;k=new u(K,void 0);for(var re=0;re<K;++re)k[re]=this[re+S]}return k},u.prototype.readUIntLE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=this[S],K=1,re=0;++re<T&&(K*=256);)J+=this[S+re]*K;return J},u.prototype.readUIntBE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=this[S+--T],K=1;T>0&&(K*=256);)J+=this[S+--T]*K;return J},u.prototype.readUInt8=function(S,T){return T||N(S,1,this.length),this[S]},u.prototype.readUInt16LE=function(S,T){return T||N(S,2,this.length),this[S]|this[S+1]<<8},u.prototype.readUInt16BE=function(S,T){return T||N(S,2,this.length),this[S]<<8|this[S+1]},u.prototype.readUInt32LE=function(S,T){return T||N(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+16777216*this[S+3]},u.prototype.readUInt32BE=function(S,T){return T||N(S,4,this.length),16777216*this[S]+(this[S+1]<<16|this[S+2]<<8|this[S+3])},u.prototype.readIntLE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=this[S],K=1,re=0;++re<T&&(K*=256);)J+=this[S+re]*K;return J>=(K*=128)&&(J-=Math.pow(2,8*T)),J},u.prototype.readIntBE=function(S,T,k){S|=0,T|=0,k||N(S,T,this.length);for(var J=T,K=1,re=this[S+--J];J>0&&(K*=256);)re+=this[S+--J]*K;return re>=(K*=128)&&(re-=Math.pow(2,8*T)),re},u.prototype.readInt8=function(S,T){return T||N(S,1,this.length),128&this[S]?-1*(255-this[S]+1):this[S]},u.prototype.readInt16LE=function(S,T){T||N(S,2,this.length);var k=this[S]|this[S+1]<<8;return 32768&k?4294901760|k:k},u.prototype.readInt16BE=function(S,T){T||N(S,2,this.length);var k=this[S+1]|this[S]<<8;return 32768&k?4294901760|k:k},u.prototype.readInt32LE=function(S,T){return T||N(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},u.prototype.readInt32BE=function(S,T){return T||N(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},u.prototype.readFloatLE=function(S,T){return T||N(S,4,this.length),s.read(this,S,!0,23,4)},u.prototype.readFloatBE=function(S,T){return T||N(S,4,this.length),s.read(this,S,!1,23,4)},u.prototype.readDoubleLE=function(S,T){return T||N(S,8,this.length),s.read(this,S,!0,52,8)},u.prototype.readDoubleBE=function(S,T){return T||N(S,8,this.length),s.read(this,S,!1,52,8)},u.prototype.writeUIntLE=function(S,T,k,J){S=+S,T|=0,k|=0,J||D(this,S,T,k,Math.pow(2,8*k)-1,0);var K=1,re=0;for(this[T]=255&S;++re<k&&(K*=256);)this[T+re]=S/K&255;return T+k},u.prototype.writeUIntBE=function(S,T,k,J){S=+S,T|=0,k|=0,J||D(this,S,T,k,Math.pow(2,8*k)-1,0);var K=k-1,re=1;for(this[T+K]=255&S;--K>=0&&(re*=256);)this[T+K]=S/re&255;return T+k},u.prototype.writeUInt8=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,1,255,0),u.TYPED_ARRAY_SUPPORT||(S=Math.floor(S)),this[T]=255&S,T+1},u.prototype.writeUInt16LE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[T]=255&S,this[T+1]=S>>>8):z(this,S,T,!0),T+2},u.prototype.writeUInt16BE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>8,this[T+1]=255&S):z(this,S,T,!1),T+2},u.prototype.writeUInt32LE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[T+3]=S>>>24,this[T+2]=S>>>16,this[T+1]=S>>>8,this[T]=255&S):O(this,S,T,!0),T+4},u.prototype.writeUInt32BE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>24,this[T+1]=S>>>16,this[T+2]=S>>>8,this[T+3]=255&S):O(this,S,T,!1),T+4},u.prototype.writeIntLE=function(S,T,k,J){if(S=+S,T|=0,!J){var K=Math.pow(2,8*k-1);D(this,S,T,k,K-1,-K)}var re=0,se=1,fe=0;for(this[T]=255&S;++re<k&&(se*=256);)S<0&&fe===0&&this[T+re-1]!==0&&(fe=1),this[T+re]=(S/se>>0)-fe&255;return T+k},u.prototype.writeIntBE=function(S,T,k,J){if(S=+S,T|=0,!J){var K=Math.pow(2,8*k-1);D(this,S,T,k,K-1,-K)}var re=k-1,se=1,fe=0;for(this[T+re]=255&S;--re>=0&&(se*=256);)S<0&&fe===0&&this[T+re+1]!==0&&(fe=1),this[T+re]=(S/se>>0)-fe&255;return T+k},u.prototype.writeInt8=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,1,127,-128),u.TYPED_ARRAY_SUPPORT||(S=Math.floor(S)),S<0&&(S=255+S+1),this[T]=255&S,T+1},u.prototype.writeInt16LE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[T]=255&S,this[T+1]=S>>>8):z(this,S,T,!0),T+2},u.prototype.writeInt16BE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>8,this[T+1]=255&S):z(this,S,T,!1),T+2},u.prototype.writeInt32LE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[T]=255&S,this[T+1]=S>>>8,this[T+2]=S>>>16,this[T+3]=S>>>24):O(this,S,T,!0),T+4},u.prototype.writeInt32BE=function(S,T,k){return S=+S,T|=0,k||D(this,S,T,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),u.TYPED_ARRAY_SUPPORT?(this[T]=S>>>24,this[T+1]=S>>>16,this[T+2]=S>>>8,this[T+3]=255&S):O(this,S,T,!1),T+4},u.prototype.writeFloatLE=function(S,T,k){return U(this,S,T,!0,k)},u.prototype.writeFloatBE=function(S,T,k){return U(this,S,T,!1,k)},u.prototype.writeDoubleLE=function(S,T,k){return V(this,S,T,!0,k)},u.prototype.writeDoubleBE=function(S,T,k){return V(this,S,T,!1,k)},u.prototype.copy=function(S,T,k,J){if(k||(k=0),J||J===0||(J=this.length),T>=S.length&&(T=S.length),T||(T=0),J>0&&J<k&&(J=k),J===k||S.length===0||this.length===0)return 0;if(T<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("sourceStart out of bounds");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),S.length-T<J-k&&(J=S.length-T+k);var K,re=J-k;if(this===S&&k<T&&T<J)for(K=re-1;K>=0;--K)S[K+T]=this[K+k];else if(re<1e3||!u.TYPED_ARRAY_SUPPORT)for(K=0;K<re;++K)S[K+T]=this[K+k];else Uint8Array.prototype.set.call(S,this.subarray(k,k+re),T);return re},u.prototype.fill=function(S,T,k,J){if(typeof S=="string"){if(typeof T=="string"?(J=T,T=0,k=this.length):typeof k=="string"&&(J=k,k=this.length),S.length===1){var K=S.charCodeAt(0);K<256&&(S=K)}if(J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!u.isEncoding(J))throw new TypeError("Unknown encoding: "+J)}else typeof S=="number"&&(S&=255);if(T<0||this.length<T||this.length<k)throw new RangeError("Out of range index");if(k<=T)return this;var re;if(T>>>=0,k=k===void 0?this.length:k>>>0,S||(S=0),typeof S=="number")for(re=T;re<k;++re)this[re]=S;else{var se=u.isBuffer(S)?S:ne(new u(S,J).toString()),fe=se.length;for(re=0;re<k-T;++re)this[re+T]=se[re%fe]}return this};var Q=/[^+\/0-9A-Za-z-_]/g;function ee(S){return S<16?"0"+S.toString(16):S.toString(16)}function ne(S,T){var k;T=T||1/0;for(var J=S.length,K=null,re=[],se=0;se<J;++se){if((k=S.charCodeAt(se))>55295&&k<57344){if(!K){if(k>56319){(T-=3)>-1&&re.push(239,191,189);continue}if(se+1===J){(T-=3)>-1&&re.push(239,191,189);continue}K=k;continue}if(k<56320){(T-=3)>-1&&re.push(239,191,189),K=k;continue}k=65536+(K-55296<<10|k-56320)}else K&&(T-=3)>-1&&re.push(239,191,189);if(K=null,k<128){if((T-=1)<0)break;re.push(k)}else if(k<2048){if((T-=2)<0)break;re.push(k>>6|192,63&k|128)}else if(k<65536){if((T-=3)<0)break;re.push(k>>12|224,k>>6&63|128,63&k|128)}else{if(!(k<1114112))throw new Error("Invalid code point");if((T-=4)<0)break;re.push(k>>18|240,k>>12&63|128,k>>6&63|128,63&k|128)}}return re}function Y(S){return i.toByteArray(function(T){if((T=function(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}(T).replace(Q,"")).length<2)return"";for(;T.length%4!=0;)T+="=";return T}(S))}function G(S,T,k,J){for(var K=0;K<J&&!(K+k>=T.length||K>=S.length);++K)T[K+k]=S[K];return K}}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){r&&(n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(n,r){if(r){n.super_=r;var i=function(){};i.prototype=r.prototype,n.prototype=new i,n.prototype.constructor=n}}},function(e,t,n){n.d(t,"a",function(){return r});const r=i=>new Promise(s=>setTimeout(s,i||0))},function(e,t,n){var r=n(99),i=r,s=Function("return this")(),l=n(98);i.object.extend(proto,l),i.exportSymbol("proto.v1.signaling.api.CreatePeerRequest",null,s),i.exportSymbol("proto.v1.signaling.api.CreatePeerResponse",null,s),i.exportSymbol("proto.v1.signaling.api.DeletePeerRequest",null,s),i.exportSymbol("proto.v1.signaling.api.DeletePeerResponse",null,s),i.exportSymbol("proto.v1.signaling.api.GetHealthRequest",null,s),i.exportSymbol("proto.v1.signaling.api.GetHealthResponse",null,s),i.exportSymbol("proto.v1.signaling.api.GetIceServersRequest",null,s),i.exportSymbol("proto.v1.signaling.api.GetIceServersResponse",null,s),i.exportSymbol("proto.v1.signaling.api.GetPeersRequest",null,s),i.exportSymbol("proto.v1.signaling.api.GetPeersResponse",null,s),i.exportSymbol("proto.v1.signaling.api.Peer",null,s),i.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamRequest",null,s),i.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamResponse",null,s),i.exportSymbol("proto.v1.signaling.api.RefreshPeerRequest",null,s),i.exportSymbol("proto.v1.signaling.api.RefreshPeerResponse",null,s),i.exportSymbol("proto.v1.signaling.api.SendSignalRequest",null,s),i.exportSymbol("proto.v1.signaling.api.SendSignalResponse",null,s),i.exportSymbol("proto.v1.signaling.api.SessionType",null,s),i.exportSymbol("proto.v1.signaling.api.Signal",null,s),proto.v1.signaling.api.Peer=function(o){r.Message.initialize(this,o,0,-1,proto.v1.signaling.api.Peer.repeatedFields_,null)},i.inherits(proto.v1.signaling.api.Peer,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Peer.displayName="proto.v1.signaling.api.Peer"),proto.v1.signaling.api.Signal=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.Signal,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Signal.displayName="proto.v1.signaling.api.Signal"),proto.v1.signaling.api.GetHealthRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetHealthRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthRequest.displayName="proto.v1.signaling.api.GetHealthRequest"),proto.v1.signaling.api.GetHealthResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetHealthResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthResponse.displayName="proto.v1.signaling.api.GetHealthResponse"),proto.v1.signaling.api.CreatePeerRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.CreatePeerRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerRequest.displayName="proto.v1.signaling.api.CreatePeerRequest"),proto.v1.signaling.api.CreatePeerResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.CreatePeerResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerResponse.displayName="proto.v1.signaling.api.CreatePeerResponse"),proto.v1.signaling.api.DeletePeerRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.DeletePeerRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerRequest.displayName="proto.v1.signaling.api.DeletePeerRequest"),proto.v1.signaling.api.DeletePeerResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.DeletePeerResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerResponse.displayName="proto.v1.signaling.api.DeletePeerResponse"),proto.v1.signaling.api.RefreshPeerRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.RefreshPeerRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerRequest.displayName="proto.v1.signaling.api.RefreshPeerRequest"),proto.v1.signaling.api.RefreshPeerResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.RefreshPeerResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerResponse.displayName="proto.v1.signaling.api.RefreshPeerResponse"),proto.v1.signaling.api.GetPeersRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetPeersRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersRequest.displayName="proto.v1.signaling.api.GetPeersRequest"),proto.v1.signaling.api.GetPeersResponse=function(o){r.Message.initialize(this,o,0,-1,proto.v1.signaling.api.GetPeersResponse.repeatedFields_,null)},i.inherits(proto.v1.signaling.api.GetPeersResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersResponse.displayName="proto.v1.signaling.api.GetPeersResponse"),proto.v1.signaling.api.GetIceServersRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetIceServersRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersRequest.displayName="proto.v1.signaling.api.GetIceServersRequest"),proto.v1.signaling.api.GetIceServersResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.GetIceServersResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersResponse.displayName="proto.v1.signaling.api.GetIceServersResponse"),proto.v1.signaling.api.SendSignalRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.SendSignalRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalRequest.displayName="proto.v1.signaling.api.SendSignalRequest"),proto.v1.signaling.api.SendSignalResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.SendSignalResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalResponse.displayName="proto.v1.signaling.api.SendSignalResponse"),proto.v1.signaling.api.ReceiveSignalStreamRequest=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.ReceiveSignalStreamRequest,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.displayName="proto.v1.signaling.api.ReceiveSignalStreamRequest"),proto.v1.signaling.api.ReceiveSignalStreamResponse=function(o){r.Message.initialize(this,o,0,-1,null,null)},i.inherits(proto.v1.signaling.api.ReceiveSignalStreamResponse,r.Message),i.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.displayName="proto.v1.signaling.api.ReceiveSignalStreamResponse"),proto.v1.signaling.api.Peer.repeatedFields_=[5],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Peer.prototype.toObject=function(o){return proto.v1.signaling.api.Peer.toObject(o,this)},proto.v1.signaling.api.Peer.toObject=function(o,c){var u,f={peerId:r.Message.getFieldWithDefault(c,1,""),organizationId:r.Message.getFieldWithDefault(c,2,""),userId:(u=c.getUserId())&&l.StringValue.toObject(o,u),deviceId:(u=c.getDeviceId())&&l.StringValue.toObject(o,u),sessionIdsList:(u=r.Message.getRepeatedField(c,5))==null?void 0:u,peerCreatedTimestamp:(u=c.getPeerCreatedTimestamp())&&l.Int64Value.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.Peer.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.Peer;return proto.v1.signaling.api.Peer.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.Peer.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setPeerId(u);break;case 2:u=c.readString(),o.setOrganizationId(u);break;case 3:u=new l.StringValue,c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setUserId(u);break;case 4:u=new l.StringValue,c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setDeviceId(u);break;case 5:u=c.readString(),o.addSessionIds(u);break;case 6:u=new l.Int64Value,c.readMessage(u,l.Int64Value.deserializeBinaryFromReader),o.setPeerCreatedTimestamp(u);break;default:c.skipField()}return o},proto.v1.signaling.api.Peer.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.Peer.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.Peer.serializeBinaryToWriter=function(o,c){var u=void 0;(u=o.getPeerId()).length>0&&c.writeString(1,u),(u=o.getOrganizationId()).length>0&&c.writeString(2,u),(u=o.getUserId())!=null&&c.writeMessage(3,u,l.StringValue.serializeBinaryToWriter),(u=o.getDeviceId())!=null&&c.writeMessage(4,u,l.StringValue.serializeBinaryToWriter),(u=o.getSessionIdsList()).length>0&&c.writeRepeatedString(5,u),(u=o.getPeerCreatedTimestamp())!=null&&c.writeMessage(6,u,l.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.Peer.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.Peer.prototype.setPeerId=function(o){return r.Message.setProto3StringField(this,1,o)},proto.v1.signaling.api.Peer.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.Peer.prototype.setOrganizationId=function(o){return r.Message.setProto3StringField(this,2,o)},proto.v1.signaling.api.Peer.prototype.getUserId=function(){return r.Message.getWrapperField(this,l.StringValue,3)},proto.v1.signaling.api.Peer.prototype.setUserId=function(o){return r.Message.setWrapperField(this,3,o)},proto.v1.signaling.api.Peer.prototype.clearUserId=function(){return this.setUserId(void 0)},proto.v1.signaling.api.Peer.prototype.hasUserId=function(){return r.Message.getField(this,3)!=null},proto.v1.signaling.api.Peer.prototype.getDeviceId=function(){return r.Message.getWrapperField(this,l.StringValue,4)},proto.v1.signaling.api.Peer.prototype.setDeviceId=function(o){return r.Message.setWrapperField(this,4,o)},proto.v1.signaling.api.Peer.prototype.clearDeviceId=function(){return this.setDeviceId(void 0)},proto.v1.signaling.api.Peer.prototype.hasDeviceId=function(){return r.Message.getField(this,4)!=null},proto.v1.signaling.api.Peer.prototype.getSessionIdsList=function(){return r.Message.getRepeatedField(this,5)},proto.v1.signaling.api.Peer.prototype.setSessionIdsList=function(o){return r.Message.setField(this,5,o||[])},proto.v1.signaling.api.Peer.prototype.addSessionIds=function(o,c){return r.Message.addToRepeatedField(this,5,o,c)},proto.v1.signaling.api.Peer.prototype.clearSessionIdsList=function(){return this.setSessionIdsList([])},proto.v1.signaling.api.Peer.prototype.getPeerCreatedTimestamp=function(){return r.Message.getWrapperField(this,l.Int64Value,6)},proto.v1.signaling.api.Peer.prototype.setPeerCreatedTimestamp=function(o){return r.Message.setWrapperField(this,6,o)},proto.v1.signaling.api.Peer.prototype.clearPeerCreatedTimestamp=function(){return this.setPeerCreatedTimestamp(void 0)},proto.v1.signaling.api.Peer.prototype.hasPeerCreatedTimestamp=function(){return r.Message.getField(this,6)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Signal.prototype.toObject=function(o){return proto.v1.signaling.api.Signal.toObject(o,this)},proto.v1.signaling.api.Signal.toObject=function(o,c){var u,f={sessionId:(u=c.getSessionId())&&l.StringValue.toObject(o,u),sessionCreatedTimestamp:(u=c.getSessionCreatedTimestamp())&&l.Int64Value.toObject(o,u),senderId:r.Message.getFieldWithDefault(c,3,""),receiverId:r.Message.getFieldWithDefault(c,4,""),payload:r.Message.getFieldWithDefault(c,5,""),iceServers:r.Message.getFieldWithDefault(c,6,""),iceTransportPolicy:r.Message.getFieldWithDefault(c,7,""),sessionType:r.Message.getFieldWithDefault(c,8,0)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.Signal.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.Signal;return proto.v1.signaling.api.Signal.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.Signal.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new l.StringValue;c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setSessionId(u);break;case 2:u=new l.Int64Value,c.readMessage(u,l.Int64Value.deserializeBinaryFromReader),o.setSessionCreatedTimestamp(u);break;case 3:u=c.readString(),o.setSenderId(u);break;case 4:u=c.readString(),o.setReceiverId(u);break;case 5:u=c.readString(),o.setPayload(u);break;case 6:u=c.readString(),o.setIceServers(u);break;case 7:u=c.readString(),o.setIceTransportPolicy(u);break;case 8:u=c.readEnum(),o.setSessionType(u);break;default:c.skipField()}return o},proto.v1.signaling.api.Signal.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.Signal.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.Signal.serializeBinaryToWriter=function(o,c){var u=void 0;(u=o.getSessionId())!=null&&c.writeMessage(1,u,l.StringValue.serializeBinaryToWriter),(u=o.getSessionCreatedTimestamp())!=null&&c.writeMessage(2,u,l.Int64Value.serializeBinaryToWriter),(u=o.getSenderId()).length>0&&c.writeString(3,u),(u=o.getReceiverId()).length>0&&c.writeString(4,u),(u=o.getPayload()).length>0&&c.writeString(5,u),(u=o.getIceServers()).length>0&&c.writeString(6,u),(u=o.getIceTransportPolicy()).length>0&&c.writeString(7,u),(u=o.getSessionType())!==0&&c.writeEnum(8,u)},proto.v1.signaling.api.Signal.prototype.getSessionId=function(){return r.Message.getWrapperField(this,l.StringValue,1)},proto.v1.signaling.api.Signal.prototype.setSessionId=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.Signal.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.Signal.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,l.Int64Value,2)},proto.v1.signaling.api.Signal.prototype.setSessionCreatedTimestamp=function(o){return r.Message.setWrapperField(this,2,o)},proto.v1.signaling.api.Signal.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},proto.v1.signaling.api.Signal.prototype.getSenderId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.Signal.prototype.setSenderId=function(o){return r.Message.setProto3StringField(this,3,o)},proto.v1.signaling.api.Signal.prototype.getReceiverId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.Signal.prototype.setReceiverId=function(o){return r.Message.setProto3StringField(this,4,o)},proto.v1.signaling.api.Signal.prototype.getPayload=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.Signal.prototype.setPayload=function(o){return r.Message.setProto3StringField(this,5,o)},proto.v1.signaling.api.Signal.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,6,"")},proto.v1.signaling.api.Signal.prototype.setIceServers=function(o){return r.Message.setProto3StringField(this,6,o)},proto.v1.signaling.api.Signal.prototype.getIceTransportPolicy=function(){return r.Message.getFieldWithDefault(this,7,"")},proto.v1.signaling.api.Signal.prototype.setIceTransportPolicy=function(o){return r.Message.setProto3StringField(this,7,o)},proto.v1.signaling.api.Signal.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,8,0)},proto.v1.signaling.api.Signal.prototype.setSessionType=function(o){return r.Message.setProto3EnumField(this,8,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthRequest.prototype.toObject=function(o){return proto.v1.signaling.api.GetHealthRequest.toObject(o,this)},proto.v1.signaling.api.GetHealthRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetHealthRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetHealthRequest;return proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.GetHealthRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthResponse.prototype.toObject=function(o){return proto.v1.signaling.api.GetHealthResponse.toObject(o,this)},proto.v1.signaling.api.GetHealthResponse.toObject=function(o,c){var u={version:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetHealthResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetHealthResponse;return proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setVersion(u);break;default:c.skipField()}return o},proto.v1.signaling.api.GetHealthResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getVersion()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.GetHealthResponse.prototype.getVersion=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetHealthResponse.prototype.setVersion=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerRequest.prototype.toObject=function(o){return proto.v1.signaling.api.CreatePeerRequest.toObject(o,this)},proto.v1.signaling.api.CreatePeerRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.CreatePeerRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.CreatePeerRequest;return proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.CreatePeerRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerResponse.prototype.toObject=function(o){return proto.v1.signaling.api.CreatePeerResponse.toObject(o,this)},proto.v1.signaling.api.CreatePeerResponse.toObject=function(o,c){var u,f={peer:(u=c.getPeer())&&proto.v1.signaling.api.Peer.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.CreatePeerResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.CreatePeerResponse;return proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Peer;c.readMessage(u,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),o.setPeer(u);break;default:c.skipField()}return o},proto.v1.signaling.api.CreatePeerResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeer())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.CreatePeerResponse.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.CreatePeerResponse.prototype.setPeer=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.CreatePeerResponse.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.CreatePeerResponse.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerRequest.prototype.toObject=function(o){return proto.v1.signaling.api.DeletePeerRequest.toObject(o,this)},proto.v1.signaling.api.DeletePeerRequest.toObject=function(o,c){var u={peerId:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.DeletePeerRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.DeletePeerRequest;return proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setPeerId(u);break;default:c.skipField()}return o},proto.v1.signaling.api.DeletePeerRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeerId()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.DeletePeerRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.DeletePeerRequest.prototype.setPeerId=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerResponse.prototype.toObject=function(o){return proto.v1.signaling.api.DeletePeerResponse.toObject(o,this)},proto.v1.signaling.api.DeletePeerResponse.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.DeletePeerResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.DeletePeerResponse;return proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.DeletePeerResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerRequest.prototype.toObject=function(o){return proto.v1.signaling.api.RefreshPeerRequest.toObject(o,this)},proto.v1.signaling.api.RefreshPeerRequest.toObject=function(o,c){var u,f={peer:(u=c.getPeer())&&proto.v1.signaling.api.Peer.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.RefreshPeerRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.RefreshPeerRequest;return proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Peer;c.readMessage(u,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),o.setPeer(u);break;default:c.skipField()}return o},proto.v1.signaling.api.RefreshPeerRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeer())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.RefreshPeerRequest.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.RefreshPeerRequest.prototype.setPeer=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.RefreshPeerRequest.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.RefreshPeerRequest.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerResponse.prototype.toObject=function(o){return proto.v1.signaling.api.RefreshPeerResponse.toObject(o,this)},proto.v1.signaling.api.RefreshPeerResponse.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.RefreshPeerResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.RefreshPeerResponse;return proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.RefreshPeerResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersRequest.prototype.toObject=function(o){return proto.v1.signaling.api.GetPeersRequest.toObject(o,this)},proto.v1.signaling.api.GetPeersRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetPeersRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetPeersRequest;return proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.GetPeersRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter=function(o,c){},proto.v1.signaling.api.GetPeersResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersResponse.prototype.toObject=function(o){return proto.v1.signaling.api.GetPeersResponse.toObject(o,this)},proto.v1.signaling.api.GetPeersResponse.toObject=function(o,c){var u={peersList:r.Message.toObjectList(c.getPeersList(),proto.v1.signaling.api.Peer.toObject,o)};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetPeersResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetPeersResponse;return proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Peer;c.readMessage(u,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),o.addPeers(u);break;default:c.skipField()}return o},proto.v1.signaling.api.GetPeersResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeersList()).length>0&&c.writeRepeatedMessage(1,u,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.GetPeersResponse.prototype.getPeersList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.GetPeersResponse.prototype.setPeersList=function(o){return r.Message.setRepeatedWrapperField(this,1,o)},proto.v1.signaling.api.GetPeersResponse.prototype.addPeers=function(o,c){return r.Message.addToRepeatedWrapperField(this,1,o,proto.v1.signaling.api.Peer,c)},proto.v1.signaling.api.GetPeersResponse.prototype.clearPeersList=function(){return this.setPeersList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersRequest.prototype.toObject=function(o){return proto.v1.signaling.api.GetIceServersRequest.toObject(o,this)},proto.v1.signaling.api.GetIceServersRequest.toObject=function(o,c){var u={};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetIceServersRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetIceServersRequest;return proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)c.getFieldNumber(),c.skipField();return o},proto.v1.signaling.api.GetIceServersRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter=function(o,c){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersResponse.prototype.toObject=function(o){return proto.v1.signaling.api.GetIceServersResponse.toObject(o,this)},proto.v1.signaling.api.GetIceServersResponse.toObject=function(o,c){var u={iceServers:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.GetIceServersResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.GetIceServersResponse;return proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setIceServers(u);break;default:c.skipField()}return o},proto.v1.signaling.api.GetIceServersResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getIceServers()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.GetIceServersResponse.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetIceServersResponse.prototype.setIceServers=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalRequest.prototype.toObject=function(o){return proto.v1.signaling.api.SendSignalRequest.toObject(o,this)},proto.v1.signaling.api.SendSignalRequest.toObject=function(o,c){var u,f={signal:(u=c.getSignal())&&proto.v1.signaling.api.Signal.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.SendSignalRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.SendSignalRequest;return proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Signal;c.readMessage(u,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),o.setSignal(u);break;default:c.skipField()}return o},proto.v1.signaling.api.SendSignalRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getSignal())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalRequest.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.SendSignalRequest.prototype.setSignal=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.SendSignalRequest.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.SendSignalRequest.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalResponse.prototype.toObject=function(o){return proto.v1.signaling.api.SendSignalResponse.toObject(o,this)},proto.v1.signaling.api.SendSignalResponse.toObject=function(o,c){var u,f={sessionId:(u=c.getSessionId())&&l.StringValue.toObject(o,u),sessionCreatedTimestamp:(u=c.getSessionCreatedTimestamp())&&l.Int64Value.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.SendSignalResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.SendSignalResponse;return proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new l.StringValue;c.readMessage(u,l.StringValue.deserializeBinaryFromReader),o.setSessionId(u);break;case 2:u=new l.Int64Value,c.readMessage(u,l.Int64Value.deserializeBinaryFromReader),o.setSessionCreatedTimestamp(u);break;default:c.skipField()}return o},proto.v1.signaling.api.SendSignalResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter=function(o,c){var u=void 0;(u=o.getSessionId())!=null&&c.writeMessage(1,u,l.StringValue.serializeBinaryToWriter),(u=o.getSessionCreatedTimestamp())!=null&&c.writeMessage(2,u,l.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionId=function(){return r.Message.getWrapperField(this,l.StringValue,1)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionId=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,l.Int64Value,2)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionCreatedTimestamp=function(o){return r.Message.setWrapperField(this,2,o)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.toObject=function(o){return proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject(o,this)},proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject=function(o,c){var u={peerId:r.Message.getFieldWithDefault(c,1,"")};return o&&(u.$jspbMessageInstance=c),u}),proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.ReceiveSignalStreamRequest;return proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=c.readString();o.setPeerId(u);break;default:c.skipField()}return o},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter=function(o,c){var u;(u=o.getPeerId()).length>0&&c.writeString(1,u)},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.setPeerId=function(o){return r.Message.setProto3StringField(this,1,o)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.toObject=function(o){return proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject(o,this)},proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject=function(o,c){var u,f={signal:(u=c.getSignal())&&proto.v1.signaling.api.Signal.toObject(o,u)};return o&&(f.$jspbMessageInstance=c),f}),proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary=function(o){var c=new r.BinaryReader(o),u=new proto.v1.signaling.api.ReceiveSignalStreamResponse;return proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader(u,c)},proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader=function(o,c){for(;c.nextField()&&!c.isEndGroup();)switch(c.getFieldNumber()){case 1:var u=new proto.v1.signaling.api.Signal;c.readMessage(u,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),o.setSignal(u);break;default:c.skipField()}return o},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.serializeBinary=function(){var o=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter(this,o),o.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter=function(o,c){var u;(u=o.getSignal())!=null&&c.writeMessage(1,u,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.setSignal=function(o){return r.Message.setWrapperField(this,1,o)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SessionType={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3},i.object.extend(t,proto.v1.signaling.api)},function(e,t,n){n.d(t,"a",function(){return i});var r=n(34);class i extends Error{constructor(l,o,c,u,f={},E){super(`Unexpected response (${c}) for ${l} ${o}: ${JSON.stringify(E?Object(r.a)([...E.entries()].reduce((w,[h,g])=>(w[h]=g,w),{})):{})} -- ${JSON.stringify(Object(r.a)(u))}`),this.method=l,this.url=o,this.statusCode=c,this.body=u,this.validationErrors=f,this.headers=E}}},function(e,t,n){function r(i,s,l=()=>!0){if(function(o,c,u=()=>!0){return o instanceof c&&u(o)}(i,s,l))return i;throw i}n.d(t,"a",function(){return r})},function(e,t,n){function r(w){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(w)}function i(w,h){return!h||r(h)!=="object"&&typeof h!="function"?s(w):h}function s(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function l(w){var h=typeof Map=="function"?new Map:void 0;return(l=function(g){if(g===null||(b=g,Function.toString.call(b).indexOf("[native code]")===-1))return g;var b;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(h!==void 0){if(h.has(g))return h.get(g);h.set(g,R)}function R(){return o(g,arguments,f(this).constructor)}return R.prototype=Object.create(g.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),u(R,g)})(w)}function o(w,h,g){return(o=c()?Reflect.construct:function(b,R,j){var F=[null];F.push.apply(F,R);var M=new(Function.bind.apply(b,F));return j&&u(M,j.prototype),M}).apply(null,arguments)}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function u(w,h){return(u=Object.setPrototypeOf||function(g,b){return g.__proto__=b,g})(w,h)}function f(w){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)})(w)}var E=function(w){(function(j,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");j.prototype=Object.create(F&&F.prototype,{constructor:{value:j,writable:!0,configurable:!0}}),F&&u(j,F)})(R,w);var h,g,b=(h=R,g=c(),function(){var j,F=f(h);if(g){var M=f(this).constructor;j=Reflect.construct(F,arguments,M)}else j=F.apply(this,arguments);return i(this,j)});function R(j){var F;return function(M,A){if(!(M instanceof A))throw new TypeError("Cannot call a class as a function")}(this,R),F=b.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
8
8
|
Found: `.concat(j.toString().split(`
|
|
9
9
|
`)[0],`
|
|
10
|
-
`)),Error.captureStackTrace(s(F),R),F}return R}(l(Error));e.exports=function(w){if(w.length>2)throw new E(w);function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=b}function g(b){return new h(b)}return h.prototype.transform=w,g.Format=h,g}},function(e,t,n){(function(r){var i=Object.getOwnPropertyDescriptors||function(N){for(var
|
|
10
|
+
`)),Error.captureStackTrace(s(F),R),F}return R}(l(Error));e.exports=function(w){if(w.length>2)throw new E(w);function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=b}function g(b){return new h(b)}return h.prototype.transform=w,g.Format=h,g}},function(e,t,n){(function(r){var i=Object.getOwnPropertyDescriptors||function(N){for(var D=Object.keys(N),z={},O=0;O<D.length;O++)z[D[O]]=Object.getOwnPropertyDescriptor(N,D[O]);return z},s=/%[sdj%]/g;t.format=function(N){if(!F(N)){for(var D=[],z=0;z<arguments.length;z++)D.push(c(arguments[z]));return D.join(" ")}z=1;for(var O=arguments,p=O.length,U=String(N).replace(s,function(Q){if(Q==="%%")return"%";if(z>=p)return Q;switch(Q){case"%s":return String(O[z++]);case"%d":return Number(O[z++]);case"%j":try{return JSON.stringify(O[z++])}catch{return"[Circular]"}default:return Q}}),V=O[z];z<p;V=O[++z])R(V)||!d(V)?U+=" "+V:U+=" "+c(V);return U},t.deprecate=function(N,D){if(r!==void 0&&r.noDeprecation===!0)return N;if(r===void 0)return function(){return t.deprecate(N,D).apply(this,arguments)};var z=!1;return function(){if(!z){if(r.throwDeprecation)throw new Error(D);r.traceDeprecation?console.trace(D):console.error(D),z=!0}return N.apply(this,arguments)}};var l,o={};function c(N,D){var z={seen:[],stylize:f};return arguments.length>=3&&(z.depth=arguments[2]),arguments.length>=4&&(z.colors=arguments[3]),b(D)?z.showHidden=D:D&&t._extend(z,D),M(z.showHidden)&&(z.showHidden=!1),M(z.depth)&&(z.depth=2),M(z.colors)&&(z.colors=!1),M(z.customInspect)&&(z.customInspect=!0),z.colors&&(z.stylize=u),E(z,N,z.depth)}function u(N,D){var z=c.styles[D];return z?"\x1B["+c.colors[z][0]+"m"+N+"\x1B["+c.colors[z][1]+"m":N}function f(N,D){return N}function E(N,D,z){if(N.customInspect&&D&&q(D.inspect)&&D.inspect!==t.inspect&&(!D.constructor||D.constructor.prototype!==D)){var O=D.inspect(z,N);return F(O)||(O=E(N,O,z)),O}var p=function(S,T){if(M(T))return S.stylize("undefined","undefined");if(F(T)){var k="'"+JSON.stringify(T).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return S.stylize(k,"string")}if(j(T))return S.stylize(""+T,"number");if(b(T))return S.stylize(""+T,"boolean");if(R(T))return S.stylize("null","null")}(N,D);if(p)return p;var U=Object.keys(D),V=function(S){var T={};return S.forEach(function(k,J){T[k]=!0}),T}(U);if(N.showHidden&&(U=Object.getOwnPropertyNames(D)),$(D)&&(U.indexOf("message")>=0||U.indexOf("description")>=0))return w(D);if(U.length===0){if(q(D)){var Q=D.name?": "+D.name:"";return N.stylize("[Function"+Q+"]","special")}if(A(D))return N.stylize(RegExp.prototype.toString.call(D),"regexp");if(C(D))return N.stylize(Date.prototype.toString.call(D),"date");if($(D))return w(D)}var ee,ne="",Y=!1,G=["{","}"];return g(D)&&(Y=!0,G=["[","]"]),q(D)&&(ne=" [Function"+(D.name?": "+D.name:"")+"]"),A(D)&&(ne=" "+RegExp.prototype.toString.call(D)),C(D)&&(ne=" "+Date.prototype.toUTCString.call(D)),$(D)&&(ne=" "+w(D)),U.length!==0||Y&&D.length!=0?z<0?A(D)?N.stylize(RegExp.prototype.toString.call(D),"regexp"):N.stylize("[Object]","special"):(N.seen.push(D),ee=Y?function(S,T,k,J,K){for(var re=[],se=0,fe=T.length;se<fe;++se)L(T,String(se))?re.push(h(S,T,k,J,String(se),!0)):re.push("");return K.forEach(function(ve){ve.match(/^\d+$/)||re.push(h(S,T,k,J,ve,!0))}),re}(N,D,z,V,U):U.map(function(S){return h(N,D,z,V,S,Y)}),N.seen.pop(),function(S,T,k){return S.reduce(function(J,K){return K.indexOf(`
|
|
11
11
|
`)>=0,J+K.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?k[0]+(T===""?"":T+`
|
|
12
12
|
`)+" "+S.join(`,
|
|
13
|
-
`)+" "+k[1]:k[0]+T+" "+S.join(", ")+" "+k[1]}(ee,ne,G)):G[0]+ne+G[1]}function w(N){return"["+Error.prototype.toString.call(N)+"]"}function h(N,
|
|
13
|
+
`)+" "+k[1]:k[0]+T+" "+S.join(", ")+" "+k[1]}(ee,ne,G)):G[0]+ne+G[1]}function w(N){return"["+Error.prototype.toString.call(N)+"]"}function h(N,D,z,O,p,U){var V,Q,ee;if((ee=Object.getOwnPropertyDescriptor(D,p)||{value:D[p]}).get?Q=ee.set?N.stylize("[Getter/Setter]","special"):N.stylize("[Getter]","special"):ee.set&&(Q=N.stylize("[Setter]","special")),L(O,p)||(V="["+p+"]"),Q||(N.seen.indexOf(ee.value)<0?(Q=R(z)?E(N,ee.value,null):E(N,ee.value,z-1)).indexOf(`
|
|
14
14
|
`)>-1&&(Q=U?Q.split(`
|
|
15
15
|
`).map(function(ne){return" "+ne}).join(`
|
|
16
16
|
`).substr(2):`
|
|
17
17
|
`+Q.split(`
|
|
18
18
|
`).map(function(ne){return" "+ne}).join(`
|
|
19
|
-
`)):Q=N.stylize("[Circular]","special")),M(V)){if(U&&p.match(/^\d+$/))return Q;(V=JSON.stringify(""+p)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.substr(1,V.length-2),V=N.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=N.stylize(V,"string"))}return V+": "+Q}function g(N){return Array.isArray(N)}function b(N){return typeof N=="boolean"}function R(N){return N===null}function j(N){return typeof N=="number"}function F(N){return typeof N=="string"}function M(N){return N===void 0}function A(N){return d(N)&&y(N)==="[object RegExp]"}function d(N){return typeof N=="object"&&N!==null}function C(N){return d(N)&&y(N)==="[object Date]"}function $(N){return d(N)&&(y(N)==="[object Error]"||N instanceof Error)}function q(N){return typeof N=="function"}function y(N){return Object.prototype.toString.call(N)}function m(N){return N<10?"0"+N.toString(10):N.toString(10)}t.debuglog=function(N){if(M(l)&&(l=r.env.NODE_DEBUG||""),N=N.toUpperCase(),!o[N])if(new RegExp("\\b"+N+"\\b","i").test(l)){var
|
|
20
|
-
`,t.homedir=function(){return"/"}},function(e,t,n){var r=n(58),i=n(61).warn,s=t;s.version=n(138).version,s.transports=n(139),s.config=n(50),s.addColors=r.levels,s.format=r.format,s.createLogger=n(88),s.ExceptionHandler=n(89),s.RejectionHandler=n(93),s.Container=n(210),s.Transport=n(20),s.loggers=new s.Container;var l=s.createLogger();Object.keys(s.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(o){return s[o]=function(){return l[o].apply(l,arguments)}}),Object.defineProperty(s,"level",{get:function(){return l.level},set:function(o){l.level=o}}),Object.defineProperty(s,"exceptions",{get:function(){return l.exceptions}}),["exitOnError"].forEach(function(o){Object.defineProperty(s,o,{get:function(){return l[o]},set:function(c){l[o]=c}})}),Object.defineProperty(s,"default",{get:function(){return{exceptionHandlers:l.exceptionHandlers,rejectionHandlers:l.rejectionHandlers,transports:l.transports}}}),i.deprecated(s,"setLevels"),i.forFunctions(s,"useFormat",["cli"]),i.forProperties(s,"useFormat",["padLevels","stripColors"]),i.forFunctions(s,"deprecated",["addRewriter","addFilter","clone","extend"]),i.forProperties(s,"deprecated",["emitErrs","levelLength"]),i.moved(s,"createLogger","Logger")},function(e,t,n){var r=n(13),i=n(142),s=n(3).LEVEL,l=e.exports=function(){var o=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.call(this,{objectMode:!0,highWaterMark:c.highWaterMark}),this.format=c.format,this.level=c.level,this.handleExceptions=c.handleExceptions,this.handleRejections=c.handleRejections,this.silent=c.silent,c.log&&(this.log=c.log),c.logv&&(this.logv=c.logv),c.close&&(this.close=c.close),this.once("pipe",function(u){o.levels=u.levels,o.parent=u}),this.once("unpipe",function(u){u===o.parent&&(o.parent=null,o.close&&o.close())})};r.inherits(l,i),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);var f=this.level||this.parent&&this.parent.level;if(!f||this.levels[f]>=this.levels[o[s]]){if(o&&!this.format)return this.log(o,u);var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o),this.format.options)}catch(h){E=h}if(E||!w){if(u(),E)throw E;return}return this.log(w,u)}return u(null)},l.prototype._writev=function(o,c){if(this.logv){var u=o.filter(this._accept,this);return u.length?this.logv(u,c):c(null)}for(var f=0;f<o.length;f++)if(this._accept(o[f]))if(!o[f].chunk||this.format){var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o[f].chunk),this.format.options)}catch(h){E=h}if(E||!w){if(o[f].callback(),E)throw c(null),E}else this.log(w,o[f].callback)}else this.log(o[f].chunk,o[f].callback);return c(null)},l.prototype._accept=function(o){var c=o.chunk;if(this.silent)return!1;var u=this.level||this.parent&&this.parent.level;return!(c.exception!==!0&&u&&!(this.levels[u]>=this.levels[c[s]])||!this.handleExceptions&&c.exception===!0)},l.prototype._nop=function(){},e.exports.LegacyTransportStream=n(148)},function(e,t,n){var r,i=typeof Reflect=="object"?Reflect:null,s=i&&typeof i.apply=="function"?i.apply:function(R,j,F){return Function.prototype.apply.call(R,j,F)};r=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:function(R){return Object.getOwnPropertyNames(R)};var l=Number.isNaN||function(R){return R!=R};function o(){o.init.call(this)}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function u(R){return R._maxListeners===void 0?o.defaultMaxListeners:R._maxListeners}function f(R,j,F,M){var A,d,C,$;if(typeof F!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof F);if((d=R._events)===void 0?(d=R._events=Object.create(null),R._eventsCount=0):(d.newListener!==void 0&&(R.emit("newListener",j,F.listener?F.listener:F),d=R._events),C=d[j]),C===void 0)C=d[j]=F,++R._eventsCount;else if(typeof C=="function"?C=d[j]=M?[F,C]:[C,F]:M?C.unshift(F):C.push(F),(A=u(R))>0&&C.length>A&&!C.warned){C.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=R,q.type=j,q.count=C.length,$=q,console&&console.warn&&console.warn($)}return R}function E(){for(var R=[],j=0;j<arguments.length;j++)R.push(arguments[j]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,R))}function w(R,j,F){var M={fired:!1,wrapFn:void 0,target:R,type:j,listener:F},A=E.bind(M);return A.listener=F,M.wrapFn=A,A}function h(R,j,F){var M=R._events;if(M===void 0)return[];var A=M[j];return A===void 0?[]:typeof A=="function"?F?[A.listener||A]:[A]:F?function(d){for(var C=new Array(d.length),$=0;$<C.length;++$)C[$]=d[$].listener||d[$];return C}(A):b(A,A.length)}function g(R){var j=this._events;if(j!==void 0){var F=j[R];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}function b(R,j){for(var F=new Array(j),M=0;M<j;++M)F[M]=R[M];return F}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(R){if(typeof R!="number"||R<0||l(R))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");c=R}}),o.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||l(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(R){for(var j=[],F=1;F<arguments.length;F++)j.push(arguments[F]);var M=R==="error",A=this._events;if(A!==void 0)M=M&&A.error===void 0;else if(!M)return!1;if(M){var d;if(j.length>0&&(d=j[0]),d instanceof Error)throw d;var C=new Error("Unhandled error."+(d?" ("+d.message+")":""));throw C.context=d,C}var $=A[R];if($===void 0)return!1;if(typeof $=="function")s($,this,j);else{var q=$.length,y=b($,q);for(F=0;F<q;++F)s(y[F],this,j)}return!0},o.prototype.addListener=function(R,j){return f(this,R,j,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(R,j){return f(this,R,j,!0)},o.prototype.once=function(R,j){if(typeof j!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof j);return this.on(R,w(this,R,j)),this},o.prototype.prependOnceListener=function(R,j){if(typeof j!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof j);return this.prependListener(R,w(this,R,j)),this},o.prototype.removeListener=function(R,j){var F,M,A,d,C;if(typeof j!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof j);if((M=this._events)===void 0)return this;if((F=M[R])===void 0)return this;if(F===j||F.listener===j)--this._eventsCount==0?this._events=Object.create(null):(delete M[R],M.removeListener&&this.emit("removeListener",R,F.listener||j));else if(typeof F!="function"){for(A=-1,d=F.length-1;d>=0;d--)if(F[d]===j||F[d].listener===j){C=F[d].listener,A=d;break}if(A<0)return this;A===0?F.shift():function($,q){for(;q+1<$.length;q++)$[q]=$[q+1];$.pop()}(F,A),F.length===1&&(M[R]=F[0]),M.removeListener!==void 0&&this.emit("removeListener",R,C||j)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(R){var j,F,M;if((F=this._events)===void 0)return this;if(F.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):F[R]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete F[R]),this;if(arguments.length===0){var A,d=Object.keys(F);for(M=0;M<d.length;++M)(A=d[M])!=="removeListener"&&this.removeAllListeners(A);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(j=F[R])=="function")this.removeListener(R,j);else if(j!==void 0)for(M=j.length-1;M>=0;M--)this.removeListener(R,j[M]);return this},o.prototype.listeners=function(R){return h(this,R,!0)},o.prototype.rawListeners=function(R){return h(this,R,!1)},o.listenerCount=function(R,j){return typeof R.listenerCount=="function"?R.listenerCount(j):g.call(R,j)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(147).Buffer,i=r.isEncoding||function(g){switch((g=""+g)&&g.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 s(g){var b;switch(this.encoding=function(R){var j=function(F){if(!F)return"utf8";for(var M;;)switch(F){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 F;default:if(M)return;F=(""+F).toLowerCase(),M=!0}}(R);if(typeof j!="string"&&(r.isEncoding===i||!i(R)))throw new Error("Unknown encoding: "+R);return j||R}(g),this.encoding){case"utf16le":this.text=c,this.end=u,b=4;break;case"utf8":this.fillLast=o,b=4;break;case"base64":this.text=f,this.end=E,b=3;break;default:return this.write=w,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(b)}function l(g){return g<=127?0:g>>5==6?2:g>>4==14?3:g>>3==30?4:g>>6==2?-1:-2}function o(g){var b=this.lastTotal-this.lastNeed,R=function(j,F,M){if((192&F[0])!=128)return j.lastNeed=0,"�";if(j.lastNeed>1&&F.length>1){if((192&F[1])!=128)return j.lastNeed=1,"�";if(j.lastNeed>2&&F.length>2&&(192&F[2])!=128)return j.lastNeed=2,"�"}}(this,g);return R!==void 0?R:this.lastNeed<=g.length?(g.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(g.copy(this.lastChar,b,0,g.length),void(this.lastNeed-=g.length))}function c(g,b){if((g.length-b)%2==0){var R=g.toString("utf16le",b);if(R){var j=R.charCodeAt(R.length-1);if(j>=55296&&j<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],R.slice(0,-1)}return R}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",b,g.length-1)}function u(g){var b=g&&g.length?this.write(g):"";if(this.lastNeed){var R=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,R)}return b}function f(g,b){var R=(g.length-b)%3;return R===0?g.toString("base64",b):(this.lastNeed=3-R,this.lastTotal=3,R===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",b,g.length-R))}function E(g){var b=g&&g.length?this.write(g):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function w(g){return g.toString(this.encoding)}function h(g){return g&&g.length?this.write(g):""}t.StringDecoder=s,s.prototype.write=function(g){if(g.length===0)return"";var b,R;if(this.lastNeed){if((b=this.fillLast(g))===void 0)return"";R=this.lastNeed,this.lastNeed=0}else R=0;return R<g.length?b?b+this.text(g,R):this.text(g,R):b||""},s.prototype.end=function(g){var b=g&&g.length?this.write(g):"";return this.lastNeed?b+"�":b},s.prototype.text=function(g,b){var R=function(F,M,A){var d=M.length-1;if(d<A)return 0;var C=l(M[d]);return C>=0?(C>0&&(F.lastNeed=C-1),C):--d<A||C===-2?0:(C=l(M[d]))>=0?(C>0&&(F.lastNeed=C-2),C):--d<A||C===-2?0:(C=l(M[d]))>=0?(C>0&&(C===2?C=0:F.lastNeed=C-3),C):0}(this,g,b);if(!this.lastNeed)return g.toString("utf8",b);this.lastTotal=R;var j=g.length-(R-this.lastNeed);return g.copy(this.lastChar,0,j),g.toString("utf8",b,j)},s.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length}},function(e,t,n){var r=n(16),i=Object.keys||function(g){var b=[];for(var R in g)b.push(R);return b};e.exports=E;var s=n(17);s.inherits=n(7);var l=n(69),o=n(48);s.inherits(E,l);for(var c=i(o.prototype),u=0;u<c.length;u++){var f=c[u];E.prototype[f]||(E.prototype[f]=o.prototype[f])}function E(g){if(!(this instanceof E))return new E(g);l.call(this,g),o.call(this,g),g&&g.readable===!1&&(this.readable=!1),g&&g.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,g&&g.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(g){g.end()}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),E.prototype._destroy=function(g,b){this.push(null),this.end(),r.nextTick(b,g)}},function(e,t,n){(function(r){function i(x){var Z=0;return function(){return Z<x.length?{done:!1,value:x[Z++]}:{done:!0}}}var s=typeof Object.defineProperties=="function"?Object.defineProperty:function(x,Z,te){x!=Array.prototype&&x!=Object.prototype&&(x[Z]=te.value)},l=function(x){x=[typeof window=="object"&&window,typeof self=="object"&&self,typeof r=="object"&&r,x];for(var Z=0;Z<x.length;++Z){var te=x[Z];if(te&&te.Math==Math)return te}throw Error("Cannot find global object")}(this);function o(x,Z){if(Z){var te=l;x=x.split(".");for(var ae=0;ae<x.length-1;ae++){var ge=x[ae];ge in te||(te[ge]={}),te=te[ge]}(Z=Z(ae=te[x=x[x.length-1]]))!=ae&&Z!=null&&s(te,x,{configurable:!0,writable:!0,value:Z})}}function c(x){var Z=typeof Symbol<"u"&&Symbol.iterator&&x[Symbol.iterator];return Z?Z.call(x):{next:i(x)}}o("Object.is",function(x){return x||function(Z,te){return Z===te?Z!==0||1/Z==1/te:Z!=Z&&te!=te}}),o("Array.prototype.includes",function(x){return x||function(Z,te){var ae=this;ae instanceof String&&(ae=String(ae));var ge=ae.length;for(0>(te=te||0)&&(te=Math.max(te+ge,0));te<ge;te++){var me=ae[te];if(me===Z||Object.is(me,Z))return!0}return!1}}),o("Promise",function(x){function Z(ue){this.b=0,this.c=void 0,this.a=[];var he=this.f();try{ue(he.resolve,he.reject)}catch(we){he.reject(we)}}function te(){this.a=null}function ae(ue){return ue instanceof Z?ue:new Z(function(he){he(ue)})}if(x)return x;te.prototype.b=function(ue){if(this.a==null){this.a=[];var he=this;this.c(function(){he.g()})}this.a.push(ue)};var ge=l.setTimeout;te.prototype.c=function(ue){ge(ue,0)},te.prototype.g=function(){for(;this.a&&this.a.length;){var ue=this.a;this.a=[];for(var he=0;he<ue.length;++he){var we=ue[he];ue[he]=null;try{we()}catch(_e){this.f(_e)}}}this.a=null},te.prototype.f=function(ue){this.c(function(){throw ue})},Z.prototype.f=function(){function ue(_e){return function(Ee){we||(we=!0,_e.call(he,Ee))}}var he=this,we=!1;return{resolve:ue(this.m),reject:ue(this.g)}},Z.prototype.m=function(ue){if(ue===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(ue instanceof Z)this.o(ue);else{e:switch(typeof ue){case"object":var he=ue!=null;break e;case"function":he=!0;break e;default:he=!1}he?this.l(ue):this.h(ue)}},Z.prototype.l=function(ue){var he=void 0;try{he=ue.then}catch(we){return void this.g(we)}typeof he=="function"?this.u(he,ue):this.h(ue)},Z.prototype.g=function(ue){this.i(2,ue)},Z.prototype.h=function(ue){this.i(1,ue)},Z.prototype.i=function(ue,he){if(this.b!=0)throw Error("Cannot settle("+ue+", "+he+"): Promise already settled in state"+this.b);this.b=ue,this.c=he,this.j()},Z.prototype.j=function(){if(this.a!=null){for(var ue=0;ue<this.a.length;++ue)me.b(this.a[ue]);this.a=null}};var me=new te;return Z.prototype.o=function(ue){var he=this.f();ue.w(he.resolve,he.reject)},Z.prototype.u=function(ue,he){var we=this.f();try{ue.call(he,we.resolve,we.reject)}catch(_e){we.reject(_e)}},Z.prototype.then=function(ue,he){function we(Pe,He){return typeof Pe=="function"?function(We){try{_e(Pe(We))}catch(Ve){Ee(Ve)}}:He}var _e,Ee,Be=new Z(function(Pe,He){_e=Pe,Ee=He});return this.w(we(ue,_e),we(he,Ee)),Be},Z.prototype.catch=function(ue){return this.then(void 0,ue)},Z.prototype.w=function(ue,he){function we(){switch(_e.b){case 1:ue(_e.c);break;case 2:he(_e.c);break;default:throw Error("Unexpected state: "+_e.b)}}var _e=this;this.a==null?me.b(we):this.a.push(we)},Z.resolve=ae,Z.reject=function(ue){return new Z(function(he,we){we(ue)})},Z.race=function(ue){return new Z(function(he,we){for(var _e=c(ue),Ee=_e.next();!Ee.done;Ee=_e.next())ae(Ee.value).w(he,we)})},Z.all=function(ue){var he=c(ue),we=he.next();return we.done?ae([]):new Z(function(_e,Ee){function Be(We){return function(Ve){Pe[We]=Ve,--He==0&&_e(Pe)}}var Pe=[],He=0;do Pe.push(void 0),He++,ae(we.value).w(Be(Pe.length-1),Ee),we=he.next();while(!we.done)})},Z});var u=u||{},f=this||self;function E(x,Z){x=x.split("."),Z=Z||f;for(var te=0;te<x.length;te++)if((Z=Z[x[te]])==null)return null;return Z}function w(){}function h(x){var Z=typeof x;if(Z=="object"){if(!x)return"null";if(x instanceof Array)return"array";if(x instanceof Object)return Z;var te=Object.prototype.toString.call(x);if(te=="[object Window]")return"object";if(te=="[object Array]"||typeof x.length=="number"&&x.splice!==void 0&&x.propertyIsEnumerable!==void 0&&!x.propertyIsEnumerable("splice"))return"array";if(te=="[object Function]"||x.call!==void 0&&x.propertyIsEnumerable!==void 0&&!x.propertyIsEnumerable("call"))return"function"}else if(Z=="function"&&x.call===void 0)return"object";return Z}function g(x){var Z=typeof x;return Z=="object"&&x!=null||Z=="function"}function b(x,Z,te){return x.call.apply(x.bind,arguments)}function R(x,Z,te){if(!x)throw Error();if(2<arguments.length){var ae=Array.prototype.slice.call(arguments,2);return function(){var ge=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(ge,ae),x.apply(Z,ge)}}return function(){return x.apply(Z,arguments)}}function j(x,Z,te){return(j=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?b:R).apply(null,arguments)}function F(x,Z){function te(){}te.prototype=Z.prototype,x.S=Z.prototype,x.prototype=new te,x.prototype.constructor=x}function M(){this.a={}}function A(x,Z,te,ae){this.f=x,this.c=Z,this.b=te,this.a=ae}function d(x,Z,te,ae){te=te===void 0?{}:te,this.c=x,this.a=te,this.b=Z,this.f=ae===void 0?null:ae}function C(x,Z,te,ae,ge,me){this.name=x,this.a=ge,this.b=me}function $(x,Z,te){te=te===void 0?{}:te;var ae=ae===void 0?new M:ae;return new A(Z,x,te,ae)}function q(x,Z,te,ae){return ae instanceof C?ae:new C(x,te,ae.b||Z.constructor,ae.f,ae.a,ae.c)}function y(x){this.a=x}function m(x){switch(x){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}}function I(x){if(Error.captureStackTrace)Error.captureStackTrace(this,I);else{var Z=Error().stack;Z&&(this.stack=Z)}x&&(this.message=String(x))}function _(x,Z){for(var te="",ae=(x=x.split("%s")).length-1,ge=0;ge<ae;ge++)te+=x[ge]+(ge<Z.length?Z[ge]:"%s");I.call(this,te+x[ae])}function L(){this.j=null,this.i=[],this.l=0,this.b=W,this.f=this.a=this.h=0,this.c=null,this.g=0}M.prototype.get=function(x){return this.a[x]},M.prototype.f=function(){return Object.keys(this.a)},A.prototype.getRequestMessage=function(){return this.f},A.prototype.getMethodDescriptor=function(){return this.c},A.prototype.getMetadata=function(){return this.b},A.prototype.getCallOptions=function(){return this.a},d.prototype.getResponseMessage=function(){return this.c},d.prototype.getMetadata=function(){return this.a},d.prototype.getMethodDescriptor=function(){return this.b},d.prototype.getStatus=function(){return this.f},y.prototype.on=function(x,Z){return x=="data"||x=="error"?this:this.a.on(x,Z)},y.prototype.removeListener=function(x,Z){return this.a.removeListener(x,Z)},y.prototype.cancel=function(){this.a.cancel()},F(I,Error),I.prototype.name="CustomError",F(_,I),_.prototype.name="AssertionError";var W=0,B=1,N=2,P=3,z=0,O=128;function p(x,Z,te,ae){throw x.b=P,x.j="The stream is broken @"+x.l+"/"+te+". Error: "+ae+`. With input:
|
|
21
|
-
`+Z,Error(x.j)}var U=Array.prototype.indexOf?function(x,Z){return Array.prototype.indexOf.call(x,Z,void 0)}:function(x,Z){if(typeof x=="string")return typeof Z!="string"||Z.length!=1?-1:x.indexOf(Z,0);for(var te=0;te<x.length;te++)if(te in x&&x[te]===Z)return te;return-1},V,Q=String.prototype.trim?function(x){return x.trim()}:function(x){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(x)[1]};function ee(x,Z){return x.indexOf(Z)!=-1}function ne(x,Z){return x<Z?-1:x>Z?1:0}e:{var Y=f.navigator;if(Y){var G=Y.userAgent;if(G){V=G;break e}}V=""}var S="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function T(x){var Z=1;x=x.split(":");for(var te=[];0<Z&&x.length;)te.push(x.shift()),Z--;return x.length&&te.push(x.join(":")),te}function k(x){return k[" "](x),x}k[" "]=w;var J,K,re=ee(V,"Opera"),se=ee(V,"Trident")||ee(V,"MSIE"),fe=ee(V,"Edge"),ve=ee(V,"Gecko")&&!(ee(V.toLowerCase(),"webkit")&&!ee(V,"Edge"))&&!(ee(V,"Trident")||ee(V,"MSIE"))&&!ee(V,"Edge"),Ce=ee(V.toLowerCase(),"webkit")&&!ee(V,"Edge");function Se(){var x=f.document;return x?x.documentMode:void 0}e:{var Ie="",Te=(K=V,ve?/rv:([^\);]+)(\)|;)/.exec(K):fe?/Edge\/([\d\.]+)/.exec(K):se?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(K):Ce?/WebKit\/(\S+)/.exec(K):re?/(?:Version)[ \/]?(\S+)/.exec(K):void 0);if(Te&&(Ie=Te?Te[1]:""),se){var Oe=Se();if(Oe!=null&&Oe>parseFloat(Ie)){J=String(Oe);break e}}J=Ie}var De,Ye={};function nt(x){return function(Z,te){var ae=Ye;return Object.prototype.hasOwnProperty.call(ae,Z)?ae[Z]:ae[Z]=te(Z)}(x,function(){for(var Z=0,te=Q(String(J)).split("."),ae=Q(String(x)).split("."),ge=Math.max(te.length,ae.length),me=0;Z==0&&me<ge;me++){var ue=te[me]||"",he=ae[me]||"";do{if(ue=/(\d*)(\D*)(.*)/.exec(ue)||["","","",""],he=/(\d*)(\D*)(.*)/.exec(he)||["","","",""],ue[0].length==0&&he[0].length==0)break;Z=ne(ue[1].length==0?0:parseInt(ue[1],10),he[1].length==0?0:parseInt(he[1],10))||ne(ue[2].length==0,he[2].length==0)||ne(ue[2],he[2]),ue=ue[3],he=he[3]}while(Z==0)}return 0<=Z})}if(f.document&&se){var tt=Se();De=tt||parseInt(J,10)||void 0}else De=void 0;var bt=De;function lt(){this.F=this.F}lt.prototype.F=!1;var _t,It=Object.freeze||function(x){return x};(_t=!se)||(_t=9<=Number(bt));var Et=_t,Ue=se&&!nt("9"),Nt=function(){if(!f.addEventListener||!Object.defineProperty)return!1;var x=!1,Z=Object.defineProperty({},"passive",{get:function(){x=!0}});try{f.addEventListener("test",w,Z),f.removeEventListener("test",w,Z)}catch{}return x}();function rt(x,Z){this.type=x,this.a=this.target=Z,this.defaultPrevented=!1}function ot(x,Z){if(rt.call(this,x?x.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,x){var te=this.type=x.type,ae=x.changedTouches&&x.changedTouches.length?x.changedTouches[0]:null;if(this.target=x.target||x.srcElement,this.a=Z,Z=x.relatedTarget){if(ve){e:{try{k(Z.nodeName);var ge=!0;break e}catch{}ge=!1}ge||(Z=null)}}else te=="mouseover"?Z=x.fromElement:te=="mouseout"&&(Z=x.toElement);this.relatedTarget=Z,ae?(this.clientX=ae.clientX!==void 0?ae.clientX:ae.pageX,this.clientY=ae.clientY!==void 0?ae.clientY:ae.pageY,this.screenX=ae.screenX||0,this.screenY=ae.screenY||0):(this.clientX=x.clientX!==void 0?x.clientX:x.pageX,this.clientY=x.clientY!==void 0?x.clientY:x.pageY,this.screenX=x.screenX||0,this.screenY=x.screenY||0),this.button=x.button,this.key=x.key||"",this.ctrlKey=x.ctrlKey,this.altKey=x.altKey,this.shiftKey=x.shiftKey,this.metaKey=x.metaKey,this.pointerId=x.pointerId||0,this.pointerType=typeof x.pointerType=="string"?x.pointerType:jt[x.pointerType]||"",this.c=x,x.defaultPrevented&&this.b()}}rt.prototype.b=function(){this.defaultPrevented=!0},F(ot,rt);var jt=It({2:"touch",3:"pen",4:"mouse"});ot.prototype.b=function(){ot.S.b.call(this);var x=this.c;if(x.preventDefault)x.preventDefault();else if(x.returnValue=!1,Ue)try{(x.ctrlKey||112<=x.keyCode&&123>=x.keyCode)&&(x.keyCode=-1)}catch{}};var pt="closure_listenable_"+(1e6*Math.random()|0),Ct=0;function ut(x,Z,te,ae,ge){this.listener=x,this.proxy=null,this.src=Z,this.type=te,this.capture=!!ae,this.A=ge,this.key=++Ct,this.s=this.v=!1}function Tt(x){x.s=!0,x.listener=null,x.proxy=null,x.src=null,x.A=null}function Fe(x){this.src=x,this.a={},this.b=0}function Rt(x,Z){var te=Z.type;if(te in x.a){var ae,ge=x.a[te],me=U(ge,Z);(ae=0<=me)&&Array.prototype.splice.call(ge,me,1),ae&&(Tt(Z),x.a[te].length==0&&(delete x.a[te],x.b--))}}function pe(x,Z,te,ae){for(var ge=0;ge<x.length;++ge){var me=x[ge];if(!me.s&&me.listener==Z&&me.capture==!!te&&me.A==ae)return ge}return-1}Fe.prototype.add=function(x,Z,te,ae,ge){var me=x.toString();(x=this.a[me])||(x=this.a[me]=[],this.b++);var ue=pe(x,Z,ae,ge);return-1<ue?(Z=x[ue],te||(Z.v=!1)):((Z=new ut(Z,this.src,me,!!ae,ge)).v=te,x.push(Z)),Z};var D="closure_lm_"+(1e6*Math.random()|0),H={};function X(x,Z,te,ae,ge){if(ae&&ae.once)(function ue(he,we,_e,Ee,Be){if(Array.isArray(we))for(var Pe=0;Pe<we.length;Pe++)ue(he,we[Pe],_e,Ee,Be);else _e=Me(_e),he&&he[pt]?he.f.add(String(we),_e,!0,g(Ee)?!!Ee.capture:!!Ee,Be):ie(he,we,_e,!0,Ee,Be)})(x,Z,te,ae,ge);else if(Array.isArray(Z))for(var me=0;me<Z.length;me++)X(x,Z[me],te,ae,ge);else te=Me(te),x&&x[pt]?x.f.add(String(Z),te,!1,g(ae)?!!ae.capture:!!ae,ge):ie(x,Z,te,!1,ae,ge)}function ie(x,Z,te,ae,ge,me){if(!Z)throw Error("Invalid event type");var ue=g(ge)?!!ge.capture:!!ge,he=le(x);if(he||(x[D]=he=new Fe(x)),!(te=he.add(Z,te,ae,ue,me)).proxy)if(ae=function(){var we=ce,_e=Et?function(Ee){return we.call(_e.src,_e.listener,Ee)}:function(Ee){if(!(Ee=we.call(_e.src,_e.listener,Ee)))return Ee};return _e}(),te.proxy=ae,ae.src=x,ae.listener=te,x.addEventListener)Nt||(ge=ue),ge===void 0&&(ge=!1),x.addEventListener(Z.toString(),ae,ge);else if(x.attachEvent)x.attachEvent(de(Z.toString()),ae);else{if(!x.addListener||!x.removeListener)throw Error("addEventListener and attachEvent are unavailable.");x.addListener(ae)}}function oe(x){if(typeof x!="number"&&x&&!x.s){var Z=x.src;if(Z&&Z[pt])Rt(Z.f,x);else{var te=x.type,ae=x.proxy;Z.removeEventListener?Z.removeEventListener(te,ae,x.capture):Z.detachEvent?Z.detachEvent(de(te),ae):Z.addListener&&Z.removeListener&&Z.removeListener(ae),(te=le(Z))?(Rt(te,x),te.b==0&&(te.src=null,Z[D]=null)):Tt(x)}}}function de(x){return x in H?H[x]:H[x]="on"+x}function ye(x,Z,te,ae){var ge=!0;if((x=le(x))&&(Z=x.a[Z.toString()]))for(Z=Z.concat(),x=0;x<Z.length;x++){var me=Z[x];me&&me.capture==te&&!me.s&&(me=be(me,ae),ge=ge&&me!==!1)}return ge}function be(x,Z){var te=x.listener,ae=x.A||x.src;return x.v&&oe(x),te.call(ae,Z)}function ce(x,Z){if(x.s)return!0;if(!Et){var te=Z||E("window.event");Z=new ot(te,this);var ae=!0;if(!(0>te.keyCode||te.returnValue!=null)){e:{var ge=!1;if(te.keyCode==0)try{te.keyCode=-1;break e}catch{ge=!0}(ge||te.returnValue==null)&&(te.returnValue=!0)}for(te=[],ge=Z.a;ge;ge=ge.parentNode)te.push(ge);for(x=x.type,ge=te.length-1;0<=ge;ge--){Z.a=te[ge];var me=ye(te[ge],x,!0,Z);ae=ae&&me}for(ge=0;ge<te.length;ge++)Z.a=te[ge],me=ye(te[ge],x,!1,Z),ae=ae&&me}return ae}return be(x,new ot(Z,this))}function le(x){return(x=x[D])instanceof Fe?x:null}var Re="__closure_events_fn_"+(1e9*Math.random()>>>0);function Me(x){return h(x)=="function"?x:(x[Re]||(x[Re]=function(Z){return x.handleEvent(Z)}),x[Re])}function xe(){lt.call(this),this.f=new Fe(this),this.N=this}function ze(x,Z){x=x.N;var te=Z.type||Z;if(typeof Z=="string")Z=new rt(Z,x);else if(Z instanceof rt)Z.target=Z.target||x;else{var ae=Z;(function(ge,me){for(var ue,he,we=1;we<arguments.length;we++){for(ue in he=arguments[we])ge[ue]=he[ue];for(var _e=0;_e<S.length;_e++)ue=S[_e],Object.prototype.hasOwnProperty.call(he,ue)&&(ge[ue]=he[ue])}})(Z=new rt(te,x),ae)}Xe(x=Z.a=x,te,!0,Z),Xe(x,te,!1,Z)}function Xe(x,Z,te,ae){if(Z=x.f.a[String(Z)]){Z=Z.concat();for(var ge=!0,me=0;me<Z.length;++me){var ue=Z[me];if(ue&&!ue.s&&ue.capture==te){var he=ue.listener,we=ue.A||ue.src;ue.v&&Rt(x.f,ue),ge=he.call(we,ae)!==!1&&ge}}}}function Ze(x,Z,te){if(h(x)=="function")te&&(x=j(x,te));else{if(!x||typeof x.handleEvent!="function")throw Error("Invalid listener argument");x=j(x.handleEvent,x)}return 2147483647<Number(Z)?-1:f.setTimeout(x,Z||0)}function Ke(x,Z,te){this.reset(x,Z,te,void 0,void 0)}F(xe,lt),xe.prototype[pt]=!0,xe.prototype.addEventListener=function(x,Z,te,ae){X(this,x,Z,te,ae)},xe.prototype.removeEventListener=function(x,Z,te,ae){(function ge(me,ue,he,we,_e){if(Array.isArray(ue))for(var Ee=0;Ee<ue.length;Ee++)ge(me,ue[Ee],he,we,_e);else we=g(we)?!!we.capture:!!we,he=Me(he),me&&me[pt]?(me=me.f,(ue=String(ue).toString())in me.a&&-1<(he=pe(Ee=me.a[ue],he,we,_e))&&(Tt(Ee[he]),Array.prototype.splice.call(Ee,he,1),Ee.length==0&&(delete me.a[ue],me.b--))):me&&(me=le(me))&&(ue=me.a[ue.toString()],me=-1,ue&&(me=pe(ue,he,we,_e)),(he=-1<me?ue[me]:null)&&oe(he))})(this,x,Z,te,ae)},Ke.prototype.a=null;function Le(x){this.f=x,this.b=this.c=this.a=null}function ke(x,Z){this.name=x,this.value=Z}Ke.prototype.reset=function(x,Z,te,ae,ge){delete this.a},ke.prototype.toString=function(){return this.name};var $e=new ke("SEVERE",1e3),qe=new ke("CONFIG",700),Je=new ke("FINE",500);function Qe(x){return x.c?x.c:x.a?Qe(x.a):(function(Z,te){throw new _("Failure"+(Z?": "+Z:""),Array.prototype.slice.call(arguments,1))}("Root logger has no level set."),null)}Le.prototype.log=function(x,Z,te){if(x.value>=Qe(this).value)for(h(Z)=="function"&&(Z=Z()),x=new Ke(x,String(Z),this.f),te&&(x.a=te),te=this;te;)te=te.a};var st,at={},ct=null;function et(x,Z){x&&x.log(Je,Z,void 0)}function Mt(){}function Bt(x){var Z;return(Z=x.a)||(Z={},Ft(x)&&(Z[0]=!0,Z[1]=!0),Z=x.a=Z),Z}function kt(){}function Ut(x){return(x=Ft(x))?new ActiveXObject(x):new XMLHttpRequest}function Ft(x){if(!x.b&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var Z=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],te=0;te<Z.length;te++){var ae=Z[te];try{return new ActiveXObject(ae),x.b=ae}catch{}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return x.b}function mt(x,Z){this.b={},this.a=[],this.c=0;var te=arguments.length;if(1<te){if(te%2)throw Error("Uneven number of arguments");for(var ae=0;ae<te;ae+=2)this.set(arguments[ae],arguments[ae+1])}else x&&zt(this,x)}function xt(x){if(x.c!=x.a.length){for(var Z=0,te=0;Z<x.a.length;){var ae=x.a[Z];vt(x.b,ae)&&(x.a[te++]=ae),Z++}x.a.length=te}if(x.c!=x.a.length){var ge={};for(te=Z=0;Z<x.a.length;)vt(ge,ae=x.a[Z])||(x.a[te++]=ae,ge[ae]=1),Z++;x.a.length=te}}function zt(x,Z){if(Z instanceof mt)for(var te=Z.f(),ae=0;ae<te.length;ae++)x.set(te[ae],Z.get(te[ae]));else for(te in Z)x.set(te,Z[te])}function vt(x,Z){return Object.prototype.hasOwnProperty.call(x,Z)}Mt.prototype.a=null,F(kt,Mt),st=new kt,mt.prototype.f=function(){return xt(this),this.a.concat()},mt.prototype.get=function(x,Z){return vt(this.b,x)?this.b[x]:Z},mt.prototype.set=function(x,Z){vt(this.b,x)||(this.c++,this.a.push(x)),this.b[x]=Z},mt.prototype.forEach=function(x,Z){for(var te=this.f(),ae=0;ae<te.length;ae++){var ge=te[ae],me=this.get(ge);x.call(Z,me,ge,this)}};var Xt=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function dt(x){xe.call(this),this.headers=new mt,this.D=x||null,this.c=!1,this.C=this.a=null,this.J=this.o="",this.g=0,this.i="",this.h=this.I=this.m=this.G=!1,this.l=0,this.u=null,this.j=Wt,this.B=this.H=!1}F(dt,xe);var Wt="",Jt=dt.prototype,Qt=function x(Z){var te;if(ct||(ct=new Le(""),at[""]=ct,ct.c=qe),!(te=at[Z])){te=new Le(Z);var ae=Z.lastIndexOf("."),ge=Z.substr(ae+1);(ae=x(Z.substr(0,ae))).b||(ae.b={}),ae.b[ge]=te,te.a=ae,at[Z]=te}return te}("goog.net.XhrIo");Jt.b=Qt;var en=/^https?$/i,tn=["POST","PUT"];function nn(x,Z,te){if(x.a)throw Error("[goog.net.XhrIo] Object is active with another request="+x.o+"; newUri="+Z);x.o=Z,x.i="",x.g=0,x.J="POST",x.G=!1,x.c=!0,x.a=x.D?Ut(x.D):Ut(st),x.C=x.D?Bt(x.D):Bt(st),x.a.onreadystatechange=j(x.K,x);try{et(x.b,ht(x,"Opening Xhr")),x.I=!0,x.a.open("POST",String(Z),!0),x.I=!1}catch(me){return et(x.b,ht(x,"Error opening Xhr: "+me.message)),void Ht(x,me)}Z=te||"";var ae=function(me){e:{for(var ue=rn,he=me.length,we=typeof me=="string"?me.split(""):me,_e=0;_e<he;_e++)if(_e in we&&ue.call(void 0,we[_e],_e,me)){ue=_e;break e}ue=-1}return 0>ue?null:typeof me=="string"?me.charAt(ue):me[ue]}((te=new mt(x.headers)).f()),ge=f.FormData&&Z instanceof f.FormData;!(0<=U(tn,"POST"))||ae||ge||te.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),te.forEach(function(me,ue){this.a.setRequestHeader(ue,me)},x),x.j&&(x.a.responseType=x.j),"withCredentials"in x.a&&x.a.withCredentials!==x.H&&(x.a.withCredentials=x.H);try{$t(x),0<x.l&&(x.B=function(me){return se&&nt(9)&&typeof me.timeout=="number"&&me.ontimeout!==void 0}(x.a),et(x.b,ht(x,"Will abort after "+x.l+"ms if incomplete, xhr2 "+x.B)),x.B?(x.a.timeout=x.l,x.a.ontimeout=j(x.L,x)):x.u=Ze(x.L,x.l,x)),et(x.b,ht(x,"Sending request")),x.m=!0,x.a.send(Z),x.m=!1}catch(me){et(x.b,ht(x,"Send error: "+me.message)),Ht(x,me)}}function rn(x){return x.toLowerCase()=="content-type"}function Ht(x,Z){x.c=!1,x.a&&(x.h=!0,x.a.abort(),x.h=!1),x.i=Z,x.g=5,Vt(x),Lt(x)}function Vt(x){x.G||(x.G=!0,ze(x,"complete"),ze(x,"error"))}function Gt(x){if(x.c&&u!==void 0){if(x.C[1]&&yt(x)==4&&x.getStatus()==2)et(x.b,ht(x,"Local request error detected and ignored"));else if(x.m&&yt(x)==4)Ze(x.K,0,x);else if(ze(x,"readystatechange"),yt(x)==4){et(x.b,ht(x,"Request complete")),x.c=!1;try{var Z,te=x.getStatus();e:switch(te){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var ae=!0;break e;default:ae=!1}if(!(Z=ae)){var ge;if(ge=te===0){var me=String(x.o).match(Xt)[1]||null;if(!me&&f.self&&f.self.location){var ue=f.self.location.protocol;me=ue.substr(0,ue.length-1)}ge=!en.test(me?me.toLowerCase():"")}Z=ge}if(Z)ze(x,"complete"),ze(x,"success");else{x.g=6;try{var he=2<yt(x)?x.a.statusText:""}catch(we){et(x.b,"Can not get status: "+we.message),he=""}x.i=he+" ["+x.getStatus()+"]",Vt(x)}}finally{Lt(x)}}}}function Lt(x){if(x.a){$t(x);var Z=x.a,te=x.C[0]?w:null;x.a=null,x.C=null,ze(x,"ready");try{Z.onreadystatechange=te}catch(ae){(x=x.b)&&x.log($e,"Problem encountered resetting onreadystatechange: "+ae.message,void 0)}}}function $t(x){x.a&&x.B&&(x.a.ontimeout=null),x.u&&(f.clearTimeout(x.u),x.u=null)}function yt(x){return x.a?x.a.readyState:0}function Zt(x,Z){if(x.a&&yt(x)==4)return(x=x.a.getResponseHeader(Z))===null?void 0:x}function ht(x,Z){return Z+" ["+x.J+" "+x.o+" "+x.getStatus()+"]"}dt.prototype.L=function(){u!==void 0&&this.a&&(this.i="Timed out after "+this.l+"ms, aborting",this.g=8,et(this.b,ht(this,this.i)),ze(this,"timeout"),this.abort(8))},dt.prototype.abort=function(x){this.a&&this.c&&(et(this.b,ht(this,"Aborting")),this.c=!1,this.h=!0,this.a.abort(),this.h=!1,this.g=x||7,ze(this,"complete"),ze(this,"abort"),Lt(this))},dt.prototype.K=function(){this.F||(this.I||this.m||this.h?Gt(this):this.O())},dt.prototype.O=function(){Gt(this)},dt.prototype.getStatus=function(){try{return 2<yt(this)?this.a.status:-1}catch{return-1}};var qt={},At=null;function an(x){var Z=x.length,te=3*Z/4;te%3?te=Math.floor(te):ee("=.",x[Z-1])&&(te=ee("=.",x[Z-2])?te-2:te-1);var ae=new Uint8Array(te),ge=0;return function(me,ue){function he(He){for(;we<me.length;){var We=me.charAt(we++),Ve=At[We];if(Ve!=null)return Ve;if(!/^[\s\xa0]*$/.test(We))throw Error("Unknown base64 encoding at char: "+We)}return He}Yt();for(var we=0;;){var _e=he(-1),Ee=he(0),Be=he(64),Pe=he(64);if(Pe===64&&_e===-1)break;ue(_e<<2|Ee>>4),Be!=64&&(ue(Ee<<4&240|Be>>2),Pe!=64&&ue(Be<<6&192|Pe))}}(x,function(me){ae[ge++]=me}),ae.subarray(0,ge)}function Yt(){if(!At){At={};for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Z=["+/=","+/","-_=","-_.","-_"],te=0;5>te;te++){var ae=x.concat(Z[te].split(""));qt[te]=ae;for(var ge=0;ge<ae.length;ge++){var me=ae[ge];At[me]===void 0&&(At[me]=ge)}}}}var sn=["content-type","grpc-status","grpc-message"];function gt(x){this.a=x.T,this.l=null,this.b=[],this.h=[],this.g=[],this.f=[],this.c=[],this.j=!1,this.i=0,this.m=new L;var Z=this;X(this.a,"readystatechange",function(){var te=Z.a;if(te=te.a?te.a.getResponseHeader("Content-Type"):null){if((te=te.toLowerCase()).lastIndexOf("application/grpc-web-text",0)==0){te=Z.a;try{var ae=te.a?te.a.responseText:""}catch(_e){et(te.b,"Can not get responseText: "+_e.message),ae=""}if(ae=(te=ae||"").length-te.length%4,(te=te.substr(Z.i,ae-Z.i)).length==0)return;Z.i=ae,te=an(te)}else{if(te.lastIndexOf("application/grpc",0)!=0)return void wt(Z,{code:2,message:"Unknown Content-type received.",metadata:{}});te=new Uint8Array(function(_e){try{if(!_e.a)return null;if("response"in _e.a)return _e.a.response;switch(_e.j){case Wt:case"text":return _e.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in _e.a)return _e.a.mozResponseArrayBuffer}var Ee=_e.b;return Ee&&Ee.log($e,"Response type "+_e.j+" is not supported on this browser",void 0),null}catch(Be){return et(_e.b,"Can not get response: "+Be.message),null}}(Z.a))}ae=null;try{ae=function(_e,Ee){function Be(St){Ne.f++,Ne.a=(Ne.a<<8)+St,Ne.f==4&&(Ne.b=N,Ne.g=0,typeof Uint8Array<"u"?Ne.c=new Uint8Array(Ne.a):Ne.c=Array(Ne.a),Ne.a==0&&He())}function Pe(St){Ne.c[Ne.g++]=St,Ne.g==Ne.a&&He()}function He(){var St={};St[Ne.h]=Ne.c,Ne.i.push(St),Ne.b=W}var We,Ve,Ne=_e,ft=0;for(We=Ee instanceof Uint8Array||Ee instanceof Array?Ee:new Uint8Array(Ee);ft<We.length;){switch(Ne.b){case P:p(Ne,We,ft,"stream already broken");break;case W:(Ve=We[ft])==z||Ve==O?Ne.h=Ve:p(Ne,We,ft,"invalid frame byte"),Ne.b=B,Ne.a=0,Ne.f=0;break;case B:Be(We[ft]);break;case N:Pe(We[ft]);break;default:throw Error("unexpected parser state: "+Ne.b)}Ne.l++,ft++}return _e=Ne.i,Ne.i=[],0<_e.length?_e:null}(Z.m,te)}catch{wt(Z,{code:2,message:"Error in parsing response body",metadata:{}})}if(ae)for(te=0;te<ae.length;te++){if(z in ae[te]){var ge=ae[te][z];if(ge)try{var me=Z.l(ge);if(me){ge=Z;for(var ue=me,he=0;he<ge.b.length;he++)ge.b[he](ue)}}catch{wt(Z,{code:2,message:"Error in response deserializer function.",metadata:{}})}}if(O in ae[te]&&0<ae[te][O].length){for(ge="",ue=0;ue<ae[te][O].length;ue++)ge+=String.fromCharCode(ae[te][O][ue]);for(ge=ge.trim().split(`\r
|
|
22
|
-
`),ue={},he=0;he<ge.length;he++){var we=ge[he].indexOf(":");ue[ge[he].substring(0,we).trim()]=ge[he].substring(we+1).trim()}ge=ue,ue=0,he="","grpc-status"in ge&&(ue=ge["grpc-status"],delete ge["grpc-status"]),"grpc-message"in ge&&(he=ge["grpc-message"],delete ge["grpc-message"]),
|
|
23
|
-
`);for(var _e=0;_e<he.length;_e++)if(!/^[\s\xa0]*$/.test(he[_e])){var Ee=T(he[_e]),
|
|
24
|
-
`}),We}(ue),typeof ge=="string"?(Ee=encodeURIComponent("$httpHeaders"),(Ee+=ue=ue!=null?"="+encodeURIComponent(String(ue)):"")&&(0>(ue=ge.indexOf("#"))&&(ue=ge.length),0>(he=ge.indexOf("?"))||he>ue?(he=ue,we=""):we=ge.substring(he+1,ue),ue=(ge=[ge.substr(0,he),we,ge.substr(ue)])[1],ge[1]=Ee?ue?ue+"&"+Ee:Ee:ue,ge=ge[0]+(ge[1]?"?"+ge[1]:"")+ge[2])):ge.a("$httpHeaders",ue))}for(ae=(Z=(0,ae.a)(Z.getRequestMessage())).length,Ee=[0,0,0,0],ue=new Uint8Array(5+ae),he=3;0<=he;he--)Ee[he]=ae%256,ae>>>=8;if(ue.set(new Uint8Array(Ee),1),ue.set(Z,5),Z=ue,x.a=="text"){var Be;for(x=Z,Be===void 0&&(Be=0),Yt(),Be=qt[Be],Z=[],ae=0;ae<x.length;ae+=3){_e=x[ae];var Pe=(Ee=ae+1<x.length)?x[ae+1]:0;he=_e>>2,_e=(3&_e)<<4|Pe>>4,Pe=(15&Pe)<<2|(we=(ue=ae+2<x.length)?x[ae+2]:0)>>6,we&=63,ue||(we=64,Ee||(Pe=64)),Z.push(Be[he],Be[_e],Be[Pe]||"",Be[we]||"")}Z=Z.join("")}else x.a=="binary"&&(te.j="arraybuffer");return nn(te,ge,Z),me}function Kt(x,Z,te){var ae=null,ge=!1;x.on("data",function(me){ae=me}),x.on("error",function(me){me.code==0||ge||(ge=!0,Z(me,null))}),x.on("status",function(me){me.code==0||ge?te&&Z(null,null,me):(ge=!0,Z({code:me.code,message:me.details,metadata:me.metadata},null))}),te&&x.on("metadata",function(me){Z(null,null,null,me)}),x.on("end",function(){ge||(ae==null?Z({code:2,message:"Incomplete response"}):Z(null,ae)),te&&Z(null,null)})}function Dt(x,Z){var te=x;return Z.forEach(function(ae){var ge=te;te=function(me){return ae.intercept(me,ge)}}),te}gt.prototype.on=function(x,Z){return x=="data"?this.b.push(Z):x=="status"?this.h.push(Z):x=="metadata"?this.g.push(Z):x=="end"?this.c.push(Z):x=="error"&&this.f.push(Z),this},gt.prototype.removeListener=function(x,Z){return x=="data"?Ot(this.b,Z):x=="status"?Ot(this.h,Z):x=="metadata"?Ot(this.g,Z):x=="end"?Ot(this.c,Z):x=="error"&&Ot(this.f,Z),this},gt.prototype.cancel=function(){this.j=!0,this.a.abort()},gt.prototype.cancel=gt.prototype.cancel,gt.prototype.removeListener=gt.prototype.removeListener,gt.prototype.on=gt.prototype.on,it.prototype.P=function(x,Z,te,ae,ge){var me=this;ae=q(x,Z,"unary",ae);var ue=x.substr(0,x.length-ae.name.length);return Kt(x=Dt(function(he){return Pt(me,he,ue)},this.b).call(this,$(ae,Z,te)),ge,!1),new y(x)},it.prototype.M=function(x,Z,te,ae){var ge=this;ae=q(x,Z,"unary",ae);var me=x.substr(0,x.length-ae.name.length);return Dt(function(ue){return new Promise(function(he,we){var _e,Ee,Be;Kt(Pt(ge,ue,me),function(Pe,He,We,Ve){Pe?we(Pe):He?Be=He:We?Ee=We:Ve?_e=Ve:(Pe=ue.getMethodDescriptor(),he(new d(Be,Pe,He=(He=_e)===void 0?{}:He,Ee===void 0?null:Ee)))},!0)})},this.g).call(this,$(ae,Z,te)).then(function(ue){return ue.getResponseMessage()})},it.prototype.unaryCall=function(x,Z,te,ae){return this.M(x,Z,te,ae)},it.prototype.R=function(x,Z,te,ae){var ge=this;ae=q(x,Z,"server_streaming",ae);var me=x.substr(0,x.length-ae.name.length);return Dt(function(ue){return Pt(ge,ue,me)},this.b).call(this,$(ae,Z,te))},it.prototype.serverStreaming=it.prototype.R,it.prototype.unaryCall=it.prototype.unaryCall,it.prototype.thenableCall=it.prototype.M,it.prototype.rpcCall=it.prototype.P,e.exports.AbstractClientBase={MethodInfo:function(x,Z,te,ae,ge){this.name=ae,this.b=ge,this.f=x,this.a=Z,this.c=te}},e.exports.GrpcWebClientBase=it,e.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15},e.exports.MethodDescriptor=C,e.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming"}}).call(this,n(6))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,i=n(152),s=(r=i)&&r.__esModule?r:{default:r};function l(o){return o[Symbol.toStringTag]==="AsyncFunction"}t.default=function(o){if(typeof o!="function")throw new Error("expected a function");return l(o)?(0,s.default)(o):o},t.isAsync=l,t.isAsyncGenerator=function(o){return o[Symbol.toStringTag]==="AsyncGenerator"},t.isAsyncIterable=function(o){return typeof o[Symbol.asyncIterator]=="function"}},function(e,t,n){var r={};function i(l,o,c){c||(c=Error);var u=function(f){var E,w;function h(g,b,R){return f.call(this,function(j,F,M){return typeof o=="string"?o:o(j,F,M)}(g,b,R))||this}return w=f,(E=h).prototype=Object.create(w.prototype),E.prototype.constructor=E,E.__proto__=w,h}(c);u.prototype.name=c.name,u.prototype.code=l,r[l]=u}function s(l,o){if(Array.isArray(l)){var c=l.length;return l=l.map(function(u){return String(u)}),c>2?"one of ".concat(o," ").concat(l.slice(0,c-1).join(", "),", or ")+l[c-1]:c===2?"one of ".concat(o," ").concat(l[0]," or ").concat(l[1]):"of ".concat(o," ").concat(l[0])}return"of ".concat(o," ").concat(String(l))}i("ERR_INVALID_OPT_VALUE",function(l,o){return'The value "'+o+'" is invalid for option "'+l+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(l,o,c){var u,f,E;if(typeof o=="string"&&(f="not ",o.substr(0,f.length)===f)?(u="must not be",o=o.replace(/^not /,"")):u="must be",function(h,g,b){return(b===void 0||b>h.length)&&(b=h.length),h.substring(b-g.length,b)===g}(l," argument"))E="The ".concat(l," ").concat(u," ").concat(s(o,"type"));else{var w=function(h,g,b){return typeof b!="number"&&(b=0),!(b+g.length>h.length)&&h.indexOf(g,b)!==-1}(l,".")?"property":"argument";E='The "'.concat(l,'" ').concat(w," ").concat(u," ").concat(s(o,"type"))}return E+=". Received type ".concat(typeof c)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var i=Object.keys||function(h){var g=[];for(var b in h)g.push(b);return g};e.exports=f;var s=n(77),l=n(81);n(7)(f,s);for(var o=i(l.prototype),c=0;c<o.length;c++){var u=o[c];f.prototype[u]||(f.prototype[u]=l.prototype[u])}function f(h){if(!(this instanceof f))return new f(h);s.call(this,h),l.call(this,h),this.allowHalfOpen=!0,h&&(h.readable===!1&&(this.readable=!1),h.writable===!1&&(this.writable=!1),h.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",E)))}function E(){this._writableState.ended||r.nextTick(w,this)}function w(h){h.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(h){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}})}).call(this,n(2))},function(e,t,n){n.d(t,"a",function(){return l});var r=n(40),i=n(4);const s={"app-id":["app-id must match formant/*"]};class l extends r.a{constructor(c,u={}){super(c,Object.assign({validateHeaders:f=>`${f.get("app-id")}`.startsWith("formant/")?{}:s},u)),this.endpoint=c}getHeaders(){return Object.assign(Object.assign({},l.headers),{"App-ID":`formant/${i.a}`,"App-Version":i.j})}}l.headers={}},function(e,t,n){n(227),e.exports={encode:r=>new TextEncoder().encode(r),decode:r=>new TextDecoder().decode(r)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r,i=r.length){if(!i)throw new Error("arity is undefined");return function(...s){return typeof s[i-1]=="function"?r.apply(this,s):new Promise((l,o)=>{s[i-1]=(c,...u)=>{if(c)return o(c);l(u.length>1?u:u[0])},r.apply(this,s)})}},e.exports=t.default},function(e,t,n){(t=e.exports=n(69)).Stream=t,t.Readable=t,t.Writable=n(48),t.Duplex=n(23),t.Transform=n(72),t.PassThrough=n(165)},function(e,t,n){(t=e.exports=n(77)).Stream=t,t.Readable=t,t.Writable=n(81),t.Duplex=n(27),t.Transform=n(82),t.PassThrough=n(184),t.finished=n(49),t.pipeline=n(185)},function(e,t,n){e.exports=function(r){return r}},function(e,t,n){n.d(t,"a",function(){return i});const r=["password","secret","token","key","buffer"];function i(s,l=new Set){return l.has(s)?"[ RECURSIVE ]":!(o=s)||typeof o!="object"&&typeof o!="function"?s:(l.add(s),Object.keys(s).reduce((c,u)=>(c[u]=r.some(f=>u.toLowerCase().includes(f.toLowerCase()))?"[ REDACTED ]":i(s[u],l),c),{}));var o}},function(e,t){e.exports=r,r.default=r,r.stable=s,r.stableStringify=s;var n=[];function r(l,o,c){(function E(w,h,g,b){var R;if(typeof w=="object"&&w!==null){for(R=0;R<g.length;R++)if(g[R]===w)return b[h]="[Circular]",void n.push([b,h,w]);if(g.push(w),Array.isArray(w))for(R=0;R<w.length;R++)E(w[R],R,g,w);else{var j=Object.keys(w);for(R=0;R<j.length;R++){var F=j[R];E(w[F],F,g,w)}}g.pop()}})(l,"",[],void 0);for(var u=JSON.stringify(l,o,c);n.length!==0;){var f=n.pop();f[0][f[1]]=f[2]}return u}function i(l,o){return l<o?-1:l>o?1:0}function s(l,o,c){for(var u=function w(h,g,b,R){var j;if(typeof h=="object"&&h!==null){for(j=0;j<b.length;j++)if(b[j]===h)return R[g]="[Circular]",void n.push([R,g,h]);if(typeof h.toJSON=="function")return;if(b.push(h),Array.isArray(h))for(j=0;j<h.length;j++)w(h[j],j,b,h);else{var F={},M=Object.keys(h).sort(i);for(j=0;j<M.length;j++){var A=M[j];w(h[A],A,b,h),F[A]=h[A]}if(R===void 0)return F;n.push([R,g,h]),R[g]=F}b.pop()}}(l,"",[],void 0)||l,f=JSON.stringify(u,o,c);n.length!==0;){var E=n.pop();E[0][E[1]]=E[2]}return f}},function(e,t,n){var r=n(16),i=Object.keys||function(g){var b=[];for(var R in g)b.push(R);return b};e.exports=E;var s=Object.create(n(17));s.inherits=n(7);var l=n(143),o=n(62);s.inherits(E,l);for(var c=i(o.prototype),u=0;u<c.length;u++){var f=c[u];E.prototype[f]||(E.prototype[f]=o.prototype[f])}function E(g){if(!(this instanceof E))return new E(g);l.call(this,g),o.call(this,g),g&&g.readable===!1&&(this.readable=!1),g&&g.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,g&&g.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(g){g.end()}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),E.prototype._destroy=function(g,b){this.push(null),this.end(),r.nextTick(b,g)}},function(e,t,n){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function i(o,c){return Object.prototype.hasOwnProperty.call(o,c)}t.assign=function(o){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)i(u,f)&&(o[f]=u[f])}}return o},t.shrinkBuf=function(o,c){return o.length===c?o:o.subarray?o.subarray(0,c):(o.length=c,o)};var s={arraySet:function(o,c,u,f,E){if(c.subarray&&o.subarray)o.set(c.subarray(u,u+f),E);else for(var w=0;w<f;w++)o[E+w]=c[u+w]},flattenChunks:function(o){var c,u,f,E,w,h;for(f=0,c=0,u=o.length;c<u;c++)f+=o[c].length;for(h=new Uint8Array(f),E=0,c=0,u=o.length;c<u;c++)w=o[c],h.set(w,E),E+=w.length;return h}},l={arraySet:function(o,c,u,f,E){for(var w=0;w<f;w++)o[E+w]=c[u+w]},flattenChunks:function(o){return[].concat.apply([],o)}};t.setTyped=function(o){o?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,s)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,l))},t.setTyped(r)},function(e,t,n){e.exports=n(186)},function(e,t,n){n.d(t,"a",function(){return i});var r=n(229);const i=Object(r.a)()},function(e,t,n){n.d(t,"a",function(){return j});var r=n(1),i=n(100),s=n.n(i),l=n(101),o=n.n(l);class c extends Error{constructor(M,A,d){super(`Connection failure: ${M.message}`),this.cause=M,this.url=A,this.retryable=d}}var u=n(10);class f extends Error{constructor(M,A){super(`Invalid headers (${JSON.stringify(M)}) for response: ${A.message}`),this.validationErrors=M,this.responseError=A}}var E=n(8),w=n(0),h=n(11),g=function(F,M,A,d){return new(A||(A=Promise))(function(C,$){function q(I){try{m(d.next(I))}catch(_){$(_)}}function y(I){try{m(d.throw(I))}catch(_){$(_)}}function m(I){var _;I.done?C(I.value):(_=I.value,_ instanceof A?_:new A(function(L){L(_)})).then(q,y)}m((d=d.apply(F,M||[])).next())})},b=function(F,M){var A={};for(var d in F)Object.prototype.hasOwnProperty.call(F,d)&&M.indexOf(d)<0&&(A[d]=F[d]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function"){var C=0;for(d=Object.getOwnPropertySymbols(F);C<d.length;C++)M.indexOf(d[C])<0&&Object.prototype.propertyIsEnumerable.call(F,d[C])&&(A[d[C]]=F[d[C]])}return A};const R=new Set(["GET","HEAD","PUT","QUERY","DELETE","OPTIONS","TRACE"]);class j{constructor(M,A={}){if(this.endpoint=M,this.validateHeaders=d=>A.validateHeaders?A.validateHeaders(d):{},this.verbose=A.verbose!==!1,A.retries!==void 0&&!(A.retries>=0))throw new Error("retries must be positive or zero");if(this.configuredRetries=A.retries,A.timeoutMs!==void 0&&!(A.timeoutMs>0))throw new Error("timeoutMs must be positive");if(this.timeoutMs=A.timeoutMs,A.maxBackoffDelayMs!==void 0&&!(A.maxBackoffDelayMs>0))throw new Error("maxBackoffDelayMs must be positive");this.maxBackoffDelayMs=A.maxBackoffDelayMs||30*r.a.second}getRetries(){return this.configuredRetries!==void 0?this.configuredRetries:this.getConstructor().retries}getHeaders(){return{}}fetch(M,A={}){return g(this,void 0,void 0,function*(){return(yield this.fetchVerbose(M,A)).body})}fetchVerbose(M,A={}){return g(this,void 0,void 0,function*(){let d=100*r.a.millisecond,C=0;const $=this.timeoutMs!==void 0?new Date().getTime()+this.timeoutMs:void 0,q=$?()=>Math.max($-new Date().getTime(),0):void 0;for(;;)try{return yield this.doFetch(M,A,q)}catch(y){const m=y,I=Object(h.a)(m,c);if((q==null?void 0:q())===0||C===this.getRetries()||!I.retryable)throw I;C++,d=Math.min(...q?[q()]:[],d*(2+.1*(Math.random()-.5)),this.maxBackoffDelayMs),yield Object(E.a)(d),this.verbose&&w.a.warn(`Connection failure, retrying. Error: ${m.cause.message}`,{url:m.url,error:m.cause,attempt:C})}})}doFetch(M,A,d){return g(this,void 0,void 0,function*(){const{token:C,json:$,allowUnsafeRetries:q}=A,y=b(A,["token","json","allowUnsafeRetries"]),m=(y.method||"GET").toUpperCase(),I=this.endpoint!==void 0?`${this.endpoint}${M?`/${M}`:""}`:M,_=new s.a;let L;if(d){const W=d();W>0?L=setTimeout(()=>{_.abort()},W):_.abort()}try{let W;yield Promise.race([this.getConstructor().waitForConnectivity(),new Promise(U=>{W=setTimeout(U,d?Math.min(r.a.minute,d()):r.a.minute)})]),W&&clearTimeout(W);const B=yield o()(I,Object.assign(Object.assign({},y),{headers:Object.assign(Object.assign(Object.assign(Object.assign({},$!==!1?{"Content-Type":"application/json"}:{}),this.getHeaders()),y.headers||{}),C!==void 0?{Authorization:`Bearer ${C}`}:{}),signal:_.signal})),N=B.headers.get("content-type")||"",P=N&&N.startsWith("application/json"),z=P?yield B.json():yield B.text(),O=()=>new u.a(m,I,B.status,z,z&&z.validationErrors||{},B.headers);if(!B.ok)throw this.verbose&&w.a[B.status>=500?"warn":"info"]("Response error",{method:m,url:I,statusCode:B.status}),O();const p=this.validateHeaders(B.headers);if(Object.keys(p).length!==0)throw new f(p,O());if(B.status===204)return{body:void 0,headers:B.headers};if($&&!P)throw new Error(`Response is not JSON: ${JSON.stringify(z)}`);return{body:z,headers:B.headers}}catch(W){const B=W,N=q||R.has(m);if(B.message==="Network request failed")throw new c(B,I,N);if(B.type==="system"&&["EAI_AGAIN","ECONNREFUSED","EHOSTUNREACH","ENOTFOUND"].find(p=>p===B.code))throw new c(B,I,!0);if(B.type==="system"&&["ETIMEDOUT","ECONNRESET","ESOCKETTIMEDOUT","EPIPE"].find(p=>p===B.code))throw new c(B,I,N);if(B.name==="AbortError")throw new c(B,I,N);const P=Object(h.a)(B,u.a),{statusCode:z}=P;if(z===408||z===429||z===502||z===503||z===504)throw this.verbose&&!N&&w.a.warn("Potentially unsafe retry"),new c(B,I,!0);const O=this.validateHeaders(P.headers);throw Object.keys(O).length!==0?new f(O,P):(yield this.getConstructor().onResponseError(P),B)}finally{L&&clearTimeout(L)}})}getConstructor(){return Object.getPrototypeOf(this).constructor}}j.retries=8,j.waitForConnectivity=()=>g(void 0,void 0,void 0,function*(){}),j.onResponseError=()=>g(void 0,void 0,void 0,function*(){})},function(e,t,n){function r(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function i(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var s=n(59),l=n(3),o=l.LEVEL,c=l.MESSAGE;s.enabled=!0;var u=/\s+/,f=function(){function E(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,E),b.colors&&this.addColors(b.colors),this.options=b}var w,h,g;return w=E,g=[{key:"addColors",value:function(b){var R=Object.keys(b).reduce(function(j,F){return j[F]=u.test(b[F])?b[F].split(u):b[F],j},{});return E.allColors=Object.assign({},E.allColors||{},R),E.allColors}}],(h=[{key:"addColors",value:function(b){return E.addColors(b)}},{key:"colorize",value:function(b,R,j){if(j===void 0&&(j=R),!Array.isArray(E.allColors[b]))return s[E.allColors[b]](j);for(var F=0,M=E.allColors[b].length;F<M;F++)j=s[E.allColors[b][F]](j);return j}},{key:"transform",value:function(b,R){return R.all&&typeof b[c]=="string"&&(b[c]=this.colorize(b[o],b.level,b[c])),(R.level||R.all||!R.message)&&(b.level=this.colorize(b[o],b.level)),(R.all||R.message)&&(b.message=this.colorize(b[o],b.level,b.message)),b}}])&&i(w.prototype,h),g&&i(w,g),E}();e.exports=function(E){return new f(E)},e.exports.Colorizer=e.exports.Format=f},function(e,t){var n={}.toString;e.exports=Array.isArray||function(r){return n.call(r)=="[object Array]"}},function(e,t,n){(function(r){function i(s){try{if(!r.localStorage)return!1}catch{return!1}var l=r.localStorage[s];return l!=null&&String(l).toLowerCase()==="true"}e.exports=function(s,l){if(i("noDeprecation"))return s;var o=!1;return function(){if(!o){if(i("throwDeprecation"))throw new Error(l);i("traceDeprecation")?console.trace(l):console.warn(l),o=!0}return s.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){var r=n(5),i=r.Buffer;function s(o,c){for(var u in o)c[u]=o[u]}function l(o,c,u){return i(o,c,u)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=l),s(i,l),l.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return i(o,c,u)},l.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var f=i(o);return c!==void 0?typeof u=="string"?f.fill(c,u):f.fill(c):f.fill(0),f},l.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return i(o)},l.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1==0},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,n){var r=n(5),i=r.Buffer;function s(o,c){for(var u in o)c[u]=o[u]}function l(o,c,u){return i(o,c,u)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=l),s(i,l),l.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return i(o,c,u)},l.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var f=i(o);return c!==void 0?typeof u=="string"?f.fill(c,u):f.fill(c):f.fill(0),f},l.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return i(o)},l.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}},function(e,t,n){(function(r,i,s){var l=n(16);function o(m){var I=this;this.next=null,this.entry=null,this.finish=function(){(function(_,L,W){var B=_.entry;for(_.entry=null;B;){var N=B.callback;L.pendingcb--,N(W),B=B.next}L.corkedRequestsFree?L.corkedRequestsFree.next=_:L.corkedRequestsFree=_})(I,m)}}e.exports=M;var c,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:l.nextTick;M.WritableState=F;var f=n(17);f.inherits=n(7);var E={deprecate:n(43)},w=n(70),h=n(47).Buffer,g=s.Uint8Array||function(){},b,R=n(71);function j(){}function F(m,I){c=c||n(23),m=m||{};var _=I instanceof c;this.objectMode=!!m.objectMode,_&&(this.objectMode=this.objectMode||!!m.writableObjectMode);var L=m.highWaterMark,W=m.writableHighWaterMark,B=this.objectMode?16:16384;this.highWaterMark=L||L===0?L:_&&(W||W===0)?W:B,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var N=m.decodeStrings===!1;this.decodeStrings=!N,this.defaultEncoding=m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(P){(function(z,O){var p=z._writableState,U=p.sync,V=p.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(p),O)(function(ee,ne,Y,G,S){--ne.pendingcb,Y?(l.nextTick(S,G),l.nextTick(y,ee,ne),ee._writableState.errorEmitted=!0,ee.emit("error",G)):(S(G),ee._writableState.errorEmitted=!0,ee.emit("error",G),y(ee,ne))})(z,p,U,O,V);else{var Q=$(p);Q||p.corked||p.bufferProcessing||!p.bufferedRequest||C(z,p),U?u(d,z,p,Q,V):d(z,p,Q,V)}})(I,P)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function M(m){if(c=c||n(23),!(b.call(M,this)||this instanceof c))return new M(m);this._writableState=new F(m,this),this.writable=!0,m&&(typeof m.write=="function"&&(this._write=m.write),typeof m.writev=="function"&&(this._writev=m.writev),typeof m.destroy=="function"&&(this._destroy=m.destroy),typeof m.final=="function"&&(this._final=m.final)),w.call(this)}function A(m,I,_,L,W,B,N){I.writelen=L,I.writecb=N,I.writing=!0,I.sync=!0,_?m._writev(W,I.onwrite):m._write(W,B,I.onwrite),I.sync=!1}function d(m,I,_,L){_||function(W,B){B.length===0&&B.needDrain&&(B.needDrain=!1,W.emit("drain"))}(m,I),I.pendingcb--,L(),y(m,I)}function C(m,I){I.bufferProcessing=!0;var _=I.bufferedRequest;if(m._writev&&_&&_.next){var L=I.bufferedRequestCount,W=new Array(L),B=I.corkedRequestsFree;B.entry=_;for(var N=0,P=!0;_;)W[N]=_,_.isBuf||(P=!1),_=_.next,N+=1;W.allBuffers=P,A(m,I,!0,I.length,W,"",B.finish),I.pendingcb++,I.lastBufferedRequest=null,B.next?(I.corkedRequestsFree=B.next,B.next=null):I.corkedRequestsFree=new o(I),I.bufferedRequestCount=0}else{for(;_;){var z=_.chunk,O=_.encoding,p=_.callback;if(A(m,I,!1,I.objectMode?1:z.length,z,O,p),_=_.next,I.bufferedRequestCount--,I.writing)break}_===null&&(I.lastBufferedRequest=null)}I.bufferedRequest=_,I.bufferProcessing=!1}function $(m){return m.ending&&m.length===0&&m.bufferedRequest===null&&!m.finished&&!m.writing}function q(m,I){m._final(function(_){I.pendingcb--,_&&m.emit("error",_),I.prefinished=!0,m.emit("prefinish"),y(m,I)})}function y(m,I){var _=$(I);return _&&(function(L,W){W.prefinished||W.finalCalled||(typeof L._final=="function"?(W.pendingcb++,W.finalCalled=!0,l.nextTick(q,L,W)):(W.prefinished=!0,L.emit("prefinish")))}(m,I),I.pendingcb===0&&(I.finished=!0,m.emit("finish"))),_}f.inherits(M,w),F.prototype.getBuffer=function(){for(var m=this.bufferedRequest,I=[];m;)I.push(m),m=m.next;return I},function(){try{Object.defineProperty(F.prototype,"buffer",{get:E.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(m){return!!b.call(this,m)||this===M&&m&&m._writableState instanceof F}})):b=function(m){return m instanceof this},M.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},M.prototype.write=function(m,I,_){var L,W=this._writableState,B=!1,N=!W.objectMode&&(L=m,h.isBuffer(L)||L instanceof g);return N&&!h.isBuffer(m)&&(m=function(P){return h.from(P)}(m)),typeof I=="function"&&(_=I,I=null),N?I="buffer":I||(I=W.defaultEncoding),typeof _!="function"&&(_=j),W.ended?function(P,z){var O=new Error("write after end");P.emit("error",O),l.nextTick(z,O)}(this,_):(N||function(P,z,O,p){var U=!0,V=!1;return O===null?V=new TypeError("May not write null values to stream"):typeof O=="string"||O===void 0||z.objectMode||(V=new TypeError("Invalid non-string/buffer chunk")),V&&(P.emit("error",V),l.nextTick(p,V),U=!1),U}(this,W,m,_))&&(W.pendingcb++,B=function(P,z,O,p,U,V){if(!O){var Q=function(G,S,T){return G.objectMode||G.decodeStrings===!1||typeof S!="string"||(S=h.from(S,T)),S}(z,p,U);p!==Q&&(O=!0,U="buffer",p=Q)}var ee=z.objectMode?1:p.length;z.length+=ee;var ne=z.length<z.highWaterMark;if(ne||(z.needDrain=!0),z.writing||z.corked){var Y=z.lastBufferedRequest;z.lastBufferedRequest={chunk:p,encoding:U,isBuf:O,callback:V,next:null},Y?Y.next=z.lastBufferedRequest:z.bufferedRequest=z.lastBufferedRequest,z.bufferedRequestCount+=1}else A(P,z,!1,ee,p,U,V);return ne}(this,W,N,m,I,_)),B},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var m=this._writableState;m.corked&&(m.corked--,m.writing||m.corked||m.finished||m.bufferProcessing||!m.bufferedRequest||C(this,m))},M.prototype.setDefaultEncoding=function(m){if(typeof m=="string"&&(m=m.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((m+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+m);return this._writableState.defaultEncoding=m,this},Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(m,I,_){_(new Error("_write() is not implemented"))},M.prototype._writev=null,M.prototype.end=function(m,I,_){var L=this._writableState;typeof m=="function"?(_=m,m=null,I=null):typeof I=="function"&&(_=I,I=null),m!=null&&this.write(m,I),L.corked&&(L.corked=1,this.uncork()),L.ending||L.finished||function(W,B,N){B.ending=!0,y(W,B),N&&(B.finished?l.nextTick(N):W.once("finish",N)),B.ended=!0,W.writable=!1}(this,L,_)},Object.defineProperty(M.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(m){this._writableState&&(this._writableState.destroyed=m)}}),M.prototype.destroy=R.destroy,M.prototype._undestroy=R.undestroy,M.prototype._destroy=function(m,I){this.end(),I(m)}}).call(this,n(2),n(15).setImmediate,n(6))},function(e,t,n){var r=n(26).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function s(l,o,c){if(typeof o=="function")return s(l,null,o);o||(o={}),c=function(M){var A=!1;return function(){if(!A){A=!0;for(var d=arguments.length,C=new Array(d),$=0;$<d;$++)C[$]=arguments[$];M.apply(this,C)}}}(c||i);var u=o.readable||o.readable!==!1&&l.readable,f=o.writable||o.writable!==!1&&l.writable,E=function(){l.writable||h()},w=l._writableState&&l._writableState.finished,h=function(){f=!1,w=!0,u||c.call(l)},g=l._readableState&&l._readableState.endEmitted,b=function(){u=!1,g=!0,f||c.call(l)},R=function(M){c.call(l,M)},j=function(){var M;return u&&!g?(l._readableState&&l._readableState.ended||(M=new r),c.call(l,M)):f&&!w?(l._writableState&&l._writableState.ended||(M=new r),c.call(l,M)):void 0},F=function(){l.req.on("finish",h)};return function(M){return M.setHeader&&typeof M.abort=="function"}(l)?(l.on("complete",h),l.on("abort",j),l.req?F():l.on("request",F)):f&&!l._writableState&&(l.on("end",E),l.on("close",E)),l.on("end",b),l.on("finish",h),o.error!==!1&&l.on("error",R),l.on("close",j),function(){l.removeListener("complete",h),l.removeListener("abort",j),l.removeListener("request",F),l.req&&l.req.removeListener("finish",h),l.removeListener("end",E),l.removeListener("close",E),l.removeListener("finish",h),l.removeListener("end",b),l.removeListener("error",R),l.removeListener("close",j)}}},function(e,t,n){var r=n(58),i=n(3).configs;t.cli=r.levels(i.cli),t.npm=r.levels(i.npm),t.syslog=r.levels(i.syslog),t.addColors=r.levels},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(203)),i=o(n(204)),s=o(n(25)),l=o(n(30));function o(c){return c&&c.__esModule?c:{default:c}}t.default=(0,l.default)(function(c,u,f){return(0,r.default)(c,(0,i.default)((0,s.default)(u)),f)},3),e.exports=t.default},function(e,t,n){class r extends Error{constructor(s,...l){super(`env-var: ${s}`,...l),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="EnvVarError"}}e.exports=r},function(e,t,n){e.exports=function(r){const i=parseInt(r,10);if(isNaN(i)||i.toString(10)!==r)throw new Error("should be a valid integer");return i}},function(e,t,n){e.exports=function(r){const i=parseFloat(r);if(isNaN(i)||i.toString()!==r)throw new Error("should be a valid float");return i}},function(e,t,n){e.exports=function(r){try{return JSON.parse(r)}catch{throw new Error("should be valid (parseable) JSON")}}},function(e,t,n){(function(r){function i(o,c){for(var u=0,f=o.length-1;f>=0;f--){var E=o[f];E==="."?o.splice(f,1):E===".."?(o.splice(f,1),u++):u&&(o.splice(f,1),u--)}if(c)for(;u--;u)o.unshift("..");return o}function s(o,c){if(o.filter)return o.filter(c);for(var u=[],f=0;f<o.length;f++)c(o[f],f,o)&&u.push(o[f]);return u}t.resolve=function(){for(var o="",c=!1,u=arguments.length-1;u>=-1&&!c;u--){var f=u>=0?arguments[u]:r.cwd();if(typeof f!="string")throw new TypeError("Arguments to path.resolve must be strings");f&&(o=f+"/"+o,c=f.charAt(0)==="/")}return(c?"/":"")+(o=i(s(o.split("/"),function(E){return!!E}),!c).join("/"))||"."},t.normalize=function(o){var c=t.isAbsolute(o),u=l(o,-1)==="/";return(o=i(s(o.split("/"),function(f){return!!f}),!c).join("/"))||c||(o="."),o&&u&&(o+="/"),(c?"/":"")+o},t.isAbsolute=function(o){return o.charAt(0)==="/"},t.join=function(){var o=Array.prototype.slice.call(arguments,0);return t.normalize(s(o,function(c,u){if(typeof c!="string")throw new TypeError("Arguments to path.join must be strings");return c}).join("/"))},t.relative=function(o,c){function u(R){for(var j=0;j<R.length&&R[j]==="";j++);for(var F=R.length-1;F>=0&&R[F]==="";F--);return j>F?[]:R.slice(j,F-j+1)}o=t.resolve(o).substr(1),c=t.resolve(c).substr(1);for(var f=u(o.split("/")),E=u(c.split("/")),w=Math.min(f.length,E.length),h=w,g=0;g<w;g++)if(f[g]!==E[g]){h=g;break}var b=[];for(g=h;g<f.length;g++)b.push("..");return(b=b.concat(E.slice(h))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(o){if(typeof o!="string"&&(o+=""),o.length===0)return".";for(var c=o.charCodeAt(0),u=c===47,f=-1,E=!0,w=o.length-1;w>=1;--w)if((c=o.charCodeAt(w))===47){if(!E){f=w;break}}else E=!1;return f===-1?u?"/":".":u&&f===1?"/":o.slice(0,f)},t.basename=function(o,c){var u=function(f){typeof f!="string"&&(f+="");var E,w=0,h=-1,g=!0;for(E=f.length-1;E>=0;--E)if(f.charCodeAt(E)===47){if(!g){w=E+1;break}}else h===-1&&(g=!1,h=E+1);return h===-1?"":f.slice(w,h)}(o);return c&&u.substr(-1*c.length)===c&&(u=u.substr(0,u.length-c.length)),u},t.extname=function(o){typeof o!="string"&&(o+="");for(var c=-1,u=0,f=-1,E=!0,w=0,h=o.length-1;h>=0;--h){var g=o.charCodeAt(h);if(g!==47)f===-1&&(E=!1,f=h+1),g===46?c===-1?c=h:w!==1&&(w=1):c!==-1&&(w=-1);else if(!E){u=h+1;break}}return c===-1||f===-1||w===0||w===1&&c===f-1&&c===u+1?"":o.slice(c,f)};var l="ab".substr(-1)==="b"?function(o,c,u){return o.substr(c,u)}:function(o,c,u){return c<0&&(c=o.length+c),o.substr(c,u)}}).call(this,n(2))},,function(e,t,n){var r=t.format=n(12);t.levels=n(105),Object.defineProperty(r,"align",{value:n(122)}),Object.defineProperty(r,"cli",{value:n(123)}),Object.defineProperty(r,"combine",{value:n(124)}),Object.defineProperty(r,"colorize",{value:n(41)}),Object.defineProperty(r,"json",{value:n(125)}),Object.defineProperty(r,"label",{value:n(128)}),Object.defineProperty(r,"logstash",{value:n(129)}),Object.defineProperty(r,"metadata",{value:n(130)}),Object.defineProperty(r,"padLevels",{value:n(60)}),Object.defineProperty(r,"prettyPrint",{value:n(131)}),Object.defineProperty(r,"printf",{value:n(132)}),Object.defineProperty(r,"simple",{value:n(133)}),Object.defineProperty(r,"splat",{value:n(134)}),Object.defineProperty(r,"timestamp",{value:n(135)}),Object.defineProperty(r,"uncolorize",{value:n(137)})},function(e,t,n){var r=n(106);e.exports=r},function(e,t,n){function r(w){return function(h){if(Array.isArray(h))return i(h)}(w)||function(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}(w)||function(h,g){if(h){if(typeof h=="string")return i(h,g);var b=Object.prototype.toString.call(h).slice(8,-1);if(b==="Object"&&h.constructor&&(b=h.constructor.name),b==="Map"||b==="Set")return Array.from(h);if(b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return i(h,g)}}(w)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
19
|
+
`)):Q=N.stylize("[Circular]","special")),M(V)){if(U&&p.match(/^\d+$/))return Q;(V=JSON.stringify(""+p)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.substr(1,V.length-2),V=N.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=N.stylize(V,"string"))}return V+": "+Q}function g(N){return Array.isArray(N)}function b(N){return typeof N=="boolean"}function R(N){return N===null}function j(N){return typeof N=="number"}function F(N){return typeof N=="string"}function M(N){return N===void 0}function A(N){return d(N)&&y(N)==="[object RegExp]"}function d(N){return typeof N=="object"&&N!==null}function C(N){return d(N)&&y(N)==="[object Date]"}function $(N){return d(N)&&(y(N)==="[object Error]"||N instanceof Error)}function q(N){return typeof N=="function"}function y(N){return Object.prototype.toString.call(N)}function m(N){return N<10?"0"+N.toString(10):N.toString(10)}t.debuglog=function(N){if(M(l)&&(l=r.env.NODE_DEBUG||""),N=N.toUpperCase(),!o[N])if(new RegExp("\\b"+N+"\\b","i").test(l)){var D=r.pid;o[N]=function(){var z=t.format.apply(t,arguments);console.error("%s %d: %s",N,D,z)}}else o[N]=function(){};return o[N]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=g,t.isBoolean=b,t.isNull=R,t.isNullOrUndefined=function(N){return N==null},t.isNumber=j,t.isString=F,t.isSymbol=function(N){return typeof N=="symbol"},t.isUndefined=M,t.isRegExp=A,t.isObject=d,t.isDate=C,t.isError=$,t.isFunction=q,t.isPrimitive=function(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||N===void 0},t.isBuffer=n(107);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(){var N=new Date,D=[m(N.getHours()),m(N.getMinutes()),m(N.getSeconds())].join(":");return[N.getDate(),I[N.getMonth()],D].join(" ")}function L(N,D){return Object.prototype.hasOwnProperty.call(N,D)}t.log=function(){console.log("%s - %s",_(),t.format.apply(t,arguments))},t.inherits=n(108),t._extend=function(N,D){if(!D||!d(D))return N;for(var z=Object.keys(D),O=z.length;O--;)N[z[O]]=D[z[O]];return N};var W=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function B(N,D){if(!N){var z=new Error("Promise was rejected with a falsy value");z.reason=N,N=z}return D(N)}t.promisify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');if(W&&N[W]){var D;if(typeof(D=N[W])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(D,W,{value:D,enumerable:!1,writable:!1,configurable:!0}),D}function D(){for(var z,O,p=new Promise(function(Q,ee){z=Q,O=ee}),U=[],V=0;V<arguments.length;V++)U.push(arguments[V]);U.push(function(Q,ee){Q?O(Q):z(ee)});try{N.apply(this,U)}catch(Q){O(Q)}return p}return Object.setPrototypeOf(D,Object.getPrototypeOf(N)),W&&Object.defineProperty(D,W,{value:D,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(D,i(N))},t.promisify.custom=W,t.callbackify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');function D(){for(var z=[],O=0;O<arguments.length;O++)z.push(arguments[O]);var p=z.pop();if(typeof p!="function")throw new TypeError("The last argument must be of type Function");var U=this,V=function(){return p.apply(U,arguments)};N.apply(this,z).then(function(Q){r.nextTick(V,null,Q)},function(Q){r.nextTick(B,Q,V)})}return Object.setPrototypeOf(D,Object.getPrototypeOf(N)),Object.defineProperties(D,i(N)),D}}).call(this,n(2))},function(e,t,n){e.exports=function(r,i){i||(i={}),typeof i=="function"&&(i={cmp:i});var s,l=typeof i.cycles=="boolean"&&i.cycles,o=i.cmp&&(s=i.cmp,function(u){return function(f,E){var w={key:f,value:u[f]},h={key:E,value:u[E]};return s(w,h)}}),c=[];return function u(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var E,w;if(Array.isArray(f)){for(w="[",E=0;E<f.length;E++)E&&(w+=","),w+=u(f[E])||"null";return w+"]"}if(f===null)return"null";if(c.indexOf(f)!==-1){if(l)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var h=c.push(f)-1,g=Object.keys(f).sort(o&&o(f));for(w="",E=0;E<g.length;E++){var b=g[E],R=u(f[b]);R&&(w&&(w+=","),w+=JSON.stringify(b)+":"+R)}return c.splice(h,1),"{"+w+"}"}}(r)}},function(e,t,n){(function(r){var i=r!==void 0&&r||typeof self<"u"&&self||window,s=Function.prototype.apply;function l(o,c){this._id=o,this._clearFn=c}t.setTimeout=function(){return new l(s.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new l(s.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(o){o&&o.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(o,c){clearTimeout(o._idleTimeoutId),o._idleTimeout=c},t.unenroll=function(o){clearTimeout(o._idleTimeoutId),o._idleTimeout=-1},t._unrefActive=t.active=function(o){clearTimeout(o._idleTimeoutId);var c=o._idleTimeout;c>=0&&(o._idleTimeoutId=setTimeout(function(){o._onTimeout&&o._onTimeout()},c))},n(141),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(6))},function(e,t,n){(function(r){r===void 0||!r.version||r.version.indexOf("v0.")===0||r.version.indexOf("v1.")===0&&r.version.indexOf("v1.8.")!==0?e.exports={nextTick:function(i,s,l,o){if(typeof i!="function")throw new TypeError('"callback" argument must be a function');var c,u,f=arguments.length;switch(f){case 0:case 1:return r.nextTick(i);case 2:return r.nextTick(function(){i.call(null,s)});case 3:return r.nextTick(function(){i.call(null,s,l)});case 4:return r.nextTick(function(){i.call(null,s,l,o)});default:for(c=new Array(f-1),u=0;u<c.length;)c[u++]=arguments[u];return r.nextTick(function(){i.apply(null,c)})}}}:e.exports=r}).call(this,n(2))},function(e,t,n){(function(r){function i(s){return Object.prototype.toString.call(s)}t.isArray=function(s){return Array.isArray?Array.isArray(s):i(s)==="[object Array]"},t.isBoolean=function(s){return typeof s=="boolean"},t.isNull=function(s){return s===null},t.isNullOrUndefined=function(s){return s==null},t.isNumber=function(s){return typeof s=="number"},t.isString=function(s){return typeof s=="string"},t.isSymbol=function(s){return typeof s=="symbol"},t.isUndefined=function(s){return s===void 0},t.isRegExp=function(s){return i(s)==="[object RegExp]"},t.isObject=function(s){return typeof s=="object"&&s!==null},t.isDate=function(s){return i(s)==="[object Date]"},t.isError=function(s){return i(s)==="[object Error]"||s instanceof Error},t.isFunction=function(s){return typeof s=="function"},t.isPrimitive=function(s){return s===null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||typeof s=="symbol"||s===void 0},t.isBuffer=r.isBuffer}).call(this,n(5).Buffer)},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return typeof location<"u"?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return typeof navigator<"u"?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL=`
|
|
20
|
+
`,t.homedir=function(){return"/"}},function(e,t,n){var r=n(58),i=n(61).warn,s=t;s.version=n(138).version,s.transports=n(139),s.config=n(50),s.addColors=r.levels,s.format=r.format,s.createLogger=n(88),s.ExceptionHandler=n(89),s.RejectionHandler=n(93),s.Container=n(210),s.Transport=n(20),s.loggers=new s.Container;var l=s.createLogger();Object.keys(s.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(o){return s[o]=function(){return l[o].apply(l,arguments)}}),Object.defineProperty(s,"level",{get:function(){return l.level},set:function(o){l.level=o}}),Object.defineProperty(s,"exceptions",{get:function(){return l.exceptions}}),["exitOnError"].forEach(function(o){Object.defineProperty(s,o,{get:function(){return l[o]},set:function(c){l[o]=c}})}),Object.defineProperty(s,"default",{get:function(){return{exceptionHandlers:l.exceptionHandlers,rejectionHandlers:l.rejectionHandlers,transports:l.transports}}}),i.deprecated(s,"setLevels"),i.forFunctions(s,"useFormat",["cli"]),i.forProperties(s,"useFormat",["padLevels","stripColors"]),i.forFunctions(s,"deprecated",["addRewriter","addFilter","clone","extend"]),i.forProperties(s,"deprecated",["emitErrs","levelLength"]),i.moved(s,"createLogger","Logger")},function(e,t,n){var r=n(13),i=n(142),s=n(3).LEVEL,l=e.exports=function(){var o=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.call(this,{objectMode:!0,highWaterMark:c.highWaterMark}),this.format=c.format,this.level=c.level,this.handleExceptions=c.handleExceptions,this.handleRejections=c.handleRejections,this.silent=c.silent,c.log&&(this.log=c.log),c.logv&&(this.logv=c.logv),c.close&&(this.close=c.close),this.once("pipe",function(u){o.levels=u.levels,o.parent=u}),this.once("unpipe",function(u){u===o.parent&&(o.parent=null,o.close&&o.close())})};r.inherits(l,i),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);var f=this.level||this.parent&&this.parent.level;if(!f||this.levels[f]>=this.levels[o[s]]){if(o&&!this.format)return this.log(o,u);var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o),this.format.options)}catch(h){E=h}if(E||!w){if(u(),E)throw E;return}return this.log(w,u)}return u(null)},l.prototype._writev=function(o,c){if(this.logv){var u=o.filter(this._accept,this);return u.length?this.logv(u,c):c(null)}for(var f=0;f<o.length;f++)if(this._accept(o[f]))if(!o[f].chunk||this.format){var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o[f].chunk),this.format.options)}catch(h){E=h}if(E||!w){if(o[f].callback(),E)throw c(null),E}else this.log(w,o[f].callback)}else this.log(o[f].chunk,o[f].callback);return c(null)},l.prototype._accept=function(o){var c=o.chunk;if(this.silent)return!1;var u=this.level||this.parent&&this.parent.level;return!(c.exception!==!0&&u&&!(this.levels[u]>=this.levels[c[s]])||!this.handleExceptions&&c.exception===!0)},l.prototype._nop=function(){},e.exports.LegacyTransportStream=n(148)},function(e,t,n){var r,i=typeof Reflect=="object"?Reflect:null,s=i&&typeof i.apply=="function"?i.apply:function(R,j,F){return Function.prototype.apply.call(R,j,F)};r=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:function(R){return Object.getOwnPropertyNames(R)};var l=Number.isNaN||function(R){return R!=R};function o(){o.init.call(this)}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function u(R){return R._maxListeners===void 0?o.defaultMaxListeners:R._maxListeners}function f(R,j,F,M){var A,d,C,$;if(typeof F!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof F);if((d=R._events)===void 0?(d=R._events=Object.create(null),R._eventsCount=0):(d.newListener!==void 0&&(R.emit("newListener",j,F.listener?F.listener:F),d=R._events),C=d[j]),C===void 0)C=d[j]=F,++R._eventsCount;else if(typeof C=="function"?C=d[j]=M?[F,C]:[C,F]:M?C.unshift(F):C.push(F),(A=u(R))>0&&C.length>A&&!C.warned){C.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=R,q.type=j,q.count=C.length,$=q,console&&console.warn&&console.warn($)}return R}function E(){for(var R=[],j=0;j<arguments.length;j++)R.push(arguments[j]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,R))}function w(R,j,F){var M={fired:!1,wrapFn:void 0,target:R,type:j,listener:F},A=E.bind(M);return A.listener=F,M.wrapFn=A,A}function h(R,j,F){var M=R._events;if(M===void 0)return[];var A=M[j];return A===void 0?[]:typeof A=="function"?F?[A.listener||A]:[A]:F?function(d){for(var C=new Array(d.length),$=0;$<C.length;++$)C[$]=d[$].listener||d[$];return C}(A):b(A,A.length)}function g(R){var j=this._events;if(j!==void 0){var F=j[R];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}function b(R,j){for(var F=new Array(j),M=0;M<j;++M)F[M]=R[M];return F}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(R){if(typeof R!="number"||R<0||l(R))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");c=R}}),o.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||l(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(R){for(var j=[],F=1;F<arguments.length;F++)j.push(arguments[F]);var M=R==="error",A=this._events;if(A!==void 0)M=M&&A.error===void 0;else if(!M)return!1;if(M){var d;if(j.length>0&&(d=j[0]),d instanceof Error)throw d;var C=new Error("Unhandled error."+(d?" ("+d.message+")":""));throw C.context=d,C}var $=A[R];if($===void 0)return!1;if(typeof $=="function")s($,this,j);else{var q=$.length,y=b($,q);for(F=0;F<q;++F)s(y[F],this,j)}return!0},o.prototype.addListener=function(R,j){return f(this,R,j,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(R,j){return f(this,R,j,!0)},o.prototype.once=function(R,j){if(typeof j!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof j);return this.on(R,w(this,R,j)),this},o.prototype.prependOnceListener=function(R,j){if(typeof j!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof j);return this.prependListener(R,w(this,R,j)),this},o.prototype.removeListener=function(R,j){var F,M,A,d,C;if(typeof j!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof j);if((M=this._events)===void 0)return this;if((F=M[R])===void 0)return this;if(F===j||F.listener===j)--this._eventsCount==0?this._events=Object.create(null):(delete M[R],M.removeListener&&this.emit("removeListener",R,F.listener||j));else if(typeof F!="function"){for(A=-1,d=F.length-1;d>=0;d--)if(F[d]===j||F[d].listener===j){C=F[d].listener,A=d;break}if(A<0)return this;A===0?F.shift():function($,q){for(;q+1<$.length;q++)$[q]=$[q+1];$.pop()}(F,A),F.length===1&&(M[R]=F[0]),M.removeListener!==void 0&&this.emit("removeListener",R,C||j)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(R){var j,F,M;if((F=this._events)===void 0)return this;if(F.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):F[R]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete F[R]),this;if(arguments.length===0){var A,d=Object.keys(F);for(M=0;M<d.length;++M)(A=d[M])!=="removeListener"&&this.removeAllListeners(A);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(j=F[R])=="function")this.removeListener(R,j);else if(j!==void 0)for(M=j.length-1;M>=0;M--)this.removeListener(R,j[M]);return this},o.prototype.listeners=function(R){return h(this,R,!0)},o.prototype.rawListeners=function(R){return h(this,R,!1)},o.listenerCount=function(R,j){return typeof R.listenerCount=="function"?R.listenerCount(j):g.call(R,j)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(147).Buffer,i=r.isEncoding||function(g){switch((g=""+g)&&g.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 s(g){var b;switch(this.encoding=function(R){var j=function(F){if(!F)return"utf8";for(var M;;)switch(F){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 F;default:if(M)return;F=(""+F).toLowerCase(),M=!0}}(R);if(typeof j!="string"&&(r.isEncoding===i||!i(R)))throw new Error("Unknown encoding: "+R);return j||R}(g),this.encoding){case"utf16le":this.text=c,this.end=u,b=4;break;case"utf8":this.fillLast=o,b=4;break;case"base64":this.text=f,this.end=E,b=3;break;default:return this.write=w,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(b)}function l(g){return g<=127?0:g>>5==6?2:g>>4==14?3:g>>3==30?4:g>>6==2?-1:-2}function o(g){var b=this.lastTotal-this.lastNeed,R=function(j,F,M){if((192&F[0])!=128)return j.lastNeed=0,"�";if(j.lastNeed>1&&F.length>1){if((192&F[1])!=128)return j.lastNeed=1,"�";if(j.lastNeed>2&&F.length>2&&(192&F[2])!=128)return j.lastNeed=2,"�"}}(this,g);return R!==void 0?R:this.lastNeed<=g.length?(g.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(g.copy(this.lastChar,b,0,g.length),void(this.lastNeed-=g.length))}function c(g,b){if((g.length-b)%2==0){var R=g.toString("utf16le",b);if(R){var j=R.charCodeAt(R.length-1);if(j>=55296&&j<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],R.slice(0,-1)}return R}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",b,g.length-1)}function u(g){var b=g&&g.length?this.write(g):"";if(this.lastNeed){var R=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,R)}return b}function f(g,b){var R=(g.length-b)%3;return R===0?g.toString("base64",b):(this.lastNeed=3-R,this.lastTotal=3,R===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",b,g.length-R))}function E(g){var b=g&&g.length?this.write(g):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function w(g){return g.toString(this.encoding)}function h(g){return g&&g.length?this.write(g):""}t.StringDecoder=s,s.prototype.write=function(g){if(g.length===0)return"";var b,R;if(this.lastNeed){if((b=this.fillLast(g))===void 0)return"";R=this.lastNeed,this.lastNeed=0}else R=0;return R<g.length?b?b+this.text(g,R):this.text(g,R):b||""},s.prototype.end=function(g){var b=g&&g.length?this.write(g):"";return this.lastNeed?b+"�":b},s.prototype.text=function(g,b){var R=function(F,M,A){var d=M.length-1;if(d<A)return 0;var C=l(M[d]);return C>=0?(C>0&&(F.lastNeed=C-1),C):--d<A||C===-2?0:(C=l(M[d]))>=0?(C>0&&(F.lastNeed=C-2),C):--d<A||C===-2?0:(C=l(M[d]))>=0?(C>0&&(C===2?C=0:F.lastNeed=C-3),C):0}(this,g,b);if(!this.lastNeed)return g.toString("utf8",b);this.lastTotal=R;var j=g.length-(R-this.lastNeed);return g.copy(this.lastChar,0,j),g.toString("utf8",b,j)},s.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length}},function(e,t,n){var r=n(16),i=Object.keys||function(g){var b=[];for(var R in g)b.push(R);return b};e.exports=E;var s=n(17);s.inherits=n(7);var l=n(69),o=n(48);s.inherits(E,l);for(var c=i(o.prototype),u=0;u<c.length;u++){var f=c[u];E.prototype[f]||(E.prototype[f]=o.prototype[f])}function E(g){if(!(this instanceof E))return new E(g);l.call(this,g),o.call(this,g),g&&g.readable===!1&&(this.readable=!1),g&&g.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,g&&g.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(g){g.end()}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),E.prototype._destroy=function(g,b){this.push(null),this.end(),r.nextTick(b,g)}},function(e,t,n){(function(r){function i(x){var Z=0;return function(){return Z<x.length?{done:!1,value:x[Z++]}:{done:!0}}}var s=typeof Object.defineProperties=="function"?Object.defineProperty:function(x,Z,te){x!=Array.prototype&&x!=Object.prototype&&(x[Z]=te.value)},l=function(x){x=[typeof window=="object"&&window,typeof self=="object"&&self,typeof r=="object"&&r,x];for(var Z=0;Z<x.length;++Z){var te=x[Z];if(te&&te.Math==Math)return te}throw Error("Cannot find global object")}(this);function o(x,Z){if(Z){var te=l;x=x.split(".");for(var ae=0;ae<x.length-1;ae++){var ge=x[ae];ge in te||(te[ge]={}),te=te[ge]}(Z=Z(ae=te[x=x[x.length-1]]))!=ae&&Z!=null&&s(te,x,{configurable:!0,writable:!0,value:Z})}}function c(x){var Z=typeof Symbol<"u"&&Symbol.iterator&&x[Symbol.iterator];return Z?Z.call(x):{next:i(x)}}o("Object.is",function(x){return x||function(Z,te){return Z===te?Z!==0||1/Z==1/te:Z!=Z&&te!=te}}),o("Array.prototype.includes",function(x){return x||function(Z,te){var ae=this;ae instanceof String&&(ae=String(ae));var ge=ae.length;for(0>(te=te||0)&&(te=Math.max(te+ge,0));te<ge;te++){var me=ae[te];if(me===Z||Object.is(me,Z))return!0}return!1}}),o("Promise",function(x){function Z(ue){this.b=0,this.c=void 0,this.a=[];var he=this.f();try{ue(he.resolve,he.reject)}catch(we){he.reject(we)}}function te(){this.a=null}function ae(ue){return ue instanceof Z?ue:new Z(function(he){he(ue)})}if(x)return x;te.prototype.b=function(ue){if(this.a==null){this.a=[];var he=this;this.c(function(){he.g()})}this.a.push(ue)};var ge=l.setTimeout;te.prototype.c=function(ue){ge(ue,0)},te.prototype.g=function(){for(;this.a&&this.a.length;){var ue=this.a;this.a=[];for(var he=0;he<ue.length;++he){var we=ue[he];ue[he]=null;try{we()}catch(_e){this.f(_e)}}}this.a=null},te.prototype.f=function(ue){this.c(function(){throw ue})},Z.prototype.f=function(){function ue(_e){return function(Ee){we||(we=!0,_e.call(he,Ee))}}var he=this,we=!1;return{resolve:ue(this.m),reject:ue(this.g)}},Z.prototype.m=function(ue){if(ue===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(ue instanceof Z)this.o(ue);else{e:switch(typeof ue){case"object":var he=ue!=null;break e;case"function":he=!0;break e;default:he=!1}he?this.l(ue):this.h(ue)}},Z.prototype.l=function(ue){var he=void 0;try{he=ue.then}catch(we){return void this.g(we)}typeof he=="function"?this.u(he,ue):this.h(ue)},Z.prototype.g=function(ue){this.i(2,ue)},Z.prototype.h=function(ue){this.i(1,ue)},Z.prototype.i=function(ue,he){if(this.b!=0)throw Error("Cannot settle("+ue+", "+he+"): Promise already settled in state"+this.b);this.b=ue,this.c=he,this.j()},Z.prototype.j=function(){if(this.a!=null){for(var ue=0;ue<this.a.length;++ue)me.b(this.a[ue]);this.a=null}};var me=new te;return Z.prototype.o=function(ue){var he=this.f();ue.w(he.resolve,he.reject)},Z.prototype.u=function(ue,he){var we=this.f();try{ue.call(he,we.resolve,we.reject)}catch(_e){we.reject(_e)}},Z.prototype.then=function(ue,he){function we(Le,We){return typeof Le=="function"?function(ze){try{_e(Le(ze))}catch(He){Ee(He)}}:We}var _e,Ee,Pe=new Z(function(Le,We){_e=Le,Ee=We});return this.w(we(ue,_e),we(he,Ee)),Pe},Z.prototype.catch=function(ue){return this.then(void 0,ue)},Z.prototype.w=function(ue,he){function we(){switch(_e.b){case 1:ue(_e.c);break;case 2:he(_e.c);break;default:throw Error("Unexpected state: "+_e.b)}}var _e=this;this.a==null?me.b(we):this.a.push(we)},Z.resolve=ae,Z.reject=function(ue){return new Z(function(he,we){we(ue)})},Z.race=function(ue){return new Z(function(he,we){for(var _e=c(ue),Ee=_e.next();!Ee.done;Ee=_e.next())ae(Ee.value).w(he,we)})},Z.all=function(ue){var he=c(ue),we=he.next();return we.done?ae([]):new Z(function(_e,Ee){function Pe(ze){return function(He){Le[ze]=He,--We==0&&_e(Le)}}var Le=[],We=0;do Le.push(void 0),We++,ae(we.value).w(Pe(Le.length-1),Ee),we=he.next();while(!we.done)})},Z});var u=u||{},f=this||self;function E(x,Z){x=x.split("."),Z=Z||f;for(var te=0;te<x.length;te++)if((Z=Z[x[te]])==null)return null;return Z}function w(){}function h(x){var Z=typeof x;if(Z=="object"){if(!x)return"null";if(x instanceof Array)return"array";if(x instanceof Object)return Z;var te=Object.prototype.toString.call(x);if(te=="[object Window]")return"object";if(te=="[object Array]"||typeof x.length=="number"&&x.splice!==void 0&&x.propertyIsEnumerable!==void 0&&!x.propertyIsEnumerable("splice"))return"array";if(te=="[object Function]"||x.call!==void 0&&x.propertyIsEnumerable!==void 0&&!x.propertyIsEnumerable("call"))return"function"}else if(Z=="function"&&x.call===void 0)return"object";return Z}function g(x){var Z=typeof x;return Z=="object"&&x!=null||Z=="function"}function b(x,Z,te){return x.call.apply(x.bind,arguments)}function R(x,Z,te){if(!x)throw Error();if(2<arguments.length){var ae=Array.prototype.slice.call(arguments,2);return function(){var ge=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(ge,ae),x.apply(Z,ge)}}return function(){return x.apply(Z,arguments)}}function j(x,Z,te){return(j=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?b:R).apply(null,arguments)}function F(x,Z){function te(){}te.prototype=Z.prototype,x.S=Z.prototype,x.prototype=new te,x.prototype.constructor=x}function M(){this.a={}}function A(x,Z,te,ae){this.f=x,this.c=Z,this.b=te,this.a=ae}function d(x,Z,te,ae){te=te===void 0?{}:te,this.c=x,this.a=te,this.b=Z,this.f=ae===void 0?null:ae}function C(x,Z,te,ae,ge,me){this.name=x,this.a=ge,this.b=me}function $(x,Z,te){te=te===void 0?{}:te;var ae=ae===void 0?new M:ae;return new A(Z,x,te,ae)}function q(x,Z,te,ae){return ae instanceof C?ae:new C(x,te,ae.b||Z.constructor,ae.f,ae.a,ae.c)}function y(x){this.a=x}function m(x){switch(x){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}}function I(x){if(Error.captureStackTrace)Error.captureStackTrace(this,I);else{var Z=Error().stack;Z&&(this.stack=Z)}x&&(this.message=String(x))}function _(x,Z){for(var te="",ae=(x=x.split("%s")).length-1,ge=0;ge<ae;ge++)te+=x[ge]+(ge<Z.length?Z[ge]:"%s");I.call(this,te+x[ae])}function L(){this.j=null,this.i=[],this.l=0,this.b=W,this.f=this.a=this.h=0,this.c=null,this.g=0}M.prototype.get=function(x){return this.a[x]},M.prototype.f=function(){return Object.keys(this.a)},A.prototype.getRequestMessage=function(){return this.f},A.prototype.getMethodDescriptor=function(){return this.c},A.prototype.getMetadata=function(){return this.b},A.prototype.getCallOptions=function(){return this.a},d.prototype.getResponseMessage=function(){return this.c},d.prototype.getMetadata=function(){return this.a},d.prototype.getMethodDescriptor=function(){return this.b},d.prototype.getStatus=function(){return this.f},y.prototype.on=function(x,Z){return x=="data"||x=="error"?this:this.a.on(x,Z)},y.prototype.removeListener=function(x,Z){return this.a.removeListener(x,Z)},y.prototype.cancel=function(){this.a.cancel()},F(I,Error),I.prototype.name="CustomError",F(_,I),_.prototype.name="AssertionError";var W=0,B=1,N=2,D=3,z=0,O=128;function p(x,Z,te,ae){throw x.b=D,x.j="The stream is broken @"+x.l+"/"+te+". Error: "+ae+`. With input:
|
|
21
|
+
`+Z,Error(x.j)}var U=Array.prototype.indexOf?function(x,Z){return Array.prototype.indexOf.call(x,Z,void 0)}:function(x,Z){if(typeof x=="string")return typeof Z!="string"||Z.length!=1?-1:x.indexOf(Z,0);for(var te=0;te<x.length;te++)if(te in x&&x[te]===Z)return te;return-1},V,Q=String.prototype.trim?function(x){return x.trim()}:function(x){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(x)[1]};function ee(x,Z){return x.indexOf(Z)!=-1}function ne(x,Z){return x<Z?-1:x>Z?1:0}e:{var Y=f.navigator;if(Y){var G=Y.userAgent;if(G){V=G;break e}}V=""}var S="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function T(x){var Z=1;x=x.split(":");for(var te=[];0<Z&&x.length;)te.push(x.shift()),Z--;return x.length&&te.push(x.join(":")),te}function k(x){return k[" "](x),x}k[" "]=w;var J,K,re=ee(V,"Opera"),se=ee(V,"Trident")||ee(V,"MSIE"),fe=ee(V,"Edge"),ve=ee(V,"Gecko")&&!(ee(V.toLowerCase(),"webkit")&&!ee(V,"Edge"))&&!(ee(V,"Trident")||ee(V,"MSIE"))&&!ee(V,"Edge"),Ce=ee(V.toLowerCase(),"webkit")&&!ee(V,"Edge");function Se(){var x=f.document;return x?x.documentMode:void 0}e:{var Ie="",Te=(K=V,ve?/rv:([^\);]+)(\)|;)/.exec(K):fe?/Edge\/([\d\.]+)/.exec(K):se?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(K):Ce?/WebKit\/(\S+)/.exec(K):re?/(?:Version)[ \/]?(\S+)/.exec(K):void 0);if(Te&&(Ie=Te?Te[1]:""),se){var Oe=Se();if(Oe!=null&&Oe>parseFloat(Ie)){J=String(Oe);break e}}J=Ie}var De,qe={};function tt(x){return function(Z,te){var ae=qe;return Object.prototype.hasOwnProperty.call(ae,Z)?ae[Z]:ae[Z]=te(Z)}(x,function(){for(var Z=0,te=Q(String(J)).split("."),ae=Q(String(x)).split("."),ge=Math.max(te.length,ae.length),me=0;Z==0&&me<ge;me++){var ue=te[me]||"",he=ae[me]||"";do{if(ue=/(\d*)(\D*)(.*)/.exec(ue)||["","","",""],he=/(\d*)(\D*)(.*)/.exec(he)||["","","",""],ue[0].length==0&&he[0].length==0)break;Z=ne(ue[1].length==0?0:parseInt(ue[1],10),he[1].length==0?0:parseInt(he[1],10))||ne(ue[2].length==0,he[2].length==0)||ne(ue[2],he[2]),ue=ue[3],he=he[3]}while(Z==0)}return 0<=Z})}if(f.document&&se){var et=Se();De=et||parseInt(J,10)||void 0}else De=void 0;var yt=De;function st(){this.F=this.F}st.prototype.F=!1;var bt,Ot=Object.freeze||function(x){return x};(bt=!se)||(bt=9<=Number(yt));var St=bt,ke=se&&!tt("9"),Mt=function(){if(!f.addEventListener||!Object.defineProperty)return!1;var x=!1,Z=Object.defineProperty({},"passive",{get:function(){x=!0}});try{f.addEventListener("test",w,Z),f.removeEventListener("test",w,Z)}catch{}return x}();function nt(x,Z){this.type=x,this.a=this.target=Z,this.defaultPrevented=!1}function it(x,Z){if(nt.call(this,x?x.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,x){var te=this.type=x.type,ae=x.changedTouches&&x.changedTouches.length?x.changedTouches[0]:null;if(this.target=x.target||x.srcElement,this.a=Z,Z=x.relatedTarget){if(ve){e:{try{k(Z.nodeName);var ge=!0;break e}catch{}ge=!1}ge||(Z=null)}}else te=="mouseover"?Z=x.fromElement:te=="mouseout"&&(Z=x.toElement);this.relatedTarget=Z,ae?(this.clientX=ae.clientX!==void 0?ae.clientX:ae.pageX,this.clientY=ae.clientY!==void 0?ae.clientY:ae.pageY,this.screenX=ae.screenX||0,this.screenY=ae.screenY||0):(this.clientX=x.clientX!==void 0?x.clientX:x.pageX,this.clientY=x.clientY!==void 0?x.clientY:x.pageY,this.screenX=x.screenX||0,this.screenY=x.screenY||0),this.button=x.button,this.key=x.key||"",this.ctrlKey=x.ctrlKey,this.altKey=x.altKey,this.shiftKey=x.shiftKey,this.metaKey=x.metaKey,this.pointerId=x.pointerId||0,this.pointerType=typeof x.pointerType=="string"?x.pointerType:Nt[x.pointerType]||"",this.c=x,x.defaultPrevented&&this.b()}}nt.prototype.b=function(){this.defaultPrevented=!0},F(it,nt);var Nt=Ot({2:"touch",3:"pen",4:"mouse"});it.prototype.b=function(){it.S.b.call(this);var x=this.c;if(x.preventDefault)x.preventDefault();else if(x.returnValue=!1,ke)try{(x.ctrlKey||112<=x.keyCode&&123>=x.keyCode)&&(x.keyCode=-1)}catch{}};var dt="closure_listenable_"+(1e6*Math.random()|0),It=0;function lt(x,Z,te,ae,ge){this.listener=x,this.proxy=null,this.src=Z,this.type=te,this.capture=!!ae,this.A=ge,this.key=++It,this.s=this.v=!1}function Et(x){x.s=!0,x.listener=null,x.proxy=null,x.src=null,x.A=null}function Ue(x){this.src=x,this.a={},this.b=0}function Tt(x,Z){var te=Z.type;if(te in x.a){var ae,ge=x.a[te],me=U(ge,Z);(ae=0<=me)&&Array.prototype.splice.call(ge,me,1),ae&&(Et(Z),x.a[te].length==0&&(delete x.a[te],x.b--))}}function pe(x,Z,te,ae){for(var ge=0;ge<x.length;++ge){var me=x[ge];if(!me.s&&me.listener==Z&&me.capture==!!te&&me.A==ae)return ge}return-1}Ue.prototype.add=function(x,Z,te,ae,ge){var me=x.toString();(x=this.a[me])||(x=this.a[me]=[],this.b++);var ue=pe(x,Z,ae,ge);return-1<ue?(Z=x[ue],te||(Z.v=!1)):((Z=new lt(Z,this.src,me,!!ae,ge)).v=te,x.push(Z)),Z};var P="closure_lm_"+(1e6*Math.random()|0),H={};function X(x,Z,te,ae,ge){if(ae&&ae.once)(function ue(he,we,_e,Ee,Pe){if(Array.isArray(we))for(var Le=0;Le<we.length;Le++)ue(he,we[Le],_e,Ee,Pe);else _e=Me(_e),he&&he[dt]?he.f.add(String(we),_e,!0,g(Ee)?!!Ee.capture:!!Ee,Pe):ie(he,we,_e,!0,Ee,Pe)})(x,Z,te,ae,ge);else if(Array.isArray(Z))for(var me=0;me<Z.length;me++)X(x,Z[me],te,ae,ge);else te=Me(te),x&&x[dt]?x.f.add(String(Z),te,!1,g(ae)?!!ae.capture:!!ae,ge):ie(x,Z,te,!1,ae,ge)}function ie(x,Z,te,ae,ge,me){if(!Z)throw Error("Invalid event type");var ue=g(ge)?!!ge.capture:!!ge,he=le(x);if(he||(x[P]=he=new Ue(x)),!(te=he.add(Z,te,ae,ue,me)).proxy)if(ae=function(){var we=ce,_e=St?function(Ee){return we.call(_e.src,_e.listener,Ee)}:function(Ee){if(!(Ee=we.call(_e.src,_e.listener,Ee)))return Ee};return _e}(),te.proxy=ae,ae.src=x,ae.listener=te,x.addEventListener)Mt||(ge=ue),ge===void 0&&(ge=!1),x.addEventListener(Z.toString(),ae,ge);else if(x.attachEvent)x.attachEvent(de(Z.toString()),ae);else{if(!x.addListener||!x.removeListener)throw Error("addEventListener and attachEvent are unavailable.");x.addListener(ae)}}function oe(x){if(typeof x!="number"&&x&&!x.s){var Z=x.src;if(Z&&Z[dt])Tt(Z.f,x);else{var te=x.type,ae=x.proxy;Z.removeEventListener?Z.removeEventListener(te,ae,x.capture):Z.detachEvent?Z.detachEvent(de(te),ae):Z.addListener&&Z.removeListener&&Z.removeListener(ae),(te=le(Z))?(Tt(te,x),te.b==0&&(te.src=null,Z[P]=null)):Et(x)}}}function de(x){return x in H?H[x]:H[x]="on"+x}function ye(x,Z,te,ae){var ge=!0;if((x=le(x))&&(Z=x.a[Z.toString()]))for(Z=Z.concat(),x=0;x<Z.length;x++){var me=Z[x];me&&me.capture==te&&!me.s&&(me=be(me,ae),ge=ge&&me!==!1)}return ge}function be(x,Z){var te=x.listener,ae=x.A||x.src;return x.v&&oe(x),te.call(ae,Z)}function ce(x,Z){if(x.s)return!0;if(!St){var te=Z||E("window.event");Z=new it(te,this);var ae=!0;if(!(0>te.keyCode||te.returnValue!=null)){e:{var ge=!1;if(te.keyCode==0)try{te.keyCode=-1;break e}catch{ge=!0}(ge||te.returnValue==null)&&(te.returnValue=!0)}for(te=[],ge=Z.a;ge;ge=ge.parentNode)te.push(ge);for(x=x.type,ge=te.length-1;0<=ge;ge--){Z.a=te[ge];var me=ye(te[ge],x,!0,Z);ae=ae&&me}for(ge=0;ge<te.length;ge++)Z.a=te[ge],me=ye(te[ge],x,!1,Z),ae=ae&&me}return ae}return be(x,new it(Z,this))}function le(x){return(x=x[P])instanceof Ue?x:null}var Ae="__closure_events_fn_"+(1e9*Math.random()>>>0);function Me(x){return h(x)=="function"?x:(x[Ae]||(x[Ae]=function(Z){return x.handleEvent(Z)}),x[Ae])}function je(){st.call(this),this.f=new Ue(this),this.N=this}function Fe(x,Z){x=x.N;var te=Z.type||Z;if(typeof Z=="string")Z=new nt(Z,x);else if(Z instanceof nt)Z.target=Z.target||x;else{var ae=Z;(function(ge,me){for(var ue,he,we=1;we<arguments.length;we++){for(ue in he=arguments[we])ge[ue]=he[ue];for(var _e=0;_e<S.length;_e++)ue=S[_e],Object.prototype.hasOwnProperty.call(he,ue)&&(ge[ue]=he[ue])}})(Z=new nt(te,x),ae)}Ke(x=Z.a=x,te,!0,Z),Ke(x,te,!1,Z)}function Ke(x,Z,te,ae){if(Z=x.f.a[String(Z)]){Z=Z.concat();for(var ge=!0,me=0;me<Z.length;++me){var ue=Z[me];if(ue&&!ue.s&&ue.capture==te){var he=ue.listener,we=ue.A||ue.src;ue.v&&Tt(x.f,ue),ge=he.call(we,ae)!==!1&&ge}}}}function $e(x,Z,te){if(h(x)=="function")te&&(x=j(x,te));else{if(!x||typeof x.handleEvent!="function")throw Error("Invalid listener argument");x=j(x.handleEvent,x)}return 2147483647<Number(Z)?-1:f.setTimeout(x,Z||0)}function Ye(x,Z,te){this.reset(x,Z,te,void 0,void 0)}F(je,st),je.prototype[dt]=!0,je.prototype.addEventListener=function(x,Z,te,ae){X(this,x,Z,te,ae)},je.prototype.removeEventListener=function(x,Z,te,ae){(function ge(me,ue,he,we,_e){if(Array.isArray(ue))for(var Ee=0;Ee<ue.length;Ee++)ge(me,ue[Ee],he,we,_e);else we=g(we)?!!we.capture:!!we,he=Me(he),me&&me[dt]?(me=me.f,(ue=String(ue).toString())in me.a&&-1<(he=pe(Ee=me.a[ue],he,we,_e))&&(Et(Ee[he]),Array.prototype.splice.call(Ee,he,1),Ee.length==0&&(delete me.a[ue],me.b--))):me&&(me=le(me))&&(ue=me.a[ue.toString()],me=-1,ue&&(me=pe(ue,he,we,_e)),(he=-1<me?ue[me]:null)&&oe(he))})(this,x,Z,te,ae)},Ye.prototype.a=null;function xe(x){this.f=x,this.b=this.c=this.a=null}function Be(x,Z){this.name=x,this.value=Z}Ye.prototype.reset=function(x,Z,te,ae,ge){delete this.a},Be.prototype.toString=function(){return this.name};var Ge=new Be("SEVERE",1e3),Ze=new Be("CONFIG",700),Xe=new Be("FINE",500);function Je(x){return x.c?x.c:x.a?Je(x.a):(function(Z,te){throw new _("Failure"+(Z?": "+Z:""),Array.prototype.slice.call(arguments,1))}("Root logger has no level set."),null)}xe.prototype.log=function(x,Z,te){if(x.value>=Je(this).value)for(h(Z)=="function"&&(Z=Z()),x=new Ye(x,String(Z),this.f),te&&(x.a=te),te=this;te;)te=te.a};var at,ot={},ut=null;function Qe(x,Z){x&&x.log(Xe,Z,void 0)}function Ct(){}function Pt(x){var Z;return(Z=x.a)||(Z={},Ut(x)&&(Z[0]=!0,Z[1]=!0),Z=x.a=Z),Z}function Bt(){}function kt(x){return(x=Ut(x))?new ActiveXObject(x):new XMLHttpRequest}function Ut(x){if(!x.b&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var Z=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],te=0;te<Z.length;te++){var ae=Z[te];try{return new ActiveXObject(ae),x.b=ae}catch{}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return x.b}function pt(x,Z){this.b={},this.a=[],this.c=0;var te=arguments.length;if(1<te){if(te%2)throw Error("Uneven number of arguments");for(var ae=0;ae<te;ae+=2)this.set(arguments[ae],arguments[ae+1])}else x&&Ft(this,x)}function jt(x){if(x.c!=x.a.length){for(var Z=0,te=0;Z<x.a.length;){var ae=x.a[Z];_t(x.b,ae)&&(x.a[te++]=ae),Z++}x.a.length=te}if(x.c!=x.a.length){var ge={};for(te=Z=0;Z<x.a.length;)_t(ge,ae=x.a[Z])||(x.a[te++]=ae,ge[ae]=1),Z++;x.a.length=te}}function Ft(x,Z){if(Z instanceof pt)for(var te=Z.f(),ae=0;ae<te.length;ae++)x.set(te[ae],Z.get(te[ae]));else for(te in Z)x.set(te,Z[te])}function _t(x,Z){return Object.prototype.hasOwnProperty.call(x,Z)}Ct.prototype.a=null,F(Bt,Ct),at=new Bt,pt.prototype.f=function(){return jt(this),this.a.concat()},pt.prototype.get=function(x,Z){return _t(this.b,x)?this.b[x]:Z},pt.prototype.set=function(x,Z){_t(this.b,x)||(this.c++,this.a.push(x)),this.b[x]=Z},pt.prototype.forEach=function(x,Z){for(var te=this.f(),ae=0;ae<te.length;ae++){var ge=te[ae],me=this.get(ge);x.call(Z,me,ge,this)}};var Kt=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function ht(x){je.call(this),this.headers=new pt,this.D=x||null,this.c=!1,this.C=this.a=null,this.J=this.o="",this.g=0,this.i="",this.h=this.I=this.m=this.G=!1,this.l=0,this.u=null,this.j=zt,this.B=this.H=!1}F(ht,je);var zt="",Xt=ht.prototype,Jt=function x(Z){var te;if(ut||(ut=new xe(""),ot[""]=ut,ut.c=Ze),!(te=ot[Z])){te=new xe(Z);var ae=Z.lastIndexOf("."),ge=Z.substr(ae+1);(ae=x(Z.substr(0,ae))).b||(ae.b={}),ae.b[ge]=te,te.a=ae,ot[Z]=te}return te}("goog.net.XhrIo");Xt.b=Jt;var Qt=/^https?$/i,en=["POST","PUT"];function tn(x,Z,te){if(x.a)throw Error("[goog.net.XhrIo] Object is active with another request="+x.o+"; newUri="+Z);x.o=Z,x.i="",x.g=0,x.J="POST",x.G=!1,x.c=!0,x.a=x.D?kt(x.D):kt(at),x.C=x.D?Pt(x.D):Pt(at),x.a.onreadystatechange=j(x.K,x);try{Qe(x.b,ft(x,"Opening Xhr")),x.I=!0,x.a.open("POST",String(Z),!0),x.I=!1}catch(me){return Qe(x.b,ft(x,"Error opening Xhr: "+me.message)),void Wt(x,me)}Z=te||"";var ae=function(me){e:{for(var ue=nn,he=me.length,we=typeof me=="string"?me.split(""):me,_e=0;_e<he;_e++)if(_e in we&&ue.call(void 0,we[_e],_e,me)){ue=_e;break e}ue=-1}return 0>ue?null:typeof me=="string"?me.charAt(ue):me[ue]}((te=new pt(x.headers)).f()),ge=f.FormData&&Z instanceof f.FormData;!(0<=U(en,"POST"))||ae||ge||te.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),te.forEach(function(me,ue){this.a.setRequestHeader(ue,me)},x),x.j&&(x.a.responseType=x.j),"withCredentials"in x.a&&x.a.withCredentials!==x.H&&(x.a.withCredentials=x.H);try{Gt(x),0<x.l&&(x.B=function(me){return se&&tt(9)&&typeof me.timeout=="number"&&me.ontimeout!==void 0}(x.a),Qe(x.b,ft(x,"Will abort after "+x.l+"ms if incomplete, xhr2 "+x.B)),x.B?(x.a.timeout=x.l,x.a.ontimeout=j(x.L,x)):x.u=$e(x.L,x.l,x)),Qe(x.b,ft(x,"Sending request")),x.m=!0,x.a.send(Z),x.m=!1}catch(me){Qe(x.b,ft(x,"Send error: "+me.message)),Wt(x,me)}}function nn(x){return x.toLowerCase()=="content-type"}function Wt(x,Z){x.c=!1,x.a&&(x.h=!0,x.a.abort(),x.h=!1),x.i=Z,x.g=5,Ht(x),xt(x)}function Ht(x){x.G||(x.G=!0,Fe(x,"complete"),Fe(x,"error"))}function Vt(x){if(x.c&&u!==void 0){if(x.C[1]&&mt(x)==4&&x.getStatus()==2)Qe(x.b,ft(x,"Local request error detected and ignored"));else if(x.m&&mt(x)==4)$e(x.K,0,x);else if(Fe(x,"readystatechange"),mt(x)==4){Qe(x.b,ft(x,"Request complete")),x.c=!1;try{var Z,te=x.getStatus();e:switch(te){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var ae=!0;break e;default:ae=!1}if(!(Z=ae)){var ge;if(ge=te===0){var me=String(x.o).match(Kt)[1]||null;if(!me&&f.self&&f.self.location){var ue=f.self.location.protocol;me=ue.substr(0,ue.length-1)}ge=!Qt.test(me?me.toLowerCase():"")}Z=ge}if(Z)Fe(x,"complete"),Fe(x,"success");else{x.g=6;try{var he=2<mt(x)?x.a.statusText:""}catch(we){Qe(x.b,"Can not get status: "+we.message),he=""}x.i=he+" ["+x.getStatus()+"]",Ht(x)}}finally{xt(x)}}}}function xt(x){if(x.a){Gt(x);var Z=x.a,te=x.C[0]?w:null;x.a=null,x.C=null,Fe(x,"ready");try{Z.onreadystatechange=te}catch(ae){(x=x.b)&&x.log(Ge,"Problem encountered resetting onreadystatechange: "+ae.message,void 0)}}}function Gt(x){x.a&&x.B&&(x.a.ontimeout=null),x.u&&(f.clearTimeout(x.u),x.u=null)}function mt(x){return x.a?x.a.readyState:0}function $t(x,Z){if(x.a&&mt(x)==4)return(x=x.a.getResponseHeader(Z))===null?void 0:x}function ft(x,Z){return Z+" ["+x.J+" "+x.o+" "+x.getStatus()+"]"}ht.prototype.L=function(){u!==void 0&&this.a&&(this.i="Timed out after "+this.l+"ms, aborting",this.g=8,Qe(this.b,ft(this,this.i)),Fe(this,"timeout"),this.abort(8))},ht.prototype.abort=function(x){this.a&&this.c&&(Qe(this.b,ft(this,"Aborting")),this.c=!1,this.h=!0,this.a.abort(),this.h=!1,this.g=x||7,Fe(this,"complete"),Fe(this,"abort"),xt(this))},ht.prototype.K=function(){this.F||(this.I||this.m||this.h?Vt(this):this.O())},ht.prototype.O=function(){Vt(this)},ht.prototype.getStatus=function(){try{return 2<mt(this)?this.a.status:-1}catch{return-1}};var Zt={},Rt=null;function rn(x){var Z=x.length,te=3*Z/4;te%3?te=Math.floor(te):ee("=.",x[Z-1])&&(te=ee("=.",x[Z-2])?te-2:te-1);var ae=new Uint8Array(te),ge=0;return function(me,ue){function he(We){for(;we<me.length;){var ze=me.charAt(we++),He=Rt[ze];if(He!=null)return He;if(!/^[\s\xa0]*$/.test(ze))throw Error("Unknown base64 encoding at char: "+ze)}return We}qt();for(var we=0;;){var _e=he(-1),Ee=he(0),Pe=he(64),Le=he(64);if(Le===64&&_e===-1)break;ue(_e<<2|Ee>>4),Pe!=64&&(ue(Ee<<4&240|Pe>>2),Le!=64&&ue(Pe<<6&192|Le))}}(x,function(me){ae[ge++]=me}),ae.subarray(0,ge)}function qt(){if(!Rt){Rt={};for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Z=["+/=","+/","-_=","-_.","-_"],te=0;5>te;te++){var ae=x.concat(Z[te].split(""));Zt[te]=ae;for(var ge=0;ge<ae.length;ge++){var me=ae[ge];Rt[me]===void 0&&(Rt[me]=ge)}}}}var an=["content-type","grpc-status","grpc-message"];function ct(x){this.a=x.T,this.l=null,this.b=[],this.h=[],this.g=[],this.f=[],this.c=[],this.j=!1,this.i=0,this.m=new L;var Z=this;X(this.a,"readystatechange",function(){var te=Z.a;if(te=te.a?te.a.getResponseHeader("Content-Type"):null){if((te=te.toLowerCase()).lastIndexOf("application/grpc-web-text",0)==0){te=Z.a;try{var ae=te.a?te.a.responseText:""}catch(_e){Qe(te.b,"Can not get responseText: "+_e.message),ae=""}if(ae=(te=ae||"").length-te.length%4,(te=te.substr(Z.i,ae-Z.i)).length==0)return;Z.i=ae,te=rn(te)}else{if(te.lastIndexOf("application/grpc",0)!=0)return void vt(Z,{code:2,message:"Unknown Content-type received.",metadata:{}});te=new Uint8Array(function(_e){try{if(!_e.a)return null;if("response"in _e.a)return _e.a.response;switch(_e.j){case zt:case"text":return _e.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in _e.a)return _e.a.mozResponseArrayBuffer}var Ee=_e.b;return Ee&&Ee.log(Ge,"Response type "+_e.j+" is not supported on this browser",void 0),null}catch(Pe){return Qe(_e.b,"Can not get response: "+Pe.message),null}}(Z.a))}ae=null;try{ae=function(_e,Ee){function Pe(wt){Ne.f++,Ne.a=(Ne.a<<8)+wt,Ne.f==4&&(Ne.b=N,Ne.g=0,typeof Uint8Array<"u"?Ne.c=new Uint8Array(Ne.a):Ne.c=Array(Ne.a),Ne.a==0&&We())}function Le(wt){Ne.c[Ne.g++]=wt,Ne.g==Ne.a&&We()}function We(){var wt={};wt[Ne.h]=Ne.c,Ne.i.push(wt),Ne.b=W}var ze,He,Ne=_e,gt=0;for(ze=Ee instanceof Uint8Array||Ee instanceof Array?Ee:new Uint8Array(Ee);gt<ze.length;){switch(Ne.b){case D:p(Ne,ze,gt,"stream already broken");break;case W:(He=ze[gt])==z||He==O?Ne.h=He:p(Ne,ze,gt,"invalid frame byte"),Ne.b=B,Ne.a=0,Ne.f=0;break;case B:Pe(ze[gt]);break;case N:Le(ze[gt]);break;default:throw Error("unexpected parser state: "+Ne.b)}Ne.l++,gt++}return _e=Ne.i,Ne.i=[],0<_e.length?_e:null}(Z.m,te)}catch{vt(Z,{code:2,message:"Error in parsing response body",metadata:{}})}if(ae)for(te=0;te<ae.length;te++){if(z in ae[te]){var ge=ae[te][z];if(ge)try{var me=Z.l(ge);if(me){ge=Z;for(var ue=me,he=0;he<ge.b.length;he++)ge.b[he](ue)}}catch{vt(Z,{code:2,message:"Error in response deserializer function.",metadata:{}})}}if(O in ae[te]&&0<ae[te][O].length){for(ge="",ue=0;ue<ae[te][O].length;ue++)ge+=String.fromCharCode(ae[te][O][ue]);for(ge=ge.trim().split(`\r
|
|
22
|
+
`),ue={},he=0;he<ge.length;he++){var we=ge[he].indexOf(":");ue[ge[he].substring(0,we).trim()]=ge[he].substring(we+1).trim()}ge=ue,ue=0,he="","grpc-status"in ge&&(ue=ge["grpc-status"],delete ge["grpc-status"]),"grpc-message"in ge&&(he=ge["grpc-message"],delete ge["grpc-message"]),vt(Z,{code:Number(ue),message:he,metadata:ge})}}}}),X(this.a,"complete",function(){var te=Z.a.g,ae="",ge={},me=function(he){var we={};he=(he.a&&mt(he)==4&&he.a.getAllResponseHeaders()||"").split(`\r
|
|
23
|
+
`);for(var _e=0;_e<he.length;_e++)if(!/^[\s\xa0]*$/.test(he[_e])){var Ee=T(he[_e]),Pe=Ee[0];if(typeof(Ee=Ee[1])=="string"){Ee=Ee.trim();var Le=we[Pe]||[];we[Pe]=Le,Le.push(Ee)}}return function(We,ze){var He,Ne={};for(He in We)Ne[He]=ze.call(void 0,We[He],He,We);return Ne}(we,function(We){return We.join(", ")})}(Z.a);if(Object.keys(me).forEach(function(he){an.includes(he)||(ge[he]=me[he])}),function(he,we){for(var _e=0;_e<he.g.length;_e++)he.g[_e](we)}(Z,ge),te!=0){switch(te){case 7:var ue=10;break;case 8:ue=4;break;case 6:ue=function(he){switch(he){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}}(Z.a.getStatus());break;default:ue=14}ue==10&&Z.j||vt(Z,{code:ue,message:m(te),metadata:{}})}else te=!1,"grpc-status"in me&&(ue=$t(Z.a,"grpc-status"),"grpc-message"in me&&(ae=$t(Z.a,"grpc-message")),Number(ue)!=0&&(vt(Z,{code:Number(ue),message:ae,metadata:me}),te=!0)),te||function(he){for(var we=0;we<he.c.length;we++)he.c[we]()}(Z)})}function At(x,Z){-1<(Z=x.indexOf(Z))&&x.splice(Z,1)}function vt(x,Z){if(Z.code!=0)for(var te={code:Z.code,message:decodeURIComponent(Z.message||""),metadata:Z.metadata},ae=0;ae<x.f.length;ae++)x.f[ae](te);for(Z={code:Z.code,details:decodeURIComponent(Z.message||""),metadata:Z.metadata},te=0;te<x.h.length;te++)x.h[te](Z)}function rt(x){this.a=E("format",x)||"text",this.f=E("suppressCorsPreflight",x)||!1,this.c=E("withCredentials",x)||!1,this.b=E("streamInterceptors",x)||[],this.g=E("unaryInterceptors",x)||[]}function Lt(x,Z,te){var ae=Z.getMethodDescriptor(),ge=te+ae.name;(te=new ht).H=x.c;var me=new ct({T:te});if(me.l=ae.b,Ft(te.headers,Z.getMetadata()),x.a=="text"?(te.headers.set("Content-Type","application/grpc-web-text"),te.headers.set("Accept","application/grpc-web-text")):te.headers.set("Content-Type","application/grpc-web+proto"),te.headers.set("X-User-Agent","grpc-web-javascript/0.1"),te.headers.set("X-Grpc-Web","1"),_t(te.headers.b,"deadline")){var ue=te.headers.get("deadline");ue=Math.round(ue-new Date().getTime());var he=te.headers;_t(he.b,"deadline")&&(delete he.b.deadline,he.c--,he.a.length>2*he.c&&jt(he)),1/0===ue&&(ue=0),0<ue&&te.headers.set("grpc-timeout",ue+"m")}if(x.f){jt(he=te.headers),ue={};for(var we=0;we<he.a.length;we++){var _e=he.a[we];ue[_e]=he.b[_e]}(he=te.headers).b={},he.a.length=0,he.c=0;e:{for(Ee in ue){var Ee=!1;break e}Ee=!0}Ee||(ue=function(We){var ze="";return function(He,Ne){for(var gt in He)Ne.call(void 0,He[gt],gt,He)}(We,function(He,Ne){ze+=Ne,ze+=":",ze+=He,ze+=`\r
|
|
24
|
+
`}),ze}(ue),typeof ge=="string"?(Ee=encodeURIComponent("$httpHeaders"),(Ee+=ue=ue!=null?"="+encodeURIComponent(String(ue)):"")&&(0>(ue=ge.indexOf("#"))&&(ue=ge.length),0>(he=ge.indexOf("?"))||he>ue?(he=ue,we=""):we=ge.substring(he+1,ue),ue=(ge=[ge.substr(0,he),we,ge.substr(ue)])[1],ge[1]=Ee?ue?ue+"&"+Ee:Ee:ue,ge=ge[0]+(ge[1]?"?"+ge[1]:"")+ge[2])):ge.a("$httpHeaders",ue))}for(ae=(Z=(0,ae.a)(Z.getRequestMessage())).length,Ee=[0,0,0,0],ue=new Uint8Array(5+ae),he=3;0<=he;he--)Ee[he]=ae%256,ae>>>=8;if(ue.set(new Uint8Array(Ee),1),ue.set(Z,5),Z=ue,x.a=="text"){var Pe;for(x=Z,Pe===void 0&&(Pe=0),qt(),Pe=Zt[Pe],Z=[],ae=0;ae<x.length;ae+=3){_e=x[ae];var Le=(Ee=ae+1<x.length)?x[ae+1]:0;he=_e>>2,_e=(3&_e)<<4|Le>>4,Le=(15&Le)<<2|(we=(ue=ae+2<x.length)?x[ae+2]:0)>>6,we&=63,ue||(we=64,Ee||(Le=64)),Z.push(Pe[he],Pe[_e],Pe[Le]||"",Pe[we]||"")}Z=Z.join("")}else x.a=="binary"&&(te.j="arraybuffer");return tn(te,ge,Z),me}function Yt(x,Z,te){var ae=null,ge=!1;x.on("data",function(me){ae=me}),x.on("error",function(me){me.code==0||ge||(ge=!0,Z(me,null))}),x.on("status",function(me){me.code==0||ge?te&&Z(null,null,me):(ge=!0,Z({code:me.code,message:me.details,metadata:me.metadata},null))}),te&&x.on("metadata",function(me){Z(null,null,null,me)}),x.on("end",function(){ge||(ae==null?Z({code:2,message:"Incomplete response"}):Z(null,ae)),te&&Z(null,null)})}function Dt(x,Z){var te=x;return Z.forEach(function(ae){var ge=te;te=function(me){return ae.intercept(me,ge)}}),te}ct.prototype.on=function(x,Z){return x=="data"?this.b.push(Z):x=="status"?this.h.push(Z):x=="metadata"?this.g.push(Z):x=="end"?this.c.push(Z):x=="error"&&this.f.push(Z),this},ct.prototype.removeListener=function(x,Z){return x=="data"?At(this.b,Z):x=="status"?At(this.h,Z):x=="metadata"?At(this.g,Z):x=="end"?At(this.c,Z):x=="error"&&At(this.f,Z),this},ct.prototype.cancel=function(){this.j=!0,this.a.abort()},ct.prototype.cancel=ct.prototype.cancel,ct.prototype.removeListener=ct.prototype.removeListener,ct.prototype.on=ct.prototype.on,rt.prototype.P=function(x,Z,te,ae,ge){var me=this;ae=q(x,Z,"unary",ae);var ue=x.substr(0,x.length-ae.name.length);return Yt(x=Dt(function(he){return Lt(me,he,ue)},this.b).call(this,$(ae,Z,te)),ge,!1),new y(x)},rt.prototype.M=function(x,Z,te,ae){var ge=this;ae=q(x,Z,"unary",ae);var me=x.substr(0,x.length-ae.name.length);return Dt(function(ue){return new Promise(function(he,we){var _e,Ee,Pe;Yt(Lt(ge,ue,me),function(Le,We,ze,He){Le?we(Le):We?Pe=We:ze?Ee=ze:He?_e=He:(Le=ue.getMethodDescriptor(),he(new d(Pe,Le,We=(We=_e)===void 0?{}:We,Ee===void 0?null:Ee)))},!0)})},this.g).call(this,$(ae,Z,te)).then(function(ue){return ue.getResponseMessage()})},rt.prototype.unaryCall=function(x,Z,te,ae){return this.M(x,Z,te,ae)},rt.prototype.R=function(x,Z,te,ae){var ge=this;ae=q(x,Z,"server_streaming",ae);var me=x.substr(0,x.length-ae.name.length);return Dt(function(ue){return Lt(ge,ue,me)},this.b).call(this,$(ae,Z,te))},rt.prototype.serverStreaming=rt.prototype.R,rt.prototype.unaryCall=rt.prototype.unaryCall,rt.prototype.thenableCall=rt.prototype.M,rt.prototype.rpcCall=rt.prototype.P,e.exports.AbstractClientBase={MethodInfo:function(x,Z,te,ae,ge){this.name=ae,this.b=ge,this.f=x,this.a=Z,this.c=te}},e.exports.GrpcWebClientBase=rt,e.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15},e.exports.MethodDescriptor=C,e.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming"}}).call(this,n(6))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,i=n(152),s=(r=i)&&r.__esModule?r:{default:r};function l(o){return o[Symbol.toStringTag]==="AsyncFunction"}t.default=function(o){if(typeof o!="function")throw new Error("expected a function");return l(o)?(0,s.default)(o):o},t.isAsync=l,t.isAsyncGenerator=function(o){return o[Symbol.toStringTag]==="AsyncGenerator"},t.isAsyncIterable=function(o){return typeof o[Symbol.asyncIterator]=="function"}},function(e,t,n){var r={};function i(l,o,c){c||(c=Error);var u=function(f){var E,w;function h(g,b,R){return f.call(this,function(j,F,M){return typeof o=="string"?o:o(j,F,M)}(g,b,R))||this}return w=f,(E=h).prototype=Object.create(w.prototype),E.prototype.constructor=E,E.__proto__=w,h}(c);u.prototype.name=c.name,u.prototype.code=l,r[l]=u}function s(l,o){if(Array.isArray(l)){var c=l.length;return l=l.map(function(u){return String(u)}),c>2?"one of ".concat(o," ").concat(l.slice(0,c-1).join(", "),", or ")+l[c-1]:c===2?"one of ".concat(o," ").concat(l[0]," or ").concat(l[1]):"of ".concat(o," ").concat(l[0])}return"of ".concat(o," ").concat(String(l))}i("ERR_INVALID_OPT_VALUE",function(l,o){return'The value "'+o+'" is invalid for option "'+l+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(l,o,c){var u,f,E;if(typeof o=="string"&&(f="not ",o.substr(0,f.length)===f)?(u="must not be",o=o.replace(/^not /,"")):u="must be",function(h,g,b){return(b===void 0||b>h.length)&&(b=h.length),h.substring(b-g.length,b)===g}(l," argument"))E="The ".concat(l," ").concat(u," ").concat(s(o,"type"));else{var w=function(h,g,b){return typeof b!="number"&&(b=0),!(b+g.length>h.length)&&h.indexOf(g,b)!==-1}(l,".")?"property":"argument";E='The "'.concat(l,'" ').concat(w," ").concat(u," ").concat(s(o,"type"))}return E+=". Received type ".concat(typeof c)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var i=Object.keys||function(h){var g=[];for(var b in h)g.push(b);return g};e.exports=f;var s=n(77),l=n(81);n(7)(f,s);for(var o=i(l.prototype),c=0;c<o.length;c++){var u=o[c];f.prototype[u]||(f.prototype[u]=l.prototype[u])}function f(h){if(!(this instanceof f))return new f(h);s.call(this,h),l.call(this,h),this.allowHalfOpen=!0,h&&(h.readable===!1&&(this.readable=!1),h.writable===!1&&(this.writable=!1),h.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",E)))}function E(){this._writableState.ended||r.nextTick(w,this)}function w(h){h.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(h){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}})}).call(this,n(2))},function(e,t,n){n.d(t,"a",function(){return l});var r=n(40),i=n(4);const s={"app-id":["app-id must match formant/*"]};class l extends r.a{constructor(c,u={}){super(c,Object.assign({validateHeaders:f=>`${f.get("app-id")}`.startsWith("formant/")?{}:s},u)),this.endpoint=c}getHeaders(){return Object.assign(Object.assign({},l.headers),{"App-ID":`formant/${i.a}`,"App-Version":i.j})}}l.headers={}},function(e,t,n){n(227),e.exports={encode:r=>new TextEncoder().encode(r),decode:r=>new TextDecoder().decode(r)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r,i=r.length){if(!i)throw new Error("arity is undefined");return function(...s){return typeof s[i-1]=="function"?r.apply(this,s):new Promise((l,o)=>{s[i-1]=(c,...u)=>{if(c)return o(c);l(u.length>1?u:u[0])},r.apply(this,s)})}},e.exports=t.default},function(e,t,n){(t=e.exports=n(69)).Stream=t,t.Readable=t,t.Writable=n(48),t.Duplex=n(23),t.Transform=n(72),t.PassThrough=n(165)},function(e,t,n){(t=e.exports=n(77)).Stream=t,t.Readable=t,t.Writable=n(81),t.Duplex=n(27),t.Transform=n(82),t.PassThrough=n(184),t.finished=n(49),t.pipeline=n(185)},function(e,t,n){e.exports=function(r){return r}},function(e,t,n){n.d(t,"a",function(){return i});const r=["password","secret","token","key","buffer"];function i(s,l=new Set){return l.has(s)?"[ RECURSIVE ]":!(o=s)||typeof o!="object"&&typeof o!="function"?s:(l.add(s),Object.keys(s).reduce((c,u)=>(c[u]=r.some(f=>u.toLowerCase().includes(f.toLowerCase()))?"[ REDACTED ]":i(s[u],l),c),{}));var o}},function(e,t){e.exports=r,r.default=r,r.stable=s,r.stableStringify=s;var n=[];function r(l,o,c){(function E(w,h,g,b){var R;if(typeof w=="object"&&w!==null){for(R=0;R<g.length;R++)if(g[R]===w)return b[h]="[Circular]",void n.push([b,h,w]);if(g.push(w),Array.isArray(w))for(R=0;R<w.length;R++)E(w[R],R,g,w);else{var j=Object.keys(w);for(R=0;R<j.length;R++){var F=j[R];E(w[F],F,g,w)}}g.pop()}})(l,"",[],void 0);for(var u=JSON.stringify(l,o,c);n.length!==0;){var f=n.pop();f[0][f[1]]=f[2]}return u}function i(l,o){return l<o?-1:l>o?1:0}function s(l,o,c){for(var u=function w(h,g,b,R){var j;if(typeof h=="object"&&h!==null){for(j=0;j<b.length;j++)if(b[j]===h)return R[g]="[Circular]",void n.push([R,g,h]);if(typeof h.toJSON=="function")return;if(b.push(h),Array.isArray(h))for(j=0;j<h.length;j++)w(h[j],j,b,h);else{var F={},M=Object.keys(h).sort(i);for(j=0;j<M.length;j++){var A=M[j];w(h[A],A,b,h),F[A]=h[A]}if(R===void 0)return F;n.push([R,g,h]),R[g]=F}b.pop()}}(l,"",[],void 0)||l,f=JSON.stringify(u,o,c);n.length!==0;){var E=n.pop();E[0][E[1]]=E[2]}return f}},function(e,t,n){var r=n(16),i=Object.keys||function(g){var b=[];for(var R in g)b.push(R);return b};e.exports=E;var s=Object.create(n(17));s.inherits=n(7);var l=n(143),o=n(62);s.inherits(E,l);for(var c=i(o.prototype),u=0;u<c.length;u++){var f=c[u];E.prototype[f]||(E.prototype[f]=o.prototype[f])}function E(g){if(!(this instanceof E))return new E(g);l.call(this,g),o.call(this,g),g&&g.readable===!1&&(this.readable=!1),g&&g.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,g&&g.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(g){g.end()}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),E.prototype._destroy=function(g,b){this.push(null),this.end(),r.nextTick(b,g)}},function(e,t,n){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function i(o,c){return Object.prototype.hasOwnProperty.call(o,c)}t.assign=function(o){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)i(u,f)&&(o[f]=u[f])}}return o},t.shrinkBuf=function(o,c){return o.length===c?o:o.subarray?o.subarray(0,c):(o.length=c,o)};var s={arraySet:function(o,c,u,f,E){if(c.subarray&&o.subarray)o.set(c.subarray(u,u+f),E);else for(var w=0;w<f;w++)o[E+w]=c[u+w]},flattenChunks:function(o){var c,u,f,E,w,h;for(f=0,c=0,u=o.length;c<u;c++)f+=o[c].length;for(h=new Uint8Array(f),E=0,c=0,u=o.length;c<u;c++)w=o[c],h.set(w,E),E+=w.length;return h}},l={arraySet:function(o,c,u,f,E){for(var w=0;w<f;w++)o[E+w]=c[u+w]},flattenChunks:function(o){return[].concat.apply([],o)}};t.setTyped=function(o){o?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,s)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,l))},t.setTyped(r)},function(e,t,n){e.exports=n(186)},function(e,t,n){n.d(t,"a",function(){return i});var r=n(229);const i=Object(r.a)()},function(e,t,n){n.d(t,"a",function(){return j});var r=n(1),i=n(100),s=n.n(i),l=n(101),o=n.n(l);class c extends Error{constructor(M,A,d){super(`Connection failure: ${M.message}`),this.cause=M,this.url=A,this.retryable=d}}var u=n(10);class f extends Error{constructor(M,A){super(`Invalid headers (${JSON.stringify(M)}) for response: ${A.message}`),this.validationErrors=M,this.responseError=A}}var E=n(8),w=n(0),h=n(11),g=function(F,M,A,d){return new(A||(A=Promise))(function(C,$){function q(I){try{m(d.next(I))}catch(_){$(_)}}function y(I){try{m(d.throw(I))}catch(_){$(_)}}function m(I){var _;I.done?C(I.value):(_=I.value,_ instanceof A?_:new A(function(L){L(_)})).then(q,y)}m((d=d.apply(F,M||[])).next())})},b=function(F,M){var A={};for(var d in F)Object.prototype.hasOwnProperty.call(F,d)&&M.indexOf(d)<0&&(A[d]=F[d]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function"){var C=0;for(d=Object.getOwnPropertySymbols(F);C<d.length;C++)M.indexOf(d[C])<0&&Object.prototype.propertyIsEnumerable.call(F,d[C])&&(A[d[C]]=F[d[C]])}return A};const R=new Set(["GET","HEAD","PUT","QUERY","DELETE","OPTIONS","TRACE"]);class j{constructor(M,A={}){if(this.endpoint=M,this.validateHeaders=d=>A.validateHeaders?A.validateHeaders(d):{},this.verbose=A.verbose!==!1,A.retries!==void 0&&!(A.retries>=0))throw new Error("retries must be positive or zero");if(this.configuredRetries=A.retries,A.timeoutMs!==void 0&&!(A.timeoutMs>0))throw new Error("timeoutMs must be positive");if(this.timeoutMs=A.timeoutMs,A.maxBackoffDelayMs!==void 0&&!(A.maxBackoffDelayMs>0))throw new Error("maxBackoffDelayMs must be positive");this.maxBackoffDelayMs=A.maxBackoffDelayMs||30*r.a.second}getRetries(){return this.configuredRetries!==void 0?this.configuredRetries:this.getConstructor().retries}getHeaders(){return{}}fetch(M,A={}){return g(this,void 0,void 0,function*(){return(yield this.fetchVerbose(M,A)).body})}fetchVerbose(M,A={}){return g(this,void 0,void 0,function*(){let d=100*r.a.millisecond,C=0;const $=this.timeoutMs!==void 0?new Date().getTime()+this.timeoutMs:void 0,q=$?()=>Math.max($-new Date().getTime(),0):void 0;for(;;)try{return yield this.doFetch(M,A,q)}catch(y){const m=y,I=Object(h.a)(m,c);if((q==null?void 0:q())===0||C===this.getRetries()||!I.retryable)throw I;C++,d=Math.min(...q?[q()]:[],d*(2+.1*(Math.random()-.5)),this.maxBackoffDelayMs),yield Object(E.a)(d),this.verbose&&w.a.warn(`Connection failure, retrying. Error: ${m.cause.message}`,{url:m.url,error:m.cause,attempt:C})}})}doFetch(M,A,d){return g(this,void 0,void 0,function*(){const{token:C,json:$,allowUnsafeRetries:q}=A,y=b(A,["token","json","allowUnsafeRetries"]),m=(y.method||"GET").toUpperCase(),I=this.endpoint!==void 0?`${this.endpoint}${M?`/${M}`:""}`:M,_=new s.a;let L;if(d){const W=d();W>0?L=setTimeout(()=>{_.abort()},W):_.abort()}try{let W;yield Promise.race([this.getConstructor().waitForConnectivity(),new Promise(U=>{W=setTimeout(U,d?Math.min(r.a.minute,d()):r.a.minute)})]),W&&clearTimeout(W);const B=yield o()(I,Object.assign(Object.assign({},y),{headers:Object.assign(Object.assign(Object.assign(Object.assign({},$!==!1?{"Content-Type":"application/json"}:{}),this.getHeaders()),y.headers||{}),C!==void 0?{Authorization:`Bearer ${C}`}:{}),signal:_.signal})),N=B.headers.get("content-type")||"",D=N&&N.startsWith("application/json"),z=D?yield B.json():yield B.text(),O=()=>new u.a(m,I,B.status,z,z&&z.validationErrors||{},B.headers);if(!B.ok)throw this.verbose&&w.a[B.status>=500?"warn":"info"]("Response error",{method:m,url:I,statusCode:B.status}),O();const p=this.validateHeaders(B.headers);if(Object.keys(p).length!==0)throw new f(p,O());if(B.status===204)return{body:void 0,headers:B.headers};if($&&!D)throw new Error(`Response is not JSON: ${JSON.stringify(z)}`);return{body:z,headers:B.headers}}catch(W){const B=W,N=q||R.has(m);if(B.message==="Network request failed")throw new c(B,I,N);if(B.type==="system"&&["EAI_AGAIN","ECONNREFUSED","EHOSTUNREACH","ENOTFOUND"].find(p=>p===B.code))throw new c(B,I,!0);if(B.type==="system"&&["ETIMEDOUT","ECONNRESET","ESOCKETTIMEDOUT","EPIPE"].find(p=>p===B.code))throw new c(B,I,N);if(B.name==="AbortError")throw new c(B,I,N);const D=Object(h.a)(B,u.a),{statusCode:z}=D;if(z===408||z===429||z===502||z===503||z===504)throw this.verbose&&!N&&w.a.warn("Potentially unsafe retry"),new c(B,I,!0);const O=this.validateHeaders(D.headers);throw Object.keys(O).length!==0?new f(O,D):(yield this.getConstructor().onResponseError(D),B)}finally{L&&clearTimeout(L)}})}getConstructor(){return Object.getPrototypeOf(this).constructor}}j.retries=8,j.waitForConnectivity=()=>g(void 0,void 0,void 0,function*(){}),j.onResponseError=()=>g(void 0,void 0,void 0,function*(){})},function(e,t,n){function r(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function i(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var s=n(59),l=n(3),o=l.LEVEL,c=l.MESSAGE;s.enabled=!0;var u=/\s+/,f=function(){function E(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,E),b.colors&&this.addColors(b.colors),this.options=b}var w,h,g;return w=E,g=[{key:"addColors",value:function(b){var R=Object.keys(b).reduce(function(j,F){return j[F]=u.test(b[F])?b[F].split(u):b[F],j},{});return E.allColors=Object.assign({},E.allColors||{},R),E.allColors}}],(h=[{key:"addColors",value:function(b){return E.addColors(b)}},{key:"colorize",value:function(b,R,j){if(j===void 0&&(j=R),!Array.isArray(E.allColors[b]))return s[E.allColors[b]](j);for(var F=0,M=E.allColors[b].length;F<M;F++)j=s[E.allColors[b][F]](j);return j}},{key:"transform",value:function(b,R){return R.all&&typeof b[c]=="string"&&(b[c]=this.colorize(b[o],b.level,b[c])),(R.level||R.all||!R.message)&&(b.level=this.colorize(b[o],b.level)),(R.all||R.message)&&(b.message=this.colorize(b[o],b.level,b.message)),b}}])&&i(w.prototype,h),g&&i(w,g),E}();e.exports=function(E){return new f(E)},e.exports.Colorizer=e.exports.Format=f},function(e,t){var n={}.toString;e.exports=Array.isArray||function(r){return n.call(r)=="[object Array]"}},function(e,t,n){(function(r){function i(s){try{if(!r.localStorage)return!1}catch{return!1}var l=r.localStorage[s];return l!=null&&String(l).toLowerCase()==="true"}e.exports=function(s,l){if(i("noDeprecation"))return s;var o=!1;return function(){if(!o){if(i("throwDeprecation"))throw new Error(l);i("traceDeprecation")?console.trace(l):console.warn(l),o=!0}return s.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){var r=n(5),i=r.Buffer;function s(o,c){for(var u in o)c[u]=o[u]}function l(o,c,u){return i(o,c,u)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=l),s(i,l),l.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return i(o,c,u)},l.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var f=i(o);return c!==void 0?typeof u=="string"?f.fill(c,u):f.fill(c):f.fill(0),f},l.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return i(o)},l.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1==0},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,n){var r=n(5),i=r.Buffer;function s(o,c){for(var u in o)c[u]=o[u]}function l(o,c,u){return i(o,c,u)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=l),s(i,l),l.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return i(o,c,u)},l.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var f=i(o);return c!==void 0?typeof u=="string"?f.fill(c,u):f.fill(c):f.fill(0),f},l.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return i(o)},l.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}},function(e,t,n){(function(r,i,s){var l=n(16);function o(m){var I=this;this.next=null,this.entry=null,this.finish=function(){(function(_,L,W){var B=_.entry;for(_.entry=null;B;){var N=B.callback;L.pendingcb--,N(W),B=B.next}L.corkedRequestsFree?L.corkedRequestsFree.next=_:L.corkedRequestsFree=_})(I,m)}}e.exports=M;var c,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:l.nextTick;M.WritableState=F;var f=n(17);f.inherits=n(7);var E={deprecate:n(43)},w=n(70),h=n(47).Buffer,g=s.Uint8Array||function(){},b,R=n(71);function j(){}function F(m,I){c=c||n(23),m=m||{};var _=I instanceof c;this.objectMode=!!m.objectMode,_&&(this.objectMode=this.objectMode||!!m.writableObjectMode);var L=m.highWaterMark,W=m.writableHighWaterMark,B=this.objectMode?16:16384;this.highWaterMark=L||L===0?L:_&&(W||W===0)?W:B,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var N=m.decodeStrings===!1;this.decodeStrings=!N,this.defaultEncoding=m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(D){(function(z,O){var p=z._writableState,U=p.sync,V=p.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(p),O)(function(ee,ne,Y,G,S){--ne.pendingcb,Y?(l.nextTick(S,G),l.nextTick(y,ee,ne),ee._writableState.errorEmitted=!0,ee.emit("error",G)):(S(G),ee._writableState.errorEmitted=!0,ee.emit("error",G),y(ee,ne))})(z,p,U,O,V);else{var Q=$(p);Q||p.corked||p.bufferProcessing||!p.bufferedRequest||C(z,p),U?u(d,z,p,Q,V):d(z,p,Q,V)}})(I,D)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function M(m){if(c=c||n(23),!(b.call(M,this)||this instanceof c))return new M(m);this._writableState=new F(m,this),this.writable=!0,m&&(typeof m.write=="function"&&(this._write=m.write),typeof m.writev=="function"&&(this._writev=m.writev),typeof m.destroy=="function"&&(this._destroy=m.destroy),typeof m.final=="function"&&(this._final=m.final)),w.call(this)}function A(m,I,_,L,W,B,N){I.writelen=L,I.writecb=N,I.writing=!0,I.sync=!0,_?m._writev(W,I.onwrite):m._write(W,B,I.onwrite),I.sync=!1}function d(m,I,_,L){_||function(W,B){B.length===0&&B.needDrain&&(B.needDrain=!1,W.emit("drain"))}(m,I),I.pendingcb--,L(),y(m,I)}function C(m,I){I.bufferProcessing=!0;var _=I.bufferedRequest;if(m._writev&&_&&_.next){var L=I.bufferedRequestCount,W=new Array(L),B=I.corkedRequestsFree;B.entry=_;for(var N=0,D=!0;_;)W[N]=_,_.isBuf||(D=!1),_=_.next,N+=1;W.allBuffers=D,A(m,I,!0,I.length,W,"",B.finish),I.pendingcb++,I.lastBufferedRequest=null,B.next?(I.corkedRequestsFree=B.next,B.next=null):I.corkedRequestsFree=new o(I),I.bufferedRequestCount=0}else{for(;_;){var z=_.chunk,O=_.encoding,p=_.callback;if(A(m,I,!1,I.objectMode?1:z.length,z,O,p),_=_.next,I.bufferedRequestCount--,I.writing)break}_===null&&(I.lastBufferedRequest=null)}I.bufferedRequest=_,I.bufferProcessing=!1}function $(m){return m.ending&&m.length===0&&m.bufferedRequest===null&&!m.finished&&!m.writing}function q(m,I){m._final(function(_){I.pendingcb--,_&&m.emit("error",_),I.prefinished=!0,m.emit("prefinish"),y(m,I)})}function y(m,I){var _=$(I);return _&&(function(L,W){W.prefinished||W.finalCalled||(typeof L._final=="function"?(W.pendingcb++,W.finalCalled=!0,l.nextTick(q,L,W)):(W.prefinished=!0,L.emit("prefinish")))}(m,I),I.pendingcb===0&&(I.finished=!0,m.emit("finish"))),_}f.inherits(M,w),F.prototype.getBuffer=function(){for(var m=this.bufferedRequest,I=[];m;)I.push(m),m=m.next;return I},function(){try{Object.defineProperty(F.prototype,"buffer",{get:E.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(m){return!!b.call(this,m)||this===M&&m&&m._writableState instanceof F}})):b=function(m){return m instanceof this},M.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},M.prototype.write=function(m,I,_){var L,W=this._writableState,B=!1,N=!W.objectMode&&(L=m,h.isBuffer(L)||L instanceof g);return N&&!h.isBuffer(m)&&(m=function(D){return h.from(D)}(m)),typeof I=="function"&&(_=I,I=null),N?I="buffer":I||(I=W.defaultEncoding),typeof _!="function"&&(_=j),W.ended?function(D,z){var O=new Error("write after end");D.emit("error",O),l.nextTick(z,O)}(this,_):(N||function(D,z,O,p){var U=!0,V=!1;return O===null?V=new TypeError("May not write null values to stream"):typeof O=="string"||O===void 0||z.objectMode||(V=new TypeError("Invalid non-string/buffer chunk")),V&&(D.emit("error",V),l.nextTick(p,V),U=!1),U}(this,W,m,_))&&(W.pendingcb++,B=function(D,z,O,p,U,V){if(!O){var Q=function(G,S,T){return G.objectMode||G.decodeStrings===!1||typeof S!="string"||(S=h.from(S,T)),S}(z,p,U);p!==Q&&(O=!0,U="buffer",p=Q)}var ee=z.objectMode?1:p.length;z.length+=ee;var ne=z.length<z.highWaterMark;if(ne||(z.needDrain=!0),z.writing||z.corked){var Y=z.lastBufferedRequest;z.lastBufferedRequest={chunk:p,encoding:U,isBuf:O,callback:V,next:null},Y?Y.next=z.lastBufferedRequest:z.bufferedRequest=z.lastBufferedRequest,z.bufferedRequestCount+=1}else A(D,z,!1,ee,p,U,V);return ne}(this,W,N,m,I,_)),B},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var m=this._writableState;m.corked&&(m.corked--,m.writing||m.corked||m.finished||m.bufferProcessing||!m.bufferedRequest||C(this,m))},M.prototype.setDefaultEncoding=function(m){if(typeof m=="string"&&(m=m.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((m+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+m);return this._writableState.defaultEncoding=m,this},Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(m,I,_){_(new Error("_write() is not implemented"))},M.prototype._writev=null,M.prototype.end=function(m,I,_){var L=this._writableState;typeof m=="function"?(_=m,m=null,I=null):typeof I=="function"&&(_=I,I=null),m!=null&&this.write(m,I),L.corked&&(L.corked=1,this.uncork()),L.ending||L.finished||function(W,B,N){B.ending=!0,y(W,B),N&&(B.finished?l.nextTick(N):W.once("finish",N)),B.ended=!0,W.writable=!1}(this,L,_)},Object.defineProperty(M.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(m){this._writableState&&(this._writableState.destroyed=m)}}),M.prototype.destroy=R.destroy,M.prototype._undestroy=R.undestroy,M.prototype._destroy=function(m,I){this.end(),I(m)}}).call(this,n(2),n(15).setImmediate,n(6))},function(e,t,n){var r=n(26).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function s(l,o,c){if(typeof o=="function")return s(l,null,o);o||(o={}),c=function(M){var A=!1;return function(){if(!A){A=!0;for(var d=arguments.length,C=new Array(d),$=0;$<d;$++)C[$]=arguments[$];M.apply(this,C)}}}(c||i);var u=o.readable||o.readable!==!1&&l.readable,f=o.writable||o.writable!==!1&&l.writable,E=function(){l.writable||h()},w=l._writableState&&l._writableState.finished,h=function(){f=!1,w=!0,u||c.call(l)},g=l._readableState&&l._readableState.endEmitted,b=function(){u=!1,g=!0,f||c.call(l)},R=function(M){c.call(l,M)},j=function(){var M;return u&&!g?(l._readableState&&l._readableState.ended||(M=new r),c.call(l,M)):f&&!w?(l._writableState&&l._writableState.ended||(M=new r),c.call(l,M)):void 0},F=function(){l.req.on("finish",h)};return function(M){return M.setHeader&&typeof M.abort=="function"}(l)?(l.on("complete",h),l.on("abort",j),l.req?F():l.on("request",F)):f&&!l._writableState&&(l.on("end",E),l.on("close",E)),l.on("end",b),l.on("finish",h),o.error!==!1&&l.on("error",R),l.on("close",j),function(){l.removeListener("complete",h),l.removeListener("abort",j),l.removeListener("request",F),l.req&&l.req.removeListener("finish",h),l.removeListener("end",E),l.removeListener("close",E),l.removeListener("finish",h),l.removeListener("end",b),l.removeListener("error",R),l.removeListener("close",j)}}},function(e,t,n){var r=n(58),i=n(3).configs;t.cli=r.levels(i.cli),t.npm=r.levels(i.npm),t.syslog=r.levels(i.syslog),t.addColors=r.levels},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(203)),i=o(n(204)),s=o(n(25)),l=o(n(30));function o(c){return c&&c.__esModule?c:{default:c}}t.default=(0,l.default)(function(c,u,f){return(0,r.default)(c,(0,i.default)((0,s.default)(u)),f)},3),e.exports=t.default},function(e,t,n){class r extends Error{constructor(s,...l){super(`env-var: ${s}`,...l),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="EnvVarError"}}e.exports=r},function(e,t,n){e.exports=function(r){const i=parseInt(r,10);if(isNaN(i)||i.toString(10)!==r)throw new Error("should be a valid integer");return i}},function(e,t,n){e.exports=function(r){const i=parseFloat(r);if(isNaN(i)||i.toString()!==r)throw new Error("should be a valid float");return i}},function(e,t,n){e.exports=function(r){try{return JSON.parse(r)}catch{throw new Error("should be valid (parseable) JSON")}}},function(e,t,n){(function(r){function i(o,c){for(var u=0,f=o.length-1;f>=0;f--){var E=o[f];E==="."?o.splice(f,1):E===".."?(o.splice(f,1),u++):u&&(o.splice(f,1),u--)}if(c)for(;u--;u)o.unshift("..");return o}function s(o,c){if(o.filter)return o.filter(c);for(var u=[],f=0;f<o.length;f++)c(o[f],f,o)&&u.push(o[f]);return u}t.resolve=function(){for(var o="",c=!1,u=arguments.length-1;u>=-1&&!c;u--){var f=u>=0?arguments[u]:r.cwd();if(typeof f!="string")throw new TypeError("Arguments to path.resolve must be strings");f&&(o=f+"/"+o,c=f.charAt(0)==="/")}return(c?"/":"")+(o=i(s(o.split("/"),function(E){return!!E}),!c).join("/"))||"."},t.normalize=function(o){var c=t.isAbsolute(o),u=l(o,-1)==="/";return(o=i(s(o.split("/"),function(f){return!!f}),!c).join("/"))||c||(o="."),o&&u&&(o+="/"),(c?"/":"")+o},t.isAbsolute=function(o){return o.charAt(0)==="/"},t.join=function(){var o=Array.prototype.slice.call(arguments,0);return t.normalize(s(o,function(c,u){if(typeof c!="string")throw new TypeError("Arguments to path.join must be strings");return c}).join("/"))},t.relative=function(o,c){function u(R){for(var j=0;j<R.length&&R[j]==="";j++);for(var F=R.length-1;F>=0&&R[F]==="";F--);return j>F?[]:R.slice(j,F-j+1)}o=t.resolve(o).substr(1),c=t.resolve(c).substr(1);for(var f=u(o.split("/")),E=u(c.split("/")),w=Math.min(f.length,E.length),h=w,g=0;g<w;g++)if(f[g]!==E[g]){h=g;break}var b=[];for(g=h;g<f.length;g++)b.push("..");return(b=b.concat(E.slice(h))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(o){if(typeof o!="string"&&(o+=""),o.length===0)return".";for(var c=o.charCodeAt(0),u=c===47,f=-1,E=!0,w=o.length-1;w>=1;--w)if((c=o.charCodeAt(w))===47){if(!E){f=w;break}}else E=!1;return f===-1?u?"/":".":u&&f===1?"/":o.slice(0,f)},t.basename=function(o,c){var u=function(f){typeof f!="string"&&(f+="");var E,w=0,h=-1,g=!0;for(E=f.length-1;E>=0;--E)if(f.charCodeAt(E)===47){if(!g){w=E+1;break}}else h===-1&&(g=!1,h=E+1);return h===-1?"":f.slice(w,h)}(o);return c&&u.substr(-1*c.length)===c&&(u=u.substr(0,u.length-c.length)),u},t.extname=function(o){typeof o!="string"&&(o+="");for(var c=-1,u=0,f=-1,E=!0,w=0,h=o.length-1;h>=0;--h){var g=o.charCodeAt(h);if(g!==47)f===-1&&(E=!1,f=h+1),g===46?c===-1?c=h:w!==1&&(w=1):c!==-1&&(w=-1);else if(!E){u=h+1;break}}return c===-1||f===-1||w===0||w===1&&c===f-1&&c===u+1?"":o.slice(c,f)};var l="ab".substr(-1)==="b"?function(o,c,u){return o.substr(c,u)}:function(o,c,u){return c<0&&(c=o.length+c),o.substr(c,u)}}).call(this,n(2))},,function(e,t,n){var r=t.format=n(12);t.levels=n(105),Object.defineProperty(r,"align",{value:n(122)}),Object.defineProperty(r,"cli",{value:n(123)}),Object.defineProperty(r,"combine",{value:n(124)}),Object.defineProperty(r,"colorize",{value:n(41)}),Object.defineProperty(r,"json",{value:n(125)}),Object.defineProperty(r,"label",{value:n(128)}),Object.defineProperty(r,"logstash",{value:n(129)}),Object.defineProperty(r,"metadata",{value:n(130)}),Object.defineProperty(r,"padLevels",{value:n(60)}),Object.defineProperty(r,"prettyPrint",{value:n(131)}),Object.defineProperty(r,"printf",{value:n(132)}),Object.defineProperty(r,"simple",{value:n(133)}),Object.defineProperty(r,"splat",{value:n(134)}),Object.defineProperty(r,"timestamp",{value:n(135)}),Object.defineProperty(r,"uncolorize",{value:n(137)})},function(e,t,n){var r=n(106);e.exports=r},function(e,t,n){function r(w){return function(h){if(Array.isArray(h))return i(h)}(w)||function(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}(w)||function(h,g){if(h){if(typeof h=="string")return i(h,g);var b=Object.prototype.toString.call(h).slice(8,-1);if(b==="Object"&&h.constructor&&(b=h.constructor.name),b==="Map"||b==="Set")return Array.from(h);if(b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return i(h,g)}}(w)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
25
25
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function i(w,h){(h==null||h>w.length)&&(h=w.length);for(var g=0,b=new Array(h);g<h;g++)b[g]=w[g];return b}function s(w,h){if(!(w instanceof h))throw new TypeError("Cannot call a class as a function")}function l(w,h){for(var g=0;g<h.length;g++){var b=h[g];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}var o=n(3),c=o.configs,u=o.LEVEL,f=o.MESSAGE,E=function(){function w(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{levels:c.npm.levels};s(this,w),this.paddings=w.paddingForLevels(R.levels,R.filler),this.options=R}var h,g,b;return h=w,b=[{key:"getLongestLevel",value:function(R){var j=Object.keys(R).map(function(F){return F.length});return Math.max.apply(Math,r(j))}},{key:"paddingForLevel",value:function(R,j,F){var M=F+1-R.length,A=Math.floor(M/j.length);return"".concat(j).concat(j.repeat(A)).slice(0,M)}},{key:"paddingForLevels",value:function(R){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ",F=w.getLongestLevel(R);return Object.keys(R).reduce(function(M,A){return M[A]=w.paddingForLevel(A,j,F),M},{})}}],(g=[{key:"transform",value:function(R,j){return R.message="".concat(this.paddings[R[u]]).concat(R.message),R[f]&&(R[f]="".concat(this.paddings[R[u]]).concat(R[f])),R}}])&&l(h.prototype,g),b&&l(h,b),w}();e.exports=function(w){return new E(w)},e.exports.Padder=e.exports.Format=E},function(e,t,n){var r=n(13).format;t.warn={deprecated:function(i){return function(){throw new Error(r("{ %s } was removed in winston@3.0.0.",i))}},useFormat:function(i){return function(){throw new Error([r("{ %s } was removed in winston@3.0.0.",i),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
26
26
|
`))}},forFunctions:function(i,s,l){l.forEach(function(o){i[o]=t.warn[s](o)})},moved:function(i,s,l){function o(){return function(){throw new Error([r("winston.%s was moved in winston@3.0.0.",l),r("Use a winston.%s instead.",s)].join(`
|
|
27
|
-
`))}}Object.defineProperty(i,l,{get:o,set:o})},forProperties:function(i,s,l){l.forEach(function(o){var c=t.warn[s](o);Object.defineProperty(i,o,{get:c,set:c})})}}},function(e,t,n){(function(r,i,s){var l=n(16);function o(m){var I=this;this.next=null,this.entry=null,this.finish=function(){(function(_,L,W){var B=_.entry;for(_.entry=null;B;){var N=B.callback;L.pendingcb--,N(W),B=B.next}L.corkedRequestsFree?L.corkedRequestsFree.next=_:L.corkedRequestsFree=_})(I,m)}}e.exports=M;var c,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:l.nextTick;M.WritableState=F;var f=Object.create(n(17));f.inherits=n(7);var E={deprecate:n(43)},w=n(63),h=n(44).Buffer,g=s.Uint8Array||function(){},b,R=n(64);function j(){}function F(m,I){c=c||n(36),m=m||{};var _=I instanceof c;this.objectMode=!!m.objectMode,_&&(this.objectMode=this.objectMode||!!m.writableObjectMode);var L=m.highWaterMark,W=m.writableHighWaterMark,B=this.objectMode?16:16384;this.highWaterMark=L||L===0?L:_&&(W||W===0)?W:B,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var N=m.decodeStrings===!1;this.decodeStrings=!N,this.defaultEncoding=m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(P){(function(z,O){var p=z._writableState,U=p.sync,V=p.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(p),O)(function(ee,ne,Y,G,S){--ne.pendingcb,Y?(l.nextTick(S,G),l.nextTick(y,ee,ne),ee._writableState.errorEmitted=!0,ee.emit("error",G)):(S(G),ee._writableState.errorEmitted=!0,ee.emit("error",G),y(ee,ne))})(z,p,U,O,V);else{var Q=$(p);Q||p.corked||p.bufferProcessing||!p.bufferedRequest||C(z,p),U?u(d,z,p,Q,V):d(z,p,Q,V)}})(I,P)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function M(m){if(c=c||n(36),!(b.call(M,this)||this instanceof c))return new M(m);this._writableState=new F(m,this),this.writable=!0,m&&(typeof m.write=="function"&&(this._write=m.write),typeof m.writev=="function"&&(this._writev=m.writev),typeof m.destroy=="function"&&(this._destroy=m.destroy),typeof m.final=="function"&&(this._final=m.final)),w.call(this)}function A(m,I,_,L,W,B,N){I.writelen=L,I.writecb=N,I.writing=!0,I.sync=!0,_?m._writev(W,I.onwrite):m._write(W,B,I.onwrite),I.sync=!1}function d(m,I,_,L){_||function(W,B){B.length===0&&B.needDrain&&(B.needDrain=!1,W.emit("drain"))}(m,I),I.pendingcb--,L(),y(m,I)}function C(m,I){I.bufferProcessing=!0;var _=I.bufferedRequest;if(m._writev&&_&&_.next){var L=I.bufferedRequestCount,W=new Array(L),B=I.corkedRequestsFree;B.entry=_;for(var N=0,P=!0;_;)W[N]=_,_.isBuf||(P=!1),_=_.next,N+=1;W.allBuffers=P,A(m,I,!0,I.length,W,"",B.finish),I.pendingcb++,I.lastBufferedRequest=null,B.next?(I.corkedRequestsFree=B.next,B.next=null):I.corkedRequestsFree=new o(I),I.bufferedRequestCount=0}else{for(;_;){var z=_.chunk,O=_.encoding,p=_.callback;if(A(m,I,!1,I.objectMode?1:z.length,z,O,p),_=_.next,I.bufferedRequestCount--,I.writing)break}_===null&&(I.lastBufferedRequest=null)}I.bufferedRequest=_,I.bufferProcessing=!1}function $(m){return m.ending&&m.length===0&&m.bufferedRequest===null&&!m.finished&&!m.writing}function q(m,I){m._final(function(_){I.pendingcb--,_&&m.emit("error",_),I.prefinished=!0,m.emit("prefinish"),y(m,I)})}function y(m,I){var _=$(I);return _&&(function(L,W){W.prefinished||W.finalCalled||(typeof L._final=="function"?(W.pendingcb++,W.finalCalled=!0,l.nextTick(q,L,W)):(W.prefinished=!0,L.emit("prefinish")))}(m,I),I.pendingcb===0&&(I.finished=!0,m.emit("finish"))),_}f.inherits(M,w),F.prototype.getBuffer=function(){for(var m=this.bufferedRequest,I=[];m;)I.push(m),m=m.next;return I},function(){try{Object.defineProperty(F.prototype,"buffer",{get:E.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(m){return!!b.call(this,m)||this===M&&m&&m._writableState instanceof F}})):b=function(m){return m instanceof this},M.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},M.prototype.write=function(m,I,_){var L,W=this._writableState,B=!1,N=!W.objectMode&&(L=m,h.isBuffer(L)||L instanceof g);return N&&!h.isBuffer(m)&&(m=function(P){return h.from(P)}(m)),typeof I=="function"&&(_=I,I=null),N?I="buffer":I||(I=W.defaultEncoding),typeof _!="function"&&(_=j),W.ended?function(P,z){var O=new Error("write after end");P.emit("error",O),l.nextTick(z,O)}(this,_):(N||function(P,z,O,p){var U=!0,V=!1;return O===null?V=new TypeError("May not write null values to stream"):typeof O=="string"||O===void 0||z.objectMode||(V=new TypeError("Invalid non-string/buffer chunk")),V&&(P.emit("error",V),l.nextTick(p,V),U=!1),U}(this,W,m,_))&&(W.pendingcb++,B=function(P,z,O,p,U,V){if(!O){var Q=function(G,S,T){return G.objectMode||G.decodeStrings===!1||typeof S!="string"||(S=h.from(S,T)),S}(z,p,U);p!==Q&&(O=!0,U="buffer",p=Q)}var ee=z.objectMode?1:p.length;z.length+=ee;var ne=z.length<z.highWaterMark;if(ne||(z.needDrain=!0),z.writing||z.corked){var Y=z.lastBufferedRequest;z.lastBufferedRequest={chunk:p,encoding:U,isBuf:O,callback:V,next:null},Y?Y.next=z.lastBufferedRequest:z.bufferedRequest=z.lastBufferedRequest,z.bufferedRequestCount+=1}else A(P,z,!1,ee,p,U,V);return ne}(this,W,N,m,I,_)),B},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var m=this._writableState;m.corked&&(m.corked--,m.writing||m.corked||m.finished||m.bufferProcessing||!m.bufferedRequest||C(this,m))},M.prototype.setDefaultEncoding=function(m){if(typeof m=="string"&&(m=m.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((m+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+m);return this._writableState.defaultEncoding=m,this},Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(m,I,_){_(new Error("_write() is not implemented"))},M.prototype._writev=null,M.prototype.end=function(m,I,_){var L=this._writableState;typeof m=="function"?(_=m,m=null,I=null):typeof I=="function"&&(_=I,I=null),m!=null&&this.write(m,I),L.corked&&(L.corked=1,this.uncork()),L.ending||L.finished||function(W,B,N){B.ending=!0,y(W,B),N&&(B.finished?l.nextTick(N):W.once("finish",N)),B.ended=!0,W.writable=!1}(this,L,_)},Object.defineProperty(M.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(m){this._writableState&&(this._writableState.destroyed=m)}}),M.prototype.destroy=R.destroy,M.prototype._undestroy=R.undestroy,M.prototype._destroy=function(m,I){this.end(),I(m)}}).call(this,n(2),n(15).setImmediate,n(6))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){var r=n(16);function i(s,l){s.emit("error",l)}e.exports={destroy:function(s,l){var o=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(l?l(s):!s||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,s),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!l&&f?(r.nextTick(i,o,f),o._writableState&&(o._writableState.errorEmitted=!0)):l&&l(f)}),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.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t){},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(156)),i=l(n(25)),s=l(n(30));function l(o){return o&&o.__esModule?o:{default:o}}t.default=(0,s.default)(function(o,c,u,f){return(0,r.default)(c)(o,(0,i.default)(u),f)},4),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){function i(...s){if(r!==null){var l=r;r=null,l.apply(this,s)}}return Object.assign(i,r),i},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...i){if(r===null)throw new Error("Callback was already called.");var s=r;r=null,s.apply(this,i)}},e.exports=t.default},function(e,t,n){(function(r,i){var s=n(16);e.exports=A;var l,o=n(42);A.ReadableState=M,n(21).EventEmitter;var c=function(O,p){return O.listeners(p).length},u=n(70),f=n(47).Buffer,E=r.Uint8Array||function(){},w=n(17);w.inherits=n(7);var h=n(162),g=void 0;g=h&&h.debuglog?h.debuglog("stream"):function(){};var b,R=n(163),j=n(71);w.inherits(A,u);var F=["error","close","destroy","pause","resume"];function M(O,p){O=O||{};var U=p instanceof(l=l||n(23));this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.readableObjectMode);var V=O.highWaterMark,Q=O.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=V||V===0?V:U&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new R,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.destroyed=!1,this.defaultEncoding=O.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,O.encoding&&(b||(b=n(22).StringDecoder),this.decoder=new b(O.encoding),this.encoding=O.encoding)}function A(O){if(l=l||n(23),!(this instanceof A))return new A(O);this._readableState=new M(O,this),this.readable=!0,O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy)),u.call(this)}function d(O,p,U,V,Q){var ee,ne=O._readableState;return p===null?(ne.reading=!1,function(Y,G){if(!G.ended){if(G.decoder){var S=G.decoder.end();S&&S.length&&(G.buffer.push(S),G.length+=G.objectMode?1:S.length)}G.ended=!0,q(Y)}}(O,ne)):(Q||(ee=function(Y,G){var S;T=G,f.isBuffer(T)||T instanceof E||typeof G=="string"||G===void 0||Y.objectMode||(S=new TypeError("Invalid non-string/buffer chunk"));var T;return S}(ne,p)),ee?O.emit("error",ee):ne.objectMode||p&&p.length>0?(typeof p=="string"||ne.objectMode||Object.getPrototypeOf(p)===f.prototype||(p=function(Y){return f.from(Y)}(p)),V?ne.endEmitted?O.emit("error",new Error("stream.unshift() after end event")):C(O,ne,p,!0):ne.ended?O.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!U?(p=ne.decoder.write(p),ne.objectMode||p.length!==0?C(O,ne,p,!1):m(O,ne)):C(O,ne,p,!1))):V||(ne.reading=!1)),function(Y){return!Y.ended&&(Y.needReadable||Y.length<Y.highWaterMark||Y.length===0)}(ne)}function C(O,p,U,V){p.flowing&&p.length===0&&!p.sync?(O.emit("data",U),O.read(0)):(p.length+=p.objectMode?1:U.length,V?p.buffer.unshift(U):p.buffer.push(U),p.needReadable&&q(O)),m(O,p)}Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(O){this._readableState&&(this._readableState.destroyed=O)}}),A.prototype.destroy=j.destroy,A.prototype._undestroy=j.undestroy,A.prototype._destroy=function(O,p){this.push(null),p(O)},A.prototype.push=function(O,p){var U,V=this._readableState;return V.objectMode?U=!0:typeof O=="string"&&((p=p||V.defaultEncoding)!==V.encoding&&(O=f.from(O,p),p=""),U=!0),d(this,O,p,!1,U)},A.prototype.unshift=function(O){return d(this,O,null,!0,!1)},A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(O){return b||(b=n(22).StringDecoder),this._readableState.decoder=new b(O),this._readableState.encoding=O,this};function $(O,p){return O<=0||p.length===0&&p.ended?0:p.objectMode?1:O!=O?p.flowing&&p.length?p.buffer.head.data.length:p.length:(O>p.highWaterMark&&(p.highWaterMark=function(U){return U>=8388608?U=8388608:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}(O)),O<=p.length?O:p.ended?p.length:(p.needReadable=!0,0))}function q(O){var p=O._readableState;p.needReadable=!1,p.emittedReadable||(g("emitReadable",p.flowing),p.emittedReadable=!0,p.sync?s.nextTick(y,O):y(O))}function y(O){g("emit readable"),O.emit("readable"),W(O)}function m(O,p){p.readingMore||(p.readingMore=!0,s.nextTick(I,O,p))}function I(O,p){for(var U=p.length;!p.reading&&!p.flowing&&!p.ended&&p.length<p.highWaterMark&&(g("maybeReadMore read 0"),O.read(0),U!==p.length);)U=p.length;p.readingMore=!1}function _(O){g("readable nexttick read 0"),O.read(0)}function L(O,p){p.reading||(g("resume read 0"),O.read(0)),p.resumeScheduled=!1,p.awaitDrain=0,O.emit("resume"),W(O),p.flowing&&!p.reading&&O.read(0)}function W(O){var p=O._readableState;for(g("flow",p.flowing);p.flowing&&O.read()!==null;);}function B(O,p){return p.length===0?null:(p.objectMode?U=p.buffer.shift():!O||O>=p.length?(U=p.decoder?p.buffer.join(""):p.buffer.length===1?p.buffer.head.data:p.buffer.concat(p.length),p.buffer.clear()):U=function(V,Q,ee){var ne;return V<Q.head.data.length?(ne=Q.head.data.slice(0,V),Q.head.data=Q.head.data.slice(V)):ne=V===Q.head.data.length?Q.shift():ee?function(Y,G){var S=G.head,T=1,k=S.data;for(Y-=k.length;S=S.next;){var J=S.data,K=Y>J.length?J.length:Y;if(K===J.length?k+=J:k+=J.slice(0,Y),(Y-=K)===0){K===J.length?(++T,S.next?G.head=S.next:G.head=G.tail=null):(G.head=S,S.data=J.slice(K));break}++T}return G.length-=T,k}(V,Q):function(Y,G){var S=f.allocUnsafe(Y),T=G.head,k=1;for(T.data.copy(S),Y-=T.data.length;T=T.next;){var J=T.data,K=Y>J.length?J.length:Y;if(J.copy(S,S.length-Y,0,K),(Y-=K)===0){K===J.length?(++k,T.next?G.head=T.next:G.head=G.tail=null):(G.head=T,T.data=J.slice(K));break}++k}return G.length-=k,S}(V,Q),ne}(O,p.buffer,p.decoder),U);var U}function N(O){var p=O._readableState;if(p.length>0)throw new Error('"endReadable()" called on non-empty stream');p.endEmitted||(p.ended=!0,s.nextTick(P,p,O))}function P(O,p){O.endEmitted||O.length!==0||(O.endEmitted=!0,p.readable=!1,p.emit("end"))}function z(O,p){for(var U=0,V=O.length;U<V;U++)if(O[U]===p)return U;return-1}A.prototype.read=function(O){g("read",O),O=parseInt(O,10);var p=this._readableState,U=O;if(O!==0&&(p.emittedReadable=!1),O===0&&p.needReadable&&(p.length>=p.highWaterMark||p.ended))return g("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?N(this):q(this),null;if((O=$(O,p))===0&&p.ended)return p.length===0&&N(this),null;var V,Q=p.needReadable;return g("need readable",Q),(p.length===0||p.length-O<p.highWaterMark)&&g("length less than watermark",Q=!0),p.ended||p.reading?g("reading or ended",Q=!1):Q&&(g("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(O=$(U,p))),(V=O>0?B(O,p):null)===null?(p.needReadable=!0,O=0):p.length-=O,p.length===0&&(p.ended||(p.needReadable=!0),U!==O&&p.ended&&N(this)),V!==null&&this.emit("data",V),V},A.prototype._read=function(O){this.emit("error",new Error("_read() is not implemented"))},A.prototype.pipe=function(O,p){var U=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=O;break;case 1:V.pipes=[V.pipes,O];break;default:V.pipes.push(O)}V.pipesCount+=1,g("pipe count=%d opts=%j",V.pipesCount,p);var Q=(!p||p.end!==!1)&&O!==i.stdout&&O!==i.stderr?ne:re;function ee(se,fe){g("onunpipe"),se===U&&fe&&fe.hasUnpiped===!1&&(fe.hasUnpiped=!0,g("cleanup"),O.removeListener("close",J),O.removeListener("finish",K),O.removeListener("drain",Y),O.removeListener("error",k),O.removeListener("unpipe",ee),U.removeListener("end",ne),U.removeListener("end",re),U.removeListener("data",T),G=!0,!V.awaitDrain||O._writableState&&!O._writableState.needDrain||Y())}function ne(){g("onend"),O.end()}V.endEmitted?s.nextTick(Q):U.once("end",Q),O.on("unpipe",ee);var Y=function(se){return function(){var fe=se._readableState;g("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&c(se,"data")&&(fe.flowing=!0,W(se))}}(U);O.on("drain",Y);var G=!1,S=!1;function T(se){g("ondata"),S=!1,O.write(se)!==!1||S||((V.pipesCount===1&&V.pipes===O||V.pipesCount>1&&z(V.pipes,O)!==-1)&&!G&&(g("false write response, pause",U._readableState.awaitDrain),U._readableState.awaitDrain++,S=!0),U.pause())}function k(se){g("onerror",se),re(),O.removeListener("error",k),c(O,"error")===0&&O.emit("error",se)}function J(){O.removeListener("finish",K),re()}function K(){g("onfinish"),O.removeListener("close",J),re()}function re(){g("unpipe"),U.unpipe(O)}return U.on("data",T),function(se,fe,ve){if(typeof se.prependListener=="function")return se.prependListener(fe,ve);se._events&&se._events[fe]?o(se._events[fe])?se._events[fe].unshift(ve):se._events[fe]=[ve,se._events[fe]]:se.on(fe,ve)}(O,"error",k),O.once("close",J),O.once("finish",K),O.emit("pipe",U),V.flowing||(g("pipe resume"),U.resume()),O},A.prototype.unpipe=function(O){var p=this._readableState,U={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return O&&O!==p.pipes||(O||(O=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,O&&O.emit("unpipe",this,U)),this;if(!O){var V=p.pipes,Q=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var ee=0;ee<Q;ee++)V[ee].emit("unpipe",this,U);return this}var ne=z(p.pipes,O);return ne===-1||(p.pipes.splice(ne,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),O.emit("unpipe",this,U)),this},A.prototype.on=function(O,p){var U=u.prototype.on.call(this,O,p);if(O==="data")this._readableState.flowing!==!1&&this.resume();else if(O==="readable"){var V=this._readableState;V.endEmitted||V.readableListening||(V.readableListening=V.needReadable=!0,V.emittedReadable=!1,V.reading?V.length&&q(this):s.nextTick(_,this))}return U},A.prototype.addListener=A.prototype.on,A.prototype.resume=function(){var O=this._readableState;return O.flowing||(g("resume"),O.flowing=!0,function(p,U){U.resumeScheduled||(U.resumeScheduled=!0,s.nextTick(L,p,U))}(this,O)),this},A.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this},A.prototype.wrap=function(O){var p=this,U=this._readableState,V=!1;for(var Q in O.on("end",function(){if(g("wrapped end"),U.decoder&&!U.ended){var ne=U.decoder.end();ne&&ne.length&&p.push(ne)}p.push(null)}),O.on("data",function(ne){g("wrapped data"),U.decoder&&(ne=U.decoder.write(ne)),U.objectMode&&ne==null||(U.objectMode||ne&&ne.length)&&(p.push(ne)||(V=!0,O.pause()))}),O)this[Q]===void 0&&typeof O[Q]=="function"&&(this[Q]=function(ne){return function(){return O[ne].apply(O,arguments)}}(Q));for(var ee=0;ee<F.length;ee++)O.on(F[ee],this.emit.bind(this,F[ee]));return this._read=function(ne){g("wrapped _read",ne),V&&(V=!1,O.resume())},this},Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),A._fromList=B}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){var r=n(16);function i(s,l){s.emit("error",l)}e.exports={destroy:function(s,l){var o=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(l?l(s):!s||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,s),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!l&&f?(r.nextTick(i,o,f),o._writableState&&(o._writableState.errorEmitted=!0)):l&&l(f)}),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.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){e.exports=l;var r=n(23),i=n(17);function s(u,f){var E=this._transformState;E.transforming=!1;var w=E.writecb;if(!w)return this.emit("error",new Error("write callback called multiple times"));E.writechunk=null,E.writecb=null,f!=null&&this.push(f),w(u);var h=this._readableState;h.reading=!1,(h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}function l(u){if(!(this instanceof l))return new l(u);r.call(this,u),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",o)}function o(){var u=this;typeof this._flush=="function"?this._flush(function(f,E){c(u,f,E)}):c(this,null,null)}function c(u,f,E){if(f)return u.emit("error",f);if(E!=null&&u.push(E),u._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(u._transformState.transforming)throw new Error("Calling transform done when still transforming");return u.push(null)}i.inherits=n(7),i.inherits(l,r),l.prototype.push=function(u,f){return this._transformState.needTransform=!1,r.prototype.push.call(this,u,f)},l.prototype._transform=function(u,f,E){throw new Error("_transform() is not implemented")},l.prototype._write=function(u,f,E){var w=this._transformState;if(w.writecb=E,w.writechunk=u,w.writeencoding=f,!w.transforming){var h=this._readableState;(w.needTransform||h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}},l.prototype._read=function(u){var f=this._transformState;f.writechunk!==null&&f.writecb&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},l.prototype._destroy=function(u,f){var E=this;r.prototype._destroy.call(this,u,function(w){f(w),E.emit("close")})}},function(e,t,n){e.exports=n(48)},function(e,t,n){(function(r){var i=n(170);function s(y,m){if(y===m)return 0;for(var I=y.length,_=m.length,L=0,W=Math.min(I,_);L<W;++L)if(y[L]!==m[L]){I=y[L],_=m[L];break}return I<_?-1:_<I?1:0}function l(y){return r.Buffer&&typeof r.Buffer.isBuffer=="function"?r.Buffer.isBuffer(y):!(y==null||!y._isBuffer)}var o=n(13),c=Object.prototype.hasOwnProperty,u=Array.prototype.slice,f=function(){}.name==="foo";function E(y){return Object.prototype.toString.call(y)}function w(y){return!l(y)&&typeof r.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(y):!!y&&(y instanceof DataView||!!(y.buffer&&y.buffer instanceof ArrayBuffer)))}var h=e.exports=M,g=/\s*function\s+([^\(\s]*)\s*/;function b(y){if(o.isFunction(y)){if(f)return y.name;var m=y.toString().match(g);return m&&m[1]}}function R(y,m){return typeof y=="string"?y.length<m?y:y.slice(0,m):y}function j(y){if(f||!o.isFunction(y))return o.inspect(y);var m=b(y);return"[Function"+(m?": "+m:"")+"]"}function F(y,m,I,_,L){throw new h.AssertionError({message:I,actual:y,expected:m,operator:_,stackStartFunction:L})}function M(y,m){y||F(y,!0,m,"==",h.ok)}function A(y,m,I,_){if(y===m)return!0;if(l(y)&&l(m))return s(y,m)===0;if(o.isDate(y)&&o.isDate(m))return y.getTime()===m.getTime();if(o.isRegExp(y)&&o.isRegExp(m))return y.source===m.source&&y.global===m.global&&y.multiline===m.multiline&&y.lastIndex===m.lastIndex&&y.ignoreCase===m.ignoreCase;if(y!==null&&typeof y=="object"||m!==null&&typeof m=="object"){if(w(y)&&w(m)&&E(y)===E(m)&&!(y instanceof Float32Array||y instanceof Float64Array))return s(new Uint8Array(y.buffer),new Uint8Array(m.buffer))===0;if(l(y)!==l(m))return!1;var L=(_=_||{actual:[],expected:[]}).actual.indexOf(y);return L!==-1&&L===_.expected.indexOf(m)||(_.actual.push(y),_.expected.push(m),function(W,B,N,P){if(W==null||B==null)return!1;if(o.isPrimitive(W)||o.isPrimitive(B))return W===B;if(N&&Object.getPrototypeOf(W)!==Object.getPrototypeOf(B))return!1;var z=d(W),O=d(B);if(z&&!O||!z&&O)return!1;if(z)return W=u.call(W),B=u.call(B),A(W,B,N);var p,U,V=q(W),Q=q(B);if(V.length!==Q.length)return!1;for(V.sort(),Q.sort(),U=V.length-1;U>=0;U--)if(V[U]!==Q[U])return!1;for(U=V.length-1;U>=0;U--)if(p=V[U],!A(W[p],B[p],N,P))return!1;return!0}(y,m,I,_))}return I?y===m:y==m}function d(y){return Object.prototype.toString.call(y)=="[object Arguments]"}function C(y,m){if(!y||!m)return!1;if(Object.prototype.toString.call(m)=="[object RegExp]")return m.test(y);try{if(y instanceof m)return!0}catch{}return!Error.isPrototypeOf(m)&&m.call({},y)===!0}function $(y,m,I,_){var L;if(typeof m!="function")throw new TypeError('"block" argument must be a function');typeof I=="string"&&(_=I,I=null),L=function(N){var P;try{N()}catch(z){P=z}return P}(m),_=(I&&I.name?" ("+I.name+").":".")+(_?" "+_:"."),y&&!L&&F(L,I,"Missing expected exception"+_);var W=typeof _=="string",B=!y&&L&&!I;if((!y&&o.isError(L)&&W&&C(L,I)||B)&&F(L,I,"Got unwanted exception"+_),y&&L&&I&&!C(L,I)||!y&&L)throw L}h.AssertionError=function(y){this.name="AssertionError",this.actual=y.actual,this.expected=y.expected,this.operator=y.operator,y.message?(this.message=y.message,this.generatedMessage=!1):(this.message=function(N){return R(j(N.actual),128)+" "+N.operator+" "+R(j(N.expected),128)}(this),this.generatedMessage=!0);var m=y.stackStartFunction||F;if(Error.captureStackTrace)Error.captureStackTrace(this,m);else{var I=new Error;if(I.stack){var _=I.stack,L=b(m),W=_.indexOf(`
|
|
27
|
+
`))}}Object.defineProperty(i,l,{get:o,set:o})},forProperties:function(i,s,l){l.forEach(function(o){var c=t.warn[s](o);Object.defineProperty(i,o,{get:c,set:c})})}}},function(e,t,n){(function(r,i,s){var l=n(16);function o(m){var I=this;this.next=null,this.entry=null,this.finish=function(){(function(_,L,W){var B=_.entry;for(_.entry=null;B;){var N=B.callback;L.pendingcb--,N(W),B=B.next}L.corkedRequestsFree?L.corkedRequestsFree.next=_:L.corkedRequestsFree=_})(I,m)}}e.exports=M;var c,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:l.nextTick;M.WritableState=F;var f=Object.create(n(17));f.inherits=n(7);var E={deprecate:n(43)},w=n(63),h=n(44).Buffer,g=s.Uint8Array||function(){},b,R=n(64);function j(){}function F(m,I){c=c||n(36),m=m||{};var _=I instanceof c;this.objectMode=!!m.objectMode,_&&(this.objectMode=this.objectMode||!!m.writableObjectMode);var L=m.highWaterMark,W=m.writableHighWaterMark,B=this.objectMode?16:16384;this.highWaterMark=L||L===0?L:_&&(W||W===0)?W:B,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var N=m.decodeStrings===!1;this.decodeStrings=!N,this.defaultEncoding=m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(D){(function(z,O){var p=z._writableState,U=p.sync,V=p.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(p),O)(function(ee,ne,Y,G,S){--ne.pendingcb,Y?(l.nextTick(S,G),l.nextTick(y,ee,ne),ee._writableState.errorEmitted=!0,ee.emit("error",G)):(S(G),ee._writableState.errorEmitted=!0,ee.emit("error",G),y(ee,ne))})(z,p,U,O,V);else{var Q=$(p);Q||p.corked||p.bufferProcessing||!p.bufferedRequest||C(z,p),U?u(d,z,p,Q,V):d(z,p,Q,V)}})(I,D)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function M(m){if(c=c||n(36),!(b.call(M,this)||this instanceof c))return new M(m);this._writableState=new F(m,this),this.writable=!0,m&&(typeof m.write=="function"&&(this._write=m.write),typeof m.writev=="function"&&(this._writev=m.writev),typeof m.destroy=="function"&&(this._destroy=m.destroy),typeof m.final=="function"&&(this._final=m.final)),w.call(this)}function A(m,I,_,L,W,B,N){I.writelen=L,I.writecb=N,I.writing=!0,I.sync=!0,_?m._writev(W,I.onwrite):m._write(W,B,I.onwrite),I.sync=!1}function d(m,I,_,L){_||function(W,B){B.length===0&&B.needDrain&&(B.needDrain=!1,W.emit("drain"))}(m,I),I.pendingcb--,L(),y(m,I)}function C(m,I){I.bufferProcessing=!0;var _=I.bufferedRequest;if(m._writev&&_&&_.next){var L=I.bufferedRequestCount,W=new Array(L),B=I.corkedRequestsFree;B.entry=_;for(var N=0,D=!0;_;)W[N]=_,_.isBuf||(D=!1),_=_.next,N+=1;W.allBuffers=D,A(m,I,!0,I.length,W,"",B.finish),I.pendingcb++,I.lastBufferedRequest=null,B.next?(I.corkedRequestsFree=B.next,B.next=null):I.corkedRequestsFree=new o(I),I.bufferedRequestCount=0}else{for(;_;){var z=_.chunk,O=_.encoding,p=_.callback;if(A(m,I,!1,I.objectMode?1:z.length,z,O,p),_=_.next,I.bufferedRequestCount--,I.writing)break}_===null&&(I.lastBufferedRequest=null)}I.bufferedRequest=_,I.bufferProcessing=!1}function $(m){return m.ending&&m.length===0&&m.bufferedRequest===null&&!m.finished&&!m.writing}function q(m,I){m._final(function(_){I.pendingcb--,_&&m.emit("error",_),I.prefinished=!0,m.emit("prefinish"),y(m,I)})}function y(m,I){var _=$(I);return _&&(function(L,W){W.prefinished||W.finalCalled||(typeof L._final=="function"?(W.pendingcb++,W.finalCalled=!0,l.nextTick(q,L,W)):(W.prefinished=!0,L.emit("prefinish")))}(m,I),I.pendingcb===0&&(I.finished=!0,m.emit("finish"))),_}f.inherits(M,w),F.prototype.getBuffer=function(){for(var m=this.bufferedRequest,I=[];m;)I.push(m),m=m.next;return I},function(){try{Object.defineProperty(F.prototype,"buffer",{get:E.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(m){return!!b.call(this,m)||this===M&&m&&m._writableState instanceof F}})):b=function(m){return m instanceof this},M.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},M.prototype.write=function(m,I,_){var L,W=this._writableState,B=!1,N=!W.objectMode&&(L=m,h.isBuffer(L)||L instanceof g);return N&&!h.isBuffer(m)&&(m=function(D){return h.from(D)}(m)),typeof I=="function"&&(_=I,I=null),N?I="buffer":I||(I=W.defaultEncoding),typeof _!="function"&&(_=j),W.ended?function(D,z){var O=new Error("write after end");D.emit("error",O),l.nextTick(z,O)}(this,_):(N||function(D,z,O,p){var U=!0,V=!1;return O===null?V=new TypeError("May not write null values to stream"):typeof O=="string"||O===void 0||z.objectMode||(V=new TypeError("Invalid non-string/buffer chunk")),V&&(D.emit("error",V),l.nextTick(p,V),U=!1),U}(this,W,m,_))&&(W.pendingcb++,B=function(D,z,O,p,U,V){if(!O){var Q=function(G,S,T){return G.objectMode||G.decodeStrings===!1||typeof S!="string"||(S=h.from(S,T)),S}(z,p,U);p!==Q&&(O=!0,U="buffer",p=Q)}var ee=z.objectMode?1:p.length;z.length+=ee;var ne=z.length<z.highWaterMark;if(ne||(z.needDrain=!0),z.writing||z.corked){var Y=z.lastBufferedRequest;z.lastBufferedRequest={chunk:p,encoding:U,isBuf:O,callback:V,next:null},Y?Y.next=z.lastBufferedRequest:z.bufferedRequest=z.lastBufferedRequest,z.bufferedRequestCount+=1}else A(D,z,!1,ee,p,U,V);return ne}(this,W,N,m,I,_)),B},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var m=this._writableState;m.corked&&(m.corked--,m.writing||m.corked||m.finished||m.bufferProcessing||!m.bufferedRequest||C(this,m))},M.prototype.setDefaultEncoding=function(m){if(typeof m=="string"&&(m=m.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((m+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+m);return this._writableState.defaultEncoding=m,this},Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(m,I,_){_(new Error("_write() is not implemented"))},M.prototype._writev=null,M.prototype.end=function(m,I,_){var L=this._writableState;typeof m=="function"?(_=m,m=null,I=null):typeof I=="function"&&(_=I,I=null),m!=null&&this.write(m,I),L.corked&&(L.corked=1,this.uncork()),L.ending||L.finished||function(W,B,N){B.ending=!0,y(W,B),N&&(B.finished?l.nextTick(N):W.once("finish",N)),B.ended=!0,W.writable=!1}(this,L,_)},Object.defineProperty(M.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(m){this._writableState&&(this._writableState.destroyed=m)}}),M.prototype.destroy=R.destroy,M.prototype._undestroy=R.undestroy,M.prototype._destroy=function(m,I){this.end(),I(m)}}).call(this,n(2),n(15).setImmediate,n(6))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){var r=n(16);function i(s,l){s.emit("error",l)}e.exports={destroy:function(s,l){var o=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(l?l(s):!s||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,s),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!l&&f?(r.nextTick(i,o,f),o._writableState&&(o._writableState.errorEmitted=!0)):l&&l(f)}),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.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t){},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(156)),i=l(n(25)),s=l(n(30));function l(o){return o&&o.__esModule?o:{default:o}}t.default=(0,s.default)(function(o,c,u,f){return(0,r.default)(c)(o,(0,i.default)(u),f)},4),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){function i(...s){if(r!==null){var l=r;r=null,l.apply(this,s)}}return Object.assign(i,r),i},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...i){if(r===null)throw new Error("Callback was already called.");var s=r;r=null,s.apply(this,i)}},e.exports=t.default},function(e,t,n){(function(r,i){var s=n(16);e.exports=A;var l,o=n(42);A.ReadableState=M,n(21).EventEmitter;var c=function(O,p){return O.listeners(p).length},u=n(70),f=n(47).Buffer,E=r.Uint8Array||function(){},w=n(17);w.inherits=n(7);var h=n(162),g=void 0;g=h&&h.debuglog?h.debuglog("stream"):function(){};var b,R=n(163),j=n(71);w.inherits(A,u);var F=["error","close","destroy","pause","resume"];function M(O,p){O=O||{};var U=p instanceof(l=l||n(23));this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.readableObjectMode);var V=O.highWaterMark,Q=O.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=V||V===0?V:U&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new R,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.destroyed=!1,this.defaultEncoding=O.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,O.encoding&&(b||(b=n(22).StringDecoder),this.decoder=new b(O.encoding),this.encoding=O.encoding)}function A(O){if(l=l||n(23),!(this instanceof A))return new A(O);this._readableState=new M(O,this),this.readable=!0,O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy)),u.call(this)}function d(O,p,U,V,Q){var ee,ne=O._readableState;return p===null?(ne.reading=!1,function(Y,G){if(!G.ended){if(G.decoder){var S=G.decoder.end();S&&S.length&&(G.buffer.push(S),G.length+=G.objectMode?1:S.length)}G.ended=!0,q(Y)}}(O,ne)):(Q||(ee=function(Y,G){var S;T=G,f.isBuffer(T)||T instanceof E||typeof G=="string"||G===void 0||Y.objectMode||(S=new TypeError("Invalid non-string/buffer chunk"));var T;return S}(ne,p)),ee?O.emit("error",ee):ne.objectMode||p&&p.length>0?(typeof p=="string"||ne.objectMode||Object.getPrototypeOf(p)===f.prototype||(p=function(Y){return f.from(Y)}(p)),V?ne.endEmitted?O.emit("error",new Error("stream.unshift() after end event")):C(O,ne,p,!0):ne.ended?O.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!U?(p=ne.decoder.write(p),ne.objectMode||p.length!==0?C(O,ne,p,!1):m(O,ne)):C(O,ne,p,!1))):V||(ne.reading=!1)),function(Y){return!Y.ended&&(Y.needReadable||Y.length<Y.highWaterMark||Y.length===0)}(ne)}function C(O,p,U,V){p.flowing&&p.length===0&&!p.sync?(O.emit("data",U),O.read(0)):(p.length+=p.objectMode?1:U.length,V?p.buffer.unshift(U):p.buffer.push(U),p.needReadable&&q(O)),m(O,p)}Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(O){this._readableState&&(this._readableState.destroyed=O)}}),A.prototype.destroy=j.destroy,A.prototype._undestroy=j.undestroy,A.prototype._destroy=function(O,p){this.push(null),p(O)},A.prototype.push=function(O,p){var U,V=this._readableState;return V.objectMode?U=!0:typeof O=="string"&&((p=p||V.defaultEncoding)!==V.encoding&&(O=f.from(O,p),p=""),U=!0),d(this,O,p,!1,U)},A.prototype.unshift=function(O){return d(this,O,null,!0,!1)},A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(O){return b||(b=n(22).StringDecoder),this._readableState.decoder=new b(O),this._readableState.encoding=O,this};function $(O,p){return O<=0||p.length===0&&p.ended?0:p.objectMode?1:O!=O?p.flowing&&p.length?p.buffer.head.data.length:p.length:(O>p.highWaterMark&&(p.highWaterMark=function(U){return U>=8388608?U=8388608:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}(O)),O<=p.length?O:p.ended?p.length:(p.needReadable=!0,0))}function q(O){var p=O._readableState;p.needReadable=!1,p.emittedReadable||(g("emitReadable",p.flowing),p.emittedReadable=!0,p.sync?s.nextTick(y,O):y(O))}function y(O){g("emit readable"),O.emit("readable"),W(O)}function m(O,p){p.readingMore||(p.readingMore=!0,s.nextTick(I,O,p))}function I(O,p){for(var U=p.length;!p.reading&&!p.flowing&&!p.ended&&p.length<p.highWaterMark&&(g("maybeReadMore read 0"),O.read(0),U!==p.length);)U=p.length;p.readingMore=!1}function _(O){g("readable nexttick read 0"),O.read(0)}function L(O,p){p.reading||(g("resume read 0"),O.read(0)),p.resumeScheduled=!1,p.awaitDrain=0,O.emit("resume"),W(O),p.flowing&&!p.reading&&O.read(0)}function W(O){var p=O._readableState;for(g("flow",p.flowing);p.flowing&&O.read()!==null;);}function B(O,p){return p.length===0?null:(p.objectMode?U=p.buffer.shift():!O||O>=p.length?(U=p.decoder?p.buffer.join(""):p.buffer.length===1?p.buffer.head.data:p.buffer.concat(p.length),p.buffer.clear()):U=function(V,Q,ee){var ne;return V<Q.head.data.length?(ne=Q.head.data.slice(0,V),Q.head.data=Q.head.data.slice(V)):ne=V===Q.head.data.length?Q.shift():ee?function(Y,G){var S=G.head,T=1,k=S.data;for(Y-=k.length;S=S.next;){var J=S.data,K=Y>J.length?J.length:Y;if(K===J.length?k+=J:k+=J.slice(0,Y),(Y-=K)===0){K===J.length?(++T,S.next?G.head=S.next:G.head=G.tail=null):(G.head=S,S.data=J.slice(K));break}++T}return G.length-=T,k}(V,Q):function(Y,G){var S=f.allocUnsafe(Y),T=G.head,k=1;for(T.data.copy(S),Y-=T.data.length;T=T.next;){var J=T.data,K=Y>J.length?J.length:Y;if(J.copy(S,S.length-Y,0,K),(Y-=K)===0){K===J.length?(++k,T.next?G.head=T.next:G.head=G.tail=null):(G.head=T,T.data=J.slice(K));break}++k}return G.length-=k,S}(V,Q),ne}(O,p.buffer,p.decoder),U);var U}function N(O){var p=O._readableState;if(p.length>0)throw new Error('"endReadable()" called on non-empty stream');p.endEmitted||(p.ended=!0,s.nextTick(D,p,O))}function D(O,p){O.endEmitted||O.length!==0||(O.endEmitted=!0,p.readable=!1,p.emit("end"))}function z(O,p){for(var U=0,V=O.length;U<V;U++)if(O[U]===p)return U;return-1}A.prototype.read=function(O){g("read",O),O=parseInt(O,10);var p=this._readableState,U=O;if(O!==0&&(p.emittedReadable=!1),O===0&&p.needReadable&&(p.length>=p.highWaterMark||p.ended))return g("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?N(this):q(this),null;if((O=$(O,p))===0&&p.ended)return p.length===0&&N(this),null;var V,Q=p.needReadable;return g("need readable",Q),(p.length===0||p.length-O<p.highWaterMark)&&g("length less than watermark",Q=!0),p.ended||p.reading?g("reading or ended",Q=!1):Q&&(g("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(O=$(U,p))),(V=O>0?B(O,p):null)===null?(p.needReadable=!0,O=0):p.length-=O,p.length===0&&(p.ended||(p.needReadable=!0),U!==O&&p.ended&&N(this)),V!==null&&this.emit("data",V),V},A.prototype._read=function(O){this.emit("error",new Error("_read() is not implemented"))},A.prototype.pipe=function(O,p){var U=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=O;break;case 1:V.pipes=[V.pipes,O];break;default:V.pipes.push(O)}V.pipesCount+=1,g("pipe count=%d opts=%j",V.pipesCount,p);var Q=(!p||p.end!==!1)&&O!==i.stdout&&O!==i.stderr?ne:re;function ee(se,fe){g("onunpipe"),se===U&&fe&&fe.hasUnpiped===!1&&(fe.hasUnpiped=!0,g("cleanup"),O.removeListener("close",J),O.removeListener("finish",K),O.removeListener("drain",Y),O.removeListener("error",k),O.removeListener("unpipe",ee),U.removeListener("end",ne),U.removeListener("end",re),U.removeListener("data",T),G=!0,!V.awaitDrain||O._writableState&&!O._writableState.needDrain||Y())}function ne(){g("onend"),O.end()}V.endEmitted?s.nextTick(Q):U.once("end",Q),O.on("unpipe",ee);var Y=function(se){return function(){var fe=se._readableState;g("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&c(se,"data")&&(fe.flowing=!0,W(se))}}(U);O.on("drain",Y);var G=!1,S=!1;function T(se){g("ondata"),S=!1,O.write(se)!==!1||S||((V.pipesCount===1&&V.pipes===O||V.pipesCount>1&&z(V.pipes,O)!==-1)&&!G&&(g("false write response, pause",U._readableState.awaitDrain),U._readableState.awaitDrain++,S=!0),U.pause())}function k(se){g("onerror",se),re(),O.removeListener("error",k),c(O,"error")===0&&O.emit("error",se)}function J(){O.removeListener("finish",K),re()}function K(){g("onfinish"),O.removeListener("close",J),re()}function re(){g("unpipe"),U.unpipe(O)}return U.on("data",T),function(se,fe,ve){if(typeof se.prependListener=="function")return se.prependListener(fe,ve);se._events&&se._events[fe]?o(se._events[fe])?se._events[fe].unshift(ve):se._events[fe]=[ve,se._events[fe]]:se.on(fe,ve)}(O,"error",k),O.once("close",J),O.once("finish",K),O.emit("pipe",U),V.flowing||(g("pipe resume"),U.resume()),O},A.prototype.unpipe=function(O){var p=this._readableState,U={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return O&&O!==p.pipes||(O||(O=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,O&&O.emit("unpipe",this,U)),this;if(!O){var V=p.pipes,Q=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var ee=0;ee<Q;ee++)V[ee].emit("unpipe",this,U);return this}var ne=z(p.pipes,O);return ne===-1||(p.pipes.splice(ne,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),O.emit("unpipe",this,U)),this},A.prototype.on=function(O,p){var U=u.prototype.on.call(this,O,p);if(O==="data")this._readableState.flowing!==!1&&this.resume();else if(O==="readable"){var V=this._readableState;V.endEmitted||V.readableListening||(V.readableListening=V.needReadable=!0,V.emittedReadable=!1,V.reading?V.length&&q(this):s.nextTick(_,this))}return U},A.prototype.addListener=A.prototype.on,A.prototype.resume=function(){var O=this._readableState;return O.flowing||(g("resume"),O.flowing=!0,function(p,U){U.resumeScheduled||(U.resumeScheduled=!0,s.nextTick(L,p,U))}(this,O)),this},A.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this},A.prototype.wrap=function(O){var p=this,U=this._readableState,V=!1;for(var Q in O.on("end",function(){if(g("wrapped end"),U.decoder&&!U.ended){var ne=U.decoder.end();ne&&ne.length&&p.push(ne)}p.push(null)}),O.on("data",function(ne){g("wrapped data"),U.decoder&&(ne=U.decoder.write(ne)),U.objectMode&&ne==null||(U.objectMode||ne&&ne.length)&&(p.push(ne)||(V=!0,O.pause()))}),O)this[Q]===void 0&&typeof O[Q]=="function"&&(this[Q]=function(ne){return function(){return O[ne].apply(O,arguments)}}(Q));for(var ee=0;ee<F.length;ee++)O.on(F[ee],this.emit.bind(this,F[ee]));return this._read=function(ne){g("wrapped _read",ne),V&&(V=!1,O.resume())},this},Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),A._fromList=B}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){var r=n(16);function i(s,l){s.emit("error",l)}e.exports={destroy:function(s,l){var o=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(l?l(s):!s||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,s),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!l&&f?(r.nextTick(i,o,f),o._writableState&&(o._writableState.errorEmitted=!0)):l&&l(f)}),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.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){e.exports=l;var r=n(23),i=n(17);function s(u,f){var E=this._transformState;E.transforming=!1;var w=E.writecb;if(!w)return this.emit("error",new Error("write callback called multiple times"));E.writechunk=null,E.writecb=null,f!=null&&this.push(f),w(u);var h=this._readableState;h.reading=!1,(h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}function l(u){if(!(this instanceof l))return new l(u);r.call(this,u),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",o)}function o(){var u=this;typeof this._flush=="function"?this._flush(function(f,E){c(u,f,E)}):c(this,null,null)}function c(u,f,E){if(f)return u.emit("error",f);if(E!=null&&u.push(E),u._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(u._transformState.transforming)throw new Error("Calling transform done when still transforming");return u.push(null)}i.inherits=n(7),i.inherits(l,r),l.prototype.push=function(u,f){return this._transformState.needTransform=!1,r.prototype.push.call(this,u,f)},l.prototype._transform=function(u,f,E){throw new Error("_transform() is not implemented")},l.prototype._write=function(u,f,E){var w=this._transformState;if(w.writecb=E,w.writechunk=u,w.writeencoding=f,!w.transforming){var h=this._readableState;(w.needTransform||h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}},l.prototype._read=function(u){var f=this._transformState;f.writechunk!==null&&f.writecb&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},l.prototype._destroy=function(u,f){var E=this;r.prototype._destroy.call(this,u,function(w){f(w),E.emit("close")})}},function(e,t,n){e.exports=n(48)},function(e,t,n){(function(r){var i=n(170);function s(y,m){if(y===m)return 0;for(var I=y.length,_=m.length,L=0,W=Math.min(I,_);L<W;++L)if(y[L]!==m[L]){I=y[L],_=m[L];break}return I<_?-1:_<I?1:0}function l(y){return r.Buffer&&typeof r.Buffer.isBuffer=="function"?r.Buffer.isBuffer(y):!(y==null||!y._isBuffer)}var o=n(13),c=Object.prototype.hasOwnProperty,u=Array.prototype.slice,f=function(){}.name==="foo";function E(y){return Object.prototype.toString.call(y)}function w(y){return!l(y)&&typeof r.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(y):!!y&&(y instanceof DataView||!!(y.buffer&&y.buffer instanceof ArrayBuffer)))}var h=e.exports=M,g=/\s*function\s+([^\(\s]*)\s*/;function b(y){if(o.isFunction(y)){if(f)return y.name;var m=y.toString().match(g);return m&&m[1]}}function R(y,m){return typeof y=="string"?y.length<m?y:y.slice(0,m):y}function j(y){if(f||!o.isFunction(y))return o.inspect(y);var m=b(y);return"[Function"+(m?": "+m:"")+"]"}function F(y,m,I,_,L){throw new h.AssertionError({message:I,actual:y,expected:m,operator:_,stackStartFunction:L})}function M(y,m){y||F(y,!0,m,"==",h.ok)}function A(y,m,I,_){if(y===m)return!0;if(l(y)&&l(m))return s(y,m)===0;if(o.isDate(y)&&o.isDate(m))return y.getTime()===m.getTime();if(o.isRegExp(y)&&o.isRegExp(m))return y.source===m.source&&y.global===m.global&&y.multiline===m.multiline&&y.lastIndex===m.lastIndex&&y.ignoreCase===m.ignoreCase;if(y!==null&&typeof y=="object"||m!==null&&typeof m=="object"){if(w(y)&&w(m)&&E(y)===E(m)&&!(y instanceof Float32Array||y instanceof Float64Array))return s(new Uint8Array(y.buffer),new Uint8Array(m.buffer))===0;if(l(y)!==l(m))return!1;var L=(_=_||{actual:[],expected:[]}).actual.indexOf(y);return L!==-1&&L===_.expected.indexOf(m)||(_.actual.push(y),_.expected.push(m),function(W,B,N,D){if(W==null||B==null)return!1;if(o.isPrimitive(W)||o.isPrimitive(B))return W===B;if(N&&Object.getPrototypeOf(W)!==Object.getPrototypeOf(B))return!1;var z=d(W),O=d(B);if(z&&!O||!z&&O)return!1;if(z)return W=u.call(W),B=u.call(B),A(W,B,N);var p,U,V=q(W),Q=q(B);if(V.length!==Q.length)return!1;for(V.sort(),Q.sort(),U=V.length-1;U>=0;U--)if(V[U]!==Q[U])return!1;for(U=V.length-1;U>=0;U--)if(p=V[U],!A(W[p],B[p],N,D))return!1;return!0}(y,m,I,_))}return I?y===m:y==m}function d(y){return Object.prototype.toString.call(y)=="[object Arguments]"}function C(y,m){if(!y||!m)return!1;if(Object.prototype.toString.call(m)=="[object RegExp]")return m.test(y);try{if(y instanceof m)return!0}catch{}return!Error.isPrototypeOf(m)&&m.call({},y)===!0}function $(y,m,I,_){var L;if(typeof m!="function")throw new TypeError('"block" argument must be a function');typeof I=="string"&&(_=I,I=null),L=function(N){var D;try{N()}catch(z){D=z}return D}(m),_=(I&&I.name?" ("+I.name+").":".")+(_?" "+_:"."),y&&!L&&F(L,I,"Missing expected exception"+_);var W=typeof _=="string",B=!y&&L&&!I;if((!y&&o.isError(L)&&W&&C(L,I)||B)&&F(L,I,"Got unwanted exception"+_),y&&L&&I&&!C(L,I)||!y&&L)throw L}h.AssertionError=function(y){this.name="AssertionError",this.actual=y.actual,this.expected=y.expected,this.operator=y.operator,y.message?(this.message=y.message,this.generatedMessage=!1):(this.message=function(N){return R(j(N.actual),128)+" "+N.operator+" "+R(j(N.expected),128)}(this),this.generatedMessage=!0);var m=y.stackStartFunction||F;if(Error.captureStackTrace)Error.captureStackTrace(this,m);else{var I=new Error;if(I.stack){var _=I.stack,L=b(m),W=_.indexOf(`
|
|
28
28
|
`+L);if(W>=0){var B=_.indexOf(`
|
|
29
|
-
`,W+1);_=_.substring(B+1)}this.stack=_}}},o.inherits(h.AssertionError,Error),h.fail=F,h.ok=M,h.equal=function(y,m,I){y!=m&&F(y,m,I,"==",h.equal)},h.notEqual=function(y,m,I){y==m&&F(y,m,I,"!=",h.notEqual)},h.deepEqual=function(y,m,I){A(y,m,!1)||F(y,m,I,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(y,m,I){A(y,m,!0)||F(y,m,I,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(y,m,I){A(y,m,!1)&&F(y,m,I,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function y(m,I,_){A(m,I,!0)&&F(m,I,_,"notDeepStrictEqual",y)},h.strictEqual=function(y,m,I){y!==m&&F(y,m,I,"===",h.strictEqual)},h.notStrictEqual=function(y,m,I){y===m&&F(y,m,I,"!==",h.notStrictEqual)},h.throws=function(y,m,I){$(!0,y,m,I)},h.doesNotThrow=function(y,m,I){$(!1,y,m,I)},h.ifError=function(y){if(y)throw y},h.strict=i(function y(m,I){m||F(m,!0,I,"==",y)},h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var q=Object.keys||function(y){var m=[];for(var I in y)c.call(y,I)&&m.push(I);return m}}).call(this,n(6))},function(e,t,n){e.exports=function(r,i,s,l){for(var o=65535&r|0,c=r>>>16&65535|0,u=0;s!==0;){s-=u=s>2e3?2e3:s;do c=c+(o=o+i[l++]|0)|0;while(--u);o%=65521,c%=65521}return o|c<<16|0}},function(e,t,n){var r=function(){for(var i,s=[],l=0;l<256;l++){i=l;for(var o=0;o<8;o++)i=1&i?3988292384^i>>>1:i>>>1;s[l]=i}return s}();e.exports=function(i,s,l,o){var c=r,u=o+l;i^=-1;for(var f=o;f<u;f++)i=i>>>8^c[255&(i^s[f])];return-1^i}},function(e,t,n){(function(r,i){var s;e.exports=m,m.ReadableState=y,n(21).EventEmitter;var l=function(Y,G){return Y.listeners(G).length},o=n(78),c=n(5).Buffer,u=r.Uint8Array||function(){},f,E=n(179);f=E&&E.debuglog?E.debuglog("stream"):function(){};var w,h,g,b=n(180),R=n(79),j=n(80).getHighWaterMark,F=n(26).codes,M=F.ERR_INVALID_ARG_TYPE,A=F.ERR_STREAM_PUSH_AFTER_EOF,d=F.ERR_METHOD_NOT_IMPLEMENTED,C=F.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(m,o);var $=R.errorOrDestroy,q=["error","close","destroy","pause","resume"];function y(Y,G,S){s=s||n(27),Y=Y||{},typeof S!="boolean"&&(S=G instanceof s),this.objectMode=!!Y.objectMode,S&&(this.objectMode=this.objectMode||!!Y.readableObjectMode),this.highWaterMark=j(this,Y,"readableHighWaterMark",S),this.buffer=new b,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=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.destroyed=!1,this.defaultEncoding=Y.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Y.encoding&&(w||(w=n(22).StringDecoder),this.decoder=new w(Y.encoding),this.encoding=Y.encoding)}function m(Y){if(s=s||n(27),!(this instanceof m))return new m(Y);var G=this instanceof s;this._readableState=new y(Y,this,G),this.readable=!0,Y&&(typeof Y.read=="function"&&(this._read=Y.read),typeof Y.destroy=="function"&&(this._destroy=Y.destroy)),o.call(this)}function I(Y,G,S,T,k){f("readableAddChunk",G);var J,K=Y._readableState;if(G===null)K.reading=!1,function(re,se){if(f("onEofChunk"),!se.ended){if(se.decoder){var fe=se.decoder.end();fe&&fe.length&&(se.buffer.push(fe),se.length+=se.objectMode?1:fe.length)}se.ended=!0,se.sync?W(re):(se.needReadable=!1,se.emittedReadable||(se.emittedReadable=!0,B(re)))}}(Y,K);else if(k||(J=function(re,se){var fe;ve=se,c.isBuffer(ve)||ve instanceof u||typeof se=="string"||se===void 0||re.objectMode||(fe=new M("chunk",["string","Buffer","Uint8Array"],se));var ve;return fe}(K,G)),J)$(Y,J);else if(K.objectMode||G&&G.length>0)if(typeof G=="string"||K.objectMode||Object.getPrototypeOf(G)===c.prototype||(G=function(re){return c.from(re)}(G)),T)K.endEmitted?$(Y,new C):_(Y,K,G,!0);else if(K.ended)$(Y,new A);else{if(K.destroyed)return!1;K.reading=!1,K.decoder&&!S?(G=K.decoder.write(G),K.objectMode||G.length!==0?_(Y,K,G,!1):N(Y,K)):_(Y,K,G,!1)}else T||(K.reading=!1,N(Y,K));return!K.ended&&(K.length<K.highWaterMark||K.length===0)}function _(Y,G,S,T){G.flowing&&G.length===0&&!G.sync?(G.awaitDrain=0,Y.emit("data",S)):(G.length+=G.objectMode?1:S.length,T?G.buffer.unshift(S):G.buffer.push(S),G.needReadable&&W(Y)),N(Y,G)}Object.defineProperty(m.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Y){this._readableState&&(this._readableState.destroyed=Y)}}),m.prototype.destroy=R.destroy,m.prototype._undestroy=R.undestroy,m.prototype._destroy=function(Y,G){G(Y)},m.prototype.push=function(Y,G){var S,T=this._readableState;return T.objectMode?S=!0:typeof Y=="string"&&((G=G||T.defaultEncoding)!==T.encoding&&(Y=c.from(Y,G),G=""),S=!0),I(this,Y,G,!1,S)},m.prototype.unshift=function(Y){return I(this,Y,null,!0,!1)},m.prototype.isPaused=function(){return this._readableState.flowing===!1},m.prototype.setEncoding=function(Y){w||(w=n(22).StringDecoder);var G=new w(Y);this._readableState.decoder=G,this._readableState.encoding=this._readableState.decoder.encoding;for(var S=this._readableState.buffer.head,T="";S!==null;)T+=G.write(S.data),S=S.next;return this._readableState.buffer.clear(),T!==""&&this._readableState.buffer.push(T),this._readableState.length=T.length,this};function L(Y,G){return Y<=0||G.length===0&&G.ended?0:G.objectMode?1:Y!=Y?G.flowing&&G.length?G.buffer.head.data.length:G.length:(Y>G.highWaterMark&&(G.highWaterMark=function(S){return S>=1073741824?S=1073741824:(S--,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S++),S}(Y)),Y<=G.length?Y:G.ended?G.length:(G.needReadable=!0,0))}function W(Y){var G=Y._readableState;f("emitReadable",G.needReadable,G.emittedReadable),G.needReadable=!1,G.emittedReadable||(f("emitReadable",G.flowing),G.emittedReadable=!0,i.nextTick(B,Y))}function B(Y){var G=Y._readableState;f("emitReadable_",G.destroyed,G.length,G.ended),G.destroyed||!G.length&&!G.ended||(Y.emit("readable"),G.emittedReadable=!1),G.needReadable=!G.flowing&&!G.ended&&G.length<=G.highWaterMark,U(Y)}function N(Y,G){G.readingMore||(G.readingMore=!0,i.nextTick(P,Y,G))}function P(Y,G){for(;!G.reading&&!G.ended&&(G.length<G.highWaterMark||G.flowing&&G.length===0);){var S=G.length;if(f("maybeReadMore read 0"),Y.read(0),S===G.length)break}G.readingMore=!1}function z(Y){var G=Y._readableState;G.readableListening=Y.listenerCount("readable")>0,G.resumeScheduled&&!G.paused?G.flowing=!0:Y.listenerCount("data")>0&&Y.resume()}function O(Y){f("readable nexttick read 0"),Y.read(0)}function p(Y,G){f("resume",G.reading),G.reading||Y.read(0),G.resumeScheduled=!1,Y.emit("resume"),U(Y),G.flowing&&!G.reading&&Y.read(0)}function U(Y){var G=Y._readableState;for(f("flow",G.flowing);G.flowing&&Y.read()!==null;);}function V(Y,G){return G.length===0?null:(G.objectMode?S=G.buffer.shift():!Y||Y>=G.length?(S=G.decoder?G.buffer.join(""):G.buffer.length===1?G.buffer.first():G.buffer.concat(G.length),G.buffer.clear()):S=G.buffer.consume(Y,G.decoder),S);var S}function Q(Y){var G=Y._readableState;f("endReadable",G.endEmitted),G.endEmitted||(G.ended=!0,i.nextTick(ee,G,Y))}function ee(Y,G){if(f("endReadableNT",Y.endEmitted,Y.length),!Y.endEmitted&&Y.length===0&&(Y.endEmitted=!0,G.readable=!1,G.emit("end"),Y.autoDestroy)){var S=G._writableState;(!S||S.autoDestroy&&S.finished)&&G.destroy()}}function ne(Y,G){for(var S=0,T=Y.length;S<T;S++)if(Y[S]===G)return S;return-1}m.prototype.read=function(Y){f("read",Y),Y=parseInt(Y,10);var G=this._readableState,S=Y;if(Y!==0&&(G.emittedReadable=!1),Y===0&&G.needReadable&&((G.highWaterMark!==0?G.length>=G.highWaterMark:G.length>0)||G.ended))return f("read: emitReadable",G.length,G.ended),G.length===0&&G.ended?Q(this):W(this),null;if((Y=L(Y,G))===0&&G.ended)return G.length===0&&Q(this),null;var T,k=G.needReadable;return f("need readable",k),(G.length===0||G.length-Y<G.highWaterMark)&&f("length less than watermark",k=!0),G.ended||G.reading?f("reading or ended",k=!1):k&&(f("do read"),G.reading=!0,G.sync=!0,G.length===0&&(G.needReadable=!0),this._read(G.highWaterMark),G.sync=!1,G.reading||(Y=L(S,G))),(T=Y>0?V(Y,G):null)===null?(G.needReadable=G.length<=G.highWaterMark,Y=0):(G.length-=Y,G.awaitDrain=0),G.length===0&&(G.ended||(G.needReadable=!0),S!==Y&&G.ended&&Q(this)),T!==null&&this.emit("data",T),T},m.prototype._read=function(Y){$(this,new d("_read()"))},m.prototype.pipe=function(Y,G){var S=this,T=this._readableState;switch(T.pipesCount){case 0:T.pipes=Y;break;case 1:T.pipes=[T.pipes,Y];break;default:T.pipes.push(Y)}T.pipesCount+=1,f("pipe count=%d opts=%j",T.pipesCount,G);var k=(!G||G.end!==!1)&&Y!==i.stdout&&Y!==i.stderr?K:Ie;function J(Te,Oe){f("onunpipe"),Te===S&&Oe&&Oe.hasUnpiped===!1&&(Oe.hasUnpiped=!0,f("cleanup"),Y.removeListener("close",Ce),Y.removeListener("finish",Se),Y.removeListener("drain",re),Y.removeListener("error",ve),Y.removeListener("unpipe",J),S.removeListener("end",K),S.removeListener("end",Ie),S.removeListener("data",fe),se=!0,!T.awaitDrain||Y._writableState&&!Y._writableState.needDrain||re())}function K(){f("onend"),Y.end()}T.endEmitted?i.nextTick(k):S.once("end",k),Y.on("unpipe",J);var re=function(Te){return function(){var Oe=Te._readableState;f("pipeOnDrain",Oe.awaitDrain),Oe.awaitDrain&&Oe.awaitDrain--,Oe.awaitDrain===0&&l(Te,"data")&&(Oe.flowing=!0,U(Te))}}(S);Y.on("drain",re);var se=!1;function fe(Te){f("ondata");var Oe=Y.write(Te);f("dest.write",Oe),Oe===!1&&((T.pipesCount===1&&T.pipes===Y||T.pipesCount>1&&ne(T.pipes,Y)!==-1)&&!se&&(f("false write response, pause",T.awaitDrain),T.awaitDrain++),S.pause())}function ve(Te){f("onerror",Te),Ie(),Y.removeListener("error",ve),l(Y,"error")===0&&$(Y,Te)}function Ce(){Y.removeListener("finish",Se),Ie()}function Se(){f("onfinish"),Y.removeListener("close",Ce),Ie()}function Ie(){f("unpipe"),S.unpipe(Y)}return S.on("data",fe),function(Te,Oe,De){if(typeof Te.prependListener=="function")return Te.prependListener(Oe,De);Te._events&&Te._events[Oe]?Array.isArray(Te._events[Oe])?Te._events[Oe].unshift(De):Te._events[Oe]=[De,Te._events[Oe]]:Te.on(Oe,De)}(Y,"error",ve),Y.once("close",Ce),Y.once("finish",Se),Y.emit("pipe",S),T.flowing||(f("pipe resume"),S.resume()),Y},m.prototype.unpipe=function(Y){var G=this._readableState,S={hasUnpiped:!1};if(G.pipesCount===0)return this;if(G.pipesCount===1)return Y&&Y!==G.pipes||(Y||(Y=G.pipes),G.pipes=null,G.pipesCount=0,G.flowing=!1,Y&&Y.emit("unpipe",this,S)),this;if(!Y){var T=G.pipes,k=G.pipesCount;G.pipes=null,G.pipesCount=0,G.flowing=!1;for(var J=0;J<k;J++)T[J].emit("unpipe",this,{hasUnpiped:!1});return this}var K=ne(G.pipes,Y);return K===-1||(G.pipes.splice(K,1),G.pipesCount-=1,G.pipesCount===1&&(G.pipes=G.pipes[0]),Y.emit("unpipe",this,S)),this},m.prototype.on=function(Y,G){var S=o.prototype.on.call(this,Y,G),T=this._readableState;return Y==="data"?(T.readableListening=this.listenerCount("readable")>0,T.flowing!==!1&&this.resume()):Y==="readable"&&(T.endEmitted||T.readableListening||(T.readableListening=T.needReadable=!0,T.flowing=!1,T.emittedReadable=!1,f("on readable",T.length,T.reading),T.length?W(this):T.reading||i.nextTick(O,this))),S},m.prototype.addListener=m.prototype.on,m.prototype.removeListener=function(Y,G){var S=o.prototype.removeListener.call(this,Y,G);return Y==="readable"&&i.nextTick(z,this),S},m.prototype.removeAllListeners=function(Y){var G=o.prototype.removeAllListeners.apply(this,arguments);return Y!=="readable"&&Y!==void 0||i.nextTick(z,this),G},m.prototype.resume=function(){var Y=this._readableState;return Y.flowing||(f("resume"),Y.flowing=!Y.readableListening,function(G,S){S.resumeScheduled||(S.resumeScheduled=!0,i.nextTick(p,G,S))}(this,Y)),Y.paused=!1,this},m.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},m.prototype.wrap=function(Y){var G=this,S=this._readableState,T=!1;for(var k in Y.on("end",function(){if(f("wrapped end"),S.decoder&&!S.ended){var K=S.decoder.end();K&&K.length&&G.push(K)}G.push(null)}),Y.on("data",function(K){f("wrapped data"),S.decoder&&(K=S.decoder.write(K)),S.objectMode&&K==null||(S.objectMode||K&&K.length)&&(G.push(K)||(T=!0,Y.pause()))}),Y)this[k]===void 0&&typeof Y[k]=="function"&&(this[k]=function(K){return function(){return Y[K].apply(Y,arguments)}}(k));for(var J=0;J<q.length;J++)Y.on(q[J],this.emit.bind(this,q[J]));return this._read=function(K){f("wrapped _read",K),T&&(T=!1,Y.resume())},this},typeof Symbol=="function"&&(m.prototype[Symbol.asyncIterator]=function(){return h===void 0&&(h=n(182)),h(this)}),Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(m.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(m.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Y){this._readableState&&(this._readableState.flowing=Y)}}),m._fromList=V,Object.defineProperty(m.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(m.from=function(Y,G){return g===void 0&&(g=n(183)),g(m,Y,G)})}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){(function(r){function i(o,c){l(o,c),s(o)}function s(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function l(o,c){o.emit("error",c)}e.exports={destroy:function(o,c){var u=this,f=this._readableState&&this._readableState.destroyed,E=this._writableState&&this._writableState.destroyed;return f||E?(c?c(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(l,this,o)):r.nextTick(l,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(w){!c&&w?u._writableState?u._writableState.errorEmitted?r.nextTick(s,u):(u._writableState.errorEmitted=!0,r.nextTick(i,u,w)):r.nextTick(i,u,w):c?(r.nextTick(s,u),c(w)):r.nextTick(s,u)}),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(o,c){var u=o._readableState,f=o._writableState;u&&u.autoDestroy||f&&f.autoDestroy?o.destroy(c):o.emit("error",c)}}}).call(this,n(2))},function(e,t,n){var r=n(26).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(i,s,l,o){var c=function(u,f,E){return u.highWaterMark!=null?u.highWaterMark:f?u[E]:null}(s,o,l);if(c!=null){if(!isFinite(c)||Math.floor(c)!==c||c<0)throw new r(o?l:"highWaterMark",c);return Math.floor(c)}return i.objectMode?16:16384}}},function(e,t,n){(function(r,i){function s(P){var z=this;this.next=null,this.entry=null,this.finish=function(){(function(O,p,U){var V=O.entry;for(O.entry=null;V;){var Q=V.callback;p.pendingcb--,Q(U),V=V.next}p.corkedRequestsFree.next=O})(z,P)}}var l;e.exports=m,m.WritableState=y;var o={deprecate:n(43)},c=n(78),u=n(5).Buffer,f=r.Uint8Array||function(){},E,w=n(79),h=n(80).getHighWaterMark,g=n(26).codes,b=g.ERR_INVALID_ARG_TYPE,R=g.ERR_METHOD_NOT_IMPLEMENTED,j=g.ERR_MULTIPLE_CALLBACK,F=g.ERR_STREAM_CANNOT_PIPE,M=g.ERR_STREAM_DESTROYED,A=g.ERR_STREAM_NULL_VALUES,d=g.ERR_STREAM_WRITE_AFTER_END,C=g.ERR_UNKNOWN_ENCODING,$=w.errorOrDestroy;function q(){}function y(P,z,O){l=l||n(27),P=P||{},typeof O!="boolean"&&(O=z instanceof l),this.objectMode=!!P.objectMode,O&&(this.objectMode=this.objectMode||!!P.writableObjectMode),this.highWaterMark=h(this,P,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=P.decodeStrings===!1;this.decodeStrings=!p,this.defaultEncoding=P.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(U){(function(V,Q){var ee=V._writableState,ne=ee.sync,Y=ee.writecb;if(typeof Y!="function")throw new j;if(function(S){S.writing=!1,S.writecb=null,S.length-=S.writelen,S.writelen=0}(ee),Q)(function(S,T,k,J,K){--T.pendingcb,k?(i.nextTick(K,J),i.nextTick(N,S,T),S._writableState.errorEmitted=!0,$(S,J)):(K(J),S._writableState.errorEmitted=!0,$(S,J),N(S,T))})(V,ee,ne,Q,Y);else{var G=W(ee)||V.destroyed;G||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||L(V,ee),ne?i.nextTick(_,V,ee,G,Y):_(V,ee,G,Y)}})(z,U)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=P.emitClose!==!1,this.autoDestroy=!!P.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function m(P){var z=this instanceof(l=l||n(27));if(!z&&!E.call(m,this))return new m(P);this._writableState=new y(P,this,z),this.writable=!0,P&&(typeof P.write=="function"&&(this._write=P.write),typeof P.writev=="function"&&(this._writev=P.writev),typeof P.destroy=="function"&&(this._destroy=P.destroy),typeof P.final=="function"&&(this._final=P.final)),c.call(this)}function I(P,z,O,p,U,V,Q){z.writelen=p,z.writecb=Q,z.writing=!0,z.sync=!0,z.destroyed?z.onwrite(new M("write")):O?P._writev(U,z.onwrite):P._write(U,V,z.onwrite),z.sync=!1}function _(P,z,O,p){O||function(U,V){V.length===0&&V.needDrain&&(V.needDrain=!1,U.emit("drain"))}(P,z),z.pendingcb--,p(),N(P,z)}function L(P,z){z.bufferProcessing=!0;var O=z.bufferedRequest;if(P._writev&&O&&O.next){var p=z.bufferedRequestCount,U=new Array(p),V=z.corkedRequestsFree;V.entry=O;for(var Q=0,ee=!0;O;)U[Q]=O,O.isBuf||(ee=!1),O=O.next,Q+=1;U.allBuffers=ee,I(P,z,!0,z.length,U,"",V.finish),z.pendingcb++,z.lastBufferedRequest=null,V.next?(z.corkedRequestsFree=V.next,V.next=null):z.corkedRequestsFree=new s(z),z.bufferedRequestCount=0}else{for(;O;){var ne=O.chunk,Y=O.encoding,G=O.callback;if(I(P,z,!1,z.objectMode?1:ne.length,ne,Y,G),O=O.next,z.bufferedRequestCount--,z.writing)break}O===null&&(z.lastBufferedRequest=null)}z.bufferedRequest=O,z.bufferProcessing=!1}function W(P){return P.ending&&P.length===0&&P.bufferedRequest===null&&!P.finished&&!P.writing}function B(P,z){P._final(function(O){z.pendingcb--,O&&$(P,O),z.prefinished=!0,P.emit("prefinish"),N(P,z)})}function N(P,z){var O=W(z);if(O&&(function(U,V){V.prefinished||V.finalCalled||(typeof U._final!="function"||V.destroyed?(V.prefinished=!0,U.emit("prefinish")):(V.pendingcb++,V.finalCalled=!0,i.nextTick(B,U,V)))}(P,z),z.pendingcb===0&&(z.finished=!0,P.emit("finish"),z.autoDestroy))){var p=P._readableState;(!p||p.autoDestroy&&p.endEmitted)&&P.destroy()}return O}n(7)(m,c),y.prototype.getBuffer=function(){for(var P=this.bufferedRequest,z=[];P;)z.push(P),P=P.next;return z},function(){try{Object.defineProperty(y.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(E=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(P){return!!E.call(this,P)||this===m&&P&&P._writableState instanceof y}})):E=function(P){return P instanceof this},m.prototype.pipe=function(){$(this,new F)},m.prototype.write=function(P,z,O){var p,U=this._writableState,V=!1,Q=!U.objectMode&&(p=P,u.isBuffer(p)||p instanceof f);return Q&&!u.isBuffer(P)&&(P=function(ee){return u.from(ee)}(P)),typeof z=="function"&&(O=z,z=null),Q?z="buffer":z||(z=U.defaultEncoding),typeof O!="function"&&(O=q),U.ending?function(ee,ne){var Y=new d;$(ee,Y),i.nextTick(ne,Y)}(this,O):(Q||function(ee,ne,Y,G){var S;return Y===null?S=new A:typeof Y=="string"||ne.objectMode||(S=new b("chunk",["string","Buffer"],Y)),!S||($(ee,S),i.nextTick(G,S),!1)}(this,U,P,O))&&(U.pendingcb++,V=function(ee,ne,Y,G,S,T){if(!Y){var k=function(se,fe,ve){return se.objectMode||se.decodeStrings===!1||typeof fe!="string"||(fe=u.from(fe,ve)),fe}(ne,G,S);G!==k&&(Y=!0,S="buffer",G=k)}var J=ne.objectMode?1:G.length;ne.length+=J;var K=ne.length<ne.highWaterMark;if(K||(ne.needDrain=!0),ne.writing||ne.corked){var re=ne.lastBufferedRequest;ne.lastBufferedRequest={chunk:G,encoding:S,isBuf:Y,callback:T,next:null},re?re.next=ne.lastBufferedRequest:ne.bufferedRequest=ne.lastBufferedRequest,ne.bufferedRequestCount+=1}else I(ee,ne,!1,J,G,S,T);return K}(this,U,Q,P,z,O)),V},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var P=this._writableState;P.corked&&(P.corked--,P.writing||P.corked||P.bufferProcessing||!P.bufferedRequest||L(this,P))},m.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=P.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((P+"").toLowerCase())>-1))throw new C(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(P,z,O){O(new R("_write()"))},m.prototype._writev=null,m.prototype.end=function(P,z,O){var p=this._writableState;return typeof P=="function"?(O=P,P=null,z=null):typeof z=="function"&&(O=z,z=null),P!=null&&this.write(P,z),p.corked&&(p.corked=1,this.uncork()),p.ending||function(U,V,Q){V.ending=!0,N(U,V),Q&&(V.finished?i.nextTick(Q):U.once("finish",Q)),V.ended=!0,U.writable=!1}(this,p,O),this},Object.defineProperty(m.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(m.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),m.prototype.destroy=w.destroy,m.prototype._undestroy=w.undestroy,m.prototype._destroy=function(P,z){z(P)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=f;var r=n(26).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,l=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(27);function u(h,g){var b=this._transformState;b.transforming=!1;var R=b.writecb;if(R===null)return this.emit("error",new s);b.writechunk=null,b.writecb=null,g!=null&&this.push(g),R(h);var j=this._readableState;j.reading=!1,(j.needReadable||j.length<j.highWaterMark)&&this._read(j.highWaterMark)}function f(h){if(!(this instanceof f))return new f(h);c.call(this,h),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",E)}function E(){var h=this;typeof this._flush!="function"||this._readableState.destroyed?w(this,null,null):this._flush(function(g,b){w(h,g,b)})}function w(h,g,b){if(g)return h.emit("error",g);if(b!=null&&h.push(b),h._writableState.length)throw new o;if(h._transformState.transforming)throw new l;return h.push(null)}n(7)(f,c),f.prototype.push=function(h,g){return this._transformState.needTransform=!1,c.prototype.push.call(this,h,g)},f.prototype._transform=function(h,g,b){b(new i("_transform()"))},f.prototype._write=function(h,g,b){var R=this._transformState;if(R.writecb=b,R.writechunk=h,R.writeencoding=g,!R.transforming){var j=this._readableState;(R.needTransform||j.needReadable||j.length<j.highWaterMark)&&this._read(j.highWaterMark)}},f.prototype._read=function(h){var g=this._transformState;g.writechunk===null||g.transforming?g.needTransform=!0:(g.transforming=!0,this._transform(g.writechunk,g.writeencoding,g.afterTransform))},f.prototype._destroy=function(h,g){c.prototype._destroy.call(this,h,function(b){g(b)})}},function(e,t,n){(function(r){var i=n(190),s=n(85),l=n(192),o=n(193),c=n(86),u=t;u.request=function(f,E){f=typeof f=="string"?c.parse(f):l(f);var w=r.location.protocol.search(/^https?:$/)===-1?"http:":"",h=f.protocol||w,g=f.hostname||f.host,b=f.port,R=f.path||"/";g&&g.indexOf(":")!==-1&&(g="["+g+"]"),f.url=(g?h+"//"+g:"")+(b?":"+b:"")+R,f.method=(f.method||"GET").toUpperCase(),f.headers=f.headers||{};var j=new i(f);return E&&j.on("response",E),j},u.get=function(f,E){var w=u.request(f,E);return w.end(),w},u.ClientRequest=i,u.IncomingMessage=s.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(6))},function(e,t,n){(function(r){t.fetch=u(r.fetch)&&u(r.ReadableStream),t.writableStream=u(r.WritableStream),t.abortController=u(r.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch{}var i;function s(){if(i!==void 0)return i;if(r.XMLHttpRequest){i=new r.XMLHttpRequest;try{i.open("GET",r.XDomainRequest?"/":"https://example.com")}catch{i=null}}else i=null;return i}function l(f){var E=s();if(!E)return!1;try{return E.responseType=f,E.responseType===f}catch{}return!1}var o=r.ArrayBuffer!==void 0,c=o&&u(r.ArrayBuffer.prototype.slice);function u(f){return typeof f=="function"}t.arraybuffer=t.fetch||o&&l("arraybuffer"),t.msstream=!t.fetch&&c&&l("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&l("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!s()&&u(s().overrideMimeType),t.vbArray=u(r.VBArray),i=null}).call(this,n(6))},function(e,t,n){(function(r,i,s){var l=n(84),o=n(7),c=n(31),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=t.IncomingMessage=function(E,w,h,g){var b=this;if(c.Readable.call(b),b._mode=h,b.headers={},b.rawHeaders=[],b.trailers={},b.rawTrailers=[],b.on("end",function(){r.nextTick(function(){b.emit("close")})}),h==="fetch"){if(b._fetchResponse=w,b.url=w.url,b.statusCode=w.status,b.statusMessage=w.statusText,w.headers.forEach(function(A,d){b.headers[d.toLowerCase()]=A,b.rawHeaders.push(d,A)}),l.writableStream){var R=new WritableStream({write:function(A){return new Promise(function(d,C){b._destroyed?C():b.push(new i(A))?d():b._resumeFetch=d})},close:function(){s.clearTimeout(g),b._destroyed||b.push(null)},abort:function(A){b._destroyed||b.emit("error",A)}});try{return void w.body.pipeTo(R).catch(function(A){s.clearTimeout(g),b._destroyed||b.emit("error",A)})}catch{}}var j=w.body.getReader();(function A(){j.read().then(function(d){if(!b._destroyed){if(d.done)return s.clearTimeout(g),void b.push(null);b.push(new i(d.value)),A()}}).catch(function(d){s.clearTimeout(g),b._destroyed||b.emit("error",d)})})()}else if(b._xhr=E,b._pos=0,b.url=E.responseURL,b.statusCode=E.status,b.statusMessage=E.statusText,E.getAllResponseHeaders().split(/\r?\n/).forEach(function(A){var d=A.match(/^([^:]+):\s*(.*)/);if(d){var C=d[1].toLowerCase();C==="set-cookie"?(b.headers[C]===void 0&&(b.headers[C]=[]),b.headers[C].push(d[2])):b.headers[C]!==void 0?b.headers[C]+=", "+d[2]:b.headers[C]=d[2],b.rawHeaders.push(d[1],d[2])}}),b._charset="x-user-defined",!l.overrideMimeType){var F=b.rawHeaders["mime-type"];if(F){var M=F.match(/;\s*charset=([^;])(;|$)/);M&&(b._charset=M[1].toLowerCase())}b._charset||(b._charset="utf-8")}};o(f,c.Readable),f.prototype._read=function(){var E=this._resumeFetch;E&&(this._resumeFetch=null,E())},f.prototype._onXHRProgress=function(){var E=this,w=E._xhr,h=null;switch(E._mode){case"text:vbarray":if(w.readyState!==u.DONE)break;try{h=new s.VBArray(w.responseBody).toArray()}catch{}if(h!==null){E.push(new i(h));break}case"text":try{h=w.responseText}catch{E._mode="text:vbarray";break}if(h.length>E._pos){var g=h.substr(E._pos);if(E._charset==="x-user-defined"){for(var b=new i(g.length),R=0;R<g.length;R++)b[R]=255&g.charCodeAt(R);E.push(b)}else E.push(g,E._charset);E._pos=h.length}break;case"arraybuffer":if(w.readyState!==u.DONE||!w.response)break;h=w.response,E.push(new i(new Uint8Array(h)));break;case"moz-chunked-arraybuffer":if(h=w.response,w.readyState!==u.LOADING||!h)break;E.push(new i(new Uint8Array(h)));break;case"ms-stream":if(h=w.response,w.readyState!==u.LOADING)break;var j=new s.MSStreamReader;j.onprogress=function(){j.result.byteLength>E._pos&&(E.push(new i(new Uint8Array(j.result.slice(E._pos)))),E._pos=j.result.byteLength)},j.onload=function(){E.push(null)},j.readAsArrayBuffer(h)}E._xhr.readyState===u.DONE&&E._mode!=="ms-stream"&&E.push(null)}}).call(this,n(2),n(5).Buffer,n(6))},function(e,t,n){var r=n(194),i=n(196);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=M,t.resolve=function(A,d){return M(A,!1,!0).resolve(d)},t.resolveObject=function(A,d){return A?M(A,!1,!0).resolveObject(d):d},t.format=function(A){return i.isString(A)&&(A=M(A)),A instanceof s?A.format():s.prototype.format.call(A)},t.Url=s;var l=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
30
|
-
`," "]),f=["'"].concat(u),E=["%","/","?",";","#"].concat(f),w=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},j={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},F=n(197);function M(A,d,C){if(A&&i.isObject(A)&&A instanceof s)return A;var $=new s;return $.parse(A,d,C),$}s.prototype.parse=function(A,d,C){if(!i.isString(A))throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var $=A.indexOf("?"),q=$!==-1&&$<A.indexOf("#")?"?":"#",y=A.split(q);y[0]=y[0].replace(/\\/g,"/");var m=A=y.join(q);if(m=m.trim(),!C&&A.split("#").length===1){var I=c.exec(m);if(I)return this.path=m,this.href=m,this.pathname=I[1],I[2]?(this.search=I[2],this.query=d?F.parse(this.search.substr(1)):this.search.substr(1)):d&&(this.search="",this.query={}),this}var _=l.exec(m);if(_){var L=(_=_[0]).toLowerCase();this.protocol=L,m=m.substr(_.length)}if(C||_||m.match(/^\/\/[^@\/]+@[^@\/]+/)){var W=m.substr(0,2)==="//";!W||_&&R[_]||(m=m.substr(2),this.slashes=!0)}if(!R[_]&&(W||_&&!j[_])){for(var B,N,P=-1,z=0;z<w.length;z++)(O=m.indexOf(w[z]))!==-1&&(P===-1||O<P)&&(P=O);for((N=P===-1?m.lastIndexOf("@"):m.lastIndexOf("@",P))!==-1&&(B=m.slice(0,N),m=m.slice(N+1),this.auth=decodeURIComponent(B)),P=-1,z=0;z<E.length;z++){var O;(O=m.indexOf(E[z]))!==-1&&(P===-1||O<P)&&(P=O)}P===-1&&(P=m.length),this.host=m.slice(0,P),m=m.slice(P),this.parseHost(),this.hostname=this.hostname||"";var p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p)for(var U=this.hostname.split(/\./),V=(z=0,U.length);z<V;z++){var Q=U[z];if(Q&&!Q.match(h)){for(var ee="",ne=0,Y=Q.length;ne<Y;ne++)Q.charCodeAt(ne)>127?ee+="x":ee+=Q[ne];if(!ee.match(h)){var G=U.slice(0,z),S=U.slice(z+1),T=Q.match(g);T&&(G.push(T[1]),S.unshift(T[2])),S.length&&(m="/"+S.join(".")+m),this.hostname=G.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),p||(this.hostname=r.toASCII(this.hostname));var k=this.port?":"+this.port:"",J=this.hostname||"";this.host=J+k,this.href+=this.host,p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),m[0]!=="/"&&(m="/"+m))}if(!b[L])for(z=0,V=f.length;z<V;z++){var K=f[z];if(m.indexOf(K)!==-1){var re=encodeURIComponent(K);re===K&&(re=escape(K)),m=m.split(K).join(re)}}var se=m.indexOf("#");se!==-1&&(this.hash=m.substr(se),m=m.slice(0,se));var fe=m.indexOf("?");if(fe!==-1?(this.search=m.substr(fe),this.query=m.substr(fe+1),d&&(this.query=F.parse(this.query)),m=m.slice(0,fe)):d&&(this.search="",this.query={}),m&&(this.pathname=m),j[L]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){k=this.pathname||"";var ve=this.search||"";this.path=k+ve}return this.href=this.format(),this},s.prototype.format=function(){var A=this.auth||"";A&&(A=(A=encodeURIComponent(A)).replace(/%3A/i,":"),A+="@");var d=this.protocol||"",C=this.pathname||"",$=this.hash||"",q=!1,y="";this.host?q=A+this.host:this.hostname&&(q=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(q+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(y=F.stringify(this.query));var m=this.search||y&&"?"+y||"";return d&&d.substr(-1)!==":"&&(d+=":"),this.slashes||(!d||j[d])&&q!==!1?(q="//"+(q||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):q||(q=""),$&&$.charAt(0)!=="#"&&($="#"+$),m&&m.charAt(0)!=="?"&&(m="?"+m),d+q+(C=C.replace(/[?#]/g,function(I){return encodeURIComponent(I)}))+(m=m.replace("#","%23"))+$},s.prototype.resolve=function(A){return this.resolveObject(M(A,!1,!0)).format()},s.prototype.resolveObject=function(A){if(i.isString(A)){var d=new s;d.parse(A,!1,!0),A=d}for(var C=new s,$=Object.keys(this),q=0;q<$.length;q++){var y=$[q];C[y]=this[y]}if(C.hash=A.hash,A.href==="")return C.href=C.format(),C;if(A.slashes&&!A.protocol){for(var m=Object.keys(A),I=0;I<m.length;I++){var _=m[I];_!=="protocol"&&(C[_]=A[_])}return j[C.protocol]&&C.hostname&&!C.pathname&&(C.path=C.pathname="/"),C.href=C.format(),C}if(A.protocol&&A.protocol!==C.protocol){if(!j[A.protocol]){for(var L=Object.keys(A),W=0;W<L.length;W++){var B=L[W];C[B]=A[B]}return C.href=C.format(),C}if(C.protocol=A.protocol,A.host||R[A.protocol])C.pathname=A.pathname;else{for(var N=(A.pathname||"").split("/");N.length&&!(A.host=N.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),N[0]!==""&&N.unshift(""),N.length<2&&N.unshift(""),C.pathname=N.join("/")}if(C.search=A.search,C.query=A.query,C.host=A.host||"",C.auth=A.auth,C.hostname=A.hostname||A.host,C.port=A.port,C.pathname||C.search){var P=C.pathname||"",z=C.search||"";C.path=P+z}return C.slashes=C.slashes||A.slashes,C.href=C.format(),C}var O=C.pathname&&C.pathname.charAt(0)==="/",p=A.host||A.pathname&&A.pathname.charAt(0)==="/",U=p||O||C.host&&A.pathname,V=U,Q=C.pathname&&C.pathname.split("/")||[],ee=(N=A.pathname&&A.pathname.split("/")||[],C.protocol&&!j[C.protocol]);if(ee&&(C.hostname="",C.port=null,C.host&&(Q[0]===""?Q[0]=C.host:Q.unshift(C.host)),C.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(N[0]===""?N[0]=A.host:N.unshift(A.host)),A.host=null),U=U&&(N[0]===""||Q[0]==="")),p)C.host=A.host||A.host===""?A.host:C.host,C.hostname=A.hostname||A.hostname===""?A.hostname:C.hostname,C.search=A.search,C.query=A.query,Q=N;else if(N.length)Q||(Q=[]),Q.pop(),Q=Q.concat(N),C.search=A.search,C.query=A.query;else if(!i.isNullOrUndefined(A.search))return ee&&(C.hostname=C.host=Q.shift(),(T=!!(C.host&&C.host.indexOf("@")>0)&&C.host.split("@"))&&(C.auth=T.shift(),C.host=C.hostname=T.shift())),C.search=A.search,C.query=A.query,i.isNull(C.pathname)&&i.isNull(C.search)||(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C;if(!Q.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var ne=Q.slice(-1)[0],Y=(C.host||A.host||Q.length>1)&&(ne==="."||ne==="..")||ne==="",G=0,S=Q.length;S>=0;S--)(ne=Q[S])==="."?Q.splice(S,1):ne===".."?(Q.splice(S,1),G++):G&&(Q.splice(S,1),G--);if(!U&&!V)for(;G--;G)Q.unshift("..");!U||Q[0]===""||Q[0]&&Q[0].charAt(0)==="/"||Q.unshift(""),Y&&Q.join("/").substr(-1)!=="/"&&Q.push("");var T,k=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";return ee&&(C.hostname=C.host=k?"":Q.length?Q.shift():"",(T=!!(C.host&&C.host.indexOf("@")>0)&&C.host.split("@"))&&(C.auth=T.shift(),C.host=C.hostname=T.shift())),(U=U||C.host&&Q.length)&&!k&&Q.unshift(""),Q.length?C.pathname=Q.join("/"):(C.pathname=null,C.path=null),i.isNull(C.pathname)&&i.isNull(C.search)||(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=A.auth||C.auth,C.slashes=C.slashes||A.slashes,C.href=C.format(),C},s.prototype.parseHost=function(){var A=this.host,d=o.exec(A);d&&((d=d[0])!==":"&&(this.port=d.substr(1)),A=A.substr(0,A.length-d.length)),A&&(this.hostname=A)}},function(e,t,n){const r=i=>i!==null&&typeof i=="object"&&typeof i.pipe=="function";r.writable=i=>r(i)&&i.writable!==!1&&typeof i._write=="function"&&typeof i._writableState=="object",r.readable=i=>r(i)&&i.readable!==!1&&typeof i._read=="function"&&typeof i._readableState=="object",r.duplex=i=>r.writable(i)&&r.readable(i),r.transform=i=>r.duplex(i)&&typeof i._transform=="function"&&typeof i._transformState=="object",e.exports=r},function(e,t,n){function r(b){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(b)}function i(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}function s(b,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(R&&R.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),R&&l(b,R)}function l(b,R){return(l=Object.setPrototypeOf||function(j,F){return j.__proto__=F,j})(b,R)}function o(b){var R=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var j,F=u(b);if(R){var M=u(this).constructor;j=Reflect.construct(F,arguments,M)}else j=F.apply(this,arguments);return c(this,j)}}function c(b,R){return!R||r(R)!=="object"&&typeof R!="function"?function(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}(b):R}function u(b){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(b)}var f=n(3).LEVEL,E=n(50),w=n(202),h=n(38)("winston:create-logger");function g(b){return"is"+b.charAt(0).toUpperCase()+b.slice(1)+"Enabled"}e.exports=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b.levels=b.levels||E.npm.levels;var R=function(F){s(A,F);var M=o(A);function A(d){return i(this,A),M.call(this,d)}return A}(w),j=new R(b);return Object.keys(b.levels).forEach(function(F){h('Define prototype method for "%s"',F),F!=="log"?(R.prototype[F]=function(){for(var M=this||j,A=arguments.length,d=new Array(A),C=0;C<A;C++)d[C]=arguments[C];if(d.length===1){var $=d[0],q=$&&$.message&&$||{message:$};return q.level=q[f]=F,M._addDefaultMeta(q),M.write(q),this||j}return d.length===0?(M.log(F,""),M):M.log.apply(M,[F].concat(d))},R.prototype[g(F)]=function(){return(this||j).isLevelEnabled(F)}):console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.')}),j}},function(e,t,n){(function(r){function i(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var s=n(18),l=n(51),o=n(38)("winston:exception"),c=n(90),u=n(91),f=n(92);e.exports=function(){function E(g){if(function(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}(this,E),!g)throw new Error("Logger is required to handle exceptions");this.logger=g,this.handlers=new Map}var w,h;return w=E,(h=[{key:"handle",value:function(){for(var g=this,b=arguments.length,R=new Array(b),j=0;j<b;j++)R[j]=arguments[j];R.forEach(function(F){if(Array.isArray(F))return F.forEach(function(M){return g._addHandler(M)});g._addHandler(F)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),r.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var g=this;this.catcher&&(r.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(b){return g.logger.unpipe(b)}))}},{key:"getAllInfo",value:function(g){var b=g.message;return b||typeof g!="string"||(b=g),{error:g,level:"error",message:["uncaughtException: ".concat(b||"(no error message)"),g.stack||" No stack trace"].join(`
|
|
29
|
+
`,W+1);_=_.substring(B+1)}this.stack=_}}},o.inherits(h.AssertionError,Error),h.fail=F,h.ok=M,h.equal=function(y,m,I){y!=m&&F(y,m,I,"==",h.equal)},h.notEqual=function(y,m,I){y==m&&F(y,m,I,"!=",h.notEqual)},h.deepEqual=function(y,m,I){A(y,m,!1)||F(y,m,I,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(y,m,I){A(y,m,!0)||F(y,m,I,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(y,m,I){A(y,m,!1)&&F(y,m,I,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function y(m,I,_){A(m,I,!0)&&F(m,I,_,"notDeepStrictEqual",y)},h.strictEqual=function(y,m,I){y!==m&&F(y,m,I,"===",h.strictEqual)},h.notStrictEqual=function(y,m,I){y===m&&F(y,m,I,"!==",h.notStrictEqual)},h.throws=function(y,m,I){$(!0,y,m,I)},h.doesNotThrow=function(y,m,I){$(!1,y,m,I)},h.ifError=function(y){if(y)throw y},h.strict=i(function y(m,I){m||F(m,!0,I,"==",y)},h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var q=Object.keys||function(y){var m=[];for(var I in y)c.call(y,I)&&m.push(I);return m}}).call(this,n(6))},function(e,t,n){e.exports=function(r,i,s,l){for(var o=65535&r|0,c=r>>>16&65535|0,u=0;s!==0;){s-=u=s>2e3?2e3:s;do c=c+(o=o+i[l++]|0)|0;while(--u);o%=65521,c%=65521}return o|c<<16|0}},function(e,t,n){var r=function(){for(var i,s=[],l=0;l<256;l++){i=l;for(var o=0;o<8;o++)i=1&i?3988292384^i>>>1:i>>>1;s[l]=i}return s}();e.exports=function(i,s,l,o){var c=r,u=o+l;i^=-1;for(var f=o;f<u;f++)i=i>>>8^c[255&(i^s[f])];return-1^i}},function(e,t,n){(function(r,i){var s;e.exports=m,m.ReadableState=y,n(21).EventEmitter;var l=function(Y,G){return Y.listeners(G).length},o=n(78),c=n(5).Buffer,u=r.Uint8Array||function(){},f,E=n(179);f=E&&E.debuglog?E.debuglog("stream"):function(){};var w,h,g,b=n(180),R=n(79),j=n(80).getHighWaterMark,F=n(26).codes,M=F.ERR_INVALID_ARG_TYPE,A=F.ERR_STREAM_PUSH_AFTER_EOF,d=F.ERR_METHOD_NOT_IMPLEMENTED,C=F.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(m,o);var $=R.errorOrDestroy,q=["error","close","destroy","pause","resume"];function y(Y,G,S){s=s||n(27),Y=Y||{},typeof S!="boolean"&&(S=G instanceof s),this.objectMode=!!Y.objectMode,S&&(this.objectMode=this.objectMode||!!Y.readableObjectMode),this.highWaterMark=j(this,Y,"readableHighWaterMark",S),this.buffer=new b,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=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.destroyed=!1,this.defaultEncoding=Y.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Y.encoding&&(w||(w=n(22).StringDecoder),this.decoder=new w(Y.encoding),this.encoding=Y.encoding)}function m(Y){if(s=s||n(27),!(this instanceof m))return new m(Y);var G=this instanceof s;this._readableState=new y(Y,this,G),this.readable=!0,Y&&(typeof Y.read=="function"&&(this._read=Y.read),typeof Y.destroy=="function"&&(this._destroy=Y.destroy)),o.call(this)}function I(Y,G,S,T,k){f("readableAddChunk",G);var J,K=Y._readableState;if(G===null)K.reading=!1,function(re,se){if(f("onEofChunk"),!se.ended){if(se.decoder){var fe=se.decoder.end();fe&&fe.length&&(se.buffer.push(fe),se.length+=se.objectMode?1:fe.length)}se.ended=!0,se.sync?W(re):(se.needReadable=!1,se.emittedReadable||(se.emittedReadable=!0,B(re)))}}(Y,K);else if(k||(J=function(re,se){var fe;ve=se,c.isBuffer(ve)||ve instanceof u||typeof se=="string"||se===void 0||re.objectMode||(fe=new M("chunk",["string","Buffer","Uint8Array"],se));var ve;return fe}(K,G)),J)$(Y,J);else if(K.objectMode||G&&G.length>0)if(typeof G=="string"||K.objectMode||Object.getPrototypeOf(G)===c.prototype||(G=function(re){return c.from(re)}(G)),T)K.endEmitted?$(Y,new C):_(Y,K,G,!0);else if(K.ended)$(Y,new A);else{if(K.destroyed)return!1;K.reading=!1,K.decoder&&!S?(G=K.decoder.write(G),K.objectMode||G.length!==0?_(Y,K,G,!1):N(Y,K)):_(Y,K,G,!1)}else T||(K.reading=!1,N(Y,K));return!K.ended&&(K.length<K.highWaterMark||K.length===0)}function _(Y,G,S,T){G.flowing&&G.length===0&&!G.sync?(G.awaitDrain=0,Y.emit("data",S)):(G.length+=G.objectMode?1:S.length,T?G.buffer.unshift(S):G.buffer.push(S),G.needReadable&&W(Y)),N(Y,G)}Object.defineProperty(m.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Y){this._readableState&&(this._readableState.destroyed=Y)}}),m.prototype.destroy=R.destroy,m.prototype._undestroy=R.undestroy,m.prototype._destroy=function(Y,G){G(Y)},m.prototype.push=function(Y,G){var S,T=this._readableState;return T.objectMode?S=!0:typeof Y=="string"&&((G=G||T.defaultEncoding)!==T.encoding&&(Y=c.from(Y,G),G=""),S=!0),I(this,Y,G,!1,S)},m.prototype.unshift=function(Y){return I(this,Y,null,!0,!1)},m.prototype.isPaused=function(){return this._readableState.flowing===!1},m.prototype.setEncoding=function(Y){w||(w=n(22).StringDecoder);var G=new w(Y);this._readableState.decoder=G,this._readableState.encoding=this._readableState.decoder.encoding;for(var S=this._readableState.buffer.head,T="";S!==null;)T+=G.write(S.data),S=S.next;return this._readableState.buffer.clear(),T!==""&&this._readableState.buffer.push(T),this._readableState.length=T.length,this};function L(Y,G){return Y<=0||G.length===0&&G.ended?0:G.objectMode?1:Y!=Y?G.flowing&&G.length?G.buffer.head.data.length:G.length:(Y>G.highWaterMark&&(G.highWaterMark=function(S){return S>=1073741824?S=1073741824:(S--,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S++),S}(Y)),Y<=G.length?Y:G.ended?G.length:(G.needReadable=!0,0))}function W(Y){var G=Y._readableState;f("emitReadable",G.needReadable,G.emittedReadable),G.needReadable=!1,G.emittedReadable||(f("emitReadable",G.flowing),G.emittedReadable=!0,i.nextTick(B,Y))}function B(Y){var G=Y._readableState;f("emitReadable_",G.destroyed,G.length,G.ended),G.destroyed||!G.length&&!G.ended||(Y.emit("readable"),G.emittedReadable=!1),G.needReadable=!G.flowing&&!G.ended&&G.length<=G.highWaterMark,U(Y)}function N(Y,G){G.readingMore||(G.readingMore=!0,i.nextTick(D,Y,G))}function D(Y,G){for(;!G.reading&&!G.ended&&(G.length<G.highWaterMark||G.flowing&&G.length===0);){var S=G.length;if(f("maybeReadMore read 0"),Y.read(0),S===G.length)break}G.readingMore=!1}function z(Y){var G=Y._readableState;G.readableListening=Y.listenerCount("readable")>0,G.resumeScheduled&&!G.paused?G.flowing=!0:Y.listenerCount("data")>0&&Y.resume()}function O(Y){f("readable nexttick read 0"),Y.read(0)}function p(Y,G){f("resume",G.reading),G.reading||Y.read(0),G.resumeScheduled=!1,Y.emit("resume"),U(Y),G.flowing&&!G.reading&&Y.read(0)}function U(Y){var G=Y._readableState;for(f("flow",G.flowing);G.flowing&&Y.read()!==null;);}function V(Y,G){return G.length===0?null:(G.objectMode?S=G.buffer.shift():!Y||Y>=G.length?(S=G.decoder?G.buffer.join(""):G.buffer.length===1?G.buffer.first():G.buffer.concat(G.length),G.buffer.clear()):S=G.buffer.consume(Y,G.decoder),S);var S}function Q(Y){var G=Y._readableState;f("endReadable",G.endEmitted),G.endEmitted||(G.ended=!0,i.nextTick(ee,G,Y))}function ee(Y,G){if(f("endReadableNT",Y.endEmitted,Y.length),!Y.endEmitted&&Y.length===0&&(Y.endEmitted=!0,G.readable=!1,G.emit("end"),Y.autoDestroy)){var S=G._writableState;(!S||S.autoDestroy&&S.finished)&&G.destroy()}}function ne(Y,G){for(var S=0,T=Y.length;S<T;S++)if(Y[S]===G)return S;return-1}m.prototype.read=function(Y){f("read",Y),Y=parseInt(Y,10);var G=this._readableState,S=Y;if(Y!==0&&(G.emittedReadable=!1),Y===0&&G.needReadable&&((G.highWaterMark!==0?G.length>=G.highWaterMark:G.length>0)||G.ended))return f("read: emitReadable",G.length,G.ended),G.length===0&&G.ended?Q(this):W(this),null;if((Y=L(Y,G))===0&&G.ended)return G.length===0&&Q(this),null;var T,k=G.needReadable;return f("need readable",k),(G.length===0||G.length-Y<G.highWaterMark)&&f("length less than watermark",k=!0),G.ended||G.reading?f("reading or ended",k=!1):k&&(f("do read"),G.reading=!0,G.sync=!0,G.length===0&&(G.needReadable=!0),this._read(G.highWaterMark),G.sync=!1,G.reading||(Y=L(S,G))),(T=Y>0?V(Y,G):null)===null?(G.needReadable=G.length<=G.highWaterMark,Y=0):(G.length-=Y,G.awaitDrain=0),G.length===0&&(G.ended||(G.needReadable=!0),S!==Y&&G.ended&&Q(this)),T!==null&&this.emit("data",T),T},m.prototype._read=function(Y){$(this,new d("_read()"))},m.prototype.pipe=function(Y,G){var S=this,T=this._readableState;switch(T.pipesCount){case 0:T.pipes=Y;break;case 1:T.pipes=[T.pipes,Y];break;default:T.pipes.push(Y)}T.pipesCount+=1,f("pipe count=%d opts=%j",T.pipesCount,G);var k=(!G||G.end!==!1)&&Y!==i.stdout&&Y!==i.stderr?K:Ie;function J(Te,Oe){f("onunpipe"),Te===S&&Oe&&Oe.hasUnpiped===!1&&(Oe.hasUnpiped=!0,f("cleanup"),Y.removeListener("close",Ce),Y.removeListener("finish",Se),Y.removeListener("drain",re),Y.removeListener("error",ve),Y.removeListener("unpipe",J),S.removeListener("end",K),S.removeListener("end",Ie),S.removeListener("data",fe),se=!0,!T.awaitDrain||Y._writableState&&!Y._writableState.needDrain||re())}function K(){f("onend"),Y.end()}T.endEmitted?i.nextTick(k):S.once("end",k),Y.on("unpipe",J);var re=function(Te){return function(){var Oe=Te._readableState;f("pipeOnDrain",Oe.awaitDrain),Oe.awaitDrain&&Oe.awaitDrain--,Oe.awaitDrain===0&&l(Te,"data")&&(Oe.flowing=!0,U(Te))}}(S);Y.on("drain",re);var se=!1;function fe(Te){f("ondata");var Oe=Y.write(Te);f("dest.write",Oe),Oe===!1&&((T.pipesCount===1&&T.pipes===Y||T.pipesCount>1&&ne(T.pipes,Y)!==-1)&&!se&&(f("false write response, pause",T.awaitDrain),T.awaitDrain++),S.pause())}function ve(Te){f("onerror",Te),Ie(),Y.removeListener("error",ve),l(Y,"error")===0&&$(Y,Te)}function Ce(){Y.removeListener("finish",Se),Ie()}function Se(){f("onfinish"),Y.removeListener("close",Ce),Ie()}function Ie(){f("unpipe"),S.unpipe(Y)}return S.on("data",fe),function(Te,Oe,De){if(typeof Te.prependListener=="function")return Te.prependListener(Oe,De);Te._events&&Te._events[Oe]?Array.isArray(Te._events[Oe])?Te._events[Oe].unshift(De):Te._events[Oe]=[De,Te._events[Oe]]:Te.on(Oe,De)}(Y,"error",ve),Y.once("close",Ce),Y.once("finish",Se),Y.emit("pipe",S),T.flowing||(f("pipe resume"),S.resume()),Y},m.prototype.unpipe=function(Y){var G=this._readableState,S={hasUnpiped:!1};if(G.pipesCount===0)return this;if(G.pipesCount===1)return Y&&Y!==G.pipes||(Y||(Y=G.pipes),G.pipes=null,G.pipesCount=0,G.flowing=!1,Y&&Y.emit("unpipe",this,S)),this;if(!Y){var T=G.pipes,k=G.pipesCount;G.pipes=null,G.pipesCount=0,G.flowing=!1;for(var J=0;J<k;J++)T[J].emit("unpipe",this,{hasUnpiped:!1});return this}var K=ne(G.pipes,Y);return K===-1||(G.pipes.splice(K,1),G.pipesCount-=1,G.pipesCount===1&&(G.pipes=G.pipes[0]),Y.emit("unpipe",this,S)),this},m.prototype.on=function(Y,G){var S=o.prototype.on.call(this,Y,G),T=this._readableState;return Y==="data"?(T.readableListening=this.listenerCount("readable")>0,T.flowing!==!1&&this.resume()):Y==="readable"&&(T.endEmitted||T.readableListening||(T.readableListening=T.needReadable=!0,T.flowing=!1,T.emittedReadable=!1,f("on readable",T.length,T.reading),T.length?W(this):T.reading||i.nextTick(O,this))),S},m.prototype.addListener=m.prototype.on,m.prototype.removeListener=function(Y,G){var S=o.prototype.removeListener.call(this,Y,G);return Y==="readable"&&i.nextTick(z,this),S},m.prototype.removeAllListeners=function(Y){var G=o.prototype.removeAllListeners.apply(this,arguments);return Y!=="readable"&&Y!==void 0||i.nextTick(z,this),G},m.prototype.resume=function(){var Y=this._readableState;return Y.flowing||(f("resume"),Y.flowing=!Y.readableListening,function(G,S){S.resumeScheduled||(S.resumeScheduled=!0,i.nextTick(p,G,S))}(this,Y)),Y.paused=!1,this},m.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},m.prototype.wrap=function(Y){var G=this,S=this._readableState,T=!1;for(var k in Y.on("end",function(){if(f("wrapped end"),S.decoder&&!S.ended){var K=S.decoder.end();K&&K.length&&G.push(K)}G.push(null)}),Y.on("data",function(K){f("wrapped data"),S.decoder&&(K=S.decoder.write(K)),S.objectMode&&K==null||(S.objectMode||K&&K.length)&&(G.push(K)||(T=!0,Y.pause()))}),Y)this[k]===void 0&&typeof Y[k]=="function"&&(this[k]=function(K){return function(){return Y[K].apply(Y,arguments)}}(k));for(var J=0;J<q.length;J++)Y.on(q[J],this.emit.bind(this,q[J]));return this._read=function(K){f("wrapped _read",K),T&&(T=!1,Y.resume())},this},typeof Symbol=="function"&&(m.prototype[Symbol.asyncIterator]=function(){return h===void 0&&(h=n(182)),h(this)}),Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(m.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(m.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Y){this._readableState&&(this._readableState.flowing=Y)}}),m._fromList=V,Object.defineProperty(m.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(m.from=function(Y,G){return g===void 0&&(g=n(183)),g(m,Y,G)})}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){(function(r){function i(o,c){l(o,c),s(o)}function s(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function l(o,c){o.emit("error",c)}e.exports={destroy:function(o,c){var u=this,f=this._readableState&&this._readableState.destroyed,E=this._writableState&&this._writableState.destroyed;return f||E?(c?c(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(l,this,o)):r.nextTick(l,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(w){!c&&w?u._writableState?u._writableState.errorEmitted?r.nextTick(s,u):(u._writableState.errorEmitted=!0,r.nextTick(i,u,w)):r.nextTick(i,u,w):c?(r.nextTick(s,u),c(w)):r.nextTick(s,u)}),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(o,c){var u=o._readableState,f=o._writableState;u&&u.autoDestroy||f&&f.autoDestroy?o.destroy(c):o.emit("error",c)}}}).call(this,n(2))},function(e,t,n){var r=n(26).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(i,s,l,o){var c=function(u,f,E){return u.highWaterMark!=null?u.highWaterMark:f?u[E]:null}(s,o,l);if(c!=null){if(!isFinite(c)||Math.floor(c)!==c||c<0)throw new r(o?l:"highWaterMark",c);return Math.floor(c)}return i.objectMode?16:16384}}},function(e,t,n){(function(r,i){function s(D){var z=this;this.next=null,this.entry=null,this.finish=function(){(function(O,p,U){var V=O.entry;for(O.entry=null;V;){var Q=V.callback;p.pendingcb--,Q(U),V=V.next}p.corkedRequestsFree.next=O})(z,D)}}var l;e.exports=m,m.WritableState=y;var o={deprecate:n(43)},c=n(78),u=n(5).Buffer,f=r.Uint8Array||function(){},E,w=n(79),h=n(80).getHighWaterMark,g=n(26).codes,b=g.ERR_INVALID_ARG_TYPE,R=g.ERR_METHOD_NOT_IMPLEMENTED,j=g.ERR_MULTIPLE_CALLBACK,F=g.ERR_STREAM_CANNOT_PIPE,M=g.ERR_STREAM_DESTROYED,A=g.ERR_STREAM_NULL_VALUES,d=g.ERR_STREAM_WRITE_AFTER_END,C=g.ERR_UNKNOWN_ENCODING,$=w.errorOrDestroy;function q(){}function y(D,z,O){l=l||n(27),D=D||{},typeof O!="boolean"&&(O=z instanceof l),this.objectMode=!!D.objectMode,O&&(this.objectMode=this.objectMode||!!D.writableObjectMode),this.highWaterMark=h(this,D,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=D.decodeStrings===!1;this.decodeStrings=!p,this.defaultEncoding=D.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(U){(function(V,Q){var ee=V._writableState,ne=ee.sync,Y=ee.writecb;if(typeof Y!="function")throw new j;if(function(S){S.writing=!1,S.writecb=null,S.length-=S.writelen,S.writelen=0}(ee),Q)(function(S,T,k,J,K){--T.pendingcb,k?(i.nextTick(K,J),i.nextTick(N,S,T),S._writableState.errorEmitted=!0,$(S,J)):(K(J),S._writableState.errorEmitted=!0,$(S,J),N(S,T))})(V,ee,ne,Q,Y);else{var G=W(ee)||V.destroyed;G||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||L(V,ee),ne?i.nextTick(_,V,ee,G,Y):_(V,ee,G,Y)}})(z,U)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function m(D){var z=this instanceof(l=l||n(27));if(!z&&!E.call(m,this))return new m(D);this._writableState=new y(D,this,z),this.writable=!0,D&&(typeof D.write=="function"&&(this._write=D.write),typeof D.writev=="function"&&(this._writev=D.writev),typeof D.destroy=="function"&&(this._destroy=D.destroy),typeof D.final=="function"&&(this._final=D.final)),c.call(this)}function I(D,z,O,p,U,V,Q){z.writelen=p,z.writecb=Q,z.writing=!0,z.sync=!0,z.destroyed?z.onwrite(new M("write")):O?D._writev(U,z.onwrite):D._write(U,V,z.onwrite),z.sync=!1}function _(D,z,O,p){O||function(U,V){V.length===0&&V.needDrain&&(V.needDrain=!1,U.emit("drain"))}(D,z),z.pendingcb--,p(),N(D,z)}function L(D,z){z.bufferProcessing=!0;var O=z.bufferedRequest;if(D._writev&&O&&O.next){var p=z.bufferedRequestCount,U=new Array(p),V=z.corkedRequestsFree;V.entry=O;for(var Q=0,ee=!0;O;)U[Q]=O,O.isBuf||(ee=!1),O=O.next,Q+=1;U.allBuffers=ee,I(D,z,!0,z.length,U,"",V.finish),z.pendingcb++,z.lastBufferedRequest=null,V.next?(z.corkedRequestsFree=V.next,V.next=null):z.corkedRequestsFree=new s(z),z.bufferedRequestCount=0}else{for(;O;){var ne=O.chunk,Y=O.encoding,G=O.callback;if(I(D,z,!1,z.objectMode?1:ne.length,ne,Y,G),O=O.next,z.bufferedRequestCount--,z.writing)break}O===null&&(z.lastBufferedRequest=null)}z.bufferedRequest=O,z.bufferProcessing=!1}function W(D){return D.ending&&D.length===0&&D.bufferedRequest===null&&!D.finished&&!D.writing}function B(D,z){D._final(function(O){z.pendingcb--,O&&$(D,O),z.prefinished=!0,D.emit("prefinish"),N(D,z)})}function N(D,z){var O=W(z);if(O&&(function(U,V){V.prefinished||V.finalCalled||(typeof U._final!="function"||V.destroyed?(V.prefinished=!0,U.emit("prefinish")):(V.pendingcb++,V.finalCalled=!0,i.nextTick(B,U,V)))}(D,z),z.pendingcb===0&&(z.finished=!0,D.emit("finish"),z.autoDestroy))){var p=D._readableState;(!p||p.autoDestroy&&p.endEmitted)&&D.destroy()}return O}n(7)(m,c),y.prototype.getBuffer=function(){for(var D=this.bufferedRequest,z=[];D;)z.push(D),D=D.next;return z},function(){try{Object.defineProperty(y.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(E=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(D){return!!E.call(this,D)||this===m&&D&&D._writableState instanceof y}})):E=function(D){return D instanceof this},m.prototype.pipe=function(){$(this,new F)},m.prototype.write=function(D,z,O){var p,U=this._writableState,V=!1,Q=!U.objectMode&&(p=D,u.isBuffer(p)||p instanceof f);return Q&&!u.isBuffer(D)&&(D=function(ee){return u.from(ee)}(D)),typeof z=="function"&&(O=z,z=null),Q?z="buffer":z||(z=U.defaultEncoding),typeof O!="function"&&(O=q),U.ending?function(ee,ne){var Y=new d;$(ee,Y),i.nextTick(ne,Y)}(this,O):(Q||function(ee,ne,Y,G){var S;return Y===null?S=new A:typeof Y=="string"||ne.objectMode||(S=new b("chunk",["string","Buffer"],Y)),!S||($(ee,S),i.nextTick(G,S),!1)}(this,U,D,O))&&(U.pendingcb++,V=function(ee,ne,Y,G,S,T){if(!Y){var k=function(se,fe,ve){return se.objectMode||se.decodeStrings===!1||typeof fe!="string"||(fe=u.from(fe,ve)),fe}(ne,G,S);G!==k&&(Y=!0,S="buffer",G=k)}var J=ne.objectMode?1:G.length;ne.length+=J;var K=ne.length<ne.highWaterMark;if(K||(ne.needDrain=!0),ne.writing||ne.corked){var re=ne.lastBufferedRequest;ne.lastBufferedRequest={chunk:G,encoding:S,isBuf:Y,callback:T,next:null},re?re.next=ne.lastBufferedRequest:ne.bufferedRequest=ne.lastBufferedRequest,ne.bufferedRequestCount+=1}else I(ee,ne,!1,J,G,S,T);return K}(this,U,Q,D,z,O)),V},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var D=this._writableState;D.corked&&(D.corked--,D.writing||D.corked||D.bufferProcessing||!D.bufferedRequest||L(this,D))},m.prototype.setDefaultEncoding=function(D){if(typeof D=="string"&&(D=D.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((D+"").toLowerCase())>-1))throw new C(D);return this._writableState.defaultEncoding=D,this},Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(D,z,O){O(new R("_write()"))},m.prototype._writev=null,m.prototype.end=function(D,z,O){var p=this._writableState;return typeof D=="function"?(O=D,D=null,z=null):typeof z=="function"&&(O=z,z=null),D!=null&&this.write(D,z),p.corked&&(p.corked=1,this.uncork()),p.ending||function(U,V,Q){V.ending=!0,N(U,V),Q&&(V.finished?i.nextTick(Q):U.once("finish",Q)),V.ended=!0,U.writable=!1}(this,p,O),this},Object.defineProperty(m.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(m.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(D){this._writableState&&(this._writableState.destroyed=D)}}),m.prototype.destroy=w.destroy,m.prototype._undestroy=w.undestroy,m.prototype._destroy=function(D,z){z(D)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=f;var r=n(26).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,l=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(27);function u(h,g){var b=this._transformState;b.transforming=!1;var R=b.writecb;if(R===null)return this.emit("error",new s);b.writechunk=null,b.writecb=null,g!=null&&this.push(g),R(h);var j=this._readableState;j.reading=!1,(j.needReadable||j.length<j.highWaterMark)&&this._read(j.highWaterMark)}function f(h){if(!(this instanceof f))return new f(h);c.call(this,h),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",E)}function E(){var h=this;typeof this._flush!="function"||this._readableState.destroyed?w(this,null,null):this._flush(function(g,b){w(h,g,b)})}function w(h,g,b){if(g)return h.emit("error",g);if(b!=null&&h.push(b),h._writableState.length)throw new o;if(h._transformState.transforming)throw new l;return h.push(null)}n(7)(f,c),f.prototype.push=function(h,g){return this._transformState.needTransform=!1,c.prototype.push.call(this,h,g)},f.prototype._transform=function(h,g,b){b(new i("_transform()"))},f.prototype._write=function(h,g,b){var R=this._transformState;if(R.writecb=b,R.writechunk=h,R.writeencoding=g,!R.transforming){var j=this._readableState;(R.needTransform||j.needReadable||j.length<j.highWaterMark)&&this._read(j.highWaterMark)}},f.prototype._read=function(h){var g=this._transformState;g.writechunk===null||g.transforming?g.needTransform=!0:(g.transforming=!0,this._transform(g.writechunk,g.writeencoding,g.afterTransform))},f.prototype._destroy=function(h,g){c.prototype._destroy.call(this,h,function(b){g(b)})}},function(e,t,n){(function(r){var i=n(190),s=n(85),l=n(192),o=n(193),c=n(86),u=t;u.request=function(f,E){f=typeof f=="string"?c.parse(f):l(f);var w=r.location.protocol.search(/^https?:$/)===-1?"http:":"",h=f.protocol||w,g=f.hostname||f.host,b=f.port,R=f.path||"/";g&&g.indexOf(":")!==-1&&(g="["+g+"]"),f.url=(g?h+"//"+g:"")+(b?":"+b:"")+R,f.method=(f.method||"GET").toUpperCase(),f.headers=f.headers||{};var j=new i(f);return E&&j.on("response",E),j},u.get=function(f,E){var w=u.request(f,E);return w.end(),w},u.ClientRequest=i,u.IncomingMessage=s.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(6))},function(e,t,n){(function(r){t.fetch=u(r.fetch)&&u(r.ReadableStream),t.writableStream=u(r.WritableStream),t.abortController=u(r.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch{}var i;function s(){if(i!==void 0)return i;if(r.XMLHttpRequest){i=new r.XMLHttpRequest;try{i.open("GET",r.XDomainRequest?"/":"https://example.com")}catch{i=null}}else i=null;return i}function l(f){var E=s();if(!E)return!1;try{return E.responseType=f,E.responseType===f}catch{}return!1}var o=r.ArrayBuffer!==void 0,c=o&&u(r.ArrayBuffer.prototype.slice);function u(f){return typeof f=="function"}t.arraybuffer=t.fetch||o&&l("arraybuffer"),t.msstream=!t.fetch&&c&&l("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&l("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!s()&&u(s().overrideMimeType),t.vbArray=u(r.VBArray),i=null}).call(this,n(6))},function(e,t,n){(function(r,i,s){var l=n(84),o=n(7),c=n(31),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=t.IncomingMessage=function(E,w,h,g){var b=this;if(c.Readable.call(b),b._mode=h,b.headers={},b.rawHeaders=[],b.trailers={},b.rawTrailers=[],b.on("end",function(){r.nextTick(function(){b.emit("close")})}),h==="fetch"){if(b._fetchResponse=w,b.url=w.url,b.statusCode=w.status,b.statusMessage=w.statusText,w.headers.forEach(function(A,d){b.headers[d.toLowerCase()]=A,b.rawHeaders.push(d,A)}),l.writableStream){var R=new WritableStream({write:function(A){return new Promise(function(d,C){b._destroyed?C():b.push(new i(A))?d():b._resumeFetch=d})},close:function(){s.clearTimeout(g),b._destroyed||b.push(null)},abort:function(A){b._destroyed||b.emit("error",A)}});try{return void w.body.pipeTo(R).catch(function(A){s.clearTimeout(g),b._destroyed||b.emit("error",A)})}catch{}}var j=w.body.getReader();(function A(){j.read().then(function(d){if(!b._destroyed){if(d.done)return s.clearTimeout(g),void b.push(null);b.push(new i(d.value)),A()}}).catch(function(d){s.clearTimeout(g),b._destroyed||b.emit("error",d)})})()}else if(b._xhr=E,b._pos=0,b.url=E.responseURL,b.statusCode=E.status,b.statusMessage=E.statusText,E.getAllResponseHeaders().split(/\r?\n/).forEach(function(A){var d=A.match(/^([^:]+):\s*(.*)/);if(d){var C=d[1].toLowerCase();C==="set-cookie"?(b.headers[C]===void 0&&(b.headers[C]=[]),b.headers[C].push(d[2])):b.headers[C]!==void 0?b.headers[C]+=", "+d[2]:b.headers[C]=d[2],b.rawHeaders.push(d[1],d[2])}}),b._charset="x-user-defined",!l.overrideMimeType){var F=b.rawHeaders["mime-type"];if(F){var M=F.match(/;\s*charset=([^;])(;|$)/);M&&(b._charset=M[1].toLowerCase())}b._charset||(b._charset="utf-8")}};o(f,c.Readable),f.prototype._read=function(){var E=this._resumeFetch;E&&(this._resumeFetch=null,E())},f.prototype._onXHRProgress=function(){var E=this,w=E._xhr,h=null;switch(E._mode){case"text:vbarray":if(w.readyState!==u.DONE)break;try{h=new s.VBArray(w.responseBody).toArray()}catch{}if(h!==null){E.push(new i(h));break}case"text":try{h=w.responseText}catch{E._mode="text:vbarray";break}if(h.length>E._pos){var g=h.substr(E._pos);if(E._charset==="x-user-defined"){for(var b=new i(g.length),R=0;R<g.length;R++)b[R]=255&g.charCodeAt(R);E.push(b)}else E.push(g,E._charset);E._pos=h.length}break;case"arraybuffer":if(w.readyState!==u.DONE||!w.response)break;h=w.response,E.push(new i(new Uint8Array(h)));break;case"moz-chunked-arraybuffer":if(h=w.response,w.readyState!==u.LOADING||!h)break;E.push(new i(new Uint8Array(h)));break;case"ms-stream":if(h=w.response,w.readyState!==u.LOADING)break;var j=new s.MSStreamReader;j.onprogress=function(){j.result.byteLength>E._pos&&(E.push(new i(new Uint8Array(j.result.slice(E._pos)))),E._pos=j.result.byteLength)},j.onload=function(){E.push(null)},j.readAsArrayBuffer(h)}E._xhr.readyState===u.DONE&&E._mode!=="ms-stream"&&E.push(null)}}).call(this,n(2),n(5).Buffer,n(6))},function(e,t,n){var r=n(194),i=n(196);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=M,t.resolve=function(A,d){return M(A,!1,!0).resolve(d)},t.resolveObject=function(A,d){return A?M(A,!1,!0).resolveObject(d):d},t.format=function(A){return i.isString(A)&&(A=M(A)),A instanceof s?A.format():s.prototype.format.call(A)},t.Url=s;var l=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
30
|
+
`," "]),f=["'"].concat(u),E=["%","/","?",";","#"].concat(f),w=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},j={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},F=n(197);function M(A,d,C){if(A&&i.isObject(A)&&A instanceof s)return A;var $=new s;return $.parse(A,d,C),$}s.prototype.parse=function(A,d,C){if(!i.isString(A))throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var $=A.indexOf("?"),q=$!==-1&&$<A.indexOf("#")?"?":"#",y=A.split(q);y[0]=y[0].replace(/\\/g,"/");var m=A=y.join(q);if(m=m.trim(),!C&&A.split("#").length===1){var I=c.exec(m);if(I)return this.path=m,this.href=m,this.pathname=I[1],I[2]?(this.search=I[2],this.query=d?F.parse(this.search.substr(1)):this.search.substr(1)):d&&(this.search="",this.query={}),this}var _=l.exec(m);if(_){var L=(_=_[0]).toLowerCase();this.protocol=L,m=m.substr(_.length)}if(C||_||m.match(/^\/\/[^@\/]+@[^@\/]+/)){var W=m.substr(0,2)==="//";!W||_&&R[_]||(m=m.substr(2),this.slashes=!0)}if(!R[_]&&(W||_&&!j[_])){for(var B,N,D=-1,z=0;z<w.length;z++)(O=m.indexOf(w[z]))!==-1&&(D===-1||O<D)&&(D=O);for((N=D===-1?m.lastIndexOf("@"):m.lastIndexOf("@",D))!==-1&&(B=m.slice(0,N),m=m.slice(N+1),this.auth=decodeURIComponent(B)),D=-1,z=0;z<E.length;z++){var O;(O=m.indexOf(E[z]))!==-1&&(D===-1||O<D)&&(D=O)}D===-1&&(D=m.length),this.host=m.slice(0,D),m=m.slice(D),this.parseHost(),this.hostname=this.hostname||"";var p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p)for(var U=this.hostname.split(/\./),V=(z=0,U.length);z<V;z++){var Q=U[z];if(Q&&!Q.match(h)){for(var ee="",ne=0,Y=Q.length;ne<Y;ne++)Q.charCodeAt(ne)>127?ee+="x":ee+=Q[ne];if(!ee.match(h)){var G=U.slice(0,z),S=U.slice(z+1),T=Q.match(g);T&&(G.push(T[1]),S.unshift(T[2])),S.length&&(m="/"+S.join(".")+m),this.hostname=G.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),p||(this.hostname=r.toASCII(this.hostname));var k=this.port?":"+this.port:"",J=this.hostname||"";this.host=J+k,this.href+=this.host,p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),m[0]!=="/"&&(m="/"+m))}if(!b[L])for(z=0,V=f.length;z<V;z++){var K=f[z];if(m.indexOf(K)!==-1){var re=encodeURIComponent(K);re===K&&(re=escape(K)),m=m.split(K).join(re)}}var se=m.indexOf("#");se!==-1&&(this.hash=m.substr(se),m=m.slice(0,se));var fe=m.indexOf("?");if(fe!==-1?(this.search=m.substr(fe),this.query=m.substr(fe+1),d&&(this.query=F.parse(this.query)),m=m.slice(0,fe)):d&&(this.search="",this.query={}),m&&(this.pathname=m),j[L]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){k=this.pathname||"";var ve=this.search||"";this.path=k+ve}return this.href=this.format(),this},s.prototype.format=function(){var A=this.auth||"";A&&(A=(A=encodeURIComponent(A)).replace(/%3A/i,":"),A+="@");var d=this.protocol||"",C=this.pathname||"",$=this.hash||"",q=!1,y="";this.host?q=A+this.host:this.hostname&&(q=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(q+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(y=F.stringify(this.query));var m=this.search||y&&"?"+y||"";return d&&d.substr(-1)!==":"&&(d+=":"),this.slashes||(!d||j[d])&&q!==!1?(q="//"+(q||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):q||(q=""),$&&$.charAt(0)!=="#"&&($="#"+$),m&&m.charAt(0)!=="?"&&(m="?"+m),d+q+(C=C.replace(/[?#]/g,function(I){return encodeURIComponent(I)}))+(m=m.replace("#","%23"))+$},s.prototype.resolve=function(A){return this.resolveObject(M(A,!1,!0)).format()},s.prototype.resolveObject=function(A){if(i.isString(A)){var d=new s;d.parse(A,!1,!0),A=d}for(var C=new s,$=Object.keys(this),q=0;q<$.length;q++){var y=$[q];C[y]=this[y]}if(C.hash=A.hash,A.href==="")return C.href=C.format(),C;if(A.slashes&&!A.protocol){for(var m=Object.keys(A),I=0;I<m.length;I++){var _=m[I];_!=="protocol"&&(C[_]=A[_])}return j[C.protocol]&&C.hostname&&!C.pathname&&(C.path=C.pathname="/"),C.href=C.format(),C}if(A.protocol&&A.protocol!==C.protocol){if(!j[A.protocol]){for(var L=Object.keys(A),W=0;W<L.length;W++){var B=L[W];C[B]=A[B]}return C.href=C.format(),C}if(C.protocol=A.protocol,A.host||R[A.protocol])C.pathname=A.pathname;else{for(var N=(A.pathname||"").split("/");N.length&&!(A.host=N.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),N[0]!==""&&N.unshift(""),N.length<2&&N.unshift(""),C.pathname=N.join("/")}if(C.search=A.search,C.query=A.query,C.host=A.host||"",C.auth=A.auth,C.hostname=A.hostname||A.host,C.port=A.port,C.pathname||C.search){var D=C.pathname||"",z=C.search||"";C.path=D+z}return C.slashes=C.slashes||A.slashes,C.href=C.format(),C}var O=C.pathname&&C.pathname.charAt(0)==="/",p=A.host||A.pathname&&A.pathname.charAt(0)==="/",U=p||O||C.host&&A.pathname,V=U,Q=C.pathname&&C.pathname.split("/")||[],ee=(N=A.pathname&&A.pathname.split("/")||[],C.protocol&&!j[C.protocol]);if(ee&&(C.hostname="",C.port=null,C.host&&(Q[0]===""?Q[0]=C.host:Q.unshift(C.host)),C.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(N[0]===""?N[0]=A.host:N.unshift(A.host)),A.host=null),U=U&&(N[0]===""||Q[0]==="")),p)C.host=A.host||A.host===""?A.host:C.host,C.hostname=A.hostname||A.hostname===""?A.hostname:C.hostname,C.search=A.search,C.query=A.query,Q=N;else if(N.length)Q||(Q=[]),Q.pop(),Q=Q.concat(N),C.search=A.search,C.query=A.query;else if(!i.isNullOrUndefined(A.search))return ee&&(C.hostname=C.host=Q.shift(),(T=!!(C.host&&C.host.indexOf("@")>0)&&C.host.split("@"))&&(C.auth=T.shift(),C.host=C.hostname=T.shift())),C.search=A.search,C.query=A.query,i.isNull(C.pathname)&&i.isNull(C.search)||(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C;if(!Q.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var ne=Q.slice(-1)[0],Y=(C.host||A.host||Q.length>1)&&(ne==="."||ne==="..")||ne==="",G=0,S=Q.length;S>=0;S--)(ne=Q[S])==="."?Q.splice(S,1):ne===".."?(Q.splice(S,1),G++):G&&(Q.splice(S,1),G--);if(!U&&!V)for(;G--;G)Q.unshift("..");!U||Q[0]===""||Q[0]&&Q[0].charAt(0)==="/"||Q.unshift(""),Y&&Q.join("/").substr(-1)!=="/"&&Q.push("");var T,k=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";return ee&&(C.hostname=C.host=k?"":Q.length?Q.shift():"",(T=!!(C.host&&C.host.indexOf("@")>0)&&C.host.split("@"))&&(C.auth=T.shift(),C.host=C.hostname=T.shift())),(U=U||C.host&&Q.length)&&!k&&Q.unshift(""),Q.length?C.pathname=Q.join("/"):(C.pathname=null,C.path=null),i.isNull(C.pathname)&&i.isNull(C.search)||(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=A.auth||C.auth,C.slashes=C.slashes||A.slashes,C.href=C.format(),C},s.prototype.parseHost=function(){var A=this.host,d=o.exec(A);d&&((d=d[0])!==":"&&(this.port=d.substr(1)),A=A.substr(0,A.length-d.length)),A&&(this.hostname=A)}},function(e,t,n){const r=i=>i!==null&&typeof i=="object"&&typeof i.pipe=="function";r.writable=i=>r(i)&&i.writable!==!1&&typeof i._write=="function"&&typeof i._writableState=="object",r.readable=i=>r(i)&&i.readable!==!1&&typeof i._read=="function"&&typeof i._readableState=="object",r.duplex=i=>r.writable(i)&&r.readable(i),r.transform=i=>r.duplex(i)&&typeof i._transform=="function"&&typeof i._transformState=="object",e.exports=r},function(e,t,n){function r(b){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(b)}function i(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}function s(b,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(R&&R.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),R&&l(b,R)}function l(b,R){return(l=Object.setPrototypeOf||function(j,F){return j.__proto__=F,j})(b,R)}function o(b){var R=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var j,F=u(b);if(R){var M=u(this).constructor;j=Reflect.construct(F,arguments,M)}else j=F.apply(this,arguments);return c(this,j)}}function c(b,R){return!R||r(R)!=="object"&&typeof R!="function"?function(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}(b):R}function u(b){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(b)}var f=n(3).LEVEL,E=n(50),w=n(202),h=n(38)("winston:create-logger");function g(b){return"is"+b.charAt(0).toUpperCase()+b.slice(1)+"Enabled"}e.exports=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b.levels=b.levels||E.npm.levels;var R=function(F){s(A,F);var M=o(A);function A(d){return i(this,A),M.call(this,d)}return A}(w),j=new R(b);return Object.keys(b.levels).forEach(function(F){h('Define prototype method for "%s"',F),F!=="log"?(R.prototype[F]=function(){for(var M=this||j,A=arguments.length,d=new Array(A),C=0;C<A;C++)d[C]=arguments[C];if(d.length===1){var $=d[0],q=$&&$.message&&$||{message:$};return q.level=q[f]=F,M._addDefaultMeta(q),M.write(q),this||j}return d.length===0?(M.log(F,""),M):M.log.apply(M,[F].concat(d))},R.prototype[g(F)]=function(){return(this||j).isLevelEnabled(F)}):console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.')}),j}},function(e,t,n){(function(r){function i(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var s=n(18),l=n(51),o=n(38)("winston:exception"),c=n(90),u=n(91),f=n(92);e.exports=function(){function E(g){if(function(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}(this,E),!g)throw new Error("Logger is required to handle exceptions");this.logger=g,this.handlers=new Map}var w,h;return w=E,(h=[{key:"handle",value:function(){for(var g=this,b=arguments.length,R=new Array(b),j=0;j<b;j++)R[j]=arguments[j];R.forEach(function(F){if(Array.isArray(F))return F.forEach(function(M){return g._addHandler(M)});g._addHandler(F)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),r.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var g=this;this.catcher&&(r.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(b){return g.logger.unpipe(b)}))}},{key:"getAllInfo",value:function(g){var b=g.message;return b||typeof g!="string"||(b=g),{error:g,level:"error",message:["uncaughtException: ".concat(b||"(no error message)"),g.stack||" No stack trace"].join(`
|
|
31
31
|
`),stack:g.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(g)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:s.loadavg(),uptime:s.uptime()}}},{key:"getTrace",value:function(g){return(g?u.parse(g):u.get()).map(function(b){return{column:b.getColumnNumber(),file:b.getFileName(),function:b.getFunctionName(),line:b.getLineNumber(),method:b.getMethodName(),native:b.isNative()}})}},{key:"_addHandler",value:function(g){if(!this.handlers.has(g)){g.handleExceptions=!0;var b=new f(g);this.handlers.set(g,b),this.logger.pipe(b)}}},{key:"_uncaughtException",value:function(g){var b,R=this.getAllInfo(g),j=this._getExceptionHandlers(),F=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(g):this.logger.exitOnError;function M(){o("doExit",F),o("process._exiting",r._exiting),F&&!r._exiting&&(b&&clearTimeout(b),r.exit(1))}if(!j.length&&F&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),F=!1),!j||j.length===0)return r.nextTick(M);l(j,function(A,d){var C=c(d),$=A.transport||A;function q(y){return function(){o(y),C()}}$._ending=!0,$.once("finish",q("finished")),$.once("error",q("error"))},function(){return F&&M()}),this.logger.log(R),F&&(b=setTimeout(M,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(g){return(g.transport||g).handleExceptions})}}])&&i(w.prototype,h),E}()}).call(this,n(2))},function(e,t,n){var r=n(205);e.exports=function(i){var s,l=0;function o(){return l||(l=1,s=i.apply(this,arguments),i=null),s}return o.displayName=r(i),o}},function(e,t){function n(r){for(var i in r)this[i]=r[i]}t.get=function(r){var i=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var s={},l=Error.prepareStackTrace;Error.prepareStackTrace=function(c,u){return u},Error.captureStackTrace(s,r||t.get);var o=s.stack;return Error.prepareStackTrace=l,Error.stackTraceLimit=i,o},t.parse=function(r){if(!r.stack)return[];var i=this;return r.stack.split(`
|
|
32
32
|
`).slice(1).map(function(s){if(s.match(/^\s*[-]{4,}$/))return i._createParsedCallSite({fileName:s,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var l=s.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(l){var o=null,c=null,u=null,f=null,E=null,w=l[5]==="native";if(l[1]){var h=(u=l[1]).lastIndexOf(".");if(u[h-1]=="."&&h--,h>0){o=u.substr(0,h),c=u.substr(h+1);var g=o.indexOf(".Module");g>0&&(u=u.substr(g+1),o=o.substr(0,g))}f=null}c&&(f=o,E=c),c==="<anonymous>"&&(E=null,u=null);var b={fileName:l[2]||null,lineNumber:parseInt(l[3],10)||null,functionName:u,typeName:f,methodName:E,columnNumber:parseInt(l[4],10)||null,native:w};return i._createParsedCallSite(b)}}).filter(function(s){return!!s})},["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"].forEach(function(r){n.prototype[r]=null,n.prototype["get"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),["topLevel","eval","native","constructor"].forEach(function(r){n.prototype[r]=!1,n.prototype["is"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),t._createParsedCallSite=function(r){return new n(r)}},function(e,t,n){function r(f){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E})(f)}function i(f,E){for(var w=0;w<E.length;w++){var h=E[w];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}function s(f,E){return(s=Object.setPrototypeOf||function(w,h){return w.__proto__=h,w})(f,E)}function l(f){var E=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var w,h=c(f);if(E){var g=c(this).constructor;w=Reflect.construct(h,arguments,g)}else w=h.apply(this,arguments);return o(this,w)}}function o(f,E){return!E||r(E)!=="object"&&typeof E!="function"?function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}(f):E}function c(f){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)})(f)}var u=n(32).Writable;e.exports=function(f){(function(b,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(R&&R.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),R&&s(b,R)})(g,f);var E,w,h=l(g);function g(b){var R;if(function(j,F){if(!(j instanceof F))throw new TypeError("Cannot call a class as a function")}(this,g),R=h.call(this,{objectMode:!0}),!b)throw new Error("ExceptionStream requires a TransportStream instance.");return R.handleExceptions=!0,R.transport=b,R}return E=g,(w=[{key:"_write",value:function(b,R,j){return b.exception?this.transport.log(b,j):(j(),!0)}}])&&i(E.prototype,w),g}(u)},function(e,t,n){(function(r){function i(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var s=n(18),l=n(51),o=n(38)("winston:rejection"),c=n(90),u=n(91),f=n(92);e.exports=function(){function E(g){if(function(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}(this,E),!g)throw new Error("Logger is required to handle rejections");this.logger=g,this.handlers=new Map}var w,h;return w=E,(h=[{key:"handle",value:function(){for(var g=this,b=arguments.length,R=new Array(b),j=0;j<b;j++)R[j]=arguments[j];R.forEach(function(F){if(Array.isArray(F))return F.forEach(function(M){return g._addHandler(M)});g._addHandler(F)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),r.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var g=this;this.catcher&&(r.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(b){return g.logger.unpipe(b)}))}},{key:"getAllInfo",value:function(g){var b=g.message;return b||typeof g!="string"||(b=g),{error:g,level:"error",message:["unhandledRejection: ".concat(b||"(no error message)"),g.stack||" No stack trace"].join(`
|
|
33
33
|
`),stack:g.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(g)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:s.loadavg(),uptime:s.uptime()}}},{key:"getTrace",value:function(g){return(g?u.parse(g):u.get()).map(function(b){return{column:b.getColumnNumber(),file:b.getFileName(),function:b.getFunctionName(),line:b.getLineNumber(),method:b.getMethodName(),native:b.isNative()}})}},{key:"_addHandler",value:function(g){if(!this.handlers.has(g)){g.handleRejections=!0;var b=new f(g);this.handlers.set(g,b),this.logger.pipe(b)}}},{key:"_unhandledRejection",value:function(g){var b,R=this.getAllInfo(g),j=this._getRejectionHandlers(),F=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(g):this.logger.exitOnError;function M(){o("doExit",F),o("process._exiting",r._exiting),F&&!r._exiting&&(b&&clearTimeout(b),r.exit(1))}if(!j.length&&F&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),F=!1),!j||j.length===0)return r.nextTick(M);l(j,function(A,d){var C=c(d),$=A.transport||A;function q(y){return function(){o(y),C()}}$._ending=!0,$.once("finish",q("finished")),$.once("error",q("error"))},function(){return F&&M()}),this.logger.log(R),F&&(b=setTimeout(M,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(g){return(g.transport||g).handleRejections})}}])&&i(w.prototype,h),E}()}).call(this,n(2))},function(e,t,n){e.exports={asArray:n(212),asBoolStrict:n(213),asBool:n(214),asPortNumber:n(215),asEnum:n(216),asFloatNegative:n(217),asFloatPositive:n(218),asFloat:n(54),asIntNegative:n(219),asIntPositive:n(95),asInt:n(53),asJsonArray:n(220),asJsonObject:n(221),asJson:n(55),asRegExp:n(222),asString:n(33),asUrlObject:n(96),asUrlString:n(223),asEmailString:n(224)}},function(e,t,n){const r=n(53);e.exports=function(i){const s=r(i);if(s<0)throw new Error("should be a positive integer");return s}},function(e,t,n){const r=n(33);e.exports=function(i){const s=r(i);try{return new URL(s)}catch{throw new Error("should be a valid URL")}}},function(e,t,n){const r={};r.web=n(24),n(98);const i={v1:{}};i.v1.signaling={},i.v1.signaling.api=n(9),i.v1.signaling.api.SignalingClient=function(h,g,b){b||(b={}),b.format="text",this.client_=new r.web.GrpcWebClientBase(b),this.hostname_=h},i.v1.signaling.api.SignalingPromiseClient=function(h,g,b){b||(b={}),b.format="text",this.client_=new r.web.GrpcWebClientBase(b),this.hostname_=h};const s=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetHealth",r.web.MethodType.UNARY,i.v1.signaling.api.GetHealthRequest,i.v1.signaling.api.GetHealthResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.GetHealthResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.GetHealthResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.GetHealthResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.getHealth=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",h,g||{},s,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.getHealth=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",h,g||{},s)};const l=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/CreatePeer",r.web.MethodType.UNARY,i.v1.signaling.api.CreatePeerRequest,i.v1.signaling.api.CreatePeerResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.CreatePeerResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.CreatePeerResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.CreatePeerResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.createPeer=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",h,g||{},l,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.createPeer=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",h,g||{},l)};const o=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/DeletePeer",r.web.MethodType.UNARY,i.v1.signaling.api.DeletePeerRequest,i.v1.signaling.api.DeletePeerResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.DeletePeerResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.DeletePeerResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.DeletePeerResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.deletePeer=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",h,g||{},o,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.deletePeer=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",h,g||{},o)};const c=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/RefreshPeer",r.web.MethodType.UNARY,i.v1.signaling.api.RefreshPeerRequest,i.v1.signaling.api.RefreshPeerResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.RefreshPeerResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.RefreshPeerResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.RefreshPeerResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.refreshPeer=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",h,g||{},c,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.refreshPeer=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",h,g||{},c)};const u=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetPeers",r.web.MethodType.UNARY,i.v1.signaling.api.GetPeersRequest,i.v1.signaling.api.GetPeersResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.GetPeersResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.GetPeersResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.GetPeersResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.getPeers=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",h,g||{},u,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.getPeers=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",h,g||{},u)};const f=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetIceServers",r.web.MethodType.UNARY,i.v1.signaling.api.GetIceServersRequest,i.v1.signaling.api.GetIceServersResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.GetIceServersResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.GetIceServersResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.GetIceServersResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.getIceServers=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",h,g||{},f,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.getIceServers=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",h,g||{},f)};const E=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/SendSignal",r.web.MethodType.UNARY,i.v1.signaling.api.SendSignalRequest,i.v1.signaling.api.SendSignalResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.SendSignalResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.SendSignalResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.SendSignalResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.sendSignal=function(h,g,b){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",h,g||{},E,b)},i.v1.signaling.api.SignalingPromiseClient.prototype.sendSignal=function(h,g){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",h,g||{},E)};const w=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/ReceiveSignalStream",r.web.MethodType.SERVER_STREAMING,i.v1.signaling.api.ReceiveSignalStreamRequest,i.v1.signaling.api.ReceiveSignalStreamResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary);new r.web.AbstractClientBase.MethodInfo(i.v1.signaling.api.ReceiveSignalStreamResponse,function(h){return h.serializeBinary()},i.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary),i.v1.signaling.api.SignalingClient.prototype.receiveSignalStream=function(h,g){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",h,g||{},w)},i.v1.signaling.api.SignalingPromiseClient.prototype.receiveSignalStream=function(h,g){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",h,g||{},w)},e.exports=i.v1.signaling.api},function(e,t,n){var r=n(99),i=r,s=Function("return this")();i.exportSymbol("proto.google.protobuf.BoolValue",null,s),i.exportSymbol("proto.google.protobuf.BytesValue",null,s),i.exportSymbol("proto.google.protobuf.DoubleValue",null,s),i.exportSymbol("proto.google.protobuf.FloatValue",null,s),i.exportSymbol("proto.google.protobuf.Int32Value",null,s),i.exportSymbol("proto.google.protobuf.Int64Value",null,s),i.exportSymbol("proto.google.protobuf.StringValue",null,s),i.exportSymbol("proto.google.protobuf.UInt32Value",null,s),i.exportSymbol("proto.google.protobuf.UInt64Value",null,s),proto.google.protobuf.DoubleValue=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.DoubleValue,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.DoubleValue.displayName="proto.google.protobuf.DoubleValue"),proto.google.protobuf.FloatValue=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.FloatValue,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.FloatValue.displayName="proto.google.protobuf.FloatValue"),proto.google.protobuf.Int64Value=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.Int64Value,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.Int64Value.displayName="proto.google.protobuf.Int64Value"),proto.google.protobuf.UInt64Value=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.UInt64Value,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt64Value.displayName="proto.google.protobuf.UInt64Value"),proto.google.protobuf.Int32Value=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.Int32Value,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.Int32Value.displayName="proto.google.protobuf.Int32Value"),proto.google.protobuf.UInt32Value=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.UInt32Value,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt32Value.displayName="proto.google.protobuf.UInt32Value"),proto.google.protobuf.BoolValue=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.BoolValue,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.BoolValue.displayName="proto.google.protobuf.BoolValue"),proto.google.protobuf.StringValue=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.StringValue,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.StringValue.displayName="proto.google.protobuf.StringValue"),proto.google.protobuf.BytesValue=function(l){r.Message.initialize(this,l,0,-1,null,null)},i.inherits(proto.google.protobuf.BytesValue,r.Message),i.DEBUG&&!COMPILED&&(proto.google.protobuf.BytesValue.displayName="proto.google.protobuf.BytesValue"),r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.DoubleValue.prototype.toObject=function(l){return proto.google.protobuf.DoubleValue.toObject(l,this)},proto.google.protobuf.DoubleValue.toObject=function(l,o){var c={value:r.Message.getFloatingPointFieldWithDefault(o,1,0)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.DoubleValue.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.DoubleValue;return proto.google.protobuf.DoubleValue.deserializeBinaryFromReader(c,o)},proto.google.protobuf.DoubleValue.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readDouble();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.DoubleValue.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.DoubleValue.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.DoubleValue.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())!==0&&o.writeDouble(1,c)},proto.google.protobuf.DoubleValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.DoubleValue.prototype.setValue=function(l){return r.Message.setProto3FloatField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.FloatValue.prototype.toObject=function(l){return proto.google.protobuf.FloatValue.toObject(l,this)},proto.google.protobuf.FloatValue.toObject=function(l,o){var c={value:r.Message.getFloatingPointFieldWithDefault(o,1,0)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.FloatValue.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.FloatValue;return proto.google.protobuf.FloatValue.deserializeBinaryFromReader(c,o)},proto.google.protobuf.FloatValue.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readFloat();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.FloatValue.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.FloatValue.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.FloatValue.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())!==0&&o.writeFloat(1,c)},proto.google.protobuf.FloatValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.FloatValue.prototype.setValue=function(l){return r.Message.setProto3FloatField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int64Value.prototype.toObject=function(l){return proto.google.protobuf.Int64Value.toObject(l,this)},proto.google.protobuf.Int64Value.toObject=function(l,o){var c={value:r.Message.getFieldWithDefault(o,1,0)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.Int64Value.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.Int64Value;return proto.google.protobuf.Int64Value.deserializeBinaryFromReader(c,o)},proto.google.protobuf.Int64Value.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readInt64();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.Int64Value.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.Int64Value.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.Int64Value.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())!==0&&o.writeInt64(1,c)},proto.google.protobuf.Int64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int64Value.prototype.setValue=function(l){return r.Message.setProto3IntField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt64Value.prototype.toObject=function(l){return proto.google.protobuf.UInt64Value.toObject(l,this)},proto.google.protobuf.UInt64Value.toObject=function(l,o){var c={value:r.Message.getFieldWithDefault(o,1,0)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.UInt64Value.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.UInt64Value;return proto.google.protobuf.UInt64Value.deserializeBinaryFromReader(c,o)},proto.google.protobuf.UInt64Value.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readUint64();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.UInt64Value.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.UInt64Value.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.UInt64Value.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())!==0&&o.writeUint64(1,c)},proto.google.protobuf.UInt64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt64Value.prototype.setValue=function(l){return r.Message.setProto3IntField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int32Value.prototype.toObject=function(l){return proto.google.protobuf.Int32Value.toObject(l,this)},proto.google.protobuf.Int32Value.toObject=function(l,o){var c={value:r.Message.getFieldWithDefault(o,1,0)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.Int32Value.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.Int32Value;return proto.google.protobuf.Int32Value.deserializeBinaryFromReader(c,o)},proto.google.protobuf.Int32Value.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readInt32();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.Int32Value.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.Int32Value.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.Int32Value.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())!==0&&o.writeInt32(1,c)},proto.google.protobuf.Int32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int32Value.prototype.setValue=function(l){return r.Message.setProto3IntField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt32Value.prototype.toObject=function(l){return proto.google.protobuf.UInt32Value.toObject(l,this)},proto.google.protobuf.UInt32Value.toObject=function(l,o){var c={value:r.Message.getFieldWithDefault(o,1,0)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.UInt32Value.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.UInt32Value;return proto.google.protobuf.UInt32Value.deserializeBinaryFromReader(c,o)},proto.google.protobuf.UInt32Value.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readUint32();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.UInt32Value.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.UInt32Value.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.UInt32Value.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())!==0&&o.writeUint32(1,c)},proto.google.protobuf.UInt32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt32Value.prototype.setValue=function(l){return r.Message.setProto3IntField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BoolValue.prototype.toObject=function(l){return proto.google.protobuf.BoolValue.toObject(l,this)},proto.google.protobuf.BoolValue.toObject=function(l,o){var c={value:r.Message.getBooleanFieldWithDefault(o,1,!1)};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.BoolValue.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.BoolValue;return proto.google.protobuf.BoolValue.deserializeBinaryFromReader(c,o)},proto.google.protobuf.BoolValue.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readBool();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.BoolValue.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.BoolValue.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.BoolValue.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue())&&o.writeBool(1,c)},proto.google.protobuf.BoolValue.prototype.getValue=function(){return r.Message.getBooleanFieldWithDefault(this,1,!1)},proto.google.protobuf.BoolValue.prototype.setValue=function(l){return r.Message.setProto3BooleanField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.StringValue.prototype.toObject=function(l){return proto.google.protobuf.StringValue.toObject(l,this)},proto.google.protobuf.StringValue.toObject=function(l,o){var c={value:r.Message.getFieldWithDefault(o,1,"")};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.StringValue.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.StringValue;return proto.google.protobuf.StringValue.deserializeBinaryFromReader(c,o)},proto.google.protobuf.StringValue.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readString();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.StringValue.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.StringValue.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.StringValue.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue()).length>0&&o.writeString(1,c)},proto.google.protobuf.StringValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.StringValue.prototype.setValue=function(l){return r.Message.setProto3StringField(this,1,l)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BytesValue.prototype.toObject=function(l){return proto.google.protobuf.BytesValue.toObject(l,this)},proto.google.protobuf.BytesValue.toObject=function(l,o){var c={value:o.getValue_asB64()};return l&&(c.$jspbMessageInstance=o),c}),proto.google.protobuf.BytesValue.deserializeBinary=function(l){var o=new r.BinaryReader(l),c=new proto.google.protobuf.BytesValue;return proto.google.protobuf.BytesValue.deserializeBinaryFromReader(c,o)},proto.google.protobuf.BytesValue.deserializeBinaryFromReader=function(l,o){for(;o.nextField()&&!o.isEndGroup();)switch(o.getFieldNumber()){case 1:var c=o.readBytes();l.setValue(c);break;default:o.skipField()}return l},proto.google.protobuf.BytesValue.prototype.serializeBinary=function(){var l=new r.BinaryWriter;return proto.google.protobuf.BytesValue.serializeBinaryToWriter(this,l),l.getResultBuffer()},proto.google.protobuf.BytesValue.serializeBinaryToWriter=function(l,o){var c;(c=l.getValue_asU8()).length>0&&o.writeBytes(1,c)},proto.google.protobuf.BytesValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.BytesValue.prototype.getValue_asB64=function(){return r.Message.bytesAsB64(this.getValue())},proto.google.protobuf.BytesValue.prototype.getValue_asU8=function(){return r.Message.bytesAsU8(this.getValue())},proto.google.protobuf.BytesValue.prototype.setValue=function(l){return r.Message.setProto3BytesField(this,1,l)},i.object.extend(t,proto.google.protobuf)},function(module,exports,__webpack_require__){(function(global,Buffer){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,i=0;i<r;i++){var s=e[i];if(t.call(n,s,i,e))return{i,v:s}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},$jscomp.getGlobal=function(e){return typeof window<"u"&&window===e?e:global!==void 0&&global!=null?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,n,r){if(t){for(n=$jscomp.global,e=e.split("."),r=0;r<e.length-1;r++){var i=e[r];i in n||(n[i]={}),n=n[i]}(t=t(r=n[e=e[e.length-1]]))!=r&&t!=null&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).i}},"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(e==null)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"endsWith");t+="",n===void 0&&(n=r.length),n=Math.max(0,Math.min(0|n,r.length));for(var i=t.length;0<i&&0<n;)if(r[--n]!=t[--i])return!1;return 0>=i}},"es6","es3"),$jscomp.polyfill("Array.prototype.find",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).v}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var i=r.length,s=t.length;n=Math.max(0,Math.min(0|n,r.length));for(var l=0;l<s&&n<i;)if(r[n++]!=t[l++])return!1;return l>=s}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(e){return e||function(t){var n=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var r="";t;)1&t&&(r+=n),(t>>>=1)&&(n+=n);return r}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return e!==void 0},goog.isString=function(e){return typeof e=="string"},goog.isBoolean=function(e){return typeof e=="boolean"},goog.isNumber=function(e){return typeof e=="number"},goog.exportPath_=function(e,t,n){e=e.split("."),n=n||goog.global,e[0]in n||n.execScript===void 0||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)!e.length&&goog.isDef(t)?n[r]=t:n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}},goog.define=function(e,t){return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||e.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&typeof e.getCurrentModulePath=="function"&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(t=t[e[n]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var n in t=t||goog.global,e)t[n]=e[n]},goog.addDependency=function(e,t,n,r){},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+`
|
|
@@ -36,17 +36,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
36
36
|
//# sourceURL=`+s)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,i=(r=goog.global.$jscomp).transpile}}return i||(i=r.transpile=function(o,c){return goog.logToConsole_(c+" requires transpilation but no transpiler was found."),o}),i(e,t,n)},goog.typeOf=function(e){var t=typeof e;if(t=="object"){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if(n=="[object Window]")return"object";if(n=="[object Array]"||typeof e.length=="number"&&e.splice!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("splice"))return"array";if(n=="[object Function]"||e.call!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("call"))return"function"}else if(t=="function"&&e.call===void 0)return"object";return t},goog.isNull=function(e){return e===null},goog.isDefAndNotNull=function(e){return e!=null},goog.isArray=function(e){return goog.typeOf(e)=="array"},goog.isArrayLike=function(e){var t=goog.typeOf(e);return t=="array"||t=="object"&&typeof e.length=="number"},goog.isDateLike=function(e){return goog.isObject(e)&&typeof e.getFullYear=="function"},goog.isFunction=function(e){return goog.typeOf(e)=="function"},goog.isObject=function(e){var t=typeof e;return t=="object"&&e!=null||t=="function"},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){e!==null&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch{}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(typeof e.clone=="function")return e.clone();for(var n in t=t=="array"?[]:{},e)t[n]=goog.cloneObject(e[n]);return t}return e},goog.bindNative_=function(e,t,n){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,r),e.apply(t,i)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,n){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments),e.apply(this,r)}},goog.mixin=function(e,t){for(var n in t)e[n]=t[n]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(goog.global._evalTest_!==void 0){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,n=t.createElement("SCRIPT");n.type="text/javascript",n.defer=!1,n.appendChild(t.createTextNode(e)),t.head.appendChild(n),t.head.removeChild(n)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if(String(e).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var n=function(i){return goog.cssNameMapping_[i]||i},r=function(i){i=i.split("-");for(var s=[],l=0;l<i.length;l++)s.push(n(i[l]));return s.join("-")};return r=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?n:r:function(i){return i},e=t?e+"-"+r(t):r(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},goog.getMsg=function(e,t,n){return n&&n.html&&(e=e.replace(/</g,"<")),t&&(e=e.replace(/\{\$([^}]+)}/g,function(r,i){return t!=null&&i in t?t[i]:r})),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,n){goog.exportPath_(e,t,n)},goog.exportProperty=function(e,t,n){e[t]=n},goog.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.base=function(r,i,s){for(var l=Array(arguments.length-2),o=2;o<arguments.length;o++)l[o-2]=arguments[o];return t.prototype[i].apply(r,l)}},goog.base=function(e,t,n){var r=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!r)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(r.superClass_!==void 0){for(var i=Array(arguments.length-1),s=1;s<arguments.length;s++)i[s-1]=arguments[s];return r.superClass_.constructor.apply(e,i)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];s=!1;for(var l=e.constructor.prototype;l;l=Object.getPrototypeOf(l))if(l[t]===r)s=!0;else if(s)return l[t].apply(e,i);if(e[t]===r)return e.constructor.prototype[t].apply(e,i);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},goog.defineClass=function(e,t){var n=t.constructor,r=t.statics;return n&&n!=Object.prototype.constructor||(n=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),n=goog.defineClass.createSealingConstructor_(n,e),e&&goog.inherits(n,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(n.prototype,t),r!=null&&(r instanceof Function?r(n):goog.defineClass.applyProperties_(n,r)),n},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var n=!goog.defineClass.isUnsealable_(t),r=function(){var i=e.apply(this,arguments)||this;return i[goog.UID_PROPERTY_]=i[goog.UID_PROPERTY_],this.constructor===r&&n&&Object.seal instanceof Function&&Object.seal(i),i};return r},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);for(var r=0;r<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;r++)n=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[r],Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},goog.tagUnsealableClass=function(e){},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if(typeof TrustedTypes>"u"||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(n){goog.logToConsole_(n.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,n=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return n.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return n.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return n.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return n.FIXED32;default:return n.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=9223372036854776e3,jspb.BinaryConstants.TWO_TO_64=18446744073709552e3,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var n="",r=(e=e.split("%s")).length-1,i=0;i<r;i++)n+=e[i]+(i<t.length?t[i]:"%s");return n+e[r]},goog.asserts.doAssertFailure_=function(e,t,n,r){var i="Assertion failed";if(n){i+=": "+n;var s=r}else e&&(i+=": "+e,s=t);e=new goog.asserts.AssertionError(""+i,s||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&e==null&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,n,r){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],n,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||typeof e=="number"&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):e===null?"null":typeof e},goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.indexOf.call(e,t,n)}:function(e,t,n){if(n=n==null?0:0>n?Math.max(0,e.length+n):n,goog.isString(e))return goog.isString(t)&&t.length==1?e.indexOf(t,n):-1;for(;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.lastIndexOf.call(e,t,n??e.length-1)}:function(e,t,n){if(0>(n=n??e.length-1)&&(n=Math.max(0,e.length+n)),goog.isString(e))return goog.isString(t)&&t.length==1?e.lastIndexOf(t,n):-1;for(;0<=n;n--)if(n in e&&e[n]===t)return n;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,n){goog.asserts.assert(e.length!=null),Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i=goog.isString(e)?e.split(""):e,s=0;s<r;s++)s in i&&t.call(n,i[s],s,e)},goog.array.forEachRight=function(e,t,n){var r=e.length,i=goog.isString(e)?e.split(""):e;for(--r;0<=r;--r)r in i&&t.call(n,i[r],r,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.filter.call(e,t,n)}:function(e,t,n){for(var r=e.length,i=[],s=0,l=goog.isString(e)?e.split(""):e,o=0;o<r;o++)if(o in l){var c=l[o];t.call(n,c,o,e)&&(i[s++]=c)}return i},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.map.call(e,t,n)}:function(e,t,n){for(var r=e.length,i=Array(r),s=goog.isString(e)?e.split(""):e,l=0;l<r;l++)l in s&&(i[l]=t.call(n,s[l],l,e));return i},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,n,r){return goog.asserts.assert(e.length!=null),r&&(t=goog.bind(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var i=n;return goog.array.forEach(e,function(s,l){i=t.call(r,i,s,l,e)}),i},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,n,r){return goog.asserts.assert(e.length!=null),goog.asserts.assert(t!=null),r&&(t=goog.bind(t,r)),Array.prototype.reduceRight.call(e,t,n)}:function(e,t,n,r){var i=n;return goog.array.forEachRight(e,function(s,l){i=t.call(r,i,s,l,e)}),i},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.some.call(e,t,n)}:function(e,t,n){for(var r=e.length,i=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in i&&t.call(n,i[s],s,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.every.call(e,t,n)}:function(e,t,n){for(var r=e.length,i=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in i&&!t.call(n,i[s],s,e))return!1;return!0},goog.array.count=function(e,t,n){var r=0;return goog.array.forEach(e,function(i,s,l){t.call(n,i,s,l)&&++r},n),r},goog.array.find=function(e,t,n){return 0>(t=goog.array.findIndex(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,n){for(var r=e.length,i=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in i&&t.call(n,i[s],s,e))return s;return-1},goog.array.findRight=function(e,t,n){return 0>(t=goog.array.findIndexRight(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,n){var r=e.length,i=goog.isString(e)?e.split(""):e;for(--r;0<=r;r--)if(r in i&&t.call(n,i[r],r,e))return r;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return e.length==0},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,n){goog.array.splice(e,n,0,t)},goog.array.insertArrayAt=function(e,t,n){goog.partial(goog.array.splice,e,n,0).apply(null,t)},goog.array.insertBefore=function(e,t,n){var r;arguments.length==2||0>(r=goog.array.indexOf(e,n))?e.push(t):goog.array.insertAt(e,t,r)},goog.array.remove=function(e,t){var n;return(n=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),n},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(e.length!=null),Array.prototype.splice.call(e,t,1).length==1},goog.array.removeIf=function(e,t,n){return 0<=(t=goog.array.findIndex(e,t,n))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,n){var r=0;return goog.array.forEachRight(e,function(i,s){t.call(n,i,s,e)&&goog.array.removeAt(e,s)&&r++}),r},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(goog.isArrayLike(r)){var i=e.length||0,s=r.length||0;e.length=i+s;for(var l=0;l<s;l++)e[i+l]=r[l]}else e.push(r)}},goog.array.splice=function(e,t,n,r){return goog.asserts.assert(e.length!=null),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,n){return goog.asserts.assert(e.length!=null),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)},goog.array.removeDuplicates=function(e,t,n){t=t||e;var r=function(c){return goog.isObject(c)?"o"+goog.getUid(c):(typeof c).charAt(0)+c};n=n||r,r={};for(var i=0,s=0;s<e.length;){var l=e[s++],o=n(l);Object.prototype.hasOwnProperty.call(r,o)||(r[o]=!0,t[i++]=l)}t.length=i},goog.array.binarySearch=function(e,t,n){return goog.array.binarySearch_(e,n||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,n){return goog.array.binarySearch_(e,t,!0,void 0,n)},goog.array.binarySearch_=function(e,t,n,r,i){for(var s,l=0,o=e.length;l<o;){var c=l+o>>1,u=n?t.call(i,e[c],c,e):t(r,e[c]);0<u?l=c+1:(o=c,s=!u)}return s?l:~l},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]={index:r,value:e[r]};var i=t||goog.array.defaultCompare;for(goog.array.sort(n,function(s,l){return i(s.value,l.value)||s.index-l.index}),r=0;r<e.length;r++)e[r]=n[r].value},goog.array.sortByKey=function(e,t,n){var r=n||goog.array.defaultCompare;goog.array.sort(e,function(i,s){return r(t(i),t(s))})},goog.array.sortObjectsByKey=function(e,t,n){goog.array.sortByKey(e,function(r){return r[t]},n)},goog.array.isSorted=function(e,t,n){t=t||goog.array.defaultCompare;for(var r=1;r<e.length;r++){var i=t(e[r-1],e[r]);if(0<i||i==0&&n)return!1}return!0},goog.array.equals=function(e,t,n){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var r=e.length;n=n||goog.array.defaultCompareEquality;for(var i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0},goog.array.compare3=function(e,t,n){n=n||goog.array.defaultCompare;for(var r=Math.min(e.length,t.length),i=0;i<r;i++){var s=n(e[i],t[i]);if(s!=0)return s}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,n){return 0>(n=goog.array.binarySearch(e,t,n))&&(goog.array.insertAt(e,t,-(n+1)),!0)},goog.array.binaryRemove=function(e,t,n){return 0<=(t=goog.array.binarySearch(e,t,n))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,n){for(var r={},i=0;i<e.length;i++){var s=e[i],l=t.call(n,s,i,e);goog.isDef(l)&&(r[l]||(r[l]=[])).push(s)}return r},goog.array.toObject=function(e,t,n){var r={};return goog.array.forEach(e,function(i,s){r[t.call(n,i,s,e)]=i}),r},goog.array.range=function(e,t,n){var r=[],i=0,s=e;if(t!==void 0&&(i=e,s=t),0>(n=n||1)*(s-i))return[];if(0<n)for(e=i;e<s;e+=n)r.push(e);else for(e=i;e>s;e+=n)r.push(e);return r},goog.array.repeat=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n},goog.array.flatten=function(e){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(goog.isArray(r))for(var i=0;i<r.length;i+=8192){var s=goog.array.slice(r,i,i+8192);s=goog.array.flatten.apply(null,s);for(var l=0;l<s.length;l++)t.push(s[l])}else t.push(r)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(e.length!=null),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,n){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=n&&n<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,n,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],n=arguments[0].length,r=1;r<arguments.length;r++)arguments[r].length<n&&(n=arguments[r].length);for(r=0;r<n;r++){for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s][r]);t.push(i)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var n=e.length-1;0<n;n--){var r=Math.floor(t()*(n+1)),i=e[n];e[n]=e[r],e[r]=i}},goog.array.copyByIndex=function(e,t){var n=[];return goog.array.forEach(t,function(r){n.push(e[r])}),n},goog.array.concatMap=function(e,t,n){return goog.array.concat.apply([],goog.array.map(e,t,n))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);255<i&&(t[n++]=255&i,i>>=8),t[n++]=i}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",n=0;n<e.length;n+=8192){var r=goog.array.slice(e,n,n+8192);t+=String.fromCharCode.apply(null,r)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,function(n){return 1<(n=n.toString(16)).length?n:"0"+n}).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(e.length%2==0,"Key string length must be multiple of 2");for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);128>i?t[n++]=i:(2048>i?t[n++]=i>>6|192:((64512&i)==55296&&r+1<e.length&&(64512&e.charCodeAt(r+1))==56320?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128):t[n++]=i>>12|224,t[n++]=i>>6&63|128),t[n++]=63&i|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],n=0,r=0;n<e.length;){var i=e[n++];if(128>i)t[r++]=String.fromCharCode(i);else if(191<i&&224>i){var s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(239<i&&365>i){s=e[n++];var l=e[n++];i=((7&i)<<18|(63&s)<<12|(63&l)<<6|63&e[n++])-65536,t[r++]=String.fromCharCode(55296+(i>>10)),t[r++]=String.fromCharCode(56320+(1023&i))}else s=e[n++],l=e[n++],t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&l)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return n},goog.string={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return e.lastIndexOf(t,0)==0},goog.string.internal.endsWith=function(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)==n},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))==0},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))==0},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&").replace(goog.string.internal.LT_RE_,"<").replace(goog.string.internal.GT_RE_,">").replace(goog.string.internal.QUOT_RE_,""").replace(goog.string.internal.SINGLE_QUOTE_RE_,"'").replace(goog.string.internal.NULL_RE_,"�");else{if(!goog.string.internal.ALL_RE_.test(e))return e;e.indexOf("&")!=-1&&(e=e.replace(goog.string.internal.AMP_RE_,"&")),e.indexOf("<")!=-1&&(e=e.replace(goog.string.internal.LT_RE_,"<")),e.indexOf(">")!=-1&&(e=e.replace(goog.string.internal.GT_RE_,">")),e.indexOf('"')!=-1&&(e=e.replace(goog.string.internal.QUOT_RE_,""")),e.indexOf("'")!=-1&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"'")),e.indexOf("\0")!=-1&&(e=e.replace(goog.string.internal.NULL_RE_,"�"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.internal.contains=function(e,t){return e.indexOf(t)!=-1},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var n=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var r=Math.max(e.length,t.length),i=0;n==0&&i<r;i++){var s=e[i]||"",l=t[i]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],s[0].length==0&&l[0].length==0)break;n=s[1].length==0?0:parseInt(s[1],10);var o=l[1].length==0?0:parseInt(l[1],10);n=goog.string.internal.compareElements_(n,o)||goog.string.internal.compareElements_(s[2].length==0,l[2].length==0)||goog.string.internal.compareElements_(s[2],l[2]),s=s[3],l=l[3]}while(n==0)}return n},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(e!=null)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return goog.fs.url.findUrlObject_()!=null},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||(goog.LOCALE.substring(0,2).toLowerCase()=="ar"||goog.LOCALE.substring(0,2).toLowerCase()=="fa"||goog.LOCALE.substring(0,2).toLowerCase()=="he"||goog.LOCALE.substring(0,2).toLowerCase()=="iw"||goog.LOCALE.substring(0,2).toLowerCase()=="ps"||goog.LOCALE.substring(0,2).toLowerCase()=="sd"||goog.LOCALE.substring(0,2).toLowerCase()=="ug"||goog.LOCALE.substring(0,2).toLowerCase()=="ur"||goog.LOCALE.substring(0,2).toLowerCase()=="yi")&&(goog.LOCALE.length==2||goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")||3<=goog.LOCALE.length&&goog.LOCALE.substring(0,3).toLowerCase()=="ckb"&&(goog.LOCALE.length==3||goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")||7<=goog.LOCALE.length&&(goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")&&(goog.LOCALE.substring(3,7).toLowerCase()=="adlm"||goog.LOCALE.substring(3,7).toLowerCase()=="arab"||goog.LOCALE.substring(3,7).toLowerCase()=="hebr"||goog.LOCALE.substring(3,7).toLowerCase()=="nkoo"||goog.LOCALE.substring(3,7).toLowerCase()=="rohg"||goog.LOCALE.substring(3,7).toLowerCase()=="thaa")||8<=goog.LOCALE.length&&(goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")&&(goog.LOCALE.substring(4,8).toLowerCase()=="adlm"||goog.LOCALE.substring(4,8).toLowerCase()=="arab"||goog.LOCALE.substring(4,8).toLowerCase()=="hebr"||goog.LOCALE.substring(4,8).toLowerCase()=="nkoo"||goog.LOCALE.substring(4,8).toLowerCase()=="rohg"||goog.LOCALE.substring(4,8).toLowerCase()=="thaa"),goog.i18n.bidi.Format={LRE:"",RLE:"",PDF:"",LRM:"",RLM:""},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return typeof e=="number"?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:e==null?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-ऀ-Ⰰ-\uD801\uD804-\uD839\uD83C-\uDBFF豈-︀--",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ\uD802-\uD803\uD83A-\uD83Bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(t===void 0?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=rtl"):`
|
|
37
37
|
<span dir=rtl>`+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=ltr"):`
|
|
38
38
|
<span dir=ltr>`+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var n=0,r=0,i=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var s=e[t];goog.i18n.bidi.startsWithRtl(s)?(n++,r++):goog.i18n.bidi.isRequiredLtrRe_.test(s)?i=!0:goog.i18n.bidi.hasAnyLtr(s)?r++:goog.i18n.bidi.hasNumeralsRe_.test(s)&&(i=!0)}return r==0?i?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:n/r>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var n=goog.html.TrustedResourceUrl.unwrap(this),r=(n=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(n))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(n[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",n[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",r,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},goog.html.TrustedResourceUrl.format=function(e,t){var n=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(r,i){if(!Object.prototype.hasOwnProperty.call(t,i))throw Error('Found marker, "'+i+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(r=t[i])instanceof goog.string.Const?goog.string.Const.unwrap(r):encodeURIComponent(String(r))}),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,n,r){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(n,r)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",n=0;n<e.length;n++)t+=goog.string.Const.unwrap(e[n]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,n){if(n==null)return t;if(goog.isString(n))return n?e+encodeURIComponent(n):"";for(var r in n){var i=n[r];i=goog.isArray(i)?i:[i];for(var s=0;s<i.length;s++){var l=i[s];l!=null&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(r)+"="+encodeURIComponent(String(l)))}}return t},goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SAFE_MIME_TYPE_PATTERN_.test(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch{return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,n){return(e=e.exec(t))?(e=e[1],(n instanceof goog.string.Const?[goog.string.Const.unwrap(n)]:n.map(function(r){return goog.string.Const.unwrap(r)})).indexOf(e)==-1&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),`Style string must contain at least one ':', to specify a "name: value" pair: `+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyle().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,n="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var r=e[t];r!=null&&(n+=t+":"+(r=goog.isArray(r)?goog.array.map(r,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(r))+";")}return n?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(n):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,n=!0,r=0;r<e.length;r++){var i=e.charAt(r);i=="'"&&n?t=!t:i=='"'&&t&&(n=!n)}return t&&n},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,n=/^[-_a-zA-Z0-9]$/,r=0;r<e.length;r++){var i=e.charAt(r);if(i=="]"){if(t)return!1;t=!0}else if(i=="["){if(!t)return!1;t=!1}else if(!t&&!n.test(i))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_=`[-,."'%_!# a-zA-Z0-9\\[\\]]`,goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,function(t,n,r,i){var s="";return r=r.replace(/^(['"])(.*)\1$/,function(l,o,c){return s=o,c}),t=goog.html.SafeUrl.sanitize(r).getTypedStringValue(),n+s+t+s+i})},goog.html.SafeStyle.concat=function(e){var t="",n=function(r){goog.isArray(r)?goog.array.forEach(r,n):t+=goog.html.SafeStyle.unwrap(r)};return goog.array.forEach(arguments,n),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var n=[],r=1;r<arguments.length;r++)n.push(goog.html.SafeScript.stringify_(arguments[r]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+n.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeScript().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.object={},goog.object.is=function(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,n){for(var r in e)t.call(n,e[r],r,e)},goog.object.filter=function(e,t,n){var r,i={};for(r in e)t.call(n,e[r],r,e)&&(i[r]=e[r]);return i},goog.object.map=function(e,t,n){var r,i={};for(r in e)i[r]=t.call(n,e[r],r,e);return i},goog.object.some=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return!0;return!1},goog.object.every=function(e,t,n){for(var r in e)if(!t.call(n,e[r],r,e))return!1;return!0},goog.object.getCount=function(e){var t,n=0;for(t in e)n++;return n},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n},goog.object.getKeys=function(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n},goog.object.getValueByKeys=function(e,t){var n=goog.isArrayLike(t),r=n?t:arguments;for(n=n?0:1;n<r.length;n++){if(e==null)return;e=e[r[n]]}return e},goog.object.containsKey=function(e,t){return e!==null&&t in e},goog.object.containsValue=function(e,t){for(var n in e)if(e[n]==t)return!0;return!1},goog.object.findKey=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},goog.object.findValue=function(e,t,n){return(t=goog.object.findKey(e,t,n))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var n;return(n=t in e)&&delete e[t],n},goog.object.add=function(e,t,n){if(e!==null&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,n)},goog.object.get=function(e,t,n){return e!==null&&t in e?e[t]:n},goog.object.set=function(e,t,n){e[t]=n},goog.object.setIfUndefined=function(e,t,n){return t in e?e[t]:e[t]=n},goog.object.setWithReturnValueIfNotSet=function(e,t,n){return t in e?e[t]:(n=n(),e[t]=n)},goog.object.equals=function(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0},goog.object.clone=function(e){var t,n={};for(t in e)n[t]=e[t];return n},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(goog.isFunction(e.clone))return e.clone();for(var n in t=t=="array"?[]:{},e)t[n]=goog.object.unsafeClone(e[n]);return t}return e},goog.object.transpose=function(e){var t,n={};for(t in e)n[e[t]]=t;return n},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var s=0;s<goog.object.PROTOTYPE_FIELDS_.length;s++)n=goog.object.PROTOTYPE_FIELDS_[s],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}},goog.object.create=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var n={},r=0;r<t;r+=2)n[arguments[r]]=arguments[r+1];return n},goog.object.createSet=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var n={},r=0;r<t;r++)n[arguments[r]]=!0;return n},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,n){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var r={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||n);){for(var i=Object.getOwnPropertyNames(e),s=0;s<i.length;s++)r[i[s]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(r)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var n=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(n))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(n))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},n=[],r=0;r<e.length;r++){var i=e[r];if(t[i])n.push(t[i]);else if(goog.object.contains(t,i)&&n.pop()!=i)return!1}return n.length==0},goog.html.SafeStyleSheet.concat=function(e){var t="",n=function(r){goog.isArray(r)?goog.array.forEach(r,n):t+=goog.html.SafeStyleSheet.unwrap(r)};return goog.array.forEach(arguments,n),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyleSheet().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return goog.dom.tags.VOID_TAGS_[e]===!0},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,n=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,r=[];t=n.exec(e);)r.push([t[1],t[2],t[3]||void 0]);return r},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(i){return i=goog.array.find(i,r),n[i]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var n={};goog.array.forEach(t,function(i){n[i[0]]=i[1]});var r=goog.partial(goog.object.containsKey,n);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var n=/MSIE +([\d\.]+)/.exec(e);if(n&&n[1])if(e=/Trident\/(\d.\d)/.exec(e),n[1]=="7.0")if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=n[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t=typeof e=="object",n=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(n=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),n)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,n){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,n)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,n,r){e&&goog.html.TrustedResourceUrl.unwrap(e);var i={};return i.src=e||null,i.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(i,{sandbox:""},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.createSandboxIframe=function(e,t,n,r){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var i={};return i.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,i.srcdoc=t||null,i.sandbox="",e=goog.html.SafeHtml.combineAttributes(i,{},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var n in t){var r=n.toLowerCase();if(r=="language"||r=="src"||r=="text"||r=="type")throw Error('Cannot set "'+r+'" attribute')}for(n="",e=goog.array.concat(e),r=0;r<e.length;r++)n+=goog.html.SafeScript.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var n="";e=goog.array.concat(e);for(var r=0;r<e.length;r++)n+=goog.html.SafeStyleSheet.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,n){if(n instanceof goog.string.Const)n=goog.string.Const.unwrap(n);else if(t.toLowerCase()=="style")n=goog.html.SafeHtml.getStyleValue_(n);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+n+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(n instanceof goog.html.TrustedResourceUrl)n=goog.html.TrustedResourceUrl.unwrap(n);else if(n instanceof goog.html.SafeUrl)n=goog.html.SafeUrl.unwrap(n);else{if(!goog.isString(n))throw Error('Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+n+'" given.');n=goog.html.SafeUrl.sanitize(n).getTypedStringValue()}}return n.implementsGoogStringTypedString&&(n=n.getTypedStringValue()),goog.asserts.assert(goog.isString(n)||goog.isNumber(n),"String or number value expected, got "+typeof n+" with value: "+n),t+'="'+goog.string.internal.htmlEscape(String(n))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e);return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,n,r){return(t=goog.html.SafeHtml.create(t,n,r)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var n=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),r=[],i=function(s){goog.isArray(s)?goog.array.forEach(s,i):(s=goog.html.SafeHtml.htmlEscape(s),r.push(goog.html.SafeHtml.unwrap(s)),s=s.getDirection(),n==goog.i18n.bidi.Dir.NEUTRAL?n=s:s!=goog.i18n.bidi.Dir.NEUTRAL&&n!=s&&(n=null))};return goog.array.forEach(t,i),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r.join(goog.html.SafeHtml.unwrap(e)),n)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var n=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return n.dir_=e,n},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return new goog.html.SafeHtml().initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,n){var r=null,i="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(n)?goog.isArray(n)||(n=[n]):n=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!n.length,"Void tag <"+e+"> does not allow content."),i+=">"):(r=goog.html.SafeHtml.concat(n),i+=">"+goog.html.SafeHtml.unwrap(r)+"</"+e+">",r=r.getDirection()),(e=t&&t.dir)&&(r=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(i,r)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var n="";if(t)for(var r in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(r))throw Error('Invalid attribute name "'+r+'".');var i=t[r];goog.isDefAndNotNull(i)&&(n+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,r,i))}return n},goog.html.SafeHtml.combineAttributes=function(e,t,n){var r,i={};for(r in e)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),i[r]=e[r];for(r in t)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),i[r]=t[r];for(r in n){var s=r.toLowerCase();if(s in e)throw Error('Cannot override "'+s+'" attribute, got "'+r+'" with value "'+n[r]+'"');s in t&&delete i[s],i[r]=n[r]}return i},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,n){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,n||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=goog.dom.asserts.getWindow_(e);n&&n[t]!==void 0&&(e&&(e instanceof n[t]||!(e instanceof n.Location||e instanceof n.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return e===void 0?"undefined":e===null?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch{return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,n=t&&(t.defaultView||t.parentWindow);if((n=n||goog.global).Element&&n.Location)return n}catch{}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var r=Array.prototype.slice.call(arguments);return r.push.apply(r,n),e.apply(this,r)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(n){return t?e==n:e===n}},goog.functions.compose=function(e,t){var n=arguments,r=n.length;return function(){var i;r&&(i=n[r-1].apply(this,arguments));for(var s=r-2;0<=s;s--)i=n[s].call(this,i);return i}},goog.functions.sequence=function(e){var t=arguments,n=t.length;return function(){for(var r,i=0;i<n;i++)r=t[i].apply(this,arguments);return r}},goog.functions.and=function(e){var t=arguments,n=t.length;return function(){for(var r=0;r<n;r++)if(!t[r].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,n=t.length;return function(){for(var r=0;r<n;r++)if(t[r].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var n=function(){};return n.prototype=e.prototype,n=new n,e.apply(n,Array.prototype.slice.call(arguments,1)),n},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,n=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(n||(t=e(),n=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var n=t;t=null,n()}}},goog.functions.debounce=function(e,t,n){var r=0;return function(i){goog.global.clearTimeout(r);var s=arguments;r=goog.global.setTimeout(function(){e.apply(n,s)},t)}},goog.functions.throttle=function(e,t,n){var r=0,i=!1,s=[],l=function(){r=0,i&&(i=!1,o())},o=function(){r=goog.global.setTimeout(l,t),e.apply(n,s)};return function(c){s=arguments,r?i=!0:o()}},goog.functions.rateLimit=function(e,t,n){var r=0,i=function(){r=0};return function(s){r||(r=goog.global.setTimeout(i,t),e.apply(n,arguments))}},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,n){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(n))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&typeof document>"u")return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild)&&(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)}),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[n])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,n){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=n,goog.string.internal.caseInsensitiveContains(n,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,n,r,i){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),n?goog.string.Const.unwrap(n):"",r,i)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,n){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),n)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var n=e.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return e.length==0},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return e==" "},goog.string.isUnicodeChar=function(e){return e.length==1&&" "<=e&&"~">=e||""<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,`
|
|
39
|
-
`)},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),i=t.toLowerCase().match(n),s=Math.min(r.length,i.length),l=0;l<s;l++){n=r[l];var o=i[l];if(n!=o)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(o,10),!isNaN(t)&&e-t)?e-t:n<o?-1:1}return r.length!=i.length?r.length-i.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&":"&","<":"<",">":">",""":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(i,s){var l=n[i];return l||(s.charAt(0)=="#"&&(s=+("0"+s.substr(1)),isNaN(s)||(l=String.fromCharCode(s))),l||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),i+" ")),l=r.firstChild.nodeValue.slice(0,-1)),n[i]=l)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(t,n){switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return n.charAt(0)!="#"||(n=+("0"+n.substr(1)),isNaN(n))?t:String.fromCharCode(n)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var i=n==1?t:t.charAt(r);if(e.charAt(0)==i&&e.charAt(e.length-1)==i)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var i=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(i)}else e.length>t&&(r=Math.floor(t/2),i=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(i));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),i=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<i&&127>i?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))==-1&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return e==null?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return t==0&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(t,n){return n.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(n,r,i){return r+i.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;typeof t=="string"&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(t[r]!=""){var i=e.lastIndexOf(t[r]);i>n&&(n=i)}return n==-1?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var i=0;i<t.length+1;i++)n[i]=i;for(i=0;i<e.length;i++){r[0]=i+1;for(var s=0;s<t.length;s++)r[s+1]=Math.min(r[s]+1,n[s+1]+1,n[s]+ +(e[i]!=t[s]));for(s=0;s<n.length;s++)n[s]=r[s]}return r[t.length]},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch{}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return n[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if(n[0]=="Edge")return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,function(n){return t==n[0]}))&&e[1]||""},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_())!=null&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function",goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function",goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var i=e[r],s=r+1<e.length,l=s?e[r+1]:0,o=r+2<e.length,c=o?e[r+2]:0,u=i>>2;i=(3&i)<<4|l>>4,l=(15&l)<<2|c>>6,c&=63,o||(c=64,s||(l=64)),n.push(t[u],t[i],t[l]||"",t[c]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,function(r){n+=String.fromCharCode(r)}),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,function(r){n.push(r)}),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return goog.crypt.base64.decodeStringInternal_(e,function(s){r[i++]=s}),r.subarray(0,i)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(c){for(;r<e.length;){var u=e.charAt(r++),f=goog.crypt.base64.charToByteMap_[u];if(f!=null)return f;if(!goog.string.isEmptyOrWhitespace(u))throw Error("Unknown base64 encoding at char: "+u)}return c}goog.crypt.base64.init_();for(var r=0;;){var i=n(-1),s=n(0),l=n(64),o=n(64);if(o===64&&i===-1)break;t(i<<2|s>>4),l!=64&&(t(s<<4&240|l>>2),o!=64&&t(l<<6&192|o))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var i=0;i<r.length;i++){var s=r[i],l=goog.crypt.base64.charToByteMap_[s];l===void 0?goog.crypt.base64.charToByteMap_[s]=i:goog.asserts.assert(l===i)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(e==0?n==0?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),s=e.charCodeAt(4),l=e.charCodeAt(5),o=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(i<<24)>>>0,jspb.utils.split64High=s+(l<<8)+(o<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,n==255?e?NaN:1/0*t:n==0?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,r==2047?e?NaN:1/0*n:r==0?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(i,s){return i=i?String(i):"",s?"0000000".slice(i.length)+i:i}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+e);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+((e=1+~e>>>0)==0?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(s,l){for(var o=0;8>o&&(s!==1||0<l);o++)l=s*r[o]+l,r[o]=255&l,l>>>=8}goog.asserts.assert(0<e.length);var n=!1;e[0]==="-"&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],i=0;i<e.length;i++)t(10,e.charCodeAt(i)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var s=0;8>s;s++)r[s]=255&~r[s]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(e.length==18),goog.asserts.assert(e[0]=="0"),goog.asserts.assert(e[1]=="x");for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),i=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+i)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,i=t;i<n;i++)r+=e[i]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var i=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(i++;;){var s=e[t++];if(!(128&s))break}else for(;t<n;){for(s=r;128<s;){if(e[t]!=(127&s|128))return i;t++,s>>=7}if(e[t++]!=s)break;for(i++;128&(s=e[t++]););}return i},jspb.utils.countFixedFields_=function(e,t,n,r,i){var s=0;if(128>r)for(;t<n&&e[t++]==r;)s++,t+=i;else for(;t<n;){for(var l=r;128<l;){if(e[t++]!=(127&l|128))return s;l>>=7}if(e[t++]!=l)break;s++,t+=i}return s},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var i=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var s=r;128<s;){if(e[t++]!=(127&s|128))return i;s>>=7}if(e[t++]!=s)break;i++;for(var l=0,o=1;l+=(127&(s=e[t++]))*o,o*=128,(128&s)!=0;);t+=l}return i},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return typeof e=="string"?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||Buffer!==void 0&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=t!==void 0?t:0,this.end_=n!==void 0?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*i;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*i+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,i=0,s=n+7;s>=n;s--)r=r<<8|t[s],i=i<<8|t[s+4];return e(r,i)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],i="";n<e;){var s=t[n++];if(128>s)r.push(s);else{if(192>s)continue;if(224>s){var l=t[n++];r.push((31&s)<<6|63&l)}else if(240>s){l=t[n++];var o=t[n++];r.push((15&s)<<12|(63&l)<<6|63&o)}else 248>s&&(s=(7&s)<<18|(63&(l=t[n++]))<<12|(63&(o=t[n++]))<<6|63&t[n++],s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))}8192<=r.length&&(i+=String.fromCharCode.apply(null,r),r.length=0)}return i+=goog.crypt.byteArrayToString(r),this.cursor_=n,i},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],i=e[t+2],s=e[t+3],l=e[t+4],o=e[t+5],c=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,i,s,l,o,c,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(this.readCallbacks_!==null),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],i=0;i<n.length;i++){var s=this.map_[n[i][0].toString()];this.wrapEntry_(s);var l=s.valueWrapper;l?(goog.asserts.assert(t),r.push([s.key,t(e,l)])):r.push([s.key,s.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var i=e[r][0],s=n(e[r][1]);t.set(i,s)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var i=this.map_[n[r]];e.call(t,this.wrapEntry_(i),i.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,i){var s=this.stringKeys_();s.sort();for(var l=0;l<s.length;l++){var o=this.map_[s[l]];t.beginSubMessage(e),n.call(t,1,o.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(o),i):r.call(t,2,o.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,i,s,l){for(;t.nextField()&&!t.isEndGroup();){var o=t.getFieldNumber();o==1?s=n.call(t):o==2&&(e.valueCtor_?(goog.asserts.assert(i),l||(l=new e.valueCtor_),r.call(t,l,i)):l=r.call(t))}goog.asserts.assert(s!=null),goog.asserts.assert(l!=null),e.set(s,l)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,i){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=i},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,i,s){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=i,this.isPacked=s},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function",jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,i,s){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=n===0?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=i),i)for(t=0;t<i.length;t++)(n=i[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(s&&s.length)for(t=0;t<s.length;t++)jspb.Message.computeOneofCase(e,s[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(e===null||typeof e!="object"||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],i=0;i<e.length;i++)r[i]=t.call(e[i],n,e[i]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,i){for(var s in n){var l=n[s],o=r.call(e,l);if(o!=null){for(var c in l.fieldName)if(l.fieldName.hasOwnProperty(c))break;t[c]=l.toObjectFn?l.isRepeated?jspb.Message.toObjectList(o,l.toObjectFn,i):l.toObjectFn(i,o):o}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var i in n){var s=n[i],l=s.fieldInfo;if(!s.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var o=r.call(e,l);if(o!=null)if(l.isMessageType()){if(!s.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");s.binaryWriterFn.call(t,l.fieldIndex,o,s.binaryMessageSerializeFn)}else s.binaryWriterFn.call(t,l.fieldIndex,o)}},jspb.Message.readBinaryExtension=function(e,t,n,r,i){var s=n[t.getFieldNumber()];if(s){if(n=s.fieldInfo,!s.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var l=new n.ctor;s.binaryReaderFn.call(t,l,s.binaryMessageDeserializeFn)}else l=s.binaryReaderFn.call(t);n.isRepeated&&!s.isPacked?(t=r.call(e,n))?t.push(l):i.call(e,n,[l]):i.call(e,n,l)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:+e},jspb.Message.getBooleanField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return e==null||typeof e=="string"?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return e==null||e instanceof Uint8Array?e:typeof e=="string"?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&typeof e[0]!="string"?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,function(n){goog.typeOf(n)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(n)+" expected "+t)})}},jspb.Message.getFieldWithDefault=function(e,t,n){return(e=jspb.Message.getField(e,t))==null?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return(e=jspb.Message.getBooleanField(e,t))==null?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return(e=jspb.Message.getOptionalFloatingPointField(e,t))==null?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var i=jspb.Message.getField(e,t);if(!i){if(n)return;i=[],jspb.Message.setField(e,t,i)}return e.wrappers_[t]=new jspb.Map(i,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),r!=null?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&r!==void 0&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,i=0;i<t.length;i++){var s=t[i],l=jspb.Message.getField(e,s);l!=null&&(n=s,r=l,jspb.Message.setField(e,s,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var i=jspb.Message.getField(e,n);(r||i)&&(e.wrappers_[n]=new t(i))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),i=[],s=0;s<r.length;s++)i[s]=new t(r[s]);e.wrappers_[n]=i}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n&&n.toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var i=r&&r.toArray();return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,i)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],i=0;i<n.length;i++)r[i]=n[i].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,i){jspb.Message.wrapRepeatedField_(e,r,t);var s=e.wrappers_[t];return s||(s=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),i!=null?(s.splice(i,0,n),e.splice(i,0,n.toArray())):(s.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var i={},s=0;s<e.length;s++)i[t.call(e[s])]=n?n.call(e[s],r,e[s]):e[s];return i},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(n){return new e.ctor(n)})),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,function(r){return r.toArray()})):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t&&t.toArray()):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],i=0,s=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),i=1);i<s;i++)jspb.Message.compareFields(n[i],t[i])||(r[i]=t[i]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!(typeof e=="number"&&isNaN(e)||typeof t=="number"&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,i=void 0,s=Math.max(e.length,t.length);for(n=0;n<s;n++){var l=e[n],o=t[n];if(l&&l.constructor==Object&&(goog.asserts.assert(r===void 0),goog.asserts.assert(n===e.length-1),r=l,l=void 0),o&&o.constructor==Object&&(goog.asserts.assert(i===void 0),goog.asserts.assert(n===t.length-1),i=o,o=void 0),!jspb.Message.compareFields(l,o))return!1}return!r&&!i||(r=r||{},i=i||{},jspb.Message.compareExtensions(r,i))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),i=n.length=0;i<r.length;i++)n[i]=r[i];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];r!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)(r=e[n])!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,i=t>>>16;for(t=n*r+65536*(n*i&65535)+65536*((e>>>=16)*r&65535),n=e*i+(n*i>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(e==0)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return e==""&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var i=parseInt(e[r],10);n.lo=i,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=(2147483648&this.hi)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&e[0]=="-";return t&&(e=e.substring(1)),(e=jspb.arith.UInt64.fromString(e))===null?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(n,r){t.writeSplitVarint64(n>>>0,r>>>0)})},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(typeof e=="boolean"||typeof e=="number"),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var i=e.charCodeAt(n+1);56320<=i&&57343>=i&&(r=1024*(r-55296)+i-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){e!=null&&t!=null&&n!=null&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,i=0;i<n;i++){var s=t[i];e.set(s,r),r+=s.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){t!=null&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){t!=null&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){t!=null&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){t!=null&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,function(i,s){r.writeSplitVarint64(i>>>0,s>>>0)})},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeSplitFixed64(e,n(t[i]),r(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeSplitVarint64(e,n(t[i]),r(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeSplitZigzagVarint64(e,n(t[i]),r(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++){var i=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(i)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var i=0;i<t.length;i++)this.encoder_.writeSplitFixed64(n(t[i]),r(t[i]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var i=0;i<t.length;i++)this.encoder_.writeSplitVarint64(n(t[i]),r(t[i]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var i=this.encoder_,s=0;s<t.length;s++)jspb.utils.toZigzag64(n(t[s]),r(t[s]),function(l,o){i.writeSplitVarint64(l>>>0,o>>>0)});this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf}).call(this,__webpack_require__(6),__webpack_require__(5).Buffer)},function(e,t,n){const{AbortController:r,AbortSignal:i}=typeof self<"u"?self:typeof window<"u"?window:void 0;e.exports=r,e.exports.AbortSignal=i,e.exports.default=r},function(e,t){var n=function(r){function i(){this.fetch=!1,this.DOMException=r.DOMException}return i.prototype=r,new i}(typeof self<"u"?self:this);(function(r){(function(i){var s="URLSearchParams"in r,l="Symbol"in r&&"iterator"in Symbol,o="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch{return!1}}(),c="FormData"in r,u="ArrayBuffer"in r;if(u)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],E=ArrayBuffer.isView||function(I){return I&&f.indexOf(Object.prototype.toString.call(I))>-1};function w(I){if(typeof I!="string"&&(I=String(I)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(I))throw new TypeError("Invalid character in header field name");return I.toLowerCase()}function h(I){return typeof I!="string"&&(I=String(I)),I}function g(I){var _={next:function(){var L=I.shift();return{done:L===void 0,value:L}}};return l&&(_[Symbol.iterator]=function(){return _}),_}function b(I){this.map={},I instanceof b?I.forEach(function(_,L){this.append(L,_)},this):Array.isArray(I)?I.forEach(function(_){this.append(_[0],_[1])},this):I&&Object.getOwnPropertyNames(I).forEach(function(_){this.append(_,I[_])},this)}function R(I){if(I.bodyUsed)return Promise.reject(new TypeError("Already read"));I.bodyUsed=!0}function j(I){return new Promise(function(_,L){I.onload=function(){_(I.result)},I.onerror=function(){L(I.error)}})}function F(I){var _=new FileReader,L=j(_);return _.readAsArrayBuffer(I),L}function M(I){if(I.slice)return I.slice(0);var _=new Uint8Array(I.byteLength);return _.set(new Uint8Array(I)),_.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(I){var _;this._bodyInit=I,I?typeof I=="string"?this._bodyText=I:o&&Blob.prototype.isPrototypeOf(I)?this._bodyBlob=I:c&&FormData.prototype.isPrototypeOf(I)?this._bodyFormData=I:s&&URLSearchParams.prototype.isPrototypeOf(I)?this._bodyText=I.toString():u&&o&&(_=I)&&DataView.prototype.isPrototypeOf(_)?(this._bodyArrayBuffer=M(I.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(I)||E(I))?this._bodyArrayBuffer=M(I):this._bodyText=I=Object.prototype.toString.call(I):this._bodyText="",this.headers.get("content-type")||(typeof I=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(I)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var I=R(this);if(I)return I;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?R(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(F)}),this.text=function(){var I,_,L,W=R(this);if(W)return W;if(this._bodyBlob)return I=this._bodyBlob,_=new FileReader,L=j(_),_.readAsText(I),L;if(this._bodyArrayBuffer)return Promise.resolve(function(B){for(var N=new Uint8Array(B),P=new Array(N.length),z=0;z<N.length;z++)P[z]=String.fromCharCode(N[z]);return P.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then($)}),this.json=function(){return this.text().then(JSON.parse)},this}b.prototype.append=function(I,_){I=w(I),_=h(_);var L=this.map[I];this.map[I]=L?L+", "+_:_},b.prototype.delete=function(I){delete this.map[w(I)]},b.prototype.get=function(I){return I=w(I),this.has(I)?this.map[I]:null},b.prototype.has=function(I){return this.map.hasOwnProperty(w(I))},b.prototype.set=function(I,_){this.map[w(I)]=h(_)},b.prototype.forEach=function(I,_){for(var L in this.map)this.map.hasOwnProperty(L)&&I.call(_,this.map[L],L,this)},b.prototype.keys=function(){var I=[];return this.forEach(function(_,L){I.push(L)}),g(I)},b.prototype.values=function(){var I=[];return this.forEach(function(_){I.push(_)}),g(I)},b.prototype.entries=function(){var I=[];return this.forEach(function(_,L){I.push([L,_])}),g(I)},l&&(b.prototype[Symbol.iterator]=b.prototype.entries);var d=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function C(I,_){var L,W,B=(_=_||{}).body;if(I instanceof C){if(I.bodyUsed)throw new TypeError("Already read");this.url=I.url,this.credentials=I.credentials,_.headers||(this.headers=new b(I.headers)),this.method=I.method,this.mode=I.mode,this.signal=I.signal,B||I._bodyInit==null||(B=I._bodyInit,I.bodyUsed=!0)}else this.url=String(I);if(this.credentials=_.credentials||this.credentials||"same-origin",!_.headers&&this.headers||(this.headers=new b(_.headers)),this.method=(L=_.method||this.method||"GET",W=L.toUpperCase(),d.indexOf(W)>-1?W:L),this.mode=_.mode||this.mode||null,this.signal=_.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(B)}function $(I){var _=new FormData;return I.trim().split("&").forEach(function(L){if(L){var W=L.split("="),B=W.shift().replace(/\+/g," "),N=W.join("=").replace(/\+/g," ");_.append(decodeURIComponent(B),decodeURIComponent(N))}}),_}function q(I,_){_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in _?_.statusText:"OK",this.headers=new b(_.headers),this.url=_.url||"",this._initBody(I)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})},A.call(C.prototype),A.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},q.error=function(){var I=new q(null,{status:0,statusText:""});return I.type="error",I};var y=[301,302,303,307,308];q.redirect=function(I,_){if(y.indexOf(_)===-1)throw new RangeError("Invalid status code");return new q(null,{status:_,headers:{location:I}})},i.DOMException=r.DOMException;try{new i.DOMException}catch{i.DOMException=function(_,L){this.message=_,this.name=L;var W=Error(_);this.stack=W.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function m(I,_){return new Promise(function(L,W){var B=new C(I,_);if(B.signal&&B.signal.aborted)return W(new i.DOMException("Aborted","AbortError"));var N=new XMLHttpRequest;function P(){N.abort()}N.onload=function(){var z,O,p={status:N.status,statusText:N.statusText,headers:(z=N.getAllResponseHeaders()||"",O=new b,z.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(V){var Q=V.split(":"),ee=Q.shift().trim();if(ee){var ne=Q.join(":").trim();O.append(ee,ne)}}),O)};p.url="responseURL"in N?N.responseURL:p.headers.get("X-Request-URL");var U="response"in N?N.response:N.responseText;L(new q(U,p))},N.onerror=function(){W(new TypeError("Network request failed"))},N.ontimeout=function(){W(new TypeError("Network request failed"))},N.onabort=function(){W(new i.DOMException("Aborted","AbortError"))},N.open(B.method,B.url,!0),B.credentials==="include"?N.withCredentials=!0:B.credentials==="omit"&&(N.withCredentials=!1),"responseType"in N&&o&&(N.responseType="blob"),B.headers.forEach(function(z,O){N.setRequestHeader(O,z)}),B.signal&&(B.signal.addEventListener("abort",P),N.onreadystatechange=function(){N.readyState===4&&B.signal.removeEventListener("abort",P)}),N.send(B._bodyInit===void 0?null:B._bodyInit)})}m.polyfill=!0,r.fetch||(r.fetch=m,r.Headers=b,r.Request=C,r.Response=q),i.Headers=b,i.Request=C,i.Response=q,i.fetch=m})({})})(n),delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},function(e,t,n){(function(r){const i=n(211),s=n(52),l=(o,c,u)=>({from:l,EnvVarError:n(52),get:function(f){if(!f)return o;if(arguments.length>1)throw new s("It looks like you passed more than one argument to env.get(). Since env-var@6.0.0 this is no longer supported. To set a default value use env.get(TARGET).default(DEFAULT)");return i(o,f,c||{},u||function(){})},accessors:n(94),logger:n(225)(console.log,o.NODE_ENV)});e.exports=l(r.env)}).call(this,n(2))},function(e,t,n){var r=n(13),i=n(73),s=n(3).LEVEL,l=e.exports=function(){var o=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.call(this,{objectMode:!0,highWaterMark:c.highWaterMark}),this.format=c.format,this.level=c.level,this.handleExceptions=c.handleExceptions,this.silent=c.silent,c.log&&(this.log=c.log),c.logv&&(this.logv=c.logv),c.close&&(this.close=c.close),this.once("pipe",function(u){o.levels=u.levels,o.parent=u}),this.once("unpipe",function(u){u===o.parent&&(o.parent=null,o.close&&o.close())})};r.inherits(l,i),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);var f=this.level||this.parent&&this.parent.level;if(!f||this.levels[f]>=this.levels[o[s]]){if(o&&!this.format)return this.log(o,u);var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o),this.format.options)}catch(h){E=h}if(E||!w){if(u(),E)throw E;return}return this.log(w,u)}return u(null)},l.prototype._writev=function(o,c){if(this.logv){var u=o.filter(this._accept,this);return u.length?this.logv(u,c):c(null)}for(var f=0;f<o.length;f++)if(this._accept(o[f]))if(!o[f].chunk||this.format){var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o[f].chunk),this.format.options)}catch(h){E=h}if(E||!w){if(o[f].callback(),E)throw c(null),E}else this.log(w,o[f].callback)}else this.log(o[f].chunk,o[f].callback);return c(null)},l.prototype._accept=function(o){var c=o.chunk;if(this.silent)return!1;var u=this.level||this.parent&&this.parent.level;return!(c.exception!==!0&&u&&!(this.levels[u]>=this.levels[c[s]])||!this.handleExceptions&&c.exception===!0)},l.prototype._nop=function(){}},function(e,t,n){(function(r){const i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new c}abort(){this.signal.dispatchEvent("abort")}},l=typeof AbortSignal=="function",o=typeof s.AbortSignal=="function",c=l?AbortSignal:o?s.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(A){if(A==="abort"){this.aborted=!0;const d={type:A,target:this};this.onabort(d),this._listeners.forEach(C=>C(d),this)}}onabort(){}addEventListener(A,d){A==="abort"&&this._listeners.push(d)}removeEventListener(A,d){A==="abort"&&(this._listeners=this._listeners.filter(C=>C!==d))}},u=new Set,f=(A,d)=>{const C=`LRU_CACHE_OPTION_${A}`;h(C)&&g(C,`${A} option`,`options.${d}`,M)},E=(A,d)=>{const C=`LRU_CACHE_METHOD_${A}`;if(h(C)){const{prototype:$}=M,{get:q}=Object.getOwnPropertyDescriptor($,A);g(C,`${A} method`,`cache.${d}()`,q)}},w=(...A)=>{typeof r=="object"&&r&&typeof r.emitWarning=="function"?r.emitWarning(...A):console.error(...A)},h=A=>!u.has(A),g=(A,d,C,$)=>{u.add(A),w(`The ${d} is deprecated. Please use ${C} instead.`,"DeprecationWarning",A,$)},b=A=>A&&A===Math.floor(A)&&A>0&&isFinite(A),R=A=>b(A)?A<=Math.pow(2,8)?Uint8Array:A<=Math.pow(2,16)?Uint16Array:A<=Math.pow(2,32)?Uint32Array:A<=Number.MAX_SAFE_INTEGER?j:null:null;class j extends Array{constructor(d){super(d),this.fill(0)}}class F{constructor(d){if(d===0)return[];const C=R(d);this.heap=new C(d),this.length=0}push(d){this.heap[this.length++]=d}pop(){return this.heap[--this.length]}}class M{constructor(d={}){const{max:C=0,ttl:$,ttlResolution:q=1,ttlAutopurge:y,updateAgeOnGet:m,updateAgeOnHas:I,allowStale:_,dispose:L,disposeAfter:W,noDisposeOnSet:B,noUpdateTTL:N,maxSize:P=0,maxEntrySize:z=0,sizeCalculation:O,fetchMethod:p,fetchContext:U,noDeleteOnFetchRejection:V,noDeleteOnStaleGet:Q}=d,{length:ee,maxAge:ne,stale:Y}=d instanceof M?{}:d;if(C!==0&&!b(C))throw new TypeError("max option must be a nonnegative integer");const G=C?R(C):Array;if(!G)throw new Error("invalid max value: "+C);if(this.max=C,this.maxSize=P,this.maxEntrySize=z||this.maxSize,this.sizeCalculation=O||ee,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=p||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=U,!this.fetchMethod&&U!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(C).fill(null),this.valList=new Array(C).fill(null),this.next=new G(C),this.prev=new G(C),this.head=0,this.tail=0,this.free=new F(C),this.initialFill=1,this.size=0,typeof L=="function"&&(this.dispose=L),typeof W=="function"?(this.disposeAfter=W,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!B,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!V,this.maxEntrySize!==0){if(this.maxSize!==0&&!b(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!b(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!_||!!Y,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!m,this.updateAgeOnHas=!!I,this.ttlResolution=b(q)||q===0?q:1,this.ttlAutopurge=!!y,this.ttl=$||ne||0,this.ttl){if(!b(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const S="LRU_CACHE_UNBOUNDED";h(S)&&(u.add(S),w("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",S,M))}Y&&f("stale","allowStale"),ne&&f("maxAge","ttl"),ee&&f("length","sizeCalculation")}getRemainingTTL(d){return this.has(d,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new j(this.max),this.starts=new j(this.max),this.setItemTTL=($,q,y=i.now())=>{if(this.starts[$]=q!==0?y:0,this.ttls[$]=q,q!==0&&this.ttlAutopurge){const m=setTimeout(()=>{this.isStale($)&&this.delete(this.keyList[$])},q+1);m.unref&&m.unref()}},this.updateItemAge=$=>{this.starts[$]=this.ttls[$]!==0?i.now():0};let d=0;const C=()=>{const $=i.now();if(this.ttlResolution>0){d=$;const q=setTimeout(()=>d=0,this.ttlResolution);q.unref&&q.unref()}return $};this.getRemainingTTL=$=>{const q=this.keyMap.get($);return q===void 0?0:this.ttls[q]===0||this.starts[q]===0?1/0:this.starts[q]+this.ttls[q]-(d||C())},this.isStale=$=>this.ttls[$]!==0&&this.starts[$]!==0&&(d||C())-this.starts[$]>this.ttls[$]}updateItemAge(d){}setItemTTL(d,C,$){}isStale(d){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new j(this.max),this.removeItemSize=d=>{this.calculatedSize-=this.sizes[d],this.sizes[d]=0},this.requireSize=(d,C,$,q)=>{if(!b($)){if(!q)throw new TypeError("invalid size value (must be positive integer)");if(typeof q!="function")throw new TypeError("sizeCalculation must be a function");if($=q(C,d),!b($))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return $},this.addItemSize=(d,C)=>{this.sizes[d]=C;const $=this.maxSize-this.sizes[d];for(;this.calculatedSize>$;)this.evict(!0);this.calculatedSize+=this.sizes[d]}}removeItemSize(d){}addItemSize(d,C){}requireSize(d,C,$,q){if($||q)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:d=this.allowStale}={}){if(this.size)for(let C=this.tail;this.isValidIndex(C)&&(!d&&this.isStale(C)||(yield C),C!==this.head);)C=this.prev[C]}*rindexes({allowStale:d=this.allowStale}={}){if(this.size)for(let C=this.head;this.isValidIndex(C)&&(!d&&this.isStale(C)||(yield C),C!==this.tail);)C=this.next[C]}isValidIndex(d){return this.keyMap.get(this.keyList[d])===d}*entries(){for(const d of this.indexes())yield[this.keyList[d],this.valList[d]]}*rentries(){for(const d of this.rindexes())yield[this.keyList[d],this.valList[d]]}*keys(){for(const d of this.indexes())yield this.keyList[d]}*rkeys(){for(const d of this.rindexes())yield this.keyList[d]}*values(){for(const d of this.indexes())yield this.valList[d]}*rvalues(){for(const d of this.rindexes())yield this.valList[d]}[Symbol.iterator](){return this.entries()}find(d,C={}){for(const $ of this.indexes())if(d(this.valList[$],this.keyList[$],this))return this.get(this.keyList[$],C)}forEach(d,C=this){for(const $ of this.indexes())d.call(C,this.valList[$],this.keyList[$],this)}rforEach(d,C=this){for(const $ of this.rindexes())d.call(C,this.valList[$],this.keyList[$],this)}get prune(){return E("prune","purgeStale"),this.purgeStale}purgeStale(){let d=!1;for(const C of this.rindexes({allowStale:!0}))this.isStale(C)&&(this.delete(this.keyList[C]),d=!0);return d}dump(){const d=[];for(const C of this.indexes({allowStale:!0})){const $=this.keyList[C],q=this.valList[C],y={value:this.isBackgroundFetch(q)?q.__staleWhileFetching:q};if(this.ttls){y.ttl=this.ttls[C];const m=i.now()-this.starts[C];y.start=Math.floor(Date.now()-m)}this.sizes&&(y.size=this.sizes[C]),d.unshift([$,y])}return d}load(d){this.clear();for(const[C,$]of d){if($.start){const q=Date.now()-$.start;$.start=i.now()-q}this.set(C,$.value,$)}}dispose(d,C,$){}set(d,C,{ttl:$=this.ttl,start:q,noDisposeOnSet:y=this.noDisposeOnSet,size:m=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:_=this.noUpdateTTL}={}){if(m=this.requireSize(d,C,m,I),this.maxEntrySize&&m>this.maxEntrySize)return this;let L=this.size===0?void 0:this.keyMap.get(d);if(L===void 0)L=this.newIndex(),this.keyList[L]=d,this.valList[L]=C,this.keyMap.set(d,L),this.next[this.tail]=L,this.prev[L]=this.tail,this.tail=L,this.size++,this.addItemSize(L,m),_=!1;else{const W=this.valList[L];C!==W&&(this.isBackgroundFetch(W)?W.__abortController.abort():y||(this.dispose(W,d,"set"),this.disposeAfter&&this.disposed.push([W,d,"set"])),this.removeItemSize(L),this.valList[L]=C,this.addItemSize(L,m)),this.moveToTail(L)}if($===0||this.ttl!==0||this.ttls||this.initializeTTLTracking(),_||this.setItemTTL(L,$,q),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const d=this.valList[this.head];return this.evict(!0),d}}evict(d){const C=this.head,$=this.keyList[C],q=this.valList[C];return this.isBackgroundFetch(q)?q.__abortController.abort():(this.dispose(q,$,"evict"),this.disposeAfter&&this.disposed.push([q,$,"evict"])),this.removeItemSize(C),d&&(this.keyList[C]=null,this.valList[C]=null,this.free.push(C)),this.head=this.next[C],this.keyMap.delete($),this.size--,C}has(d,{updateAgeOnHas:C=this.updateAgeOnHas}={}){const $=this.keyMap.get(d);return $!==void 0&&!this.isStale($)&&(C&&this.updateItemAge($),!0)}peek(d,{allowStale:C=this.allowStale}={}){const $=this.keyMap.get(d);if($!==void 0&&(C||!this.isStale($))){const q=this.valList[$];return this.isBackgroundFetch(q)?q.__staleWhileFetching:q}}backgroundFetch(d,C,$,q){const y=C===void 0?void 0:this.valList[C];if(this.isBackgroundFetch(y))return y;const m=new s,I={signal:m.signal,options:$,context:q},_=new Promise(L=>L(this.fetchMethod(d,y,I))).then(L=>(m.signal.aborted||this.set(d,L,I.options),L),L=>{if(this.valList[C]===_&&(!$.noDeleteOnFetchRejection||_.__staleWhileFetching===void 0?this.delete(d):this.valList[C]=_.__staleWhileFetching),_.__returned===_)throw L});return _.__abortController=m,_.__staleWhileFetching=y,_.__returned=null,C===void 0?(this.set(d,_,I.options),C=this.keyMap.get(d)):this.valList[C]=_,_}isBackgroundFetch(d){return d&&typeof d=="object"&&typeof d.then=="function"&&Object.prototype.hasOwnProperty.call(d,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(d,"__returned")&&(d.__returned===d||d.__returned===null)}async fetch(d,{allowStale:C=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:q=this.noDeleteOnStaleGet,ttl:y=this.ttl,noDisposeOnSet:m=this.noDisposeOnSet,size:I=0,sizeCalculation:_=this.sizeCalculation,noUpdateTTL:L=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,fetchContext:B=this.fetchContext,forceRefresh:N=!1}={}){if(!this.fetchMethod)return this.get(d,{allowStale:C,updateAgeOnGet:$,noDeleteOnStaleGet:q});const P={allowStale:C,updateAgeOnGet:$,noDeleteOnStaleGet:q,ttl:y,noDisposeOnSet:m,size:I,sizeCalculation:_,noUpdateTTL:L,noDeleteOnFetchRejection:W};let z=this.keyMap.get(d);if(z===void 0){const O=this.backgroundFetch(d,z,P,B);return O.__returned=O}{const O=this.valList[z];if(this.isBackgroundFetch(O))return C&&O.__staleWhileFetching!==void 0?O.__staleWhileFetching:O.__returned=O;if(!N&&!this.isStale(z))return this.moveToTail(z),$&&this.updateItemAge(z),O;const p=this.backgroundFetch(d,z,P,B);return C&&p.__staleWhileFetching!==void 0?p.__staleWhileFetching:p.__returned=p}}get(d,{allowStale:C=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:q=this.noDeleteOnStaleGet}={}){const y=this.keyMap.get(d);if(y!==void 0){const m=this.valList[y],I=this.isBackgroundFetch(m);return this.isStale(y)?I?C?m.__staleWhileFetching:void 0:(q||this.delete(d),C?m:void 0):I?void 0:(this.moveToTail(y),$&&this.updateItemAge(y),m)}}connect(d,C){this.prev[C]=d,this.next[d]=C}moveToTail(d){d!==this.tail&&(d===this.head?this.head=this.next[d]:this.connect(this.prev[d],this.next[d]),this.connect(this.tail,d),this.tail=d)}get del(){return E("del","delete"),this.delete}delete(d){let C=!1;if(this.size!==0){const $=this.keyMap.get(d);if($!==void 0)if(C=!0,this.size===1)this.clear();else{this.removeItemSize($);const q=this.valList[$];this.isBackgroundFetch(q)?q.__abortController.abort():(this.dispose(q,d,"delete"),this.disposeAfter&&this.disposed.push([q,d,"delete"])),this.keyMap.delete(d),this.keyList[$]=null,this.valList[$]=null,$===this.tail?this.tail=this.prev[$]:$===this.head?this.head=this.next[$]:(this.next[this.prev[$]]=this.next[$],this.prev[this.next[$]]=this.prev[$]),this.size--,this.free.push($)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return C}clear(){for(const d of this.rindexes({allowStale:!0})){const C=this.valList[d];if(this.isBackgroundFetch(C))C.__abortController.abort();else{const $=this.keyList[d];this.dispose(C,$,"delete"),this.disposeAfter&&this.disposed.push([C,$,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E("reset","clear"),this.clear}get length(){return((d,C)=>{const $=`LRU_CACHE_PROPERTY_${d}`;if(h($)){const{prototype:q}=M,{get:y}=Object.getOwnPropertyDescriptor(q,d);g($,`${d} property`,`cache.${C}`,y)}})("length","size"),this.size}static get AbortController(){return s}static get AbortSignal(){return c}}e.exports=M}).call(this,n(2))},function(e,t,n){var r=n(41).Colorizer;e.exports=function(i){return r.addColors(i.colors||i),i}},function(e,t,n){var r={};e.exports=r,r.themes={};var i=n(13),s=r.styles=n(109),l=Object.defineProperties,o=new RegExp(/[\r\n]+/g);r.supportsColor=n(110).supportsColor,r.enabled===void 0&&(r.enabled=r.supportsColor()!==!1),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(R){return(""+R).replace(/\x1B\[\d+m/g,"")},r.stylize=function(R,j){return r.enabled?s[j].open+R+s[j].close:R+""};var c=/[|\\{}()[\]^$+*?.]/g;function u(R){var j=function F(){return h.apply(F,arguments)};return j._styles=R,j.__proto__=w,j}var f,E=(f={},s.grey=s.gray,Object.keys(s).forEach(function(R){s[R].closeRe=new RegExp(function(j){if(typeof j!="string")throw new TypeError("Expected a string");return j.replace(c,"\\$&")}(s[R].close),"g"),f[R]={get:function(){return u(this._styles.concat(R))}}}),f),w=l(function(){},E);function h(){var R=Array.prototype.slice.call(arguments),j=R.map(function(C){return C!==void 0&&C.constructor===String?C:i.inspect(C)}).join(" ");if(!r.enabled||!j)return j;for(var F=j.indexOf(`
|
|
39
|
+
`)},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),i=t.toLowerCase().match(n),s=Math.min(r.length,i.length),l=0;l<s;l++){n=r[l];var o=i[l];if(n!=o)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(o,10),!isNaN(t)&&e-t)?e-t:n<o?-1:1}return r.length!=i.length?r.length-i.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&":"&","<":"<",">":">",""":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(i,s){var l=n[i];return l||(s.charAt(0)=="#"&&(s=+("0"+s.substr(1)),isNaN(s)||(l=String.fromCharCode(s))),l||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),i+" ")),l=r.firstChild.nodeValue.slice(0,-1)),n[i]=l)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(t,n){switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return n.charAt(0)!="#"||(n=+("0"+n.substr(1)),isNaN(n))?t:String.fromCharCode(n)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var i=n==1?t:t.charAt(r);if(e.charAt(0)==i&&e.charAt(e.length-1)==i)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var i=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(i)}else e.length>t&&(r=Math.floor(t/2),i=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(i));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),i=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<i&&127>i?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))==-1&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return e==null?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return t==0&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(t,n){return n.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(n,r,i){return r+i.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;typeof t=="string"&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(t[r]!=""){var i=e.lastIndexOf(t[r]);i>n&&(n=i)}return n==-1?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var i=0;i<t.length+1;i++)n[i]=i;for(i=0;i<e.length;i++){r[0]=i+1;for(var s=0;s<t.length;s++)r[s+1]=Math.min(r[s]+1,n[s+1]+1,n[s]+ +(e[i]!=t[s]));for(s=0;s<n.length;s++)n[s]=r[s]}return r[t.length]},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch{}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return n[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if(n[0]=="Edge")return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,function(n){return t==n[0]}))&&e[1]||""},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_())!=null&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function",goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function",goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var i=e[r],s=r+1<e.length,l=s?e[r+1]:0,o=r+2<e.length,c=o?e[r+2]:0,u=i>>2;i=(3&i)<<4|l>>4,l=(15&l)<<2|c>>6,c&=63,o||(c=64,s||(l=64)),n.push(t[u],t[i],t[l]||"",t[c]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,function(r){n+=String.fromCharCode(r)}),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,function(r){n.push(r)}),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return goog.crypt.base64.decodeStringInternal_(e,function(s){r[i++]=s}),r.subarray(0,i)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(c){for(;r<e.length;){var u=e.charAt(r++),f=goog.crypt.base64.charToByteMap_[u];if(f!=null)return f;if(!goog.string.isEmptyOrWhitespace(u))throw Error("Unknown base64 encoding at char: "+u)}return c}goog.crypt.base64.init_();for(var r=0;;){var i=n(-1),s=n(0),l=n(64),o=n(64);if(o===64&&i===-1)break;t(i<<2|s>>4),l!=64&&(t(s<<4&240|l>>2),o!=64&&t(l<<6&192|o))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var i=0;i<r.length;i++){var s=r[i],l=goog.crypt.base64.charToByteMap_[s];l===void 0?goog.crypt.base64.charToByteMap_[s]=i:goog.asserts.assert(l===i)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(e==0?n==0?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),s=e.charCodeAt(4),l=e.charCodeAt(5),o=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(i<<24)>>>0,jspb.utils.split64High=s+(l<<8)+(o<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,n==255?e?NaN:1/0*t:n==0?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,r==2047?e?NaN:1/0*n:r==0?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(i,s){return i=i?String(i):"",s?"0000000".slice(i.length)+i:i}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+e);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+((e=1+~e>>>0)==0?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(s,l){for(var o=0;8>o&&(s!==1||0<l);o++)l=s*r[o]+l,r[o]=255&l,l>>>=8}goog.asserts.assert(0<e.length);var n=!1;e[0]==="-"&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],i=0;i<e.length;i++)t(10,e.charCodeAt(i)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var s=0;8>s;s++)r[s]=255&~r[s]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(e.length==18),goog.asserts.assert(e[0]=="0"),goog.asserts.assert(e[1]=="x");for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),i=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+i)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,i=t;i<n;i++)r+=e[i]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var i=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(i++;;){var s=e[t++];if(!(128&s))break}else for(;t<n;){for(s=r;128<s;){if(e[t]!=(127&s|128))return i;t++,s>>=7}if(e[t++]!=s)break;for(i++;128&(s=e[t++]););}return i},jspb.utils.countFixedFields_=function(e,t,n,r,i){var s=0;if(128>r)for(;t<n&&e[t++]==r;)s++,t+=i;else for(;t<n;){for(var l=r;128<l;){if(e[t++]!=(127&l|128))return s;l>>=7}if(e[t++]!=l)break;s++,t+=i}return s},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var i=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var s=r;128<s;){if(e[t++]!=(127&s|128))return i;s>>=7}if(e[t++]!=s)break;i++;for(var l=0,o=1;l+=(127&(s=e[t++]))*o,o*=128,(128&s)!=0;);t+=l}return i},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return typeof e=="string"?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||Buffer!==void 0&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=t!==void 0?t:0,this.end_=n!==void 0?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*i;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*i+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,i=0,s=n+7;s>=n;s--)r=r<<8|t[s],i=i<<8|t[s+4];return e(r,i)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],i="";n<e;){var s=t[n++];if(128>s)r.push(s);else{if(192>s)continue;if(224>s){var l=t[n++];r.push((31&s)<<6|63&l)}else if(240>s){l=t[n++];var o=t[n++];r.push((15&s)<<12|(63&l)<<6|63&o)}else 248>s&&(s=(7&s)<<18|(63&(l=t[n++]))<<12|(63&(o=t[n++]))<<6|63&t[n++],s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))}8192<=r.length&&(i+=String.fromCharCode.apply(null,r),r.length=0)}return i+=goog.crypt.byteArrayToString(r),this.cursor_=n,i},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],i=e[t+2],s=e[t+3],l=e[t+4],o=e[t+5],c=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,i,s,l,o,c,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(this.readCallbacks_!==null),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],i=0;i<n.length;i++){var s=this.map_[n[i][0].toString()];this.wrapEntry_(s);var l=s.valueWrapper;l?(goog.asserts.assert(t),r.push([s.key,t(e,l)])):r.push([s.key,s.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var i=e[r][0],s=n(e[r][1]);t.set(i,s)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var i=this.map_[n[r]];e.call(t,this.wrapEntry_(i),i.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,i){var s=this.stringKeys_();s.sort();for(var l=0;l<s.length;l++){var o=this.map_[s[l]];t.beginSubMessage(e),n.call(t,1,o.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(o),i):r.call(t,2,o.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,i,s,l){for(;t.nextField()&&!t.isEndGroup();){var o=t.getFieldNumber();o==1?s=n.call(t):o==2&&(e.valueCtor_?(goog.asserts.assert(i),l||(l=new e.valueCtor_),r.call(t,l,i)):l=r.call(t))}goog.asserts.assert(s!=null),goog.asserts.assert(l!=null),e.set(s,l)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,i){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=i},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,i,s){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=i,this.isPacked=s},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function",jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,i,s){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=n===0?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=i),i)for(t=0;t<i.length;t++)(n=i[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(s&&s.length)for(t=0;t<s.length;t++)jspb.Message.computeOneofCase(e,s[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(e===null||typeof e!="object"||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],i=0;i<e.length;i++)r[i]=t.call(e[i],n,e[i]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,i){for(var s in n){var l=n[s],o=r.call(e,l);if(o!=null){for(var c in l.fieldName)if(l.fieldName.hasOwnProperty(c))break;t[c]=l.toObjectFn?l.isRepeated?jspb.Message.toObjectList(o,l.toObjectFn,i):l.toObjectFn(i,o):o}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var i in n){var s=n[i],l=s.fieldInfo;if(!s.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var o=r.call(e,l);if(o!=null)if(l.isMessageType()){if(!s.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");s.binaryWriterFn.call(t,l.fieldIndex,o,s.binaryMessageSerializeFn)}else s.binaryWriterFn.call(t,l.fieldIndex,o)}},jspb.Message.readBinaryExtension=function(e,t,n,r,i){var s=n[t.getFieldNumber()];if(s){if(n=s.fieldInfo,!s.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var l=new n.ctor;s.binaryReaderFn.call(t,l,s.binaryMessageDeserializeFn)}else l=s.binaryReaderFn.call(t);n.isRepeated&&!s.isPacked?(t=r.call(e,n))?t.push(l):i.call(e,n,[l]):i.call(e,n,l)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:+e},jspb.Message.getBooleanField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return e==null||typeof e=="string"?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return e==null||e instanceof Uint8Array?e:typeof e=="string"?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&typeof e[0]!="string"?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,function(n){goog.typeOf(n)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(n)+" expected "+t)})}},jspb.Message.getFieldWithDefault=function(e,t,n){return(e=jspb.Message.getField(e,t))==null?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return(e=jspb.Message.getBooleanField(e,t))==null?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return(e=jspb.Message.getOptionalFloatingPointField(e,t))==null?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var i=jspb.Message.getField(e,t);if(!i){if(n)return;i=[],jspb.Message.setField(e,t,i)}return e.wrappers_[t]=new jspb.Map(i,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),r!=null?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&r!==void 0&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,i=0;i<t.length;i++){var s=t[i],l=jspb.Message.getField(e,s);l!=null&&(n=s,r=l,jspb.Message.setField(e,s,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var i=jspb.Message.getField(e,n);(r||i)&&(e.wrappers_[n]=new t(i))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),i=[],s=0;s<r.length;s++)i[s]=new t(r[s]);e.wrappers_[n]=i}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n&&n.toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var i=r&&r.toArray();return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,i)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],i=0;i<n.length;i++)r[i]=n[i].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,i){jspb.Message.wrapRepeatedField_(e,r,t);var s=e.wrappers_[t];return s||(s=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),i!=null?(s.splice(i,0,n),e.splice(i,0,n.toArray())):(s.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var i={},s=0;s<e.length;s++)i[t.call(e[s])]=n?n.call(e[s],r,e[s]):e[s];return i},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(n){return new e.ctor(n)})),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,function(r){return r.toArray()})):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t&&t.toArray()):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],i=0,s=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),i=1);i<s;i++)jspb.Message.compareFields(n[i],t[i])||(r[i]=t[i]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!(typeof e=="number"&&isNaN(e)||typeof t=="number"&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,i=void 0,s=Math.max(e.length,t.length);for(n=0;n<s;n++){var l=e[n],o=t[n];if(l&&l.constructor==Object&&(goog.asserts.assert(r===void 0),goog.asserts.assert(n===e.length-1),r=l,l=void 0),o&&o.constructor==Object&&(goog.asserts.assert(i===void 0),goog.asserts.assert(n===t.length-1),i=o,o=void 0),!jspb.Message.compareFields(l,o))return!1}return!r&&!i||(r=r||{},i=i||{},jspb.Message.compareExtensions(r,i))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),i=n.length=0;i<r.length;i++)n[i]=r[i];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];r!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)(r=e[n])!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,i=t>>>16;for(t=n*r+65536*(n*i&65535)+65536*((e>>>=16)*r&65535),n=e*i+(n*i>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(e==0)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return e==""&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var i=parseInt(e[r],10);n.lo=i,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=(2147483648&this.hi)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&e[0]=="-";return t&&(e=e.substring(1)),(e=jspb.arith.UInt64.fromString(e))===null?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(n,r){t.writeSplitVarint64(n>>>0,r>>>0)})},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(typeof e=="boolean"||typeof e=="number"),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var i=e.charCodeAt(n+1);56320<=i&&57343>=i&&(r=1024*(r-55296)+i-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){e!=null&&t!=null&&n!=null&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,i=0;i<n;i++){var s=t[i];e.set(s,r),r+=s.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){t!=null&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){t!=null&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){t!=null&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){t!=null&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,function(i,s){r.writeSplitVarint64(i>>>0,s>>>0)})},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeSplitFixed64(e,n(t[i]),r(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeSplitVarint64(e,n(t[i]),r(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeSplitZigzagVarint64(e,n(t[i]),r(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++){var i=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(i)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var i=0;i<t.length;i++)this.encoder_.writeSplitFixed64(n(t[i]),r(t[i]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var i=0;i<t.length;i++)this.encoder_.writeSplitVarint64(n(t[i]),r(t[i]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var i=this.encoder_,s=0;s<t.length;s++)jspb.utils.toZigzag64(n(t[s]),r(t[s]),function(l,o){i.writeSplitVarint64(l>>>0,o>>>0)});this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf}).call(this,__webpack_require__(6),__webpack_require__(5).Buffer)},function(e,t,n){const{AbortController:r,AbortSignal:i}=typeof self<"u"?self:typeof window<"u"?window:void 0;e.exports=r,e.exports.AbortSignal=i,e.exports.default=r},function(e,t){var n=function(r){function i(){this.fetch=!1,this.DOMException=r.DOMException}return i.prototype=r,new i}(typeof self<"u"?self:this);(function(r){(function(i){var s="URLSearchParams"in r,l="Symbol"in r&&"iterator"in Symbol,o="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch{return!1}}(),c="FormData"in r,u="ArrayBuffer"in r;if(u)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],E=ArrayBuffer.isView||function(I){return I&&f.indexOf(Object.prototype.toString.call(I))>-1};function w(I){if(typeof I!="string"&&(I=String(I)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(I))throw new TypeError("Invalid character in header field name");return I.toLowerCase()}function h(I){return typeof I!="string"&&(I=String(I)),I}function g(I){var _={next:function(){var L=I.shift();return{done:L===void 0,value:L}}};return l&&(_[Symbol.iterator]=function(){return _}),_}function b(I){this.map={},I instanceof b?I.forEach(function(_,L){this.append(L,_)},this):Array.isArray(I)?I.forEach(function(_){this.append(_[0],_[1])},this):I&&Object.getOwnPropertyNames(I).forEach(function(_){this.append(_,I[_])},this)}function R(I){if(I.bodyUsed)return Promise.reject(new TypeError("Already read"));I.bodyUsed=!0}function j(I){return new Promise(function(_,L){I.onload=function(){_(I.result)},I.onerror=function(){L(I.error)}})}function F(I){var _=new FileReader,L=j(_);return _.readAsArrayBuffer(I),L}function M(I){if(I.slice)return I.slice(0);var _=new Uint8Array(I.byteLength);return _.set(new Uint8Array(I)),_.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(I){var _;this._bodyInit=I,I?typeof I=="string"?this._bodyText=I:o&&Blob.prototype.isPrototypeOf(I)?this._bodyBlob=I:c&&FormData.prototype.isPrototypeOf(I)?this._bodyFormData=I:s&&URLSearchParams.prototype.isPrototypeOf(I)?this._bodyText=I.toString():u&&o&&(_=I)&&DataView.prototype.isPrototypeOf(_)?(this._bodyArrayBuffer=M(I.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(I)||E(I))?this._bodyArrayBuffer=M(I):this._bodyText=I=Object.prototype.toString.call(I):this._bodyText="",this.headers.get("content-type")||(typeof I=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(I)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var I=R(this);if(I)return I;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?R(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(F)}),this.text=function(){var I,_,L,W=R(this);if(W)return W;if(this._bodyBlob)return I=this._bodyBlob,_=new FileReader,L=j(_),_.readAsText(I),L;if(this._bodyArrayBuffer)return Promise.resolve(function(B){for(var N=new Uint8Array(B),D=new Array(N.length),z=0;z<N.length;z++)D[z]=String.fromCharCode(N[z]);return D.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then($)}),this.json=function(){return this.text().then(JSON.parse)},this}b.prototype.append=function(I,_){I=w(I),_=h(_);var L=this.map[I];this.map[I]=L?L+", "+_:_},b.prototype.delete=function(I){delete this.map[w(I)]},b.prototype.get=function(I){return I=w(I),this.has(I)?this.map[I]:null},b.prototype.has=function(I){return this.map.hasOwnProperty(w(I))},b.prototype.set=function(I,_){this.map[w(I)]=h(_)},b.prototype.forEach=function(I,_){for(var L in this.map)this.map.hasOwnProperty(L)&&I.call(_,this.map[L],L,this)},b.prototype.keys=function(){var I=[];return this.forEach(function(_,L){I.push(L)}),g(I)},b.prototype.values=function(){var I=[];return this.forEach(function(_){I.push(_)}),g(I)},b.prototype.entries=function(){var I=[];return this.forEach(function(_,L){I.push([L,_])}),g(I)},l&&(b.prototype[Symbol.iterator]=b.prototype.entries);var d=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function C(I,_){var L,W,B=(_=_||{}).body;if(I instanceof C){if(I.bodyUsed)throw new TypeError("Already read");this.url=I.url,this.credentials=I.credentials,_.headers||(this.headers=new b(I.headers)),this.method=I.method,this.mode=I.mode,this.signal=I.signal,B||I._bodyInit==null||(B=I._bodyInit,I.bodyUsed=!0)}else this.url=String(I);if(this.credentials=_.credentials||this.credentials||"same-origin",!_.headers&&this.headers||(this.headers=new b(_.headers)),this.method=(L=_.method||this.method||"GET",W=L.toUpperCase(),d.indexOf(W)>-1?W:L),this.mode=_.mode||this.mode||null,this.signal=_.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(B)}function $(I){var _=new FormData;return I.trim().split("&").forEach(function(L){if(L){var W=L.split("="),B=W.shift().replace(/\+/g," "),N=W.join("=").replace(/\+/g," ");_.append(decodeURIComponent(B),decodeURIComponent(N))}}),_}function q(I,_){_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in _?_.statusText:"OK",this.headers=new b(_.headers),this.url=_.url||"",this._initBody(I)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})},A.call(C.prototype),A.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},q.error=function(){var I=new q(null,{status:0,statusText:""});return I.type="error",I};var y=[301,302,303,307,308];q.redirect=function(I,_){if(y.indexOf(_)===-1)throw new RangeError("Invalid status code");return new q(null,{status:_,headers:{location:I}})},i.DOMException=r.DOMException;try{new i.DOMException}catch{i.DOMException=function(_,L){this.message=_,this.name=L;var W=Error(_);this.stack=W.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function m(I,_){return new Promise(function(L,W){var B=new C(I,_);if(B.signal&&B.signal.aborted)return W(new i.DOMException("Aborted","AbortError"));var N=new XMLHttpRequest;function D(){N.abort()}N.onload=function(){var z,O,p={status:N.status,statusText:N.statusText,headers:(z=N.getAllResponseHeaders()||"",O=new b,z.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(V){var Q=V.split(":"),ee=Q.shift().trim();if(ee){var ne=Q.join(":").trim();O.append(ee,ne)}}),O)};p.url="responseURL"in N?N.responseURL:p.headers.get("X-Request-URL");var U="response"in N?N.response:N.responseText;L(new q(U,p))},N.onerror=function(){W(new TypeError("Network request failed"))},N.ontimeout=function(){W(new TypeError("Network request failed"))},N.onabort=function(){W(new i.DOMException("Aborted","AbortError"))},N.open(B.method,B.url,!0),B.credentials==="include"?N.withCredentials=!0:B.credentials==="omit"&&(N.withCredentials=!1),"responseType"in N&&o&&(N.responseType="blob"),B.headers.forEach(function(z,O){N.setRequestHeader(O,z)}),B.signal&&(B.signal.addEventListener("abort",D),N.onreadystatechange=function(){N.readyState===4&&B.signal.removeEventListener("abort",D)}),N.send(B._bodyInit===void 0?null:B._bodyInit)})}m.polyfill=!0,r.fetch||(r.fetch=m,r.Headers=b,r.Request=C,r.Response=q),i.Headers=b,i.Request=C,i.Response=q,i.fetch=m})({})})(n),delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},function(e,t,n){(function(r){const i=n(211),s=n(52),l=(o,c,u)=>({from:l,EnvVarError:n(52),get:function(f){if(!f)return o;if(arguments.length>1)throw new s("It looks like you passed more than one argument to env.get(). Since env-var@6.0.0 this is no longer supported. To set a default value use env.get(TARGET).default(DEFAULT)");return i(o,f,c||{},u||function(){})},accessors:n(94),logger:n(225)(console.log,o.NODE_ENV)});e.exports=l(r.env)}).call(this,n(2))},function(e,t,n){var r=n(13),i=n(73),s=n(3).LEVEL,l=e.exports=function(){var o=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i.call(this,{objectMode:!0,highWaterMark:c.highWaterMark}),this.format=c.format,this.level=c.level,this.handleExceptions=c.handleExceptions,this.silent=c.silent,c.log&&(this.log=c.log),c.logv&&(this.logv=c.logv),c.close&&(this.close=c.close),this.once("pipe",function(u){o.levels=u.levels,o.parent=u}),this.once("unpipe",function(u){u===o.parent&&(o.parent=null,o.close&&o.close())})};r.inherits(l,i),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);var f=this.level||this.parent&&this.parent.level;if(!f||this.levels[f]>=this.levels[o[s]]){if(o&&!this.format)return this.log(o,u);var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o),this.format.options)}catch(h){E=h}if(E||!w){if(u(),E)throw E;return}return this.log(w,u)}return u(null)},l.prototype._writev=function(o,c){if(this.logv){var u=o.filter(this._accept,this);return u.length?this.logv(u,c):c(null)}for(var f=0;f<o.length;f++)if(this._accept(o[f]))if(!o[f].chunk||this.format){var E=void 0,w=void 0;try{w=this.format.transform(Object.assign({},o[f].chunk),this.format.options)}catch(h){E=h}if(E||!w){if(o[f].callback(),E)throw c(null),E}else this.log(w,o[f].callback)}else this.log(o[f].chunk,o[f].callback);return c(null)},l.prototype._accept=function(o){var c=o.chunk;if(this.silent)return!1;var u=this.level||this.parent&&this.parent.level;return!(c.exception!==!0&&u&&!(this.levels[u]>=this.levels[c[s]])||!this.handleExceptions&&c.exception===!0)},l.prototype._nop=function(){}},function(e,t,n){(function(r){const i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new c}abort(){this.signal.dispatchEvent("abort")}},l=typeof AbortSignal=="function",o=typeof s.AbortSignal=="function",c=l?AbortSignal:o?s.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(A){if(A==="abort"){this.aborted=!0;const d={type:A,target:this};this.onabort(d),this._listeners.forEach(C=>C(d),this)}}onabort(){}addEventListener(A,d){A==="abort"&&this._listeners.push(d)}removeEventListener(A,d){A==="abort"&&(this._listeners=this._listeners.filter(C=>C!==d))}},u=new Set,f=(A,d)=>{const C=`LRU_CACHE_OPTION_${A}`;h(C)&&g(C,`${A} option`,`options.${d}`,M)},E=(A,d)=>{const C=`LRU_CACHE_METHOD_${A}`;if(h(C)){const{prototype:$}=M,{get:q}=Object.getOwnPropertyDescriptor($,A);g(C,`${A} method`,`cache.${d}()`,q)}},w=(...A)=>{typeof r=="object"&&r&&typeof r.emitWarning=="function"?r.emitWarning(...A):console.error(...A)},h=A=>!u.has(A),g=(A,d,C,$)=>{u.add(A),w(`The ${d} is deprecated. Please use ${C} instead.`,"DeprecationWarning",A,$)},b=A=>A&&A===Math.floor(A)&&A>0&&isFinite(A),R=A=>b(A)?A<=Math.pow(2,8)?Uint8Array:A<=Math.pow(2,16)?Uint16Array:A<=Math.pow(2,32)?Uint32Array:A<=Number.MAX_SAFE_INTEGER?j:null:null;class j extends Array{constructor(d){super(d),this.fill(0)}}class F{constructor(d){if(d===0)return[];const C=R(d);this.heap=new C(d),this.length=0}push(d){this.heap[this.length++]=d}pop(){return this.heap[--this.length]}}class M{constructor(d={}){const{max:C=0,ttl:$,ttlResolution:q=1,ttlAutopurge:y,updateAgeOnGet:m,updateAgeOnHas:I,allowStale:_,dispose:L,disposeAfter:W,noDisposeOnSet:B,noUpdateTTL:N,maxSize:D=0,maxEntrySize:z=0,sizeCalculation:O,fetchMethod:p,fetchContext:U,noDeleteOnFetchRejection:V,noDeleteOnStaleGet:Q}=d,{length:ee,maxAge:ne,stale:Y}=d instanceof M?{}:d;if(C!==0&&!b(C))throw new TypeError("max option must be a nonnegative integer");const G=C?R(C):Array;if(!G)throw new Error("invalid max value: "+C);if(this.max=C,this.maxSize=D,this.maxEntrySize=z||this.maxSize,this.sizeCalculation=O||ee,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=p||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=U,!this.fetchMethod&&U!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(C).fill(null),this.valList=new Array(C).fill(null),this.next=new G(C),this.prev=new G(C),this.head=0,this.tail=0,this.free=new F(C),this.initialFill=1,this.size=0,typeof L=="function"&&(this.dispose=L),typeof W=="function"?(this.disposeAfter=W,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!B,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!V,this.maxEntrySize!==0){if(this.maxSize!==0&&!b(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!b(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!_||!!Y,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!m,this.updateAgeOnHas=!!I,this.ttlResolution=b(q)||q===0?q:1,this.ttlAutopurge=!!y,this.ttl=$||ne||0,this.ttl){if(!b(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const S="LRU_CACHE_UNBOUNDED";h(S)&&(u.add(S),w("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",S,M))}Y&&f("stale","allowStale"),ne&&f("maxAge","ttl"),ee&&f("length","sizeCalculation")}getRemainingTTL(d){return this.has(d,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new j(this.max),this.starts=new j(this.max),this.setItemTTL=($,q,y=i.now())=>{if(this.starts[$]=q!==0?y:0,this.ttls[$]=q,q!==0&&this.ttlAutopurge){const m=setTimeout(()=>{this.isStale($)&&this.delete(this.keyList[$])},q+1);m.unref&&m.unref()}},this.updateItemAge=$=>{this.starts[$]=this.ttls[$]!==0?i.now():0};let d=0;const C=()=>{const $=i.now();if(this.ttlResolution>0){d=$;const q=setTimeout(()=>d=0,this.ttlResolution);q.unref&&q.unref()}return $};this.getRemainingTTL=$=>{const q=this.keyMap.get($);return q===void 0?0:this.ttls[q]===0||this.starts[q]===0?1/0:this.starts[q]+this.ttls[q]-(d||C())},this.isStale=$=>this.ttls[$]!==0&&this.starts[$]!==0&&(d||C())-this.starts[$]>this.ttls[$]}updateItemAge(d){}setItemTTL(d,C,$){}isStale(d){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new j(this.max),this.removeItemSize=d=>{this.calculatedSize-=this.sizes[d],this.sizes[d]=0},this.requireSize=(d,C,$,q)=>{if(!b($)){if(!q)throw new TypeError("invalid size value (must be positive integer)");if(typeof q!="function")throw new TypeError("sizeCalculation must be a function");if($=q(C,d),!b($))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return $},this.addItemSize=(d,C)=>{this.sizes[d]=C;const $=this.maxSize-this.sizes[d];for(;this.calculatedSize>$;)this.evict(!0);this.calculatedSize+=this.sizes[d]}}removeItemSize(d){}addItemSize(d,C){}requireSize(d,C,$,q){if($||q)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:d=this.allowStale}={}){if(this.size)for(let C=this.tail;this.isValidIndex(C)&&(!d&&this.isStale(C)||(yield C),C!==this.head);)C=this.prev[C]}*rindexes({allowStale:d=this.allowStale}={}){if(this.size)for(let C=this.head;this.isValidIndex(C)&&(!d&&this.isStale(C)||(yield C),C!==this.tail);)C=this.next[C]}isValidIndex(d){return this.keyMap.get(this.keyList[d])===d}*entries(){for(const d of this.indexes())yield[this.keyList[d],this.valList[d]]}*rentries(){for(const d of this.rindexes())yield[this.keyList[d],this.valList[d]]}*keys(){for(const d of this.indexes())yield this.keyList[d]}*rkeys(){for(const d of this.rindexes())yield this.keyList[d]}*values(){for(const d of this.indexes())yield this.valList[d]}*rvalues(){for(const d of this.rindexes())yield this.valList[d]}[Symbol.iterator](){return this.entries()}find(d,C={}){for(const $ of this.indexes())if(d(this.valList[$],this.keyList[$],this))return this.get(this.keyList[$],C)}forEach(d,C=this){for(const $ of this.indexes())d.call(C,this.valList[$],this.keyList[$],this)}rforEach(d,C=this){for(const $ of this.rindexes())d.call(C,this.valList[$],this.keyList[$],this)}get prune(){return E("prune","purgeStale"),this.purgeStale}purgeStale(){let d=!1;for(const C of this.rindexes({allowStale:!0}))this.isStale(C)&&(this.delete(this.keyList[C]),d=!0);return d}dump(){const d=[];for(const C of this.indexes({allowStale:!0})){const $=this.keyList[C],q=this.valList[C],y={value:this.isBackgroundFetch(q)?q.__staleWhileFetching:q};if(this.ttls){y.ttl=this.ttls[C];const m=i.now()-this.starts[C];y.start=Math.floor(Date.now()-m)}this.sizes&&(y.size=this.sizes[C]),d.unshift([$,y])}return d}load(d){this.clear();for(const[C,$]of d){if($.start){const q=Date.now()-$.start;$.start=i.now()-q}this.set(C,$.value,$)}}dispose(d,C,$){}set(d,C,{ttl:$=this.ttl,start:q,noDisposeOnSet:y=this.noDisposeOnSet,size:m=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:_=this.noUpdateTTL}={}){if(m=this.requireSize(d,C,m,I),this.maxEntrySize&&m>this.maxEntrySize)return this;let L=this.size===0?void 0:this.keyMap.get(d);if(L===void 0)L=this.newIndex(),this.keyList[L]=d,this.valList[L]=C,this.keyMap.set(d,L),this.next[this.tail]=L,this.prev[L]=this.tail,this.tail=L,this.size++,this.addItemSize(L,m),_=!1;else{const W=this.valList[L];C!==W&&(this.isBackgroundFetch(W)?W.__abortController.abort():y||(this.dispose(W,d,"set"),this.disposeAfter&&this.disposed.push([W,d,"set"])),this.removeItemSize(L),this.valList[L]=C,this.addItemSize(L,m)),this.moveToTail(L)}if($===0||this.ttl!==0||this.ttls||this.initializeTTLTracking(),_||this.setItemTTL(L,$,q),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const d=this.valList[this.head];return this.evict(!0),d}}evict(d){const C=this.head,$=this.keyList[C],q=this.valList[C];return this.isBackgroundFetch(q)?q.__abortController.abort():(this.dispose(q,$,"evict"),this.disposeAfter&&this.disposed.push([q,$,"evict"])),this.removeItemSize(C),d&&(this.keyList[C]=null,this.valList[C]=null,this.free.push(C)),this.head=this.next[C],this.keyMap.delete($),this.size--,C}has(d,{updateAgeOnHas:C=this.updateAgeOnHas}={}){const $=this.keyMap.get(d);return $!==void 0&&!this.isStale($)&&(C&&this.updateItemAge($),!0)}peek(d,{allowStale:C=this.allowStale}={}){const $=this.keyMap.get(d);if($!==void 0&&(C||!this.isStale($))){const q=this.valList[$];return this.isBackgroundFetch(q)?q.__staleWhileFetching:q}}backgroundFetch(d,C,$,q){const y=C===void 0?void 0:this.valList[C];if(this.isBackgroundFetch(y))return y;const m=new s,I={signal:m.signal,options:$,context:q},_=new Promise(L=>L(this.fetchMethod(d,y,I))).then(L=>(m.signal.aborted||this.set(d,L,I.options),L),L=>{if(this.valList[C]===_&&(!$.noDeleteOnFetchRejection||_.__staleWhileFetching===void 0?this.delete(d):this.valList[C]=_.__staleWhileFetching),_.__returned===_)throw L});return _.__abortController=m,_.__staleWhileFetching=y,_.__returned=null,C===void 0?(this.set(d,_,I.options),C=this.keyMap.get(d)):this.valList[C]=_,_}isBackgroundFetch(d){return d&&typeof d=="object"&&typeof d.then=="function"&&Object.prototype.hasOwnProperty.call(d,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(d,"__returned")&&(d.__returned===d||d.__returned===null)}async fetch(d,{allowStale:C=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:q=this.noDeleteOnStaleGet,ttl:y=this.ttl,noDisposeOnSet:m=this.noDisposeOnSet,size:I=0,sizeCalculation:_=this.sizeCalculation,noUpdateTTL:L=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,fetchContext:B=this.fetchContext,forceRefresh:N=!1}={}){if(!this.fetchMethod)return this.get(d,{allowStale:C,updateAgeOnGet:$,noDeleteOnStaleGet:q});const D={allowStale:C,updateAgeOnGet:$,noDeleteOnStaleGet:q,ttl:y,noDisposeOnSet:m,size:I,sizeCalculation:_,noUpdateTTL:L,noDeleteOnFetchRejection:W};let z=this.keyMap.get(d);if(z===void 0){const O=this.backgroundFetch(d,z,D,B);return O.__returned=O}{const O=this.valList[z];if(this.isBackgroundFetch(O))return C&&O.__staleWhileFetching!==void 0?O.__staleWhileFetching:O.__returned=O;if(!N&&!this.isStale(z))return this.moveToTail(z),$&&this.updateItemAge(z),O;const p=this.backgroundFetch(d,z,D,B);return C&&p.__staleWhileFetching!==void 0?p.__staleWhileFetching:p.__returned=p}}get(d,{allowStale:C=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:q=this.noDeleteOnStaleGet}={}){const y=this.keyMap.get(d);if(y!==void 0){const m=this.valList[y],I=this.isBackgroundFetch(m);return this.isStale(y)?I?C?m.__staleWhileFetching:void 0:(q||this.delete(d),C?m:void 0):I?void 0:(this.moveToTail(y),$&&this.updateItemAge(y),m)}}connect(d,C){this.prev[C]=d,this.next[d]=C}moveToTail(d){d!==this.tail&&(d===this.head?this.head=this.next[d]:this.connect(this.prev[d],this.next[d]),this.connect(this.tail,d),this.tail=d)}get del(){return E("del","delete"),this.delete}delete(d){let C=!1;if(this.size!==0){const $=this.keyMap.get(d);if($!==void 0)if(C=!0,this.size===1)this.clear();else{this.removeItemSize($);const q=this.valList[$];this.isBackgroundFetch(q)?q.__abortController.abort():(this.dispose(q,d,"delete"),this.disposeAfter&&this.disposed.push([q,d,"delete"])),this.keyMap.delete(d),this.keyList[$]=null,this.valList[$]=null,$===this.tail?this.tail=this.prev[$]:$===this.head?this.head=this.next[$]:(this.next[this.prev[$]]=this.next[$],this.prev[this.next[$]]=this.prev[$]),this.size--,this.free.push($)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return C}clear(){for(const d of this.rindexes({allowStale:!0})){const C=this.valList[d];if(this.isBackgroundFetch(C))C.__abortController.abort();else{const $=this.keyList[d];this.dispose(C,$,"delete"),this.disposeAfter&&this.disposed.push([C,$,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E("reset","clear"),this.clear}get length(){return((d,C)=>{const $=`LRU_CACHE_PROPERTY_${d}`;if(h($)){const{prototype:q}=M,{get:y}=Object.getOwnPropertyDescriptor(q,d);g($,`${d} property`,`cache.${C}`,y)}})("length","size"),this.size}static get AbortController(){return s}static get AbortSignal(){return c}}e.exports=M}).call(this,n(2))},function(e,t,n){var r=n(41).Colorizer;e.exports=function(i){return r.addColors(i.colors||i),i}},function(e,t,n){var r={};e.exports=r,r.themes={};var i=n(13),s=r.styles=n(109),l=Object.defineProperties,o=new RegExp(/[\r\n]+/g);r.supportsColor=n(110).supportsColor,r.enabled===void 0&&(r.enabled=r.supportsColor()!==!1),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(R){return(""+R).replace(/\x1B\[\d+m/g,"")},r.stylize=function(R,j){return r.enabled?s[j].open+R+s[j].close:R+""};var c=/[|\\{}()[\]^$+*?.]/g;function u(R){var j=function F(){return h.apply(F,arguments)};return j._styles=R,j.__proto__=w,j}var f,E=(f={},s.grey=s.gray,Object.keys(s).forEach(function(R){s[R].closeRe=new RegExp(function(j){if(typeof j!="string")throw new TypeError("Expected a string");return j.replace(c,"\\$&")}(s[R].close),"g"),f[R]={get:function(){return u(this._styles.concat(R))}}}),f),w=l(function(){},E);function h(){var R=Array.prototype.slice.call(arguments),j=R.map(function(C){return C!==void 0&&C.constructor===String?C:i.inspect(C)}).join(" ");if(!r.enabled||!j)return j;for(var F=j.indexOf(`
|
|
40
40
|
`)!=-1,M=this._styles,A=M.length;A--;){var d=s[M[A]];j=d.open+j.replace(d.closeRe,d.open)+d.close,F&&(j=j.replace(o,function(C){return d.close+C+d.open}))}return j}r.setTheme=function(R){if(typeof R!="string")for(var j in R)(function(F){r[F]=function(M){if(typeof R[F]=="object"){var A=M;for(var d in R[F])A=r[R[F][d]](A);return A}return r[R[F]](M)}})(j);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var g=function(R,j){var F=j.split("");return(F=F.map(R)).join("")};for(var b in r.trap=n(112),r.zalgo=n(113),r.maps={},r.maps.america=n(114)(r),r.maps.zebra=n(115)(r),r.maps.rainbow=n(116)(r),r.maps.random=n(117)(r),r.maps)(function(R){r[R]=function(j){return g(r.maps[R],j)}})(b);l(r,function(){var R={};return Object.keys(E).forEach(function(j){R[j]={get:function(){return u([j])}}}),R}())},function(e,t){e.exports=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"}},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(n,r){n.super_=r;var i=function(){};i.prototype=r.prototype,n.prototype=new i,n.prototype.constructor=n}},function(e,t){var n={};e.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(i){var s=r[i],l=n[i]=[];l.open="\x1B["+s[0]+"m",l.close="\x1B["+s[1]+"m"})},function(e,t,n){(function(r){var i=n(18),s=n(111),l=r.env,o=void 0;function c(u){return function(f){return f!==0&&{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}(function(f){if(o===!1)return 0;if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2;if(f&&!f.isTTY&&o!==!0)return 0;var E=o?1:0;if(r.platform==="win32"){var w=i.release().split(".");return Number(r.versions.node.split(".")[0])>=8&&Number(w[0])>=10&&Number(w[2])>=10586?Number(w[2])>=14931?3:2:1}return"CI"in l?["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(h){return h in l})||l.CI_NAME==="codeship"?1:E:"TEAMCITY_VERSION"in l?/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l.TEAMCITY_VERSION)?1:0:"TERM_PROGRAM"in l?(parseInt("445".split(".")[0],10),2):/-256(color)?$/i.test("xterm-256color")?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test("xterm-256color")||"COLORTERM"in l?1:E}(u))}s("no-color")||s("no-colors")||s("color=false")?o=!1:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(o=!0),"FORCE_COLOR"in l&&(o=l.FORCE_COLOR.length===0||parseInt(l.FORCE_COLOR,10)!==0),e.exports={supportsColor:c,stdout:c(r.stdout),stderr:c(r.stderr)}}).call(this,n(2))},function(e,t,n){(function(r){e.exports=function(i,s){var l=(s=s||r.argv).indexOf("--"),o=/^-{1,2}/.test(i)?"":"--",c=s.indexOf(o+i);return c!==-1&&(l===-1||c<l)}}).call(this,n(2))},function(e,t){e.exports=function(n,r){var i="";n=(n=n||"Run the trap, drop the bass").split("");var s={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return n.forEach(function(l){l=l.toLowerCase();var o=s[l]||[" "],c=Math.floor(Math.random()*o.length);i+=s[l]!==void 0?s[l][c]:l}),i}},function(e,t){e.exports=function(n,r){n=n||" he is here ";var i={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},s=[].concat(i.up,i.down,i.mid);function l(c){return Math.floor(Math.random()*c)}function o(c){var u=!1;return s.filter(function(f){u=f===c}),u}return function(c,u){var f,E,w="";for(E in(u=u||{}).up=u.up===void 0||u.up,u.mid=u.mid===void 0||u.mid,u.down=u.down===void 0||u.down,u.size=u.size!==void 0?u.size:"maxi",c=c.split(""))if(!o(E)){switch(w+=c[E],f={up:0,down:0,mid:0},u.size){case"mini":f.up=l(8),f.mid=l(2),f.down=l(8);break;case"maxi":f.up=l(16)+3,f.mid=l(4)+1,f.down=l(64)+3;break;default:f.up=l(8)+1,f.mid=l(6)/2,f.down=l(8)+1}var h=["up","mid","down"];for(var g in h)for(var b=h[g],R=0;R<=f[b];R++)u[b]&&(w+=i[b][l(i[b].length)])}return w}(n,r)}},function(e,t){e.exports=function(n){return function(r,i,s){if(r===" ")return r;switch(i%3){case 0:return n.red(r);case 1:return n.white(r);case 2:return n.blue(r)}}}},function(e,t){e.exports=function(n){return function(r,i,s){return i%2==0?r:n.inverse(r)}}},function(e,t){e.exports=function(n){var r=["red","yellow","green","blue","magenta"];return function(i,s,l){return i===" "?i:n[r[s++%r.length]](i)}}},function(e,t){e.exports=function(n){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta"];return function(i,s,l){return i===" "?i:n[r[Math.round(Math.random()*(r.length-2))]](i)}}},function(e,t,n){Object.defineProperty(t,"cli",{value:n(119)}),Object.defineProperty(t,"npm",{value:n(120)}),Object.defineProperty(t,"syslog",{value:n(121)})},function(e,t,n){t.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},t.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}},function(e,t,n){t.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},t.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}},function(e,t,n){t.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},t.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}},function(e,t,n){var r=n(12);e.exports=r(function(i){return i.message=" ".concat(i.message),i})},function(e,t,n){function r(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function i(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var s=n(41).Colorizer,l=n(60).Padder,o=n(3),c=o.configs,u=o.MESSAGE,f=function(){function E(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,E),g.levels||(g.levels=c.npm.levels),this.colorizer=new s(g),this.padder=new l(g),this.options=g}var w,h;return w=E,(h=[{key:"transform",value:function(g,b){return this.colorizer.transform(this.padder.transform(g,b),b),g[u]="".concat(g.level,":").concat(g.message),g}}])&&i(w.prototype,h),E}();e.exports=function(E){return new f(E)},e.exports.Format=f},function(e,t,n){var r=n(12);function i(l){if(l.every(s))return function(o){for(var c=o,u=0;u<l.length;u++)if(!(c=l[u].transform(c,l[u].options)))return!1;return c}}function s(l){if(typeof l.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
|
|
41
41
|
`));return!0}e.exports=function(){for(var l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];var u=r(i(o)),f=u();return f.Format=u.Format,f},e.exports.cascade=i},function(e,t,n){(function(r){var i=n(12),s=n(3).MESSAGE,l=n(35);function o(c,u){return u instanceof r?u.toString("base64"):typeof u=="bigint"?u.toString():u}e.exports=i(function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return c[s]=(u.stable?l.stableStringify:l)(c,u.replacer||o,u.space),c})}).call(this,n(5).Buffer)},function(e,t,n){t.byteLength=function(E){var w=u(E),h=w[0],g=w[1];return 3*(h+g)/4-g},t.toByteArray=function(E){for(var w,h=u(E),g=h[0],b=h[1],R=new s(function(A,d,C){return 3*(d+C)/4-C}(0,g,b)),j=0,F=b>0?g-4:g,M=0;M<F;M+=4)w=i[E.charCodeAt(M)]<<18|i[E.charCodeAt(M+1)]<<12|i[E.charCodeAt(M+2)]<<6|i[E.charCodeAt(M+3)],R[j++]=w>>16&255,R[j++]=w>>8&255,R[j++]=255&w;return b===2&&(w=i[E.charCodeAt(M)]<<2|i[E.charCodeAt(M+1)]>>4,R[j++]=255&w),b===1&&(w=i[E.charCodeAt(M)]<<10|i[E.charCodeAt(M+1)]<<4|i[E.charCodeAt(M+2)]>>2,R[j++]=w>>8&255,R[j++]=255&w),R},t.fromByteArray=function(E){for(var w,h=E.length,g=h%3,b=[],R=0,j=h-g;R<j;R+=16383)b.push(f(E,R,R+16383>j?j:R+16383));return g===1?(w=E[h-1],b.push(r[w>>2]+r[w<<4&63]+"==")):g===2&&(w=(E[h-2]<<8)+E[h-1],b.push(r[w>>10]+r[w>>4&63]+r[w<<2&63]+"=")),b.join("")};for(var r=[],i=[],s=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=l.length;o<c;++o)r[o]=l[o],i[l.charCodeAt(o)]=o;function u(E){var w=E.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=E.indexOf("=");return h===-1&&(h=w),[h,h===w?0:4-h%4]}function f(E,w,h){for(var g,b,R=[],j=w;j<h;j+=3)g=(E[j]<<16&16711680)+(E[j+1]<<8&65280)+(255&E[j+2]),R.push(r[(b=g)>>18&63]+r[b>>12&63]+r[b>>6&63]+r[63&b]);return R.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(n,r,i,s,l){var o,c,u=8*l-s-1,f=(1<<u)-1,E=f>>1,w=-7,h=i?l-1:0,g=i?-1:1,b=n[r+h];for(h+=g,o=b&(1<<-w)-1,b>>=-w,w+=u;w>0;o=256*o+n[r+h],h+=g,w-=8);for(c=o&(1<<-w)-1,o>>=-w,w+=s;w>0;c=256*c+n[r+h],h+=g,w-=8);if(o===0)o=1-E;else{if(o===f)return c?NaN:1/0*(b?-1:1);c+=Math.pow(2,s),o-=E}return(b?-1:1)*c*Math.pow(2,o-s)},t.write=function(n,r,i,s,l,o){var c,u,f,E=8*o-l-1,w=(1<<E)-1,h=w>>1,g=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=s?0:o-1,R=s?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,c=w):(c=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-c))<1&&(c--,f*=2),(r+=c+h>=1?g/f:g*Math.pow(2,1-h))*f>=2&&(c++,f/=2),c+h>=w?(u=0,c=w):c+h>=1?(u=(r*f-1)*Math.pow(2,l),c+=h):(u=r*Math.pow(2,h-1)*Math.pow(2,l),c=0));l>=8;n[i+b]=255&u,b+=R,u/=256,l-=8);for(c=c<<l|u,E+=l;E>0;n[i+b]=255&c,b+=R,c/=256,E-=8);n[i+b-R]|=128*j}},function(e,t,n){var r=n(12);e.exports=r(function(i,s){return s.message?(i.message="[".concat(s.label,"] ").concat(i.message),i):(i.label=s.label,i)})},function(e,t,n){var r=n(12),i=n(3).MESSAGE,s=n(35);e.exports=r(function(l){var o={};return l.message&&(o["@message"]=l.message,delete l.message),l.timestamp&&(o["@timestamp"]=l.timestamp,delete l.timestamp),o["@fields"]=l,l[i]=s(o),l})},function(e,t,n){var r=n(12);function i(l,o,c){var u,f,E,w=o.reduce(function(g,b){return g[b]=l[b],delete l[b],g},{}),h=Object.keys(l).reduce(function(g,b){return g[b]=l[b],delete l[b],g},{});return Object.assign(l,w,(E=h,(f=c)in(u={})?Object.defineProperty(u,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):u[f]=E,u)),l}function s(l,o,c){return l[c]=o.reduce(function(u,f){return u[f]=l[f],delete l[f],u},{}),l}e.exports=r(function(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c="metadata";o.key&&(c=o.key);var u=[];return o.fillExcept||o.fillWith||(u.push("level"),u.push("message")),o.fillExcept&&(u=o.fillExcept),u.length>0?i(l,u,c):o.fillWith?s(l,o.fillWith,c):l})},function(e,t,n){var r=n(13).inspect,i=n(12),s=n(3),l=s.LEVEL,o=s.MESSAGE,c=s.SPLAT;e.exports=i(function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=Object.assign({},u);return delete E[l],delete E[o],delete E[c],u[o]=r(E,!1,f.depth||null,f.colorize),u})},function(e,t,n){function r(l,o){for(var c=0;c<o.length;c++){var u=o[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}var i=n(3).MESSAGE,s=function(){function l(u){(function(f,E){if(!(f instanceof E))throw new TypeError("Cannot call a class as a function")})(this,l),this.template=u}var o,c;return o=l,(c=[{key:"transform",value:function(u){return u[i]=this.template(u),u}}])&&r(o.prototype,c),l}();e.exports=function(l){return new s(l)},e.exports.Printf=e.exports.Format=s},function(e,t,n){var r=n(12),i=n(3).MESSAGE,s=n(35);e.exports=r(function(l){var o=s(Object.assign({},l,{level:void 0,message:void 0,splat:void 0})),c=l.padding&&l.padding[l.level]||"";return l[i]=o!=="{}"?"".concat(l.level,":").concat(c," ").concat(l.message," ").concat(o):"".concat(l.level,":").concat(c," ").concat(l.message),l})},function(e,t,n){function r(E){return function(w){if(Array.isArray(w))return i(w)}(E)||function(w){if(typeof Symbol<"u"&&Symbol.iterator in Object(w))return Array.from(w)}(E)||function(w,h){if(w){if(typeof w=="string")return i(w,h);var g=Object.prototype.toString.call(w).slice(8,-1);if(g==="Object"&&w.constructor&&(g=w.constructor.name),g==="Map"||g==="Set")return Array.from(w);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return i(w,h)}}(E)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
42
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function i(E,w){(w==null||w>E.length)&&(w=E.length);for(var h=0,g=new Array(w);h<w;h++)g[h]=E[h];return g}function s(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var l=n(13),o=n(3).SPLAT,c=/%[scdjifoO%]/g,u=/%%/g,f=function(){function E(g){(function(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")})(this,E),this.options=g}var w,h;return w=E,(h=[{key:"_splat",value:function(g,b){var R=g.message,j=g[o]||g.splat||[],F=R.match(u),M=F&&F.length||0,A=b.length-M-j.length,d=A<0?j.splice(A,-1*A):[],C=d.length;if(C)for(var $=0;$<C;$++)Object.assign(g,d[$]);return g.message=l.format.apply(l,[R].concat(r(j))),g}},{key:"transform",value:function(g){var b=g.message,R=g[o]||g.splat;if(!R||!R.length)return g;var j=b&&b.match&&b.match(c);if(!j&&(R||R.length)){var F=R.length>1?R.splice(0):R,M=F.length;if(M)for(var A=0;A<M;A++)Object.assign(g,F[A]);return g}return j?this._splat(g,j):g}}])&&s(w.prototype,h),E}();e.exports=function(E){return new f(E)}},function(e,t,n){var r=n(136),i=n(12);e.exports=i(function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return l.format&&(s.timestamp=typeof l.format=="function"?l.format():r.format(new Date,l.format)),s.timestamp||(s.timestamp=new Date().toISOString()),l.alias&&(s[l.alias]=s.timestamp),s})},function(e,t,n){n.r(t),n.d(t,"assign",function(){return c}),n.d(t,"format",function(){return m}),n.d(t,"parse",function(){return I}),n.d(t,"defaultI18n",function(){return w}),n.d(t,"setGlobalDateI18n",function(){return g}),n.d(t,"setGlobalDateMasks",function(){return y});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,i="[^\\s]+",s=/\[([^]*?)\]/gm;function l(L,W){for(var B=[],N=0,P=L.length;N<P;N++)B.push(L[N].substr(0,W));return B}var o=function(L){return function(W,B){var N=B[L].map(function(P){return P.toLowerCase()}).indexOf(W.toLowerCase());return N>-1?N:null}};function c(L){for(var W=[],B=1;B<arguments.length;B++)W[B-1]=arguments[B];for(var N=0,P=W;N<P.length;N++){var z=P[N];for(var O in z)L[O]=z[O]}return L}var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],E=l(f,3),w={dayNamesShort:l(u,3),dayNames:u,monthNamesShort:E,monthNames:f,amPm:["am","pm"],DoFn:function(L){return L+["th","st","nd","rd"][L%10>3?0:(L-L%10!=10?1:0)*L%10]}},h=c({},w),g=function(L){return h=c(h,L)},b=function(L){return L.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},R=function(L,W){for(W===void 0&&(W=2),L=String(L);L.length<W;)L="0"+L;return L},j={D:function(L){return String(L.getDate())},DD:function(L){return R(L.getDate())},Do:function(L,W){return W.DoFn(L.getDate())},d:function(L){return String(L.getDay())},dd:function(L){return R(L.getDay())},ddd:function(L,W){return W.dayNamesShort[L.getDay()]},dddd:function(L,W){return W.dayNames[L.getDay()]},M:function(L){return String(L.getMonth()+1)},MM:function(L){return R(L.getMonth()+1)},MMM:function(L,W){return W.monthNamesShort[L.getMonth()]},MMMM:function(L,W){return W.monthNames[L.getMonth()]},YY:function(L){return R(String(L.getFullYear()),4).substr(2)},YYYY:function(L){return R(L.getFullYear(),4)},h:function(L){return String(L.getHours()%12||12)},hh:function(L){return R(L.getHours()%12||12)},H:function(L){return String(L.getHours())},HH:function(L){return R(L.getHours())},m:function(L){return String(L.getMinutes())},mm:function(L){return R(L.getMinutes())},s:function(L){return String(L.getSeconds())},ss:function(L){return R(L.getSeconds())},S:function(L){return String(Math.round(L.getMilliseconds()/100))},SS:function(L){return R(Math.round(L.getMilliseconds()/10),2)},SSS:function(L){return R(L.getMilliseconds(),3)},a:function(L,W){return L.getHours()<12?W.amPm[0]:W.amPm[1]},A:function(L,W){return L.getHours()<12?W.amPm[0].toUpperCase():W.amPm[1].toUpperCase()},ZZ:function(L){var W=L.getTimezoneOffset();return(W>0?"-":"+")+R(100*Math.floor(Math.abs(W)/60)+Math.abs(W)%60,4)},Z:function(L){var W=L.getTimezoneOffset();return(W>0?"-":"+")+R(Math.floor(Math.abs(W)/60),2)+":"+R(Math.abs(W)%60,2)}},F=function(L){return+L-1},M=[null,"[1-9]\\d?"],A=[null,i],d=["isPm",i,function(L,W){var B=L.toLowerCase();return B===W.amPm[0]?0:B===W.amPm[1]?1:null}],C=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(L){var W=(L+"").match(/([+-]|\d\d)/gi);if(W){var B=60*+W[1]+parseInt(W[2],10);return W[0]==="+"?B:-B}return 0}],$={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+i,function(L){return parseInt(L,10)}],M:["month","[1-9]\\d?",F],MM:["month","\\d\\d",F],YY:["year","\\d\\d",function(L){var W=+(""+new Date().getFullYear()).substr(0,2);return+(""+(+L>68?W-1:W)+L)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(L){return 100*+L}],SS:["millisecond","\\d\\d",function(L){return 10*+L}],SSS:["millisecond","\\d{3}"],d:M,dd:M,ddd:A,dddd:A,MMM:["month",i,o("monthNamesShort")],MMMM:["month",i,o("monthNames")],a:d,A:d,ZZ:C,Z:C},q={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},y=function(L){return c(q,L)},m=function(L,W,B){if(W===void 0&&(W=q.default),B===void 0&&(B={}),typeof L=="number"&&(L=new Date(L)),Object.prototype.toString.call(L)!=="[object Date]"||isNaN(L.getTime()))throw new Error("Invalid Date pass to format");var N=[];W=(W=q[W]||W).replace(s,function(z,O){return N.push(O),"@@@"});var P=c(c({},h),B);return(W=W.replace(r,function(z){return j[z](L,P)})).replace(/@@@/g,function(){return N.shift()})};function I(L,W,B){if(B===void 0&&(B={}),typeof W!="string")throw new Error("Invalid format in fecha parse");if(W=q[W]||W,L.length>1e3)return null;var N={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},P=[],z=[],O=W.replace(s,function(K,re){return z.push(b(re)),"@@@"}),p={},U={};O=b(O).replace(r,function(K){var re=$[K],se=re[0],fe=re[1],ve=re[3];if(p[se])throw new Error("Invalid format. "+se+" specified twice in format");return p[se]=!0,ve&&(U[ve]=!0),P.push(re),"("+fe+")"}),Object.keys(U).forEach(function(K){if(!p[K])throw new Error("Invalid format. "+K+" is required in specified format")}),O=O.replace(/@@@/g,function(){return z.shift()});var V=L.match(new RegExp(O,"i"));if(!V)return null;for(var Q=c(c({},h),B),ee=1;ee<V.length;ee++){var ne=P[ee-1],Y=ne[0],G=ne[2],S=G?G(V[ee],Q):+V[ee];if(S==null)return null;N[Y]=S}N.isPm===1&&N.hour!=null&&+N.hour!=12?N.hour=+N.hour+12:N.isPm===0&&+N.hour==12&&(N.hour=0);for(var T=new Date(N.year,N.month,N.day,N.hour,N.minute,N.second,N.millisecond),k=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],J=(ee=0,k.length);ee<J;ee++)if(p[k[ee][0]]&&N[k[ee][0]]!==T[k[ee][1]]())return null;return N.timezoneOffset==null?T:new Date(Date.UTC(N.year,N.month,N.day,N.hour,N.minute-N.timezoneOffset,N.second,N.millisecond))}var _={format:m,parse:I,defaultI18n:w,setGlobalDateI18n:g,setGlobalDateMasks:y};t.default=_},function(e,t,n){var r=n(59),i=n(12),s=n(3).MESSAGE;e.exports=i(function(l,o){return o.level!==!1&&(l.level=r.strip(l.level)),o.message!==!1&&(l.message=r.strip(l.message)),o.raw!==!1&&l[s]&&(l[s]=r.strip(l[s])),l})},function(e){e.exports=JSON.parse('{"name":"winston","description":"A logger for just about everything.","version":"3.3.3","author":"Charlie Robbins <charlie.robbins@gmail.com>","maintainers":["Jarrett Cruger <jcrugzz@gmail.com>","Chris Alderson <chrisalderson@protonmail.com>","David Hyde <dabh@stanford.edu>"],"repository":{"type":"git","url":"https://github.com/winstonjs/winston.git"},"keywords":["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],"dependencies":{"async":"^3.1.0","@dabh/diagnostics":"^2.0.2","is-stream":"^2.0.0","logform":"^2.2.0","one-time":"^1.0.0","readable-stream":"^3.4.0","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.10.3","@babel/core":"^7.10.3","@babel/preset-env":"^7.10.3","@types/node":"^14.0.13","abstract-winston-transport":"^0.5.1","assume":"^2.2.0","colors":"^1.4.0","cross-spawn-async":"^2.2.5","eslint-config-populist":"^4.2.0","hock":"^1.4.1","mocha":"^8.0.1","nyc":"^15.1.0","rimraf":"^3.0.2","split2":"^3.1.1","std-mocks":"^1.0.1","through2":"^3.0.1","winston-compat":"^0.1.5"},"main":"./lib/winston","browser":"./dist/winston","types":"./index.d.ts","scripts":{"lint":"populist lib/*.js lib/winston/*.js lib/winston/**/*.js","pretest":"npm run lint","test":"nyc --reporter=text --reporter lcov npm run test:mocha","test:mocha":"mocha test/*.test.js test/**/*.test.js --exit","build":"./node_modules/.bin/rimraf dist && babel lib -d dist","prepublishOnly":"npm run build"},"engines":{"node":">= 6.4.0"},"license":"MIT"}')},function(e,t,n){Object.defineProperty(t,"Console",{configurable:!0,enumerable:!0,get:function(){return n(140)}}),Object.defineProperty(t,"File",{configurable:!0,enumerable:!0,get:function(){return n(149)}}),Object.defineProperty(t,"Http",{configurable:!0,enumerable:!0,get:function(){return n(189)}}),Object.defineProperty(t,"Stream",{configurable:!0,enumerable:!0,get:function(){return n(201)}})},function(e,t,n){(function(r){function i(R){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j})(R)}function s(R,j){if(!(R instanceof j))throw new TypeError("Cannot call a class as a function")}function l(R,j){for(var F=0;F<j.length;F++){var M=j[F];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(R,M.key,M)}}function o(R,j){return(o=Object.setPrototypeOf||function(F,M){return F.__proto__=M,F})(R,j)}function c(R){var j=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var F,M=f(R);if(j){var A=f(this).constructor;F=Reflect.construct(M,arguments,A)}else F=M.apply(this,arguments);return u(this,F)}}function u(R,j){return!j||i(j)!=="object"&&typeof j!="function"?function(F){if(F===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F}(R):j}function f(R){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(j){return j.__proto__||Object.getPrototypeOf(j)})(R)}var E=n(18),w=n(3),h=w.LEVEL,g=w.MESSAGE,b=n(20);e.exports=function(R){(function(d,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(C&&C.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),C&&o(d,C)})(A,R);var j,F,M=c(A);function A(){var d,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return s(this,A),(d=M.call(this,C)).name=C.name||"console",d.stderrLevels=d._stringArrayToSet(C.stderrLevels),d.consoleWarnLevels=d._stringArrayToSet(C.consoleWarnLevels),d.eol=C.eol||E.EOL,d.setMaxListeners(30),d}return j=A,(F=[{key:"log",value:function(d,C){var $=this;return r(function(){return $.emit("logged",d)}),this.stderrLevels[d[h]]?(console._stderr?console._stderr.write("".concat(d[g]).concat(this.eol)):console.error(d[g]),void(C&&C())):this.consoleWarnLevels[d[h]]?(console._stderr?console._stderr.write("".concat(d[g]).concat(this.eol)):console.warn(d[g]),void(C&&C())):(console._stdout?console._stdout.write("".concat(d[g]).concat(this.eol)):console.log(d[g]),void(C&&C()))}},{key:"_stringArrayToSet",value:function(d,C){if(!d)return{};if(C=C||"Cannot make set from type other than Array of string elements",!Array.isArray(d))throw new Error(C);return d.reduce(function($,q){if(typeof q!="string")throw new Error(C);return $[q]=!0,$},{})}}])&&l(j.prototype,F),A}(b)}).call(this,n(15).setImmediate)},function(e,t,n){(function(r,i){(function(s,l){if(!s.setImmediate){var o,c,u,f,E,w=1,h={},g=!1,b=s.document,R=Object.getPrototypeOf&&Object.getPrototypeOf(s);R=R&&R.setTimeout?R:s,{}.toString.call(s.process)==="[object process]"?o=function(M){i.nextTick(function(){F(M)})}:function(){if(s.postMessage&&!s.importScripts){var M=!0,A=s.onmessage;return s.onmessage=function(){M=!1},s.postMessage("","*"),s.onmessage=A,M}}()?(f="setImmediate$"+Math.random()+"$",E=function(M){M.source===s&&typeof M.data=="string"&&M.data.indexOf(f)===0&&F(+M.data.slice(f.length))},s.addEventListener?s.addEventListener("message",E,!1):s.attachEvent("onmessage",E),o=function(M){s.postMessage(f+M,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(M){F(M.data)},o=function(M){u.port2.postMessage(M)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,o=function(M){var A=b.createElement("script");A.onreadystatechange=function(){F(M),A.onreadystatechange=null,c.removeChild(A),A=null},c.appendChild(A)}):o=function(M){setTimeout(F,0,M)},R.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var A=new Array(arguments.length-1),d=0;d<A.length;d++)A[d]=arguments[d+1];var C={callback:M,args:A};return h[w]=C,o(w),w++},R.clearImmediate=j}function j(M){delete h[M]}function F(M){if(g)setTimeout(F,0,M);else{var A=h[M];if(A){g=!0;try{(function(d){var C=d.callback,$=d.args;switch($.length){case 0:C();break;case 1:C($[0]);break;case 2:C($[0],$[1]);break;case 3:C($[0],$[1],$[2]);break;default:C.apply(void 0,$)}})(A)}finally{j(M),g=!1}}}}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(62)},function(e,t,n){(function(r,i){var s=n(16);e.exports=A;var l,o=n(42);A.ReadableState=M,n(21).EventEmitter;var c=function(O,p){return O.listeners(p).length},u=n(63),f=n(44).Buffer,E=r.Uint8Array||function(){},w=Object.create(n(17));w.inherits=n(7);var h=n(144),g=void 0;g=h&&h.debuglog?h.debuglog("stream"):function(){};var b,R=n(145),j=n(64);w.inherits(A,u);var F=["error","close","destroy","pause","resume"];function M(O,p){O=O||{};var U=p instanceof(l=l||n(36));this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.readableObjectMode);var V=O.highWaterMark,Q=O.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=V||V===0?V:U&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new R,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.destroyed=!1,this.defaultEncoding=O.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,O.encoding&&(b||(b=n(22).StringDecoder),this.decoder=new b(O.encoding),this.encoding=O.encoding)}function A(O){if(l=l||n(36),!(this instanceof A))return new A(O);this._readableState=new M(O,this),this.readable=!0,O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy)),u.call(this)}function d(O,p,U,V,Q){var ee,ne=O._readableState;return p===null?(ne.reading=!1,function(Y,G){if(!G.ended){if(G.decoder){var S=G.decoder.end();S&&S.length&&(G.buffer.push(S),G.length+=G.objectMode?1:S.length)}G.ended=!0,q(Y)}}(O,ne)):(Q||(ee=function(Y,G){var S;T=G,f.isBuffer(T)||T instanceof E||typeof G=="string"||G===void 0||Y.objectMode||(S=new TypeError("Invalid non-string/buffer chunk"));var T;return S}(ne,p)),ee?O.emit("error",ee):ne.objectMode||p&&p.length>0?(typeof p=="string"||ne.objectMode||Object.getPrototypeOf(p)===f.prototype||(p=function(Y){return f.from(Y)}(p)),V?ne.endEmitted?O.emit("error",new Error("stream.unshift() after end event")):C(O,ne,p,!0):ne.ended?O.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!U?(p=ne.decoder.write(p),ne.objectMode||p.length!==0?C(O,ne,p,!1):m(O,ne)):C(O,ne,p,!1))):V||(ne.reading=!1)),function(Y){return!Y.ended&&(Y.needReadable||Y.length<Y.highWaterMark||Y.length===0)}(ne)}function C(O,p,U,V){p.flowing&&p.length===0&&!p.sync?(O.emit("data",U),O.read(0)):(p.length+=p.objectMode?1:U.length,V?p.buffer.unshift(U):p.buffer.push(U),p.needReadable&&q(O)),m(O,p)}Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(O){this._readableState&&(this._readableState.destroyed=O)}}),A.prototype.destroy=j.destroy,A.prototype._undestroy=j.undestroy,A.prototype._destroy=function(O,p){this.push(null),p(O)},A.prototype.push=function(O,p){var U,V=this._readableState;return V.objectMode?U=!0:typeof O=="string"&&((p=p||V.defaultEncoding)!==V.encoding&&(O=f.from(O,p),p=""),U=!0),d(this,O,p,!1,U)},A.prototype.unshift=function(O){return d(this,O,null,!0,!1)},A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(O){return b||(b=n(22).StringDecoder),this._readableState.decoder=new b(O),this._readableState.encoding=O,this};function $(O,p){return O<=0||p.length===0&&p.ended?0:p.objectMode?1:O!=O?p.flowing&&p.length?p.buffer.head.data.length:p.length:(O>p.highWaterMark&&(p.highWaterMark=function(U){return U>=8388608?U=8388608:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}(O)),O<=p.length?O:p.ended?p.length:(p.needReadable=!0,0))}function q(O){var p=O._readableState;p.needReadable=!1,p.emittedReadable||(g("emitReadable",p.flowing),p.emittedReadable=!0,p.sync?s.nextTick(y,O):y(O))}function y(O){g("emit readable"),O.emit("readable"),W(O)}function m(O,p){p.readingMore||(p.readingMore=!0,s.nextTick(I,O,p))}function I(O,p){for(var U=p.length;!p.reading&&!p.flowing&&!p.ended&&p.length<p.highWaterMark&&(g("maybeReadMore read 0"),O.read(0),U!==p.length);)U=p.length;p.readingMore=!1}function _(O){g("readable nexttick read 0"),O.read(0)}function L(O,p){p.reading||(g("resume read 0"),O.read(0)),p.resumeScheduled=!1,p.awaitDrain=0,O.emit("resume"),W(O),p.flowing&&!p.reading&&O.read(0)}function W(O){var p=O._readableState;for(g("flow",p.flowing);p.flowing&&O.read()!==null;);}function B(O,p){return p.length===0?null:(p.objectMode?U=p.buffer.shift():!O||O>=p.length?(U=p.decoder?p.buffer.join(""):p.buffer.length===1?p.buffer.head.data:p.buffer.concat(p.length),p.buffer.clear()):U=function(V,Q,ee){var ne;return V<Q.head.data.length?(ne=Q.head.data.slice(0,V),Q.head.data=Q.head.data.slice(V)):ne=V===Q.head.data.length?Q.shift():ee?function(Y,G){var S=G.head,T=1,k=S.data;for(Y-=k.length;S=S.next;){var J=S.data,K=Y>J.length?J.length:Y;if(K===J.length?k+=J:k+=J.slice(0,Y),(Y-=K)===0){K===J.length?(++T,S.next?G.head=S.next:G.head=G.tail=null):(G.head=S,S.data=J.slice(K));break}++T}return G.length-=T,k}(V,Q):function(Y,G){var S=f.allocUnsafe(Y),T=G.head,k=1;for(T.data.copy(S),Y-=T.data.length;T=T.next;){var J=T.data,K=Y>J.length?J.length:Y;if(J.copy(S,S.length-Y,0,K),(Y-=K)===0){K===J.length?(++k,T.next?G.head=T.next:G.head=G.tail=null):(G.head=T,T.data=J.slice(K));break}++k}return G.length-=k,S}(V,Q),ne}(O,p.buffer,p.decoder),U);var U}function N(O){var p=O._readableState;if(p.length>0)throw new Error('"endReadable()" called on non-empty stream');p.endEmitted||(p.ended=!0,s.nextTick(P,p,O))}function P(O,p){O.endEmitted||O.length!==0||(O.endEmitted=!0,p.readable=!1,p.emit("end"))}function z(O,p){for(var U=0,V=O.length;U<V;U++)if(O[U]===p)return U;return-1}A.prototype.read=function(O){g("read",O),O=parseInt(O,10);var p=this._readableState,U=O;if(O!==0&&(p.emittedReadable=!1),O===0&&p.needReadable&&(p.length>=p.highWaterMark||p.ended))return g("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?N(this):q(this),null;if((O=$(O,p))===0&&p.ended)return p.length===0&&N(this),null;var V,Q=p.needReadable;return g("need readable",Q),(p.length===0||p.length-O<p.highWaterMark)&&g("length less than watermark",Q=!0),p.ended||p.reading?g("reading or ended",Q=!1):Q&&(g("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(O=$(U,p))),(V=O>0?B(O,p):null)===null?(p.needReadable=!0,O=0):p.length-=O,p.length===0&&(p.ended||(p.needReadable=!0),U!==O&&p.ended&&N(this)),V!==null&&this.emit("data",V),V},A.prototype._read=function(O){this.emit("error",new Error("_read() is not implemented"))},A.prototype.pipe=function(O,p){var U=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=O;break;case 1:V.pipes=[V.pipes,O];break;default:V.pipes.push(O)}V.pipesCount+=1,g("pipe count=%d opts=%j",V.pipesCount,p);var Q=(!p||p.end!==!1)&&O!==i.stdout&&O!==i.stderr?ne:re;function ee(se,fe){g("onunpipe"),se===U&&fe&&fe.hasUnpiped===!1&&(fe.hasUnpiped=!0,g("cleanup"),O.removeListener("close",J),O.removeListener("finish",K),O.removeListener("drain",Y),O.removeListener("error",k),O.removeListener("unpipe",ee),U.removeListener("end",ne),U.removeListener("end",re),U.removeListener("data",T),G=!0,!V.awaitDrain||O._writableState&&!O._writableState.needDrain||Y())}function ne(){g("onend"),O.end()}V.endEmitted?s.nextTick(Q):U.once("end",Q),O.on("unpipe",ee);var Y=function(se){return function(){var fe=se._readableState;g("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&c(se,"data")&&(fe.flowing=!0,W(se))}}(U);O.on("drain",Y);var G=!1,S=!1;function T(se){g("ondata"),S=!1,O.write(se)!==!1||S||((V.pipesCount===1&&V.pipes===O||V.pipesCount>1&&z(V.pipes,O)!==-1)&&!G&&(g("false write response, pause",U._readableState.awaitDrain),U._readableState.awaitDrain++,S=!0),U.pause())}function k(se){g("onerror",se),re(),O.removeListener("error",k),c(O,"error")===0&&O.emit("error",se)}function J(){O.removeListener("finish",K),re()}function K(){g("onfinish"),O.removeListener("close",J),re()}function re(){g("unpipe"),U.unpipe(O)}return U.on("data",T),function(se,fe,ve){if(typeof se.prependListener=="function")return se.prependListener(fe,ve);se._events&&se._events[fe]?o(se._events[fe])?se._events[fe].unshift(ve):se._events[fe]=[ve,se._events[fe]]:se.on(fe,ve)}(O,"error",k),O.once("close",J),O.once("finish",K),O.emit("pipe",U),V.flowing||(g("pipe resume"),U.resume()),O},A.prototype.unpipe=function(O){var p=this._readableState,U={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return O&&O!==p.pipes||(O||(O=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,O&&O.emit("unpipe",this,U)),this;if(!O){var V=p.pipes,Q=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var ee=0;ee<Q;ee++)V[ee].emit("unpipe",this,U);return this}var ne=z(p.pipes,O);return ne===-1||(p.pipes.splice(ne,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),O.emit("unpipe",this,U)),this},A.prototype.on=function(O,p){var U=u.prototype.on.call(this,O,p);if(O==="data")this._readableState.flowing!==!1&&this.resume();else if(O==="readable"){var V=this._readableState;V.endEmitted||V.readableListening||(V.readableListening=V.needReadable=!0,V.emittedReadable=!1,V.reading?V.length&&q(this):s.nextTick(_,this))}return U},A.prototype.addListener=A.prototype.on,A.prototype.resume=function(){var O=this._readableState;return O.flowing||(g("resume"),O.flowing=!0,function(p,U){U.resumeScheduled||(U.resumeScheduled=!0,s.nextTick(L,p,U))}(this,O)),this},A.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this},A.prototype.wrap=function(O){var p=this,U=this._readableState,V=!1;for(var Q in O.on("end",function(){if(g("wrapped end"),U.decoder&&!U.ended){var ne=U.decoder.end();ne&&ne.length&&p.push(ne)}p.push(null)}),O.on("data",function(ne){g("wrapped data"),U.decoder&&(ne=U.decoder.write(ne)),U.objectMode&&ne==null||(U.objectMode||ne&&ne.length)&&(p.push(ne)||(V=!0,O.pause()))}),O)this[Q]===void 0&&typeof O[Q]=="function"&&(this[Q]=function(ne){return function(){return O[ne].apply(O,arguments)}}(Q));for(var ee=0;ee<F.length;ee++)O.on(F[ee],this.emit.bind(this,F[ee]));return this._read=function(ne){g("wrapped _read",ne),V&&(V=!1,O.resume())},this},Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),A._fromList=B}).call(this,n(6),n(2))},function(e,t){},function(e,t,n){var r=n(44).Buffer,i=n(146);e.exports=function(){function s(){(function(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")})(this,s),this.head=null,this.tail=null,this.length=0}return s.prototype.push=function(l){var o={data:l,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},s.prototype.unshift=function(l){var o={data:l,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},s.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},s.prototype.clear=function(){this.head=this.tail=null,this.length=0},s.prototype.join=function(l){if(this.length===0)return"";for(var o=this.head,c=""+o.data;o=o.next;)c+=l+o.data;return c},s.prototype.concat=function(l){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var o,c,u,f=r.allocUnsafe(l>>>0),E=this.head,w=0;E;)o=E.data,c=f,u=w,o.copy(c,u),w+=E.data.length,E=E.next;return f},s}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var s=i.inspect({length:this.length});return this.constructor.name+" "+s})},function(e,t){},function(e,t,n){var r=n(5),i=r.Buffer;function s(o,c){for(var u in o)c[u]=o[u]}function l(o,c,u){return i(o,c,u)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=l),s(i,l),l.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return i(o,c,u)},l.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var f=i(o);return c!==void 0?typeof u=="string"?f.fill(c,u):f.fill(c):f.fill(0),f},l.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return i(o)},l.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}},function(e,t,n){var r=n(13),i=n(3).LEVEL,s=n(20),l=e.exports=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(s.call(this,o),!o.transport||typeof o.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");function c(u){this.emit("error",u,this.transport)}this.transport=o.transport,this.level=this.level||o.transport.level,this.handleExceptions=this.handleExceptions||o.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=c.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(l,s),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);(!this.level||this.levels[this.level]>=this.levels[o[i]])&&this.transport.log(o[i],o.message,o,this._nop),u(null)},l.prototype._writev=function(o,c){for(var u=0;u<o.length;u++)this._accept(o[u])&&(this.transport.log(o[u].chunk[i],o[u].chunk.message,o[u].chunk,this._nop),o[u].callback());return c(null)},l.prototype._deprecated=function(){console.error([this.transport.name+" is a legacy winston transport. Consider upgrading: ","- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
43
|
-
`))},l.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){(function(r,i){function s(y){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(y)}function l(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function o(y,m){for(var I=0;I<m.length;I++){var _=m[I];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}function c(y,m){return(c=Object.setPrototypeOf||function(I,_){return I.__proto__=_,I})(y,m)}function u(y){var m=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var I,_=w(y);if(m){var L=w(this).constructor;I=Reflect.construct(_,arguments,L)}else I=_.apply(this,arguments);return f(this,I)}}function f(y,m){return!m||s(m)!=="object"&&typeof m!="function"?E(y):m}function E(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function w(y){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)})(y)}var h=n(65),g=n(56),b=n(150),R=n(160),j=n(3).MESSAGE,F=n(32),M=F.Stream,A=F.PassThrough,d=n(20),C=n(38)("winston:file"),$=n(18),q=n(188);e.exports=function(y){(function(W,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");W.prototype=Object.create(B&&B.prototype,{constructor:{value:W,writable:!0,configurable:!0}}),B&&c(W,B)})(L,y);var m,I,_=u(L);function L(){var W,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function N(P){for(var z=arguments.length,O=new Array(z>1?z-1:0),p=1;p<z;p++)O[p-1]=arguments[p];O.slice(1).forEach(function(U){if(B[U])throw new Error("Cannot set ".concat(U," and ").concat(P," together"))})}if(l(this,L),(W=_.call(this,B)).name=B.name||"file",W._stream=new A,W._stream.setMaxListeners(30),W._onError=W._onError.bind(E(W)),B.filename||B.dirname)N("filename or dirname","stream"),W._basename=W.filename=B.filename?g.basename(B.filename):"winston.log",W.dirname=B.dirname||g.dirname(B.filename),W.options=B.options||{flags:"a"};else{if(!B.stream)throw new Error("Cannot log to file without filename or stream.");console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),N("stream","filename","maxsize"),W._dest=W._stream.pipe(W._setupStream(B.stream)),W.dirname=g.dirname(W._dest.path)}return W.maxsize=B.maxsize||null,W.rotationFormat=B.rotationFormat||!1,W.zippedArchive=B.zippedArchive||!1,W.maxFiles=B.maxFiles||null,W.eol=B.eol||$.EOL,W.tailable=B.tailable||!1,W._size=0,W._pendingSize=0,W._created=0,W._drain=!1,W._opening=!1,W._ending=!1,W.dirname&&W._createLogDirIfNotExist(W.dirname),W.open(),W}return m=L,(I=[{key:"finishIfEnding",value:function(){var W=this;this._ending&&(this._opening?this.once("open",function(){W._stream.once("finish",function(){return W.emit("finish")}),r(function(){return W._stream.end()})}):(this._stream.once("finish",function(){return W.emit("finish")}),r(function(){return W._stream.end()})))}},{key:"log",value:function(W){var B=this,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return N(),!0;if(this._drain)this._stream.once("drain",function(){B._drain=!1,B.log(W,N)});else{if(!this._rotate){var P="".concat(W[j]).concat(this.eol),z=i.byteLength(P);this._pendingSize+=z,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var O=this._stream.write(P,p.bind(this));return O?N():(this._drain=!0,this._stream.once("drain",function(){B._drain=!1,N()})),C("written",O,this._drain),this.finishIfEnding(),O}this._stream.once("rotate",function(){B._rotate=!1,B.log(W,N)})}function p(){var U=this;this._size+=z,this._pendingSize-=z,C("logged %s %s",this._size,P),this.emit("logged",W),this._opening||this._needsNewFile()&&(this._rotate=!0,this._endStream(function(){return U._rotateFile()}))}}},{key:"query",value:function(W,B){typeof W=="function"&&(B=W,W={}),W=function(V){return(V=V||{}).rows=V.rows||V.limit||10,V.start=V.start||0,V.until=V.until||new Date,s(V.until)!=="object"&&(V.until=new Date(V.until)),V.from=V.from||V.until-864e5,s(V.from)!=="object"&&(V.from=new Date(V.from)),V.order=V.order||"desc",V}(W);var N=g.join(this.dirname,this.filename),P="",z=[],O=0,p=h.createReadStream(N,{encoding:"utf8"});function U(V,Q){try{var ee=JSON.parse(V);(function(ne){if(ne&&s(ne)==="object"){var Y=new Date(ne.timestamp);if(!(W.from&&Y<W.from||W.until&&Y>W.until||W.level&&W.level!==ne.level))return!0}})(ee)&&function(ne){W.rows&&z.length>=W.rows&&W.order!=="desc"?p.readable&&p.destroy():(W.fields&&(ne=W.fields.reduce(function(Y,G){return Y[G]=ne[G],Y},{})),W.order==="desc"&&z.length>=W.rows&&z.shift(),z.push(ne))}(ee)}catch(ne){Q||p.emit("error",ne)}}p.on("error",function(V){if(p.readable&&p.destroy(),B)return V.code!=="ENOENT"?B(V):B(null,z)}),p.on("data",function(V){for(var Q=(V=(P+V).split(/\n+/)).length-1,ee=0;ee<Q;ee++)(!W.start||O>=W.start)&&U(V[ee]),O++;P=V[Q]}),p.on("close",function(){P&&U(P,!0),W.order==="desc"&&(z=z.reverse()),B&&B(null,z)})}},{key:"stream",value:function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=g.join(this.dirname,this.filename),N=new M,P={file:B,start:W.start};return N.destroy=q(P,function(z,O){if(z)return N.emit("error",z);try{N.emit("data",O),O=JSON.parse(O),N.emit("log",O)}catch(p){N.emit("error",p)}}),N}},{key:"open",value:function(){var W=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(B,N){if(B)return W.emit("error",B);C("stat done: %s { size: %s }",W.filename,N),W._size=N,W._dest=W._createStream(W._stream),W._opening=!1,W.once("open",function(){W._stream.eventNames().includes("rotate")?W._stream.emit("rotate"):W._rotate=!1})})))}},{key:"stat",value:function(W){var B=this,N=this._getFile(),P=g.join(this.dirname,N);h.stat(P,function(z,O){return z&&z.code==="ENOENT"?(C("ENOENT ok",P),B.filename=N,W(null,0)):z?(C("err ".concat(z.code," ").concat(P)),W(z)):!O||B._needsNewFile(O.size)?B._incFile(function(){return B.stat(W)}):(B.filename=N,void W(null,O.size))})}},{key:"close",value:function(W){var B=this;this._stream&&this._stream.end(function(){W&&W(),B.emit("flush"),B.emit("closed")})}},{key:"_needsNewFile",value:function(W){return W=W||this._size,this.maxsize&&W>=this.maxsize}},{key:"_onError",value:function(W){this.emit("error",W)}},{key:"_setupStream",value:function(W){return W.on("error",this._onError),W}},{key:"_cleanupStream",value:function(W){return W.removeListener("error",this._onError),W}},{key:"_rotateFile",value:function(){var W=this;this._incFile(function(){return W.open()})}},{key:"_endStream",value:function(){var W=this,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){W._cleanupStream(W._dest),B()})):B()}},{key:"_createStream",value:function(W){var B=this,N=g.join(this.dirname,this.filename);C("create stream start",N,this.options);var P=h.createWriteStream(N,this.options).on("error",function(O){return C(O)}).on("close",function(){return C("close",P.path,P.bytesWritten)}).on("open",function(){C("file open ok",N),B.emit("open",N),W.pipe(P),B.rotatedWhileOpening&&(B._stream=new A,B._stream.setMaxListeners(30),B._rotateFile(),B.rotatedWhileOpening=!1,B._cleanupStream(P),W.end())});if(C("create stream ok",N),this.zippedArchive){var z=R.createGzip();return z.pipe(P),z}return P}},{key:"_incFile",value:function(W){C("_incFile",this.filename);var B=g.extname(this._basename),N=g.basename(this._basename,B);this.tailable?this._checkMaxFilesTailable(B,N,W):(this._created+=1,this._checkMaxFilesIncrementing(B,N,W))}},{key:"_getFile",value:function(){var W=g.extname(this._basename),B=g.basename(this._basename,W),N=this.rotationFormat?this.rotationFormat():this._created,P=!this.tailable&&this._created?"".concat(B).concat(N).concat(W):"".concat(B).concat(W);return this.zippedArchive&&!this.tailable?"".concat(P,".gz"):P}},{key:"_checkMaxFilesIncrementing",value:function(W,B,N){if(!this.maxFiles||this._created<this.maxFiles)return r(N);var P=this._created-this.maxFiles,z=P!==0?P:"",O=this.zippedArchive?".gz":"",p="".concat(B).concat(z).concat(W).concat(O),U=g.join(this.dirname,p);h.unlink(U,N)}},{key:"_checkMaxFilesTailable",value:function(W,B,N){var P=this,z=[];if(this.maxFiles){for(var O=this.zippedArchive?".gz":"",p=this.maxFiles-1;p>1;p--)z.push(function(U,V){var Q=this,ee="".concat(B).concat(U-1).concat(W).concat(O),ne=g.join(this.dirname,ee);h.exists(ne,function(Y){if(!Y)return V(null);ee="".concat(B).concat(U).concat(W).concat(O),h.rename(ne,g.join(Q.dirname,ee),V)})}.bind(this,p));b(z,function(){h.rename(g.join(P.dirname,"".concat(B).concat(W)),g.join(P.dirname,"".concat(B,"1").concat(W).concat(O)),N)})}}},{key:"_createLogDirIfNotExist",value:function(W){h.existsSync(W)||h.mkdirSync(W,{recursive:!0})}}])&&o(m.prototype,I),L}(d)}).call(this,n(15).setImmediate,n(5).Buffer)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(l,o){return(0,r.default)(i.default,l,o)};var r=s(n(151)),i=s(n(155));function s(l){return l&&l.__esModule?l:{default:l}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(45)),i=l(n(25)),s=l(n(30));function l(o){return o&&o.__esModule?o:{default:o}}t.default=(0,s.default)((o,c,u)=>{var f=(0,r.default)(c)?[]:{};o(c,(E,w,h)=>{(0,i.default)(E)((g,...b)=>{b.length<2&&([b]=b),f[w]=b,h(g)})},E=>u(E,f))},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u){return(0,s.isAsync)(u)?function(...f){const E=f.pop();return o(u.apply(this,f),E)}:(0,r.default)(function(f,E){var w;try{w=u.apply(this,f)}catch(h){return E(h)}if(w&&typeof w.then=="function")return o(w,E);E(null,w)})};var r=l(n(153)),i=l(n(154)),s=n(25);function l(u){return u&&u.__esModule?u:{default:u}}function o(u,f){return u.then(E=>{c(f,null,E)},E=>{c(f,E&&E.message?E:new Error(E))})}function c(u,f,E){try{u(f,E)}catch(w){(0,i.default)(h=>{throw h},w)}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...i){var s=i.pop();return r.call(this,i,s)}},e.exports=t.default},function(e,t,n){(function(r,i){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=u,t.wrap=f;var s,l=t.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,o=t.hasSetImmediate=typeof r=="function"&&r,c=t.hasNextTick=typeof i=="object"&&typeof i.nextTick=="function";function u(E){setTimeout(E,0)}function f(E){return(w,...h)=>E(()=>w(...h))}s=l?queueMicrotask:o?r:c?i.nextTick:u,t.default=f(s)}).call(this,n(15).setImmediate,n(2))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(66)),i=s(n(30));function s(l){return l&&l.__esModule?l:{default:l}}t.default=(0,i.default)(function(l,o,c){return(0,r.default)(l,1,o,c)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(67)),i=u(n(157)),s=u(n(68)),l=n(25),o=u(n(159)),c=u(n(46));function u(f){return f&&f.__esModule?f:{default:f}}t.default=f=>(E,w,h)=>{if(h=(0,r.default)(h),f<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!E)return h(null);if((0,l.isAsyncGenerator)(E))return(0,o.default)(E,f,w,h);if((0,l.isAsyncIterable)(E))return(0,o.default)(E[Symbol.asyncIterator](),f,w,h);var g=(0,i.default)(E),b=!1,R=!1,j=0,F=!1;function M(d,C){if(!R)if(j-=1,d)b=!0,h(d);else if(d===!1)b=!0,R=!0;else{if(C===c.default||b&&j<=0)return b=!0,h(null);F||A()}}function A(){for(F=!0;j<f&&!b;){var d=g();if(d===null)return b=!0,void(j<=0&&h(null));j+=1,w(d.value,d.key,(0,s.default)(M))}F=!1}A()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(l){if((0,r.default)(l))return function(w){var h=-1,g=w.length;return function(){return++h<g?{value:w[h],key:h}:null}}(l);var o=(0,i.default)(l);return o?function(w){var h=-1;return function(){var g=w.next();return g.done?null:(h++,{value:g.value,key:h})}}(o):(c=l,u=c?Object.keys(c):[],f=-1,E=u.length,function w(){var h=u[++f];return h==="__proto__"?w():f<E?{value:c[h],key:h}:null});var c,u,f,E};var r=s(n(45)),i=s(n(158));function s(l){return l&&l.__esModule?l:{default:l}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(l,o,c,u){let f=!1,E=!1,w=!1,h=0,g=0;function b(){h>=o||w||f||(w=!0,l.next().then(({value:F,done:M})=>{if(!E&&!f){if(w=!1,M)return f=!0,void(h<=0&&u(null));h++,c(F,g,R),g++,b()}}).catch(j))}function R(F,M){if(h-=1,!E)return F?j(F):F===!1?(f=!0,void(E=!0)):M===s.default||f&&h<=0?(f=!0,u(null)):void b()}function j(F){E||(w=!1,f=!0,u(F))}b()};var r,i=n(46),s=(r=i)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){(function(r){var i=n(5).Buffer,s=n(161).Transform,l=n(169),o=n(13),c=n(74).ok,u=n(5).kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";l.Z_MIN_WINDOWBITS=8,l.Z_MAX_WINDOWBITS=15,l.Z_DEFAULT_WINDOWBITS=15,l.Z_MIN_CHUNK=64,l.Z_MAX_CHUNK=1/0,l.Z_DEFAULT_CHUNK=16384,l.Z_MIN_MEMLEVEL=1,l.Z_MAX_MEMLEVEL=9,l.Z_DEFAULT_MEMLEVEL=8,l.Z_MIN_LEVEL=-1,l.Z_MAX_LEVEL=9,l.Z_DEFAULT_LEVEL=l.Z_DEFAULT_COMPRESSION;for(var E=Object.keys(l),w=0;w<E.length;w++){var h=E[w];h.match(/^Z/)&&Object.defineProperty(t,h,{enumerable:!0,value:l[h],writable:!1})}for(var g={Z_OK:l.Z_OK,Z_STREAM_END:l.Z_STREAM_END,Z_NEED_DICT:l.Z_NEED_DICT,Z_ERRNO:l.Z_ERRNO,Z_STREAM_ERROR:l.Z_STREAM_ERROR,Z_DATA_ERROR:l.Z_DATA_ERROR,Z_MEM_ERROR:l.Z_MEM_ERROR,Z_BUF_ERROR:l.Z_BUF_ERROR,Z_VERSION_ERROR:l.Z_VERSION_ERROR},b=Object.keys(g),R=0;R<b.length;R++){var j=b[R];g[g[j]]=j}function F(B,N,P){var z=[],O=0;function p(){for(var V;(V=B.read())!==null;)z.push(V),O+=V.length;B.once("readable",p)}function U(){var V,Q=null;O>=u?Q=new RangeError(f):V=i.concat(z,O),z=[],B.close(),P(Q,V)}B.on("error",function(V){B.removeListener("end",U),B.removeListener("readable",p),P(V)}),B.on("end",U),B.end(N),p()}function M(B,N){if(typeof N=="string"&&(N=i.from(N)),!i.isBuffer(N))throw new TypeError("Not a string or buffer");var P=B._finishFlushFlag;return B._processChunk(N,P)}function A(B){if(!(this instanceof A))return new A(B);_.call(this,B,l.DEFLATE)}function d(B){if(!(this instanceof d))return new d(B);_.call(this,B,l.INFLATE)}function C(B){if(!(this instanceof C))return new C(B);_.call(this,B,l.GZIP)}function $(B){if(!(this instanceof $))return new $(B);_.call(this,B,l.GUNZIP)}function q(B){if(!(this instanceof q))return new q(B);_.call(this,B,l.DEFLATERAW)}function y(B){if(!(this instanceof y))return new y(B);_.call(this,B,l.INFLATERAW)}function m(B){if(!(this instanceof m))return new m(B);_.call(this,B,l.UNZIP)}function I(B){return B===l.Z_NO_FLUSH||B===l.Z_PARTIAL_FLUSH||B===l.Z_SYNC_FLUSH||B===l.Z_FULL_FLUSH||B===l.Z_FINISH||B===l.Z_BLOCK}function _(B,N){var P=this;if(this._opts=B=B||{},this._chunkSize=B.chunkSize||t.Z_DEFAULT_CHUNK,s.call(this,B),B.flush&&!I(B.flush))throw new Error("Invalid flush flag: "+B.flush);if(B.finishFlush&&!I(B.finishFlush))throw new Error("Invalid flush flag: "+B.finishFlush);if(this._flushFlag=B.flush||l.Z_NO_FLUSH,this._finishFlushFlag=B.finishFlush!==void 0?B.finishFlush:l.Z_FINISH,B.chunkSize&&(B.chunkSize<t.Z_MIN_CHUNK||B.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+B.chunkSize);if(B.windowBits&&(B.windowBits<t.Z_MIN_WINDOWBITS||B.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+B.windowBits);if(B.level&&(B.level<t.Z_MIN_LEVEL||B.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+B.level);if(B.memLevel&&(B.memLevel<t.Z_MIN_MEMLEVEL||B.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+B.memLevel);if(B.strategy&&B.strategy!=t.Z_FILTERED&&B.strategy!=t.Z_HUFFMAN_ONLY&&B.strategy!=t.Z_RLE&&B.strategy!=t.Z_FIXED&&B.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+B.strategy);if(B.dictionary&&!i.isBuffer(B.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new l.Zlib(N);var z=this;this._hadError=!1,this._handle.onerror=function(U,V){L(z),z._hadError=!0;var Q=new Error(U);Q.errno=V,Q.code=t.codes[V],z.emit("error",Q)};var O=t.Z_DEFAULT_COMPRESSION;typeof B.level=="number"&&(O=B.level);var p=t.Z_DEFAULT_STRATEGY;typeof B.strategy=="number"&&(p=B.strategy),this._handle.init(B.windowBits||t.Z_DEFAULT_WINDOWBITS,O,B.memLevel||t.Z_DEFAULT_MEMLEVEL,p,B.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=O,this._strategy=p,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!P._handle},configurable:!0,enumerable:!0})}function L(B,N){N&&r.nextTick(N),B._handle&&(B._handle.close(),B._handle=null)}function W(B){B.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(g),writable:!1}),t.Deflate=A,t.Inflate=d,t.Gzip=C,t.Gunzip=$,t.DeflateRaw=q,t.InflateRaw=y,t.Unzip=m,t.createDeflate=function(B){return new A(B)},t.createInflate=function(B){return new d(B)},t.createDeflateRaw=function(B){return new q(B)},t.createInflateRaw=function(B){return new y(B)},t.createGzip=function(B){return new C(B)},t.createGunzip=function(B){return new $(B)},t.createUnzip=function(B){return new m(B)},t.deflate=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new A(N),B,P)},t.deflateSync=function(B,N){return M(new A(N),B)},t.gzip=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new C(N),B,P)},t.gzipSync=function(B,N){return M(new C(N),B)},t.deflateRaw=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new q(N),B,P)},t.deflateRawSync=function(B,N){return M(new q(N),B)},t.unzip=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new m(N),B,P)},t.unzipSync=function(B,N){return M(new m(N),B)},t.inflate=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new d(N),B,P)},t.inflateSync=function(B,N){return M(new d(N),B)},t.gunzip=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new $(N),B,P)},t.gunzipSync=function(B,N){return M(new $(N),B)},t.inflateRaw=function(B,N,P){return typeof N=="function"&&(P=N,N={}),F(new y(N),B,P)},t.inflateRawSync=function(B,N){return M(new y(N),B)},o.inherits(_,s),_.prototype.params=function(B,N,P){if(B<t.Z_MIN_LEVEL||B>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+B);if(N!=t.Z_FILTERED&&N!=t.Z_HUFFMAN_ONLY&&N!=t.Z_RLE&&N!=t.Z_FIXED&&N!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+N);if(this._level!==B||this._strategy!==N){var z=this;this.flush(l.Z_SYNC_FLUSH,function(){c(z._handle,"zlib binding closed"),z._handle.params(B,N),z._hadError||(z._level=B,z._strategy=N,P&&P())})}else r.nextTick(P)},_.prototype.reset=function(){return c(this._handle,"zlib binding closed"),this._handle.reset()},_.prototype._flush=function(B){this._transform(i.alloc(0),"",B)},_.prototype.flush=function(B,N){var P=this,z=this._writableState;(typeof B=="function"||B===void 0&&!N)&&(N=B,B=l.Z_FULL_FLUSH),z.ended?N&&r.nextTick(N):z.ending?N&&this.once("end",N):z.needDrain?N&&this.once("drain",function(){return P.flush(B,N)}):(this._flushFlag=B,this.write(i.alloc(0),"",N))},_.prototype.close=function(B){L(this,B),r.nextTick(W,this)},_.prototype._transform=function(B,N,P){var z,O=this._writableState,p=(O.ending||O.ended)&&(!B||O.length===B.length);return B===null||i.isBuffer(B)?this._handle?(p?z=this._finishFlushFlag:(z=this._flushFlag,B.length>=O.length&&(this._flushFlag=this._opts.flush||l.Z_NO_FLUSH)),void this._processChunk(B,z,P)):P(new Error("zlib binding closed")):P(new Error("invalid input"))},_.prototype._processChunk=function(B,N,P){var z=B&&B.length,O=this._chunkSize-this._offset,p=0,U=this,V=typeof P=="function";if(!V){var Q,ee=[],ne=0;this.on("error",function(k){Q=k}),c(this._handle,"zlib binding closed");do var Y=this._handle.writeSync(N,B,p,z,this._buffer,this._offset,O);while(!this._hadError&&T(Y[0],Y[1]));if(this._hadError)throw Q;if(ne>=u)throw L(this),new RangeError(f);var G=i.concat(ee,ne);return L(this),G}c(this._handle,"zlib binding closed");var S=this._handle.write(N,B,p,z,this._buffer,this._offset,O);function T(k,J){if(this&&(this.buffer=null,this.callback=null),!U._hadError){var K=O-J;if(c(K>=0,"have should not go down"),K>0){var re=U._buffer.slice(U._offset,U._offset+K);U._offset+=K,V?U.push(re):(ee.push(re),ne+=re.length)}if((J===0||U._offset>=U._chunkSize)&&(O=U._chunkSize,U._offset=0,U._buffer=i.allocUnsafe(U._chunkSize)),J===0){if(p+=z-k,z=k,!V)return!0;var se=U._handle.write(N,B,p,z,U._buffer,U._offset,U._chunkSize);return se.callback=T,void(se.buffer=B)}if(!V)return!1;P()}}S.buffer=B,S.callback=T},o.inherits(A,_),o.inherits(d,_),o.inherits(C,_),o.inherits($,_),o.inherits(q,_),o.inherits(y,_),o.inherits(m,_)}).call(this,n(2))},function(e,t,n){e.exports=i;var r=n(21).EventEmitter;function i(){r.call(this)}n(7)(i,r),i.Readable=n(31),i.Writable=n(73),i.Duplex=n(166),i.Transform=n(167),i.PassThrough=n(168),i.Stream=i,i.prototype.pipe=function(s,l){var o=this;function c(b){s.writable&&s.write(b)===!1&&o.pause&&o.pause()}function u(){o.readable&&o.resume&&o.resume()}o.on("data",c),s.on("drain",u),s._isStdio||l&&l.end===!1||(o.on("end",E),o.on("close",w));var f=!1;function E(){f||(f=!0,s.end())}function w(){f||(f=!0,typeof s.destroy=="function"&&s.destroy())}function h(b){if(g(),r.listenerCount(this,"error")===0)throw b}function g(){o.removeListener("data",c),s.removeListener("drain",u),o.removeListener("end",E),o.removeListener("close",w),o.removeListener("error",h),s.removeListener("error",h),o.removeListener("end",g),o.removeListener("close",g),s.removeListener("close",g)}return o.on("error",h),s.on("error",h),o.on("end",g),o.on("close",g),s.on("close",g),s.emit("pipe",o),s}},function(e,t){},function(e,t,n){var r=n(47).Buffer,i=n(164);e.exports=function(){function s(){(function(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")})(this,s),this.head=null,this.tail=null,this.length=0}return s.prototype.push=function(l){var o={data:l,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},s.prototype.unshift=function(l){var o={data:l,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},s.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},s.prototype.clear=function(){this.head=this.tail=null,this.length=0},s.prototype.join=function(l){if(this.length===0)return"";for(var o=this.head,c=""+o.data;o=o.next;)c+=l+o.data;return c},s.prototype.concat=function(l){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var o,c,u,f=r.allocUnsafe(l>>>0),E=this.head,w=0;E;)o=E.data,c=f,u=w,o.copy(c,u),w+=E.data.length,E=E.next;return f},s}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var s=i.inspect({length:this.length});return this.constructor.name+" "+s})},function(e,t){},function(e,t,n){e.exports=s;var r=n(72),i=n(17);function s(l){if(!(this instanceof s))return new s(l);r.call(this,l)}i.inherits=n(7),i.inherits(s,r),s.prototype._transform=function(l,o,c){c(null,l)}},function(e,t,n){e.exports=n(23)},function(e,t,n){e.exports=n(31).Transform},function(e,t,n){e.exports=n(31).PassThrough},function(e,t,n){(function(r,i){var s=n(74),l=n(171),o=n(172),c=n(175),u=n(178);for(var f in u)t[f]=u[f];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function E(w){if(typeof w!="number"||w<t.DEFLATE||w>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=w,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}E.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,s(this.init_done,"close before init"),s(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||c.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},E.prototype.write=function(w,h,g,b,R,j,F){return this._write(!0,w,h,g,b,R,j,F)},E.prototype.writeSync=function(w,h,g,b,R,j,F){return this._write(!1,w,h,g,b,R,j,F)},E.prototype._write=function(w,h,g,b,R,j,F,M){if(s.equal(arguments.length,8),s(this.init_done,"write before init"),s(this.mode!==t.NONE,"already finalized"),s.equal(!1,this.write_in_progress,"write already in progress"),s.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,s.equal(!1,h===void 0,"must provide flush value"),this.write_in_progress=!0,h!==t.Z_NO_FLUSH&&h!==t.Z_PARTIAL_FLUSH&&h!==t.Z_SYNC_FLUSH&&h!==t.Z_FULL_FLUSH&&h!==t.Z_FINISH&&h!==t.Z_BLOCK)throw new Error("Invalid flush value");if(g==null&&(g=r.alloc(0),R=0,b=0),this.strm.avail_in=R,this.strm.input=g,this.strm.next_in=b,this.strm.avail_out=M,this.strm.output=j,this.strm.next_out=F,this.flush=h,!w)return this._process(),this._checkError()?this._afterSync():void 0;var A=this;return i.nextTick(function(){A._process(),A._after()}),this},E.prototype._afterSync=function(){var w=this.strm.avail_out,h=this.strm.avail_in;return this.write_in_progress=!1,[h,w]},E.prototype._process=function(){var w=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(w=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(w===null)break;if(this.strm.input[w]!==31){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,w++,this.strm.avail_in===1)break;case 1:if(w===null)break;this.strm.input[w]===139?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=c.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=c.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=c.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=c.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},E.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},E.prototype._after=function(){if(this._checkError()){var w=this.strm.avail_out,h=this.strm.avail_in;this.write_in_progress=!1,this.callback(h,w),this.pending_close&&this.close()}},E.prototype._error=function(w){this.strm.msg&&(w=this.strm.msg),this.onerror(w,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},E.prototype.init=function(w,h,g,b,R){s(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),s(w>=8&&w<=15,"invalid windowBits"),s(h>=-1&&h<=9,"invalid compression level"),s(g>=1&&g<=9,"invalid memlevel"),s(b===t.Z_FILTERED||b===t.Z_HUFFMAN_ONLY||b===t.Z_RLE||b===t.Z_FIXED||b===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(h,w,g,b,R),this._setDictionary()},E.prototype.params=function(){throw new Error("deflateParams Not supported")},E.prototype.reset=function(){this._reset(),this._setDictionary()},E.prototype._init=function(w,h,g,b,R){switch(this.level=w,this.windowBits=h,this.memLevel=g,this.strategy=b,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new l,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=c.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=R,this.write_in_progress=!1,this.init_done=!0},E.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},E.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=c.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=E}).call(this,n(5).Buffer,n(2))},function(e,t,n){var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function l(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}e.exports=function(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var c={},u=0;u<10;u++)c["_"+String.fromCharCode(u)]=u;if(Object.getOwnPropertyNames(c).map(function(E){return c[E]}).join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(E){f[E]=E}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(o,c){for(var u,f,E=l(o),w=1;w<arguments.length;w++){for(var h in u=Object(arguments[w]))i.call(u,h)&&(E[h]=u[h]);if(r){f=r(u);for(var g=0;g<f.length;g++)s.call(u,f[g])&&(E[f[g]]=u[f[g]])}}return E}},function(e,t,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){var r,i=n(37),s=n(173),l=n(75),o=n(76),c=n(174);function u(y,m){return y.msg=c[m],m}function f(y){return(y<<1)-(y>4?9:0)}function E(y){for(var m=y.length;--m>=0;)y[m]=0}function w(y){var m=y.state,I=m.pending;I>y.avail_out&&(I=y.avail_out),I!==0&&(i.arraySet(y.output,m.pending_buf,m.pending_out,I,y.next_out),y.next_out+=I,m.pending_out+=I,y.total_out+=I,y.avail_out-=I,m.pending-=I,m.pending===0&&(m.pending_out=0))}function h(y,m){s._tr_flush_block(y,y.block_start>=0?y.block_start:-1,y.strstart-y.block_start,m),y.block_start=y.strstart,w(y.strm)}function g(y,m){y.pending_buf[y.pending++]=m}function b(y,m){y.pending_buf[y.pending++]=m>>>8&255,y.pending_buf[y.pending++]=255&m}function R(y,m){var I,_,L=y.max_chain_length,W=y.strstart,B=y.prev_length,N=y.nice_match,P=y.strstart>y.w_size-262?y.strstart-(y.w_size-262):0,z=y.window,O=y.w_mask,p=y.prev,U=y.strstart+258,V=z[W+B-1],Q=z[W+B];y.prev_length>=y.good_match&&(L>>=2),N>y.lookahead&&(N=y.lookahead);do if(z[(I=m)+B]===Q&&z[I+B-1]===V&&z[I]===z[W]&&z[++I]===z[W+1]){W+=2,I++;do;while(z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&W<U);if(_=258-(U-W),W=U-258,_>B){if(y.match_start=m,B=_,_>=N)break;V=z[W+B-1],Q=z[W+B]}}while((m=p[m&O])>P&&--L!=0);return B<=y.lookahead?B:y.lookahead}function j(y){var m,I,_,L,W,B,N,P,z,O,p=y.w_size;do{if(L=y.window_size-y.lookahead-y.strstart,y.strstart>=p+(p-262)){i.arraySet(y.window,y.window,p,p,0),y.match_start-=p,y.strstart-=p,y.block_start-=p,m=I=y.hash_size;do _=y.head[--m],y.head[m]=_>=p?_-p:0;while(--I);m=I=p;do _=y.prev[--m],y.prev[m]=_>=p?_-p:0;while(--I);L+=p}if(y.strm.avail_in===0)break;if(B=y.strm,N=y.window,P=y.strstart+y.lookahead,z=L,O=void 0,(O=B.avail_in)>z&&(O=z),I=O===0?0:(B.avail_in-=O,i.arraySet(N,B.input,B.next_in,O,P),B.state.wrap===1?B.adler=l(B.adler,N,O,P):B.state.wrap===2&&(B.adler=o(B.adler,N,O,P)),B.next_in+=O,B.total_in+=O,O),y.lookahead+=I,y.lookahead+y.insert>=3)for(W=y.strstart-y.insert,y.ins_h=y.window[W],y.ins_h=(y.ins_h<<y.hash_shift^y.window[W+1])&y.hash_mask;y.insert&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[W+3-1])&y.hash_mask,y.prev[W&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=W,W++,y.insert--,!(y.lookahead+y.insert<3)););}while(y.lookahead<262&&y.strm.avail_in!==0)}function F(y,m){for(var I,_;;){if(y.lookahead<262){if(j(y),y.lookahead<262&&m===0)return 1;if(y.lookahead===0)break}if(I=0,y.lookahead>=3&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),I!==0&&y.strstart-I<=y.w_size-262&&(y.match_length=R(y,I)),y.match_length>=3)if(_=s._tr_tally(y,y.strstart-y.match_start,y.match_length-3),y.lookahead-=y.match_length,y.match_length<=y.max_lazy_match&&y.lookahead>=3){y.match_length--;do y.strstart++,y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart;while(--y.match_length!=0);y.strstart++}else y.strstart+=y.match_length,y.match_length=0,y.ins_h=y.window[y.strstart],y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+1])&y.hash_mask;else _=s._tr_tally(y,0,y.window[y.strstart]),y.lookahead--,y.strstart++;if(_&&(h(y,!1),y.strm.avail_out===0))return 1}return y.insert=y.strstart<2?y.strstart:2,m===4?(h(y,!0),y.strm.avail_out===0?3:4):y.last_lit&&(h(y,!1),y.strm.avail_out===0)?1:2}function M(y,m){for(var I,_,L;;){if(y.lookahead<262){if(j(y),y.lookahead<262&&m===0)return 1;if(y.lookahead===0)break}if(I=0,y.lookahead>=3&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),y.prev_length=y.match_length,y.prev_match=y.match_start,y.match_length=2,I!==0&&y.prev_length<y.max_lazy_match&&y.strstart-I<=y.w_size-262&&(y.match_length=R(y,I),y.match_length<=5&&(y.strategy===1||y.match_length===3&&y.strstart-y.match_start>4096)&&(y.match_length=2)),y.prev_length>=3&&y.match_length<=y.prev_length){L=y.strstart+y.lookahead-3,_=s._tr_tally(y,y.strstart-1-y.prev_match,y.prev_length-3),y.lookahead-=y.prev_length-1,y.prev_length-=2;do++y.strstart<=L&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart);while(--y.prev_length!=0);if(y.match_available=0,y.match_length=2,y.strstart++,_&&(h(y,!1),y.strm.avail_out===0))return 1}else if(y.match_available){if((_=s._tr_tally(y,0,y.window[y.strstart-1]))&&h(y,!1),y.strstart++,y.lookahead--,y.strm.avail_out===0)return 1}else y.match_available=1,y.strstart++,y.lookahead--}return y.match_available&&(_=s._tr_tally(y,0,y.window[y.strstart-1]),y.match_available=0),y.insert=y.strstart<2?y.strstart:2,m===4?(h(y,!0),y.strm.avail_out===0?3:4):y.last_lit&&(h(y,!1),y.strm.avail_out===0)?1:2}function A(y,m,I,_,L){this.good_length=y,this.max_lazy=m,this.nice_length=I,this.max_chain=_,this.func=L}function d(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),E(this.dyn_ltree),E(this.dyn_dtree),E(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),E(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),E(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function C(y){var m;return y&&y.state?(y.total_in=y.total_out=0,y.data_type=2,(m=y.state).pending=0,m.pending_out=0,m.wrap<0&&(m.wrap=-m.wrap),m.status=m.wrap?42:113,y.adler=m.wrap===2?0:1,m.last_flush=0,s._tr_init(m),0):u(y,-2)}function $(y){var m,I=C(y);return I===0&&((m=y.state).window_size=2*m.w_size,E(m.head),m.max_lazy_match=r[m.level].max_lazy,m.good_match=r[m.level].good_length,m.nice_match=r[m.level].nice_length,m.max_chain_length=r[m.level].max_chain,m.strstart=0,m.block_start=0,m.lookahead=0,m.insert=0,m.match_length=m.prev_length=2,m.match_available=0,m.ins_h=0),I}function q(y,m,I,_,L,W){if(!y)return-2;var B=1;if(m===-1&&(m=6),_<0?(B=0,_=-_):_>15&&(B=2,_-=16),L<1||L>9||I!==8||_<8||_>15||m<0||m>9||W<0||W>4)return u(y,-2);_===8&&(_=9);var N=new d;return y.state=N,N.strm=y,N.wrap=B,N.gzhead=null,N.w_bits=_,N.w_size=1<<N.w_bits,N.w_mask=N.w_size-1,N.hash_bits=L+7,N.hash_size=1<<N.hash_bits,N.hash_mask=N.hash_size-1,N.hash_shift=~~((N.hash_bits+3-1)/3),N.window=new i.Buf8(2*N.w_size),N.head=new i.Buf16(N.hash_size),N.prev=new i.Buf16(N.w_size),N.lit_bufsize=1<<L+6,N.pending_buf_size=4*N.lit_bufsize,N.pending_buf=new i.Buf8(N.pending_buf_size),N.d_buf=1*N.lit_bufsize,N.l_buf=3*N.lit_bufsize,N.level=m,N.strategy=W,N.method=I,$(y)}r=[new A(0,0,0,0,function(y,m){var I=65535;for(I>y.pending_buf_size-5&&(I=y.pending_buf_size-5);;){if(y.lookahead<=1){if(j(y),y.lookahead===0&&m===0)return 1;if(y.lookahead===0)break}y.strstart+=y.lookahead,y.lookahead=0;var _=y.block_start+I;if((y.strstart===0||y.strstart>=_)&&(y.lookahead=y.strstart-_,y.strstart=_,h(y,!1),y.strm.avail_out===0)||y.strstart-y.block_start>=y.w_size-262&&(h(y,!1),y.strm.avail_out===0))return 1}return y.insert=0,m===4?(h(y,!0),y.strm.avail_out===0?3:4):(y.strstart>y.block_start&&(h(y,!1),y.strm.avail_out),1)}),new A(4,4,8,4,F),new A(4,5,16,8,F),new A(4,6,32,32,F),new A(4,4,16,16,M),new A(8,16,32,32,M),new A(8,16,128,128,M),new A(8,32,128,256,M),new A(32,128,258,1024,M),new A(32,258,258,4096,M)],t.deflateInit=function(y,m){return q(y,m,8,15,8,0)},t.deflateInit2=q,t.deflateReset=$,t.deflateResetKeep=C,t.deflateSetHeader=function(y,m){return y&&y.state?y.state.wrap!==2?-2:(y.state.gzhead=m,0):-2},t.deflate=function(y,m){var I,_,L,W;if(!y||!y.state||m>5||m<0)return y?u(y,-2):-2;if(_=y.state,!y.output||!y.input&&y.avail_in!==0||_.status===666&&m!==4)return u(y,y.avail_out===0?-5:-2);if(_.strm=y,I=_.last_flush,_.last_flush=m,_.status===42)if(_.wrap===2)y.adler=0,g(_,31),g(_,139),g(_,8),_.gzhead?(g(_,(_.gzhead.text?1:0)+(_.gzhead.hcrc?2:0)+(_.gzhead.extra?4:0)+(_.gzhead.name?8:0)+(_.gzhead.comment?16:0)),g(_,255&_.gzhead.time),g(_,_.gzhead.time>>8&255),g(_,_.gzhead.time>>16&255),g(_,_.gzhead.time>>24&255),g(_,_.level===9?2:_.strategy>=2||_.level<2?4:0),g(_,255&_.gzhead.os),_.gzhead.extra&&_.gzhead.extra.length&&(g(_,255&_.gzhead.extra.length),g(_,_.gzhead.extra.length>>8&255)),_.gzhead.hcrc&&(y.adler=o(y.adler,_.pending_buf,_.pending,0)),_.gzindex=0,_.status=69):(g(_,0),g(_,0),g(_,0),g(_,0),g(_,0),g(_,_.level===9?2:_.strategy>=2||_.level<2?4:0),g(_,3),_.status=113);else{var B=8+(_.w_bits-8<<4)<<8;B|=(_.strategy>=2||_.level<2?0:_.level<6?1:_.level===6?2:3)<<6,_.strstart!==0&&(B|=32),B+=31-B%31,_.status=113,b(_,B),_.strstart!==0&&(b(_,y.adler>>>16),b(_,65535&y.adler)),y.adler=1}if(_.status===69)if(_.gzhead.extra){for(L=_.pending;_.gzindex<(65535&_.gzhead.extra.length)&&(_.pending!==_.pending_buf_size||(_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),w(y),L=_.pending,_.pending!==_.pending_buf_size));)g(_,255&_.gzhead.extra[_.gzindex]),_.gzindex++;_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),_.gzindex===_.gzhead.extra.length&&(_.gzindex=0,_.status=73)}else _.status=73;if(_.status===73)if(_.gzhead.name){L=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),w(y),L=_.pending,_.pending===_.pending_buf_size)){W=1;break}W=_.gzindex<_.gzhead.name.length?255&_.gzhead.name.charCodeAt(_.gzindex++):0,g(_,W)}while(W!==0);_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),W===0&&(_.gzindex=0,_.status=91)}else _.status=91;if(_.status===91)if(_.gzhead.comment){L=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),w(y),L=_.pending,_.pending===_.pending_buf_size)){W=1;break}W=_.gzindex<_.gzhead.comment.length?255&_.gzhead.comment.charCodeAt(_.gzindex++):0,g(_,W)}while(W!==0);_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),W===0&&(_.status=103)}else _.status=103;if(_.status===103&&(_.gzhead.hcrc?(_.pending+2>_.pending_buf_size&&w(y),_.pending+2<=_.pending_buf_size&&(g(_,255&y.adler),g(_,y.adler>>8&255),y.adler=0,_.status=113)):_.status=113),_.pending!==0){if(w(y),y.avail_out===0)return _.last_flush=-1,0}else if(y.avail_in===0&&f(m)<=f(I)&&m!==4)return u(y,-5);if(_.status===666&&y.avail_in!==0)return u(y,-5);if(y.avail_in!==0||_.lookahead!==0||m!==0&&_.status!==666){var N=_.strategy===2?function(P,z){for(var O;;){if(P.lookahead===0&&(j(P),P.lookahead===0)){if(z===0)return 1;break}if(P.match_length=0,O=s._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++,O&&(h(P,!1),P.strm.avail_out===0))return 1}return P.insert=0,z===4?(h(P,!0),P.strm.avail_out===0?3:4):P.last_lit&&(h(P,!1),P.strm.avail_out===0)?1:2}(_,m):_.strategy===3?function(P,z){for(var O,p,U,V,Q=P.window;;){if(P.lookahead<=258){if(j(P),P.lookahead<=258&&z===0)return 1;if(P.lookahead===0)break}if(P.match_length=0,P.lookahead>=3&&P.strstart>0&&(p=Q[U=P.strstart-1])===Q[++U]&&p===Q[++U]&&p===Q[++U]){V=P.strstart+258;do;while(p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&U<V);P.match_length=258-(V-U),P.match_length>P.lookahead&&(P.match_length=P.lookahead)}if(P.match_length>=3?(O=s._tr_tally(P,1,P.match_length-3),P.lookahead-=P.match_length,P.strstart+=P.match_length,P.match_length=0):(O=s._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++),O&&(h(P,!1),P.strm.avail_out===0))return 1}return P.insert=0,z===4?(h(P,!0),P.strm.avail_out===0?3:4):P.last_lit&&(h(P,!1),P.strm.avail_out===0)?1:2}(_,m):r[_.level].func(_,m);if(N!==3&&N!==4||(_.status=666),N===1||N===3)return y.avail_out===0&&(_.last_flush=-1),0;if(N===2&&(m===1?s._tr_align(_):m!==5&&(s._tr_stored_block(_,0,0,!1),m===3&&(E(_.head),_.lookahead===0&&(_.strstart=0,_.block_start=0,_.insert=0))),w(y),y.avail_out===0))return _.last_flush=-1,0}return m!==4?0:_.wrap<=0?1:(_.wrap===2?(g(_,255&y.adler),g(_,y.adler>>8&255),g(_,y.adler>>16&255),g(_,y.adler>>24&255),g(_,255&y.total_in),g(_,y.total_in>>8&255),g(_,y.total_in>>16&255),g(_,y.total_in>>24&255)):(b(_,y.adler>>>16),b(_,65535&y.adler)),w(y),_.wrap>0&&(_.wrap=-_.wrap),_.pending!==0?0:1)},t.deflateEnd=function(y){var m;return y&&y.state?(m=y.state.status)!==42&&m!==69&&m!==73&&m!==91&&m!==103&&m!==113&&m!==666?u(y,-2):(y.state=null,m===113?u(y,-3):0):-2},t.deflateSetDictionary=function(y,m){var I,_,L,W,B,N,P,z,O=m.length;if(!y||!y.state||(W=(I=y.state).wrap)===2||W===1&&I.status!==42||I.lookahead)return-2;for(W===1&&(y.adler=l(y.adler,m,O,0)),I.wrap=0,O>=I.w_size&&(W===0&&(E(I.head),I.strstart=0,I.block_start=0,I.insert=0),z=new i.Buf8(I.w_size),i.arraySet(z,m,O-I.w_size,I.w_size,0),m=z,O=I.w_size),B=y.avail_in,N=y.next_in,P=y.input,y.avail_in=O,y.next_in=0,y.input=m,j(I);I.lookahead>=3;){_=I.strstart,L=I.lookahead-2;do I.ins_h=(I.ins_h<<I.hash_shift^I.window[_+3-1])&I.hash_mask,I.prev[_&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=_,_++;while(--L);I.strstart=_,I.lookahead=2,j(I)}return I.strstart+=I.lookahead,I.block_start=I.strstart,I.insert=I.lookahead,I.lookahead=0,I.match_length=I.prev_length=2,I.match_available=0,y.next_in=N,y.input=P,y.avail_in=B,I.wrap=W,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){var r=n(37);function i(p){for(var U=p.length;--U>=0;)p[U]=0}var s=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var f=new Array(60);i(f);var E=new Array(512);i(E);var w=new Array(256);i(w);var h=new Array(29);i(h);var g,b,R,j=new Array(30);function F(p,U,V,Q,ee){this.static_tree=p,this.extra_bits=U,this.extra_base=V,this.elems=Q,this.max_length=ee,this.has_stree=p&&p.length}function M(p,U){this.dyn_tree=p,this.max_code=0,this.stat_desc=U}function A(p){return p<256?E[p]:E[256+(p>>>7)]}function d(p,U){p.pending_buf[p.pending++]=255&U,p.pending_buf[p.pending++]=U>>>8&255}function C(p,U,V){p.bi_valid>16-V?(p.bi_buf|=U<<p.bi_valid&65535,d(p,p.bi_buf),p.bi_buf=U>>16-p.bi_valid,p.bi_valid+=V-16):(p.bi_buf|=U<<p.bi_valid&65535,p.bi_valid+=V)}function $(p,U,V){C(p,V[2*U],V[2*U+1])}function q(p,U){var V=0;do V|=1&p,p>>>=1,V<<=1;while(--U>0);return V>>>1}function y(p,U,V){var Q,ee,ne=new Array(16),Y=0;for(Q=1;Q<=15;Q++)ne[Q]=Y=Y+V[Q-1]<<1;for(ee=0;ee<=U;ee++){var G=p[2*ee+1];G!==0&&(p[2*ee]=q(ne[G]++,G))}}function m(p){var U;for(U=0;U<286;U++)p.dyn_ltree[2*U]=0;for(U=0;U<30;U++)p.dyn_dtree[2*U]=0;for(U=0;U<19;U++)p.bl_tree[2*U]=0;p.dyn_ltree[512]=1,p.opt_len=p.static_len=0,p.last_lit=p.matches=0}function I(p){p.bi_valid>8?d(p,p.bi_buf):p.bi_valid>0&&(p.pending_buf[p.pending++]=p.bi_buf),p.bi_buf=0,p.bi_valid=0}function _(p,U,V,Q){var ee=2*U,ne=2*V;return p[ee]<p[ne]||p[ee]===p[ne]&&Q[U]<=Q[V]}function L(p,U,V){for(var Q=p.heap[V],ee=V<<1;ee<=p.heap_len&&(ee<p.heap_len&&_(U,p.heap[ee+1],p.heap[ee],p.depth)&&ee++,!_(U,Q,p.heap[ee],p.depth));)p.heap[V]=p.heap[ee],V=ee,ee<<=1;p.heap[V]=Q}function W(p,U,V){var Q,ee,ne,Y,G=0;if(p.last_lit!==0)do Q=p.pending_buf[p.d_buf+2*G]<<8|p.pending_buf[p.d_buf+2*G+1],ee=p.pending_buf[p.l_buf+G],G++,Q===0?$(p,ee,U):($(p,(ne=w[ee])+256+1,U),(Y=s[ne])!==0&&C(p,ee-=h[ne],Y),$(p,ne=A(--Q),V),(Y=l[ne])!==0&&C(p,Q-=j[ne],Y));while(G<p.last_lit);$(p,256,U)}function B(p,U){var V,Q,ee,ne=U.dyn_tree,Y=U.stat_desc.static_tree,G=U.stat_desc.has_stree,S=U.stat_desc.elems,T=-1;for(p.heap_len=0,p.heap_max=573,V=0;V<S;V++)ne[2*V]!==0?(p.heap[++p.heap_len]=T=V,p.depth[V]=0):ne[2*V+1]=0;for(;p.heap_len<2;)ne[2*(ee=p.heap[++p.heap_len]=T<2?++T:0)]=1,p.depth[ee]=0,p.opt_len--,G&&(p.static_len-=Y[2*ee+1]);for(U.max_code=T,V=p.heap_len>>1;V>=1;V--)L(p,ne,V);ee=S;do V=p.heap[1],p.heap[1]=p.heap[p.heap_len--],L(p,ne,1),Q=p.heap[1],p.heap[--p.heap_max]=V,p.heap[--p.heap_max]=Q,ne[2*ee]=ne[2*V]+ne[2*Q],p.depth[ee]=(p.depth[V]>=p.depth[Q]?p.depth[V]:p.depth[Q])+1,ne[2*V+1]=ne[2*Q+1]=ee,p.heap[1]=ee++,L(p,ne,1);while(p.heap_len>=2);p.heap[--p.heap_max]=p.heap[1],function(k,J){var K,re,se,fe,ve,Ce,Se=J.dyn_tree,Ie=J.max_code,Te=J.stat_desc.static_tree,Oe=J.stat_desc.has_stree,De=J.stat_desc.extra_bits,Ye=J.stat_desc.extra_base,nt=J.stat_desc.max_length,tt=0;for(fe=0;fe<=15;fe++)k.bl_count[fe]=0;for(Se[2*k.heap[k.heap_max]+1]=0,K=k.heap_max+1;K<573;K++)(fe=Se[2*Se[2*(re=k.heap[K])+1]+1]+1)>nt&&(fe=nt,tt++),Se[2*re+1]=fe,re>Ie||(k.bl_count[fe]++,ve=0,re>=Ye&&(ve=De[re-Ye]),Ce=Se[2*re],k.opt_len+=Ce*(fe+ve),Oe&&(k.static_len+=Ce*(Te[2*re+1]+ve)));if(tt!==0){do{for(fe=nt-1;k.bl_count[fe]===0;)fe--;k.bl_count[fe]--,k.bl_count[fe+1]+=2,k.bl_count[nt]--,tt-=2}while(tt>0);for(fe=nt;fe!==0;fe--)for(re=k.bl_count[fe];re!==0;)(se=k.heap[--K])>Ie||(Se[2*se+1]!==fe&&(k.opt_len+=(fe-Se[2*se+1])*Se[2*se],Se[2*se+1]=fe),re--)}}(p,U),y(ne,T,p.bl_count)}function N(p,U,V){var Q,ee,ne=-1,Y=U[1],G=0,S=7,T=4;for(Y===0&&(S=138,T=3),U[2*(V+1)+1]=65535,Q=0;Q<=V;Q++)ee=Y,Y=U[2*(Q+1)+1],++G<S&&ee===Y||(G<T?p.bl_tree[2*ee]+=G:ee!==0?(ee!==ne&&p.bl_tree[2*ee]++,p.bl_tree[32]++):G<=10?p.bl_tree[34]++:p.bl_tree[36]++,G=0,ne=ee,Y===0?(S=138,T=3):ee===Y?(S=6,T=3):(S=7,T=4))}function P(p,U,V){var Q,ee,ne=-1,Y=U[1],G=0,S=7,T=4;for(Y===0&&(S=138,T=3),Q=0;Q<=V;Q++)if(ee=Y,Y=U[2*(Q+1)+1],!(++G<S&&ee===Y)){if(G<T)do $(p,ee,p.bl_tree);while(--G!=0);else ee!==0?(ee!==ne&&($(p,ee,p.bl_tree),G--),$(p,16,p.bl_tree),C(p,G-3,2)):G<=10?($(p,17,p.bl_tree),C(p,G-3,3)):($(p,18,p.bl_tree),C(p,G-11,7));G=0,ne=ee,Y===0?(S=138,T=3):ee===Y?(S=6,T=3):(S=7,T=4)}}i(j);var z=!1;function O(p,U,V,Q){C(p,0+(Q?1:0),3),function(ee,ne,Y,G){I(ee),G&&(d(ee,Y),d(ee,~Y)),r.arraySet(ee.pending_buf,ee.window,ne,Y,ee.pending),ee.pending+=Y}(p,U,V,!0)}t._tr_init=function(p){z||(function(){var U,V,Q,ee,ne,Y=new Array(16);for(Q=0,ee=0;ee<28;ee++)for(h[ee]=Q,U=0;U<1<<s[ee];U++)w[Q++]=ee;for(w[Q-1]=ee,ne=0,ee=0;ee<16;ee++)for(j[ee]=ne,U=0;U<1<<l[ee];U++)E[ne++]=ee;for(ne>>=7;ee<30;ee++)for(j[ee]=ne<<7,U=0;U<1<<l[ee]-7;U++)E[256+ne++]=ee;for(V=0;V<=15;V++)Y[V]=0;for(U=0;U<=143;)u[2*U+1]=8,U++,Y[8]++;for(;U<=255;)u[2*U+1]=9,U++,Y[9]++;for(;U<=279;)u[2*U+1]=7,U++,Y[7]++;for(;U<=287;)u[2*U+1]=8,U++,Y[8]++;for(y(u,287,Y),U=0;U<30;U++)f[2*U+1]=5,f[2*U]=q(U,5);g=new F(u,s,257,286,15),b=new F(f,l,0,30,15),R=new F(new Array(0),o,0,19,7)}(),z=!0),p.l_desc=new M(p.dyn_ltree,g),p.d_desc=new M(p.dyn_dtree,b),p.bl_desc=new M(p.bl_tree,R),p.bi_buf=0,p.bi_valid=0,m(p)},t._tr_stored_block=O,t._tr_flush_block=function(p,U,V,Q){var ee,ne,Y=0;p.level>0?(p.strm.data_type===2&&(p.strm.data_type=function(G){var S,T=4093624447;for(S=0;S<=31;S++,T>>>=1)if(1&T&&G.dyn_ltree[2*S]!==0)return 0;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return 1;for(S=32;S<256;S++)if(G.dyn_ltree[2*S]!==0)return 1;return 0}(p)),B(p,p.l_desc),B(p,p.d_desc),Y=function(G){var S;for(N(G,G.dyn_ltree,G.l_desc.max_code),N(G,G.dyn_dtree,G.d_desc.max_code),B(G,G.bl_desc),S=18;S>=3&&G.bl_tree[2*c[S]+1]===0;S--);return G.opt_len+=3*(S+1)+5+5+4,S}(p),ee=p.opt_len+3+7>>>3,(ne=p.static_len+3+7>>>3)<=ee&&(ee=ne)):ee=ne=V+5,V+4<=ee&&U!==-1?O(p,U,V,Q):p.strategy===4||ne===ee?(C(p,2+(Q?1:0),3),W(p,u,f)):(C(p,4+(Q?1:0),3),function(G,S,T,k){var J;for(C(G,S-257,5),C(G,T-1,5),C(G,k-4,4),J=0;J<k;J++)C(G,G.bl_tree[2*c[J]+1],3);P(G,G.dyn_ltree,S-1),P(G,G.dyn_dtree,T-1)}(p,p.l_desc.max_code+1,p.d_desc.max_code+1,Y+1),W(p,p.dyn_ltree,p.dyn_dtree)),m(p),Q&&I(p)},t._tr_tally=function(p,U,V){return p.pending_buf[p.d_buf+2*p.last_lit]=U>>>8&255,p.pending_buf[p.d_buf+2*p.last_lit+1]=255&U,p.pending_buf[p.l_buf+p.last_lit]=255&V,p.last_lit++,U===0?p.dyn_ltree[2*V]++:(p.matches++,U--,p.dyn_ltree[2*(w[V]+256+1)]++,p.dyn_dtree[2*A(U)]++),p.last_lit===p.lit_bufsize-1},t._tr_align=function(p){C(p,2,3),$(p,256,u),function(U){U.bi_valid===16?(d(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):U.bi_valid>=8&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)}(p)}},function(e,t,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){var r=n(37),i=n(75),s=n(76),l=n(176),o=n(177);function c(M){return(M>>>24&255)+(M>>>8&65280)+((65280&M)<<8)+((255&M)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(M){var A;return M&&M.state?(A=M.state,M.total_in=M.total_out=A.total=0,M.msg="",A.wrap&&(M.adler=1&A.wrap),A.mode=1,A.last=0,A.havedict=0,A.dmax=32768,A.head=null,A.hold=0,A.bits=0,A.lencode=A.lendyn=new r.Buf32(852),A.distcode=A.distdyn=new r.Buf32(592),A.sane=1,A.back=-1,0):-2}function E(M){var A;return M&&M.state?((A=M.state).wsize=0,A.whave=0,A.wnext=0,f(M)):-2}function w(M,A){var d,C;return M&&M.state?(C=M.state,A<0?(d=0,A=-A):(d=1+(A>>4),A<48&&(A&=15)),A&&(A<8||A>15)?-2:(C.window!==null&&C.wbits!==A&&(C.window=null),C.wrap=d,C.wbits=A,E(M))):-2}function h(M,A){var d,C;return M?(C=new u,M.state=C,C.window=null,(d=w(M,A))!==0&&(M.state=null),d):-2}var g,b,R=!0;function j(M){if(R){var A;for(g=new r.Buf32(512),b=new r.Buf32(32),A=0;A<144;)M.lens[A++]=8;for(;A<256;)M.lens[A++]=9;for(;A<280;)M.lens[A++]=7;for(;A<288;)M.lens[A++]=8;for(o(1,M.lens,0,288,g,0,M.work,{bits:9}),A=0;A<32;)M.lens[A++]=5;o(2,M.lens,0,32,b,0,M.work,{bits:5}),R=!1}M.lencode=g,M.lenbits=9,M.distcode=b,M.distbits=5}function F(M,A,d,C){var $,q=M.state;return q.window===null&&(q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new r.Buf8(q.wsize)),C>=q.wsize?(r.arraySet(q.window,A,d-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(($=q.wsize-q.wnext)>C&&($=C),r.arraySet(q.window,A,d-C,$,q.wnext),(C-=$)?(r.arraySet(q.window,A,d-C,C,0),q.wnext=C,q.whave=q.wsize):(q.wnext+=$,q.wnext===q.wsize&&(q.wnext=0),q.whave<q.wsize&&(q.whave+=$))),0}t.inflateReset=E,t.inflateReset2=w,t.inflateResetKeep=f,t.inflateInit=function(M){return h(M,15)},t.inflateInit2=h,t.inflate=function(M,A){var d,C,$,q,y,m,I,_,L,W,B,N,P,z,O,p,U,V,Q,ee,ne,Y,G,S,T=0,k=new r.Buf8(4),J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return-2;(d=M.state).mode===12&&(d.mode=13),y=M.next_out,$=M.output,I=M.avail_out,q=M.next_in,C=M.input,m=M.avail_in,_=d.hold,L=d.bits,W=m,B=I,Y=0;e:for(;;)switch(d.mode){case 1:if(d.wrap===0){d.mode=13;break}for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(2&d.wrap&&_===35615){d.check=0,k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0),_=0,L=0,d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1),!(1&d.wrap)||(((255&_)<<8)+(_>>8))%31){M.msg="incorrect header check",d.mode=30;break}if((15&_)!=8){M.msg="unknown compression method",d.mode=30;break}if(L-=4,ne=8+(15&(_>>>=4)),d.wbits===0)d.wbits=ne;else if(ne>d.wbits){M.msg="invalid window size",d.mode=30;break}d.dmax=1<<ne,M.adler=d.check=1,d.mode=512&_?10:12,_=0,L=0;break;case 2:for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(d.flags=_,(255&d.flags)!=8){M.msg="unknown compression method",d.mode=30;break}if(57344&d.flags){M.msg="unknown header flags set",d.mode=30;break}d.head&&(d.head.text=_>>8&1),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0)),_=0,L=0,d.mode=3;case 3:for(;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.head&&(d.head.time=_),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,k[2]=_>>>16&255,k[3]=_>>>24&255,d.check=s(d.check,k,4,0)),_=0,L=0,d.mode=4;case 4:for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.head&&(d.head.xflags=255&_,d.head.os=_>>8),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0)),_=0,L=0,d.mode=5;case 5:if(1024&d.flags){for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.length=_,d.head&&(d.head.extra_len=_),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0)),_=0,L=0}else d.head&&(d.head.extra=null);d.mode=6;case 6:if(1024&d.flags&&((N=d.length)>m&&(N=m),N&&(d.head&&(ne=d.head.extra_len-d.length,d.head.extra||(d.head.extra=new Array(d.head.extra_len)),r.arraySet(d.head.extra,C,q,N,ne)),512&d.flags&&(d.check=s(d.check,C,N,q)),m-=N,q+=N,d.length-=N),d.length))break e;d.length=0,d.mode=7;case 7:if(2048&d.flags){if(m===0)break e;N=0;do ne=C[q+N++],d.head&&ne&&d.length<65536&&(d.head.name+=String.fromCharCode(ne));while(ne&&N<m);if(512&d.flags&&(d.check=s(d.check,C,N,q)),m-=N,q+=N,ne)break e}else d.head&&(d.head.name=null);d.length=0,d.mode=8;case 8:if(4096&d.flags){if(m===0)break e;N=0;do ne=C[q+N++],d.head&&ne&&d.length<65536&&(d.head.comment+=String.fromCharCode(ne));while(ne&&N<m);if(512&d.flags&&(d.check=s(d.check,C,N,q)),m-=N,q+=N,ne)break e}else d.head&&(d.head.comment=null);d.mode=9;case 9:if(512&d.flags){for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(_!==(65535&d.check)){M.msg="header crc mismatch",d.mode=30;break}_=0,L=0}d.head&&(d.head.hcrc=d.flags>>9&1,d.head.done=!0),M.adler=d.check=0,d.mode=12;break;case 10:for(;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}M.adler=d.check=c(_),_=0,L=0,d.mode=11;case 11:if(d.havedict===0)return M.next_out=y,M.avail_out=I,M.next_in=q,M.avail_in=m,d.hold=_,d.bits=L,2;M.adler=d.check=1,d.mode=12;case 12:if(A===5||A===6)break e;case 13:if(d.last){_>>>=7&L,L-=7&L,d.mode=27;break}for(;L<3;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}switch(d.last=1&_,L-=1,3&(_>>>=1)){case 0:d.mode=14;break;case 1:if(j(d),d.mode=20,A===6){_>>>=2,L-=2;break e}break;case 2:d.mode=17;break;case 3:M.msg="invalid block type",d.mode=30}_>>>=2,L-=2;break;case 14:for(_>>>=7&L,L-=7&L;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if((65535&_)!=(_>>>16^65535)){M.msg="invalid stored block lengths",d.mode=30;break}if(d.length=65535&_,_=0,L=0,d.mode=15,A===6)break e;case 15:d.mode=16;case 16:if(N=d.length){if(N>m&&(N=m),N>I&&(N=I),N===0)break e;r.arraySet($,C,q,N,y),m-=N,q+=N,I-=N,y+=N,d.length-=N;break}d.mode=12;break;case 17:for(;L<14;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(d.nlen=257+(31&_),_>>>=5,L-=5,d.ndist=1+(31&_),_>>>=5,L-=5,d.ncode=4+(15&_),_>>>=4,L-=4,d.nlen>286||d.ndist>30){M.msg="too many length or distance symbols",d.mode=30;break}d.have=0,d.mode=18;case 18:for(;d.have<d.ncode;){for(;L<3;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.lens[J[d.have++]]=7&_,_>>>=3,L-=3}for(;d.have<19;)d.lens[J[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,G={bits:d.lenbits},Y=o(0,d.lens,0,19,d.lencode,0,d.work,G),d.lenbits=G.bits,Y){M.msg="invalid code lengths set",d.mode=30;break}d.have=0,d.mode=19;case 19:for(;d.have<d.nlen+d.ndist;){for(;p=(T=d.lencode[_&(1<<d.lenbits)-1])>>>16&255,U=65535&T,!((O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(U<16)_>>>=O,L-=O,d.lens[d.have++]=U;else{if(U===16){for(S=O+2;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(_>>>=O,L-=O,d.have===0){M.msg="invalid bit length repeat",d.mode=30;break}ne=d.lens[d.have-1],N=3+(3&_),_>>>=2,L-=2}else if(U===17){for(S=O+3;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}L-=O,ne=0,N=3+(7&(_>>>=O)),_>>>=3,L-=3}else{for(S=O+7;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}L-=O,ne=0,N=11+(127&(_>>>=O)),_>>>=7,L-=7}if(d.have+N>d.nlen+d.ndist){M.msg="invalid bit length repeat",d.mode=30;break}for(;N--;)d.lens[d.have++]=ne}}if(d.mode===30)break;if(d.lens[256]===0){M.msg="invalid code -- missing end-of-block",d.mode=30;break}if(d.lenbits=9,G={bits:d.lenbits},Y=o(1,d.lens,0,d.nlen,d.lencode,0,d.work,G),d.lenbits=G.bits,Y){M.msg="invalid literal/lengths set",d.mode=30;break}if(d.distbits=6,d.distcode=d.distdyn,G={bits:d.distbits},Y=o(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,G),d.distbits=G.bits,Y){M.msg="invalid distances set",d.mode=30;break}if(d.mode=20,A===6)break e;case 20:d.mode=21;case 21:if(m>=6&&I>=258){M.next_out=y,M.avail_out=I,M.next_in=q,M.avail_in=m,d.hold=_,d.bits=L,l(M,B),y=M.next_out,$=M.output,I=M.avail_out,q=M.next_in,C=M.input,m=M.avail_in,_=d.hold,L=d.bits,d.mode===12&&(d.back=-1);break}for(d.back=0;p=(T=d.lencode[_&(1<<d.lenbits)-1])>>>16&255,U=65535&T,!((O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(p&&!(240&p)){for(V=O,Q=p,ee=U;p=(T=d.lencode[ee+((_&(1<<V+Q)-1)>>V)])>>>16&255,U=65535&T,!(V+(O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}_>>>=V,L-=V,d.back+=V}if(_>>>=O,L-=O,d.back+=O,d.length=U,p===0){d.mode=26;break}if(32&p){d.back=-1,d.mode=12;break}if(64&p){M.msg="invalid literal/length code",d.mode=30;break}d.extra=15&p,d.mode=22;case 22:if(d.extra){for(S=d.extra;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.length+=_&(1<<d.extra)-1,_>>>=d.extra,L-=d.extra,d.back+=d.extra}d.was=d.length,d.mode=23;case 23:for(;p=(T=d.distcode[_&(1<<d.distbits)-1])>>>16&255,U=65535&T,!((O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(!(240&p)){for(V=O,Q=p,ee=U;p=(T=d.distcode[ee+((_&(1<<V+Q)-1)>>V)])>>>16&255,U=65535&T,!(V+(O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}_>>>=V,L-=V,d.back+=V}if(_>>>=O,L-=O,d.back+=O,64&p){M.msg="invalid distance code",d.mode=30;break}d.offset=U,d.extra=15&p,d.mode=24;case 24:if(d.extra){for(S=d.extra;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.offset+=_&(1<<d.extra)-1,_>>>=d.extra,L-=d.extra,d.back+=d.extra}if(d.offset>d.dmax){M.msg="invalid distance too far back",d.mode=30;break}d.mode=25;case 25:if(I===0)break e;if(N=B-I,d.offset>N){if((N=d.offset-N)>d.whave&&d.sane){M.msg="invalid distance too far back",d.mode=30;break}N>d.wnext?(N-=d.wnext,P=d.wsize-N):P=d.wnext-N,N>d.length&&(N=d.length),z=d.window}else z=$,P=y-d.offset,N=d.length;N>I&&(N=I),I-=N,d.length-=N;do $[y++]=z[P++];while(--N);d.length===0&&(d.mode=21);break;case 26:if(I===0)break e;$[y++]=d.length,I--,d.mode=21;break;case 27:if(d.wrap){for(;L<32;){if(m===0)break e;m--,_|=C[q++]<<L,L+=8}if(B-=I,M.total_out+=B,d.total+=B,B&&(M.adler=d.check=d.flags?s(d.check,$,B,y-B):i(d.check,$,B,y-B)),B=I,(d.flags?_:c(_))!==d.check){M.msg="incorrect data check",d.mode=30;break}_=0,L=0}d.mode=28;case 28:if(d.wrap&&d.flags){for(;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(_!==(4294967295&d.total)){M.msg="incorrect length check",d.mode=30;break}_=0,L=0}d.mode=29;case 29:Y=1;break e;case 30:Y=-3;break e;case 31:return-4;case 32:default:return-2}return M.next_out=y,M.avail_out=I,M.next_in=q,M.avail_in=m,d.hold=_,d.bits=L,(d.wsize||B!==M.avail_out&&d.mode<30&&(d.mode<27||A!==4))&&F(M,M.output,M.next_out,B-M.avail_out)?(d.mode=31,-4):(W-=M.avail_in,B-=M.avail_out,M.total_in+=W,M.total_out+=B,d.total+=B,d.wrap&&B&&(M.adler=d.check=d.flags?s(d.check,$,B,M.next_out-B):i(d.check,$,B,M.next_out-B)),M.data_type=d.bits+(d.last?64:0)+(d.mode===12?128:0)+(d.mode===20||d.mode===15?256:0),(W===0&&B===0||A===4)&&Y===0&&(Y=-5),Y)},t.inflateEnd=function(M){if(!M||!M.state)return-2;var A=M.state;return A.window&&(A.window=null),M.state=null,0},t.inflateGetHeader=function(M,A){var d;return M&&M.state&&2&(d=M.state).wrap?(d.head=A,A.done=!1,0):-2},t.inflateSetDictionary=function(M,A){var d,C=A.length;return M&&M.state?(d=M.state).wrap!==0&&d.mode!==11?-2:d.mode===11&&i(1,A,C,0)!==d.check?-3:F(M,A,C,C)?(d.mode=31,-4):(d.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){e.exports=function(r,i){var s,l,o,c,u,f,E,w,h,g,b,R,j,F,M,A,d,C,$,q,y,m,I,_,L;s=r.state,l=r.next_in,_=r.input,o=l+(r.avail_in-5),c=r.next_out,L=r.output,u=c-(i-r.avail_out),f=c+(r.avail_out-257),E=s.dmax,w=s.wsize,h=s.whave,g=s.wnext,b=s.window,R=s.hold,j=s.bits,F=s.lencode,M=s.distcode,A=(1<<s.lenbits)-1,d=(1<<s.distbits)-1;e:do{j<15&&(R+=_[l++]<<j,j+=8,R+=_[l++]<<j,j+=8),C=F[R&A];t:for(;;){if(R>>>=$=C>>>24,j-=$,($=C>>>16&255)===0)L[c++]=65535&C;else{if(!(16&$)){if(!(64&$)){C=F[(65535&C)+(R&(1<<$)-1)];continue t}if(32&$){s.mode=12;break e}r.msg="invalid literal/length code",s.mode=30;break e}q=65535&C,($&=15)&&(j<$&&(R+=_[l++]<<j,j+=8),q+=R&(1<<$)-1,R>>>=$,j-=$),j<15&&(R+=_[l++]<<j,j+=8,R+=_[l++]<<j,j+=8),C=M[R&d];n:for(;;){if(R>>>=$=C>>>24,j-=$,!(16&($=C>>>16&255))){if(!(64&$)){C=M[(65535&C)+(R&(1<<$)-1)];continue n}r.msg="invalid distance code",s.mode=30;break e}if(y=65535&C,j<($&=15)&&(R+=_[l++]<<j,(j+=8)<$&&(R+=_[l++]<<j,j+=8)),(y+=R&(1<<$)-1)>E){r.msg="invalid distance too far back",s.mode=30;break e}if(R>>>=$,j-=$,y>($=c-u)){if(($=y-$)>h&&s.sane){r.msg="invalid distance too far back",s.mode=30;break e}if(m=0,I=b,g===0){if(m+=w-$,$<q){q-=$;do L[c++]=b[m++];while(--$);m=c-y,I=L}}else if(g<$){if(m+=w+g-$,($-=g)<q){q-=$;do L[c++]=b[m++];while(--$);if(m=0,g<q){q-=$=g;do L[c++]=b[m++];while(--$);m=c-y,I=L}}}else if(m+=g-$,$<q){q-=$;do L[c++]=b[m++];while(--$);m=c-y,I=L}for(;q>2;)L[c++]=I[m++],L[c++]=I[m++],L[c++]=I[m++],q-=3;q&&(L[c++]=I[m++],q>1&&(L[c++]=I[m++]))}else{m=c-y;do L[c++]=L[m++],L[c++]=L[m++],L[c++]=L[m++],q-=3;while(q>2);q&&(L[c++]=L[m++],q>1&&(L[c++]=L[m++]))}break}}break}}while(l<o&&c<f);l-=q=j>>3,R&=(1<<(j-=q<<3))-1,r.next_in=l,r.next_out=c,r.avail_in=l<o?o-l+5:5-(l-o),r.avail_out=c<f?f-c+257:257-(c-f),s.hold=R,s.bits=j}},function(e,t,n){var r=n(37),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(c,u,f,E,w,h,g,b){var R,j,F,M,A,d,C,$,q,y=b.bits,m=0,I=0,_=0,L=0,W=0,B=0,N=0,P=0,z=0,O=0,p=null,U=0,V=new r.Buf16(16),Q=new r.Buf16(16),ee=null,ne=0;for(m=0;m<=15;m++)V[m]=0;for(I=0;I<E;I++)V[u[f+I]]++;for(W=y,L=15;L>=1&&V[L]===0;L--);if(W>L&&(W=L),L===0)return w[h++]=20971520,w[h++]=20971520,b.bits=1,0;for(_=1;_<L&&V[_]===0;_++);for(W<_&&(W=_),P=1,m=1;m<=15;m++)if(P<<=1,(P-=V[m])<0)return-1;if(P>0&&(c===0||L!==1))return-1;for(Q[1]=0,m=1;m<15;m++)Q[m+1]=Q[m]+V[m];for(I=0;I<E;I++)u[f+I]!==0&&(g[Q[u[f+I]]++]=I);if(c===0?(p=ee=g,d=19):c===1?(p=i,U-=257,ee=s,ne-=257,d=256):(p=l,ee=o,d=-1),O=0,I=0,m=_,A=h,B=W,N=0,F=-1,M=(z=1<<W)-1,c===1&&z>852||c===2&&z>592)return 1;for(;;){C=m-N,g[I]<d?($=0,q=g[I]):g[I]>d?($=ee[ne+g[I]],q=p[U+g[I]]):($=96,q=0),R=1<<m-N,_=j=1<<B;do w[A+(O>>N)+(j-=R)]=C<<24|$<<16|q|0;while(j!==0);for(R=1<<m-1;O&R;)R>>=1;if(R!==0?(O&=R-1,O+=R):O=0,I++,--V[m]==0){if(m===L)break;m=u[f+g[I]]}if(m>W&&(O&M)!==F){for(N===0&&(N=W),A+=_,P=1<<(B=m-N);B+N<L&&!((P-=V[B+N])<=0);)B++,P<<=1;if(z+=1<<B,c===1&&z>852||c===2&&z>592)return 1;w[F=O&M]=W<<24|B<<16|A-h|0}}return O!==0&&(w[A+O]=m-N<<24|64<<16|0),b.bits=W,0}},function(e,t,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t){},function(e,t,n){function r(u,f){var E=Object.keys(u);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(u);f&&(w=w.filter(function(h){return Object.getOwnPropertyDescriptor(u,h).enumerable})),E.push.apply(E,w)}return E}function i(u,f,E){return f in u?Object.defineProperty(u,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):u[f]=E,u}function s(u,f){for(var E=0;E<f.length;E++){var w=f[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(u,w.key,w)}}var l=n(5).Buffer,o=n(181).inspect,c=o&&o.custom||"inspect";e.exports=function(){function u(){(function(w,h){if(!(w instanceof h))throw new TypeError("Cannot call a class as a function")})(this,u),this.head=null,this.tail=null,this.length=0}var f,E;return f=u,(E=[{key:"push",value:function(w){var h={data:w,next:null};this.length>0?this.tail.next=h:this.head=h,this.tail=h,++this.length}},{key:"unshift",value:function(w){var h={data:w,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var h=this.head,g=""+h.data;h=h.next;)g+=w+h.data;return g}},{key:"concat",value:function(w){if(this.length===0)return l.alloc(0);for(var h,g,b,R=l.allocUnsafe(w>>>0),j=this.head,F=0;j;)h=j.data,g=R,b=F,l.prototype.copy.call(h,g,b),F+=j.data.length,j=j.next;return R}},{key:"consume",value:function(w,h){var g;return w<this.head.data.length?(g=this.head.data.slice(0,w),this.head.data=this.head.data.slice(w)):g=w===this.head.data.length?this.shift():h?this._getString(w):this._getBuffer(w),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(w){var h=this.head,g=1,b=h.data;for(w-=b.length;h=h.next;){var R=h.data,j=w>R.length?R.length:w;if(j===R.length?b+=R:b+=R.slice(0,w),(w-=j)==0){j===R.length?(++g,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=R.slice(j));break}++g}return this.length-=g,b}},{key:"_getBuffer",value:function(w){var h=l.allocUnsafe(w),g=this.head,b=1;for(g.data.copy(h),w-=g.data.length;g=g.next;){var R=g.data,j=w>R.length?R.length:w;if(R.copy(h,h.length-w,0,j),(w-=j)==0){j===R.length?(++b,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=R.slice(j));break}++b}return this.length-=b,h}},{key:c,value:function(w,h){return o(this,function(g){for(var b=1;b<arguments.length;b++){var R=arguments[b]!=null?arguments[b]:{};b%2?r(Object(R),!0).forEach(function(j){i(g,j,R[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(R)):r(Object(R)).forEach(function(j){Object.defineProperty(g,j,Object.getOwnPropertyDescriptor(R,j))})}return g}({},h,{depth:0,customInspect:!1}))}}])&&s(f.prototype,E),u}()},function(e,t){},function(e,t,n){(function(r){var i;function s(M,A,d){return A in M?Object.defineProperty(M,A,{value:d,enumerable:!0,configurable:!0,writable:!0}):M[A]=d,M}var l=n(49),o=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),E=Symbol("lastPromise"),w=Symbol("handlePromise"),h=Symbol("stream");function g(M,A){return{value:M,done:A}}function b(M){var A=M[o];if(A!==null){var d=M[h].read();d!==null&&(M[E]=null,M[o]=null,M[c]=null,A(g(d,!1)))}}function R(M){r.nextTick(b,M)}var j=Object.getPrototypeOf(function(){}),F=Object.setPrototypeOf((s(i={get stream(){return this[h]},next:function(){var M=this,A=this[u];if(A!==null)return Promise.reject(A);if(this[f])return Promise.resolve(g(void 0,!0));if(this[h].destroyed)return new Promise(function(q,y){r.nextTick(function(){M[u]?y(M[u]):q(g(void 0,!0))})});var d,C=this[E];if(C)d=new Promise(function(q,y){return function(m,I){q.then(function(){y[f]?m(g(void 0,!0)):y[w](m,I)},I)}}(C,this));else{var $=this[h].read();if($!==null)return Promise.resolve(g($,!1));d=new Promise(this[w])}return this[E]=d,d}},Symbol.asyncIterator,function(){return this}),s(i,"return",function(){var M=this;return new Promise(function(A,d){M[h].destroy(null,function(C){C?d(C):A(g(void 0,!0))})})}),i),j);e.exports=function(M){var A,d=Object.create(F,(s(A={},h,{value:M,writable:!0}),s(A,o,{value:null,writable:!0}),s(A,c,{value:null,writable:!0}),s(A,u,{value:null,writable:!0}),s(A,f,{value:M._readableState.endEmitted,writable:!0}),s(A,w,{value:function(C,$){var q=d[h].read();q?(d[E]=null,d[o]=null,d[c]=null,C(g(q,!1))):(d[o]=C,d[c]=$)},writable:!0}),A));return d[E]=null,l(M,function(C){if(C&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"){var $=d[c];return $!==null&&(d[E]=null,d[o]=null,d[c]=null,$(C)),void(d[u]=C)}var q=d[o];q!==null&&(d[E]=null,d[o]=null,d[c]=null,q(g(void 0,!0))),d[f]=!0}),M.on("readable",R.bind(null,d)),d}}).call(this,n(2))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){e.exports=i;var r=n(82);function i(s){if(!(this instanceof i))return new i(s);r.call(this,s)}n(7)(i,r),i.prototype._transform=function(s,l,o){o(null,s)}},function(e,t,n){var r,i=n(26).codes,s=i.ERR_MISSING_ARGS,l=i.ERR_STREAM_DESTROYED;function o(w){if(w)throw w}function c(w,h,g,b){b=function(F){var M=!1;return function(){M||(M=!0,F.apply(void 0,arguments))}}(b);var R=!1;w.on("close",function(){R=!0}),r===void 0&&(r=n(49)),r(w,{readable:h,writable:g},function(F){if(F)return b(F);R=!0,b()});var j=!1;return function(F){if(!R&&!j)return j=!0,function(M){return M.setHeader&&typeof M.abort=="function"}(w)?w.abort():typeof w.destroy=="function"?w.destroy():void b(F||new l("pipe"))}}function u(w){w()}function f(w,h){return w.pipe(h)}function E(w){return w.length?typeof w[w.length-1]!="function"?o:w.pop():o}e.exports=function(){for(var w=arguments.length,h=new Array(w),g=0;g<w;g++)h[g]=arguments[g];var b,R=E(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new s("streams");var j=h.map(function(F,M){var A=M<h.length-1;return c(F,A,M>0,function(d){b||(b=d),d&&j.forEach(u),A||(j.forEach(u),R(b))})});return h.reduce(f)}},function(e,t,n){var r=n(187)(function i(s,l){return(l=l||{}).namespace=s,l.prod=!0,l.dev=!1,l.force||i.force?i.yep(l):i.nope(l)});e.exports=r},function(e,t){var n=[],r=[],i=function(){};function s(g){return!~n.indexOf(g)&&(n.push(g),!0)}function l(g){i=g}function o(g){for(var b=[],R=0;R<n.length;R++)if(n[R].async)b.push(n[R]);else if(n[R](g))return!0;return!!b.length&&new Promise(function(j){Promise.all(b.map(function(F){return F(g)})).then(function(F){j(F.some(Boolean))})})}function c(g){return!~r.indexOf(g)&&(r.push(g),!0)}function u(){i.apply(i,arguments)}function f(g){for(var b=0;b<r.length;b++)g=r[b].apply(r[b],arguments);return g}function E(g,b){var R=Object.prototype.hasOwnProperty;for(var j in b)R.call(b,j)&&(g[j]=b[j]);return g}function w(g){return g.enabled=!1,g.modify=c,g.set=l,g.use=s,E(function(){return!1},g)}function h(g){return g.enabled=!0,g.modify=c,g.set=l,g.use=s,E(function(){var b=Array.prototype.slice.call(arguments,0);return u.call(u,g,f(b,g)),!0},g)}e.exports=function(g){return g.introduce=E,g.enabled=o,g.process=f,g.modify=c,g.write=u,g.nope=w,g.yep=h,g.set=l,g.use=s,g}},function(e,t,n){(function(r){var i=n(65),s=n(22).StringDecoder,l=n(32).Stream;function o(){}e.exports=function(c,u){var f=r.alloc(65536),E=new s("utf8"),w=new l,h="",g=0,b=0;return c.start===-1&&delete c.start,w.readable=!0,w.destroy=function(){w.destroyed=!0,w.emit("end"),w.emit("close")},i.open(c.file,"a+","0644",function(R,j){if(R)return u?u(R):w.emit("error",R),void w.destroy();(function F(){if(!w.destroyed)return i.read(j,f,0,f.length,g,function(M,A){if(M)return u?u(M):w.emit("error",M),void w.destroy();if(!A)return h&&((c.start==null||b>c.start)&&(u?u(null,h):w.emit("line",h)),b++,h=""),setTimeout(F,1e3);var d=E.write(f.slice(0,A));u||w.emit("data",d);for(var C=(d=(h+d).split(/\n+/)).length-1,$=0;$<C;$++)(c.start==null||b>c.start)&&(u?u(null,d[$]):w.emit("line",d[$])),b++;return h=d[C],g+=A,F()});i.close(j,o)})()}),u?w.destroy:w}}).call(this,n(5).Buffer)},function(e,t,n){(function(r,i){function s(M){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(M)}function l(M,A){var d=Object.keys(M);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(M);A&&(C=C.filter(function($){return Object.getOwnPropertyDescriptor(M,$).enumerable})),d.push.apply(d,C)}return d}function o(M){for(var A=1;A<arguments.length;A++){var d=arguments[A]!=null?arguments[A]:{};A%2?l(Object(d),!0).forEach(function(C){c(M,C,d[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(M,Object.getOwnPropertyDescriptors(d)):l(Object(d)).forEach(function(C){Object.defineProperty(M,C,Object.getOwnPropertyDescriptor(d,C))})}return M}function c(M,A,d){return A in M?Object.defineProperty(M,A,{value:d,enumerable:!0,configurable:!0,writable:!0}):M[A]=d,M}function u(M,A){if(!(M instanceof A))throw new TypeError("Cannot call a class as a function")}function f(M,A){for(var d=0;d<A.length;d++){var C=A[d];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(M,C.key,C)}}function E(M,A){return(E=Object.setPrototypeOf||function(d,C){return d.__proto__=C,d})(M,A)}function w(M){var A=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var d,C=g(M);if(A){var $=g(this).constructor;d=Reflect.construct(C,arguments,$)}else d=C.apply(this,arguments);return h(this,d)}}function h(M,A){return!A||s(A)!=="object"&&typeof A!="function"?function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}(M):A}function g(M){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(M)}var b=n(83),R=n(200),j=n(32).Stream,F=n(20);e.exports=function(M){(function(q,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(y&&y.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),y&&E(q,y)})($,M);var A,d,C=w($);function $(){var q,y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return u(this,$),(q=C.call(this,y)).options=y,q.name=y.name||"http",q.ssl=!!y.ssl,q.host=y.host||"localhost",q.port=y.port,q.auth=y.auth,q.path=y.path||"",q.agent=y.agent,q.headers=y.headers||{},q.headers["content-type"]="application/json",q.port||(q.port=q.ssl?443:80),q}return A=$,(d=[{key:"log",value:function(q,y){var m=this;this._request(q,function(I,_){_&&_.statusCode!==200&&(I=new Error("Invalid HTTP Status Code: ".concat(_.statusCode))),I?m.emit("warn",I):m.emit("logged",q)}),y&&r(y)}},{key:"query",value:function(q,y){typeof q=="function"&&(y=q,q={}),(q={method:"query",params:this.normalizeQuery(q)}).params.path&&(q.path=q.params.path,delete q.params.path),q.params.auth&&(q.auth=q.params.auth,delete q.params.auth),this._request(q,function(m,I,_){if(I&&I.statusCode!==200&&(m=new Error("Invalid HTTP Status Code: ".concat(I.statusCode))),m)return y(m);if(typeof _=="string")try{_=JSON.parse(_)}catch(L){return y(L)}y(null,_)})}},{key:"stream",value:function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=new j;(q={method:"stream",params:q}).params.path&&(q.path=q.params.path,delete q.params.path),q.params.auth&&(q.auth=q.params.auth,delete q.params.auth);var m="",I=this._request(q);return y.destroy=function(){return I.destroy()},I.on("data",function(_){for(var L=(_=(m+_).split(/\n+/)).length-1,W=0;W<L;W++)try{y.emit("log",JSON.parse(_[W]))}catch(B){y.emit("error",B)}m=_[L]}),I.on("error",function(_){return y.emit("error",_)}),y}},{key:"_request",value:function(q,y){var m=(q=q||{}).auth||this.auth,I=q.path||this.path||"";delete q.auth,delete q.path;var _=Object.assign({},this.headers);m&&m.bearer&&(_.Authorization="Bearer ".concat(m.bearer));var L=(this.ssl?R:b).request(o(o({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(I.replace(/^\//,"")),headers:_,auth:m&&m.username&&m.password?"".concat(m.username,":").concat(m.password):"",agent:this.agent}));L.on("error",y),L.on("response",function(W){return W.on("end",function(){return y(null,W)}).resume()}),L.end(i.from(JSON.stringify(q),"utf8"))}}])&&f(A.prototype,d),$}(F)}).call(this,n(15).setImmediate,n(5).Buffer)},function(e,t,n){(function(r,i,s){var l=n(84),o=n(7),c=n(85),u=n(31),f=n(191),E=c.IncomingMessage,w=c.readyStates,h=e.exports=function(b){var R,j=this;u.Writable.call(j),j._opts=b,j._body=[],j._headers={},b.auth&&j.setHeader("Authorization","Basic "+new r(b.auth).toString("base64")),Object.keys(b.headers).forEach(function(M){j.setHeader(M,b.headers[M])});var F=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!l.abortController)F=!1,R=!0;else if(b.mode==="prefer-streaming")R=!1;else if(b.mode==="allow-wrong-content-type")R=!l.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");R=!0}j._mode=function(M,A){return l.fetch&&A?"fetch":l.mozchunkedarraybuffer?"moz-chunked-arraybuffer":l.msstream?"ms-stream":l.arraybuffer&&M?"arraybuffer":l.vbArray&&M?"text:vbarray":"text"}(R,F),j._fetchTimer=null,j.on("finish",function(){j._onFinish()})};o(h,u.Writable),h.prototype.setHeader=function(b,R){var j=b.toLowerCase();g.indexOf(j)===-1&&(this._headers[j]={name:b,value:R})},h.prototype.getHeader=function(b){var R=this._headers[b.toLowerCase()];return R?R.value:null},h.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},h.prototype._onFinish=function(){var b=this;if(!b._destroyed){var R=b._opts,j=b._headers,F=null;R.method!=="GET"&&R.method!=="HEAD"&&(F=l.arraybuffer?f(r.concat(b._body)):l.blobConstructor?new i.Blob(b._body.map(function($){return f($)}),{type:(j["content-type"]||{}).value||""}):r.concat(b._body).toString());var M=[];if(Object.keys(j).forEach(function($){var q=j[$].name,y=j[$].value;Array.isArray(y)?y.forEach(function(m){M.push([q,m])}):M.push([q,y])}),b._mode==="fetch"){var A=null;if(l.abortController){var d=new AbortController;A=d.signal,b._fetchAbortController=d,"requestTimeout"in R&&R.requestTimeout!==0&&(b._fetchTimer=i.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},R.requestTimeout))}i.fetch(b._opts.url,{method:b._opts.method,headers:M,body:F||void 0,mode:"cors",credentials:R.withCredentials?"include":"same-origin",signal:A}).then(function($){b._fetchResponse=$,b._connect()},function($){i.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",$)})}else{var C=b._xhr=new i.XMLHttpRequest;try{C.open(b._opts.method,b._opts.url,!0)}catch($){return void s.nextTick(function(){b.emit("error",$)})}"responseType"in C&&(C.responseType=b._mode.split(":")[0]),"withCredentials"in C&&(C.withCredentials=!!R.withCredentials),b._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in R&&(C.timeout=R.requestTimeout,C.ontimeout=function(){b.emit("requestTimeout")}),M.forEach(function($){C.setRequestHeader($[0],$[1])}),b._response=null,C.onreadystatechange=function(){switch(C.readyState){case w.LOADING:case w.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){b._onXHRProgress()}),C.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{C.send(F)}catch($){return void s.nextTick(function(){b.emit("error",$)})}}}},h.prototype._onXHRProgress=function(){(function(b){try{var R=b.status;return R!==null&&R!==0}catch{return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var b=this;b._destroyed||(b._response=new E(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(R){b.emit("error",R)}),b.emit("response",b._response))},h.prototype._write=function(b,R,j){this._body.push(b),j()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,i.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(b,R,j){typeof b=="function"&&(j=b,b=void 0),u.Writable.prototype.end.call(this,b,R,j)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var g=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(5).Buffer,n(6),n(2))},function(e,t,n){var r=n(5).Buffer;e.exports=function(i){if(i instanceof Uint8Array){if(i.byteOffset===0&&i.byteLength===i.buffer.byteLength)return i.buffer;if(typeof i.buffer.slice=="function")return i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}if(r.isBuffer(i)){for(var s=new Uint8Array(i.length),l=i.length,o=0;o<l;o++)s[o]=i[o];return s.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var r={},i=0;i<arguments.length;i++){var s=arguments[i];for(var l in s)n.call(s,l)&&(r[l]=s[l])}return r};var n=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){(function(r,i){var s;(function(l){t&&t.nodeType,r&&r.nodeType;var o=typeof i=="object"&&i;o.global!==o&&o.window!==o&&o.self;var c,u=2147483647,f=/^xn--/,E=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,b=String.fromCharCode;function R(y){throw new RangeError(h[y])}function j(y,m){for(var I=y.length,_=[];I--;)_[I]=m(y[I]);return _}function F(y,m){var I=y.split("@"),_="";return I.length>1&&(_=I[0]+"@",y=I[1]),_+j((y=y.replace(w,".")).split("."),m).join(".")}function M(y){for(var m,I,_=[],L=0,W=y.length;L<W;)(m=y.charCodeAt(L++))>=55296&&m<=56319&&L<W?(64512&(I=y.charCodeAt(L++)))==56320?_.push(((1023&m)<<10)+(1023&I)+65536):(_.push(m),L--):_.push(m);return _}function A(y){return j(y,function(m){var I="";return m>65535&&(I+=b((m-=65536)>>>10&1023|55296),m=56320|1023&m),I+=b(m)}).join("")}function d(y,m){return y+22+75*(y<26)-((m!=0)<<5)}function C(y,m,I){var _=0;for(y=I?g(y/700):y>>1,y+=g(y/m);y>455;_+=36)y=g(y/35);return g(_+36*y/(y+38))}function $(y){var m,I,_,L,W,B,N,P,z,O,p,U=[],V=y.length,Q=0,ee=128,ne=72;for((I=y.lastIndexOf("-"))<0&&(I=0),_=0;_<I;++_)y.charCodeAt(_)>=128&&R("not-basic"),U.push(y.charCodeAt(_));for(L=I>0?I+1:0;L<V;){for(W=Q,B=1,N=36;L>=V&&R("invalid-input"),((P=(p=y.charCodeAt(L++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||P>g((u-Q)/B))&&R("overflow"),Q+=P*B,!(P<(z=N<=ne?1:N>=ne+26?26:N-ne));N+=36)B>g(u/(O=36-z))&&R("overflow"),B*=O;ne=C(Q-W,m=U.length+1,W==0),g(Q/m)>u-ee&&R("overflow"),ee+=g(Q/m),Q%=m,U.splice(Q++,0,ee)}return A(U)}function q(y){var m,I,_,L,W,B,N,P,z,O,p,U,V,Q,ee,ne=[];for(U=(y=M(y)).length,m=128,I=0,W=72,B=0;B<U;++B)(p=y[B])<128&&ne.push(b(p));for(_=L=ne.length,L&&ne.push("-");_<U;){for(N=u,B=0;B<U;++B)(p=y[B])>=m&&p<N&&(N=p);for(N-m>g((u-I)/(V=_+1))&&R("overflow"),I+=(N-m)*V,m=N,B=0;B<U;++B)if((p=y[B])<m&&++I>u&&R("overflow"),p==m){for(P=I,z=36;!(P<(O=z<=W?1:z>=W+26?26:z-W));z+=36)ee=P-O,Q=36-O,ne.push(b(d(O+ee%Q,0))),P=g(ee/Q);ne.push(b(d(P,0))),W=C(I,V,_==L),I=0,++_}++I,++m}return ne.join("")}c={version:"1.4.1",ucs2:{decode:M,encode:A},decode:$,encode:q,toASCII:function(y){return F(y,function(m){return E.test(m)?"xn--"+q(m):m})},toUnicode:function(y){return F(y,function(m){return f.test(m)?$(m.slice(4).toLowerCase()):m})}},(s=function(){return c}.call(t,n,t,r))===void 0||(r.exports=s)})()}).call(this,n(195)(e),n(6))},function(e,t){e.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(e,t,n){e.exports={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}}},function(e,t,n){t.decode=t.parse=n(198),t.encode=t.stringify=n(199)},function(e,t,n){function r(s,l){return Object.prototype.hasOwnProperty.call(s,l)}e.exports=function(s,l,o,c){l=l||"&",o=o||"=";var u={};if(typeof s!="string"||s.length===0)return u;var f=/\+/g;s=s.split(l);var E=1e3;c&&typeof c.maxKeys=="number"&&(E=c.maxKeys);var w=s.length;E>0&&w>E&&(w=E);for(var h=0;h<w;++h){var g,b,R,j,F=s[h].replace(f,"%20"),M=F.indexOf(o);M>=0?(g=F.substr(0,M),b=F.substr(M+1)):(g=F,b=""),R=decodeURIComponent(g),j=decodeURIComponent(b),r(u,R)?i(u[R])?u[R].push(j):u[R]=[u[R],j]:u[R]=j}return u};var i=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"}},function(e,t,n){var r=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};e.exports=function(o,c,u,f){return c=c||"&",u=u||"=",o===null&&(o=void 0),typeof o=="object"?s(l(o),function(E){var w=encodeURIComponent(r(E))+u;return i(o[E])?s(o[E],function(h){return w+encodeURIComponent(r(h))}).join(c):w+encodeURIComponent(r(o[E]))}).join(c):f?encodeURIComponent(r(f))+u+encodeURIComponent(r(o)):""};var i=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function s(o,c){if(o.map)return o.map(c);for(var u=[],f=0;f<o.length;f++)u.push(c(o[f],f));return u}var l=Object.keys||function(o){var c=[];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&c.push(u);return c}},function(e,t,n){var r=n(83),i=n(86),s=e.exports;for(var l in r)r.hasOwnProperty(l)&&(s[l]=r[l]);function o(c){if(typeof c=="string"&&(c=i.parse(c)),c.protocol||(c.protocol="https:"),c.protocol!=="https:")throw new Error('Protocol "'+c.protocol+'" not supported. Expected "https:"');return c}s.request=function(c,u){return c=o(c),r.request.call(this,c,u)},s.get=function(c,u){return c=o(c),r.get.call(this,c,u)}},function(e,t,n){(function(r){function i(b){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(b)}function s(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}function l(b,R){for(var j=0;j<R.length;j++){var F=R[j];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(b,F.key,F)}}function o(b,R){return(o=Object.setPrototypeOf||function(j,F){return j.__proto__=F,j})(b,R)}function c(b){var R=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var j,F=f(b);if(R){var M=f(this).constructor;j=Reflect.construct(F,arguments,M)}else j=F.apply(this,arguments);return u(this,j)}}function u(b,R){return!R||i(R)!=="object"&&typeof R!="function"?function(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}(b):R}function f(b){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(b)}var E=n(87),w=n(3).MESSAGE,h=n(18),g=n(20);e.exports=function(b){(function(A,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(d&&d.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),d&&o(A,d)})(M,b);var R,j,F=c(M);function M(){var A,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(s(this,M),A=F.call(this,d),!d.stream||!E(d.stream))throw new Error("options.stream is required.");return A._stream=d.stream,A._stream.setMaxListeners(1/0),A.isObjectMode=d.stream._writableState.objectMode,A.eol=d.eol||h.EOL,A}return R=M,(j=[{key:"log",value:function(A,d){var C=this;if(r(function(){return C.emit("logged",A)}),this.isObjectMode)return this._stream.write(A),void(d&&d());this._stream.write("".concat(A[w]).concat(this.eol)),d&&d()}}])&&l(R.prototype,j),M}(g)}).call(this,n(15).setImmediate)},function(e,t,n){(function(r){function i(_,L,W){return L in _?Object.defineProperty(_,L,{value:W,enumerable:!0,configurable:!0,writable:!0}):_[L]=W,_}function s(_){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L})(_)}function l(_,L){for(var W=0;W<L.length;W++){var B=L[W];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(_,B.key,B)}}function o(_,L){return(o=Object.setPrototypeOf||function(W,B){return W.__proto__=B,W})(_,L)}function c(_){var L=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var W,B=f(_);if(L){var N=f(this).constructor;W=Reflect.construct(B,arguments,N)}else W=B.apply(this,arguments);return u(this,W)}}function u(_,L){return!L||s(L)!=="object"&&typeof L!="function"?function(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W}(_):L}function f(_){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)})(_)}var E=n(32),w=E.Stream,h=E.Transform,g=n(51),b=n(3),R=b.LEVEL,j=b.SPLAT,F=n(87),M=n(89),A=n(93),d=n(206),C=n(207),$=n(61).warn,q=n(50),y=/%[scdjifoO%]/g,m=function(_){(function(P,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");P.prototype=Object.create(z&&z.prototype,{constructor:{value:P,writable:!0,configurable:!0}}),z&&o(P,z)})(N,_);var L,W,B=c(N);function N(P){var z;return function(O,p){if(!(O instanceof p))throw new TypeError("Cannot call a class as a function")}(this,N),(z=B.call(this,{objectMode:!0})).configure(P),z}return L=N,(W=[{key:"child",value:function(P){var z=this;return Object.create(z,{write:{value:function(O){var p=Object.assign({},P,O);O instanceof Error&&(p.stack=O.stack,p.message=O.message),z.write(p)}}})}},{key:"configure",value:function(){var P=this,z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},O=z.silent,p=z.format,U=z.defaultMeta,V=z.levels,Q=z.level,ee=Q===void 0?"info":Q,ne=z.exitOnError,Y=ne===void 0||ne,G=z.transports,S=z.colors,T=z.emitErrs,k=z.formatters,J=z.padLevels,K=z.rewriters,re=z.stripColors,se=z.exceptionHandlers,fe=z.rejectionHandlers;if(this.transports.length&&this.clear(),this.silent=O,this.format=p||this.format||n(208)(),this.defaultMeta=U||null,this.levels=V||this.levels||q.npm.levels,this.level=ee,this.exceptions=new M(this),this.rejections=new A(this),this.profilers={},this.exitOnError=Y,G&&(G=Array.isArray(G)?G:[G]).forEach(function(ve){return P.add(ve)}),S||T||k||J||K||re)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
44
|
-
`));se&&this.exceptions.handle(se),fe&&this.rejections.handle(fe)}},{key:"isLevelEnabled",value:function(
|
|
45
|
-
`))}},{key:"_onEvent",value:function(
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function i(E,w){(w==null||w>E.length)&&(w=E.length);for(var h=0,g=new Array(w);h<w;h++)g[h]=E[h];return g}function s(E,w){for(var h=0;h<w.length;h++){var g=w[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}var l=n(13),o=n(3).SPLAT,c=/%[scdjifoO%]/g,u=/%%/g,f=function(){function E(g){(function(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")})(this,E),this.options=g}var w,h;return w=E,(h=[{key:"_splat",value:function(g,b){var R=g.message,j=g[o]||g.splat||[],F=R.match(u),M=F&&F.length||0,A=b.length-M-j.length,d=A<0?j.splice(A,-1*A):[],C=d.length;if(C)for(var $=0;$<C;$++)Object.assign(g,d[$]);return g.message=l.format.apply(l,[R].concat(r(j))),g}},{key:"transform",value:function(g){var b=g.message,R=g[o]||g.splat;if(!R||!R.length)return g;var j=b&&b.match&&b.match(c);if(!j&&(R||R.length)){var F=R.length>1?R.splice(0):R,M=F.length;if(M)for(var A=0;A<M;A++)Object.assign(g,F[A]);return g}return j?this._splat(g,j):g}}])&&s(w.prototype,h),E}();e.exports=function(E){return new f(E)}},function(e,t,n){var r=n(136),i=n(12);e.exports=i(function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return l.format&&(s.timestamp=typeof l.format=="function"?l.format():r.format(new Date,l.format)),s.timestamp||(s.timestamp=new Date().toISOString()),l.alias&&(s[l.alias]=s.timestamp),s})},function(e,t,n){n.r(t),n.d(t,"assign",function(){return c}),n.d(t,"format",function(){return m}),n.d(t,"parse",function(){return I}),n.d(t,"defaultI18n",function(){return w}),n.d(t,"setGlobalDateI18n",function(){return g}),n.d(t,"setGlobalDateMasks",function(){return y});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,i="[^\\s]+",s=/\[([^]*?)\]/gm;function l(L,W){for(var B=[],N=0,D=L.length;N<D;N++)B.push(L[N].substr(0,W));return B}var o=function(L){return function(W,B){var N=B[L].map(function(D){return D.toLowerCase()}).indexOf(W.toLowerCase());return N>-1?N:null}};function c(L){for(var W=[],B=1;B<arguments.length;B++)W[B-1]=arguments[B];for(var N=0,D=W;N<D.length;N++){var z=D[N];for(var O in z)L[O]=z[O]}return L}var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],E=l(f,3),w={dayNamesShort:l(u,3),dayNames:u,monthNamesShort:E,monthNames:f,amPm:["am","pm"],DoFn:function(L){return L+["th","st","nd","rd"][L%10>3?0:(L-L%10!=10?1:0)*L%10]}},h=c({},w),g=function(L){return h=c(h,L)},b=function(L){return L.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},R=function(L,W){for(W===void 0&&(W=2),L=String(L);L.length<W;)L="0"+L;return L},j={D:function(L){return String(L.getDate())},DD:function(L){return R(L.getDate())},Do:function(L,W){return W.DoFn(L.getDate())},d:function(L){return String(L.getDay())},dd:function(L){return R(L.getDay())},ddd:function(L,W){return W.dayNamesShort[L.getDay()]},dddd:function(L,W){return W.dayNames[L.getDay()]},M:function(L){return String(L.getMonth()+1)},MM:function(L){return R(L.getMonth()+1)},MMM:function(L,W){return W.monthNamesShort[L.getMonth()]},MMMM:function(L,W){return W.monthNames[L.getMonth()]},YY:function(L){return R(String(L.getFullYear()),4).substr(2)},YYYY:function(L){return R(L.getFullYear(),4)},h:function(L){return String(L.getHours()%12||12)},hh:function(L){return R(L.getHours()%12||12)},H:function(L){return String(L.getHours())},HH:function(L){return R(L.getHours())},m:function(L){return String(L.getMinutes())},mm:function(L){return R(L.getMinutes())},s:function(L){return String(L.getSeconds())},ss:function(L){return R(L.getSeconds())},S:function(L){return String(Math.round(L.getMilliseconds()/100))},SS:function(L){return R(Math.round(L.getMilliseconds()/10),2)},SSS:function(L){return R(L.getMilliseconds(),3)},a:function(L,W){return L.getHours()<12?W.amPm[0]:W.amPm[1]},A:function(L,W){return L.getHours()<12?W.amPm[0].toUpperCase():W.amPm[1].toUpperCase()},ZZ:function(L){var W=L.getTimezoneOffset();return(W>0?"-":"+")+R(100*Math.floor(Math.abs(W)/60)+Math.abs(W)%60,4)},Z:function(L){var W=L.getTimezoneOffset();return(W>0?"-":"+")+R(Math.floor(Math.abs(W)/60),2)+":"+R(Math.abs(W)%60,2)}},F=function(L){return+L-1},M=[null,"[1-9]\\d?"],A=[null,i],d=["isPm",i,function(L,W){var B=L.toLowerCase();return B===W.amPm[0]?0:B===W.amPm[1]?1:null}],C=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(L){var W=(L+"").match(/([+-]|\d\d)/gi);if(W){var B=60*+W[1]+parseInt(W[2],10);return W[0]==="+"?B:-B}return 0}],$={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+i,function(L){return parseInt(L,10)}],M:["month","[1-9]\\d?",F],MM:["month","\\d\\d",F],YY:["year","\\d\\d",function(L){var W=+(""+new Date().getFullYear()).substr(0,2);return+(""+(+L>68?W-1:W)+L)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(L){return 100*+L}],SS:["millisecond","\\d\\d",function(L){return 10*+L}],SSS:["millisecond","\\d{3}"],d:M,dd:M,ddd:A,dddd:A,MMM:["month",i,o("monthNamesShort")],MMMM:["month",i,o("monthNames")],a:d,A:d,ZZ:C,Z:C},q={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},y=function(L){return c(q,L)},m=function(L,W,B){if(W===void 0&&(W=q.default),B===void 0&&(B={}),typeof L=="number"&&(L=new Date(L)),Object.prototype.toString.call(L)!=="[object Date]"||isNaN(L.getTime()))throw new Error("Invalid Date pass to format");var N=[];W=(W=q[W]||W).replace(s,function(z,O){return N.push(O),"@@@"});var D=c(c({},h),B);return(W=W.replace(r,function(z){return j[z](L,D)})).replace(/@@@/g,function(){return N.shift()})};function I(L,W,B){if(B===void 0&&(B={}),typeof W!="string")throw new Error("Invalid format in fecha parse");if(W=q[W]||W,L.length>1e3)return null;var N={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},D=[],z=[],O=W.replace(s,function(K,re){return z.push(b(re)),"@@@"}),p={},U={};O=b(O).replace(r,function(K){var re=$[K],se=re[0],fe=re[1],ve=re[3];if(p[se])throw new Error("Invalid format. "+se+" specified twice in format");return p[se]=!0,ve&&(U[ve]=!0),D.push(re),"("+fe+")"}),Object.keys(U).forEach(function(K){if(!p[K])throw new Error("Invalid format. "+K+" is required in specified format")}),O=O.replace(/@@@/g,function(){return z.shift()});var V=L.match(new RegExp(O,"i"));if(!V)return null;for(var Q=c(c({},h),B),ee=1;ee<V.length;ee++){var ne=D[ee-1],Y=ne[0],G=ne[2],S=G?G(V[ee],Q):+V[ee];if(S==null)return null;N[Y]=S}N.isPm===1&&N.hour!=null&&+N.hour!=12?N.hour=+N.hour+12:N.isPm===0&&+N.hour==12&&(N.hour=0);for(var T=new Date(N.year,N.month,N.day,N.hour,N.minute,N.second,N.millisecond),k=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],J=(ee=0,k.length);ee<J;ee++)if(p[k[ee][0]]&&N[k[ee][0]]!==T[k[ee][1]]())return null;return N.timezoneOffset==null?T:new Date(Date.UTC(N.year,N.month,N.day,N.hour,N.minute-N.timezoneOffset,N.second,N.millisecond))}var _={format:m,parse:I,defaultI18n:w,setGlobalDateI18n:g,setGlobalDateMasks:y};t.default=_},function(e,t,n){var r=n(59),i=n(12),s=n(3).MESSAGE;e.exports=i(function(l,o){return o.level!==!1&&(l.level=r.strip(l.level)),o.message!==!1&&(l.message=r.strip(l.message)),o.raw!==!1&&l[s]&&(l[s]=r.strip(l[s])),l})},function(e){e.exports=JSON.parse('{"name":"winston","description":"A logger for just about everything.","version":"3.3.3","author":"Charlie Robbins <charlie.robbins@gmail.com>","maintainers":["Jarrett Cruger <jcrugzz@gmail.com>","Chris Alderson <chrisalderson@protonmail.com>","David Hyde <dabh@stanford.edu>"],"repository":{"type":"git","url":"https://github.com/winstonjs/winston.git"},"keywords":["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],"dependencies":{"async":"^3.1.0","@dabh/diagnostics":"^2.0.2","is-stream":"^2.0.0","logform":"^2.2.0","one-time":"^1.0.0","readable-stream":"^3.4.0","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.10.3","@babel/core":"^7.10.3","@babel/preset-env":"^7.10.3","@types/node":"^14.0.13","abstract-winston-transport":"^0.5.1","assume":"^2.2.0","colors":"^1.4.0","cross-spawn-async":"^2.2.5","eslint-config-populist":"^4.2.0","hock":"^1.4.1","mocha":"^8.0.1","nyc":"^15.1.0","rimraf":"^3.0.2","split2":"^3.1.1","std-mocks":"^1.0.1","through2":"^3.0.1","winston-compat":"^0.1.5"},"main":"./lib/winston","browser":"./dist/winston","types":"./index.d.ts","scripts":{"lint":"populist lib/*.js lib/winston/*.js lib/winston/**/*.js","pretest":"npm run lint","test":"nyc --reporter=text --reporter lcov npm run test:mocha","test:mocha":"mocha test/*.test.js test/**/*.test.js --exit","build":"./node_modules/.bin/rimraf dist && babel lib -d dist","prepublishOnly":"npm run build"},"engines":{"node":">= 6.4.0"},"license":"MIT"}')},function(e,t,n){Object.defineProperty(t,"Console",{configurable:!0,enumerable:!0,get:function(){return n(140)}}),Object.defineProperty(t,"File",{configurable:!0,enumerable:!0,get:function(){return n(149)}}),Object.defineProperty(t,"Http",{configurable:!0,enumerable:!0,get:function(){return n(189)}}),Object.defineProperty(t,"Stream",{configurable:!0,enumerable:!0,get:function(){return n(201)}})},function(e,t,n){(function(r){function i(R){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j})(R)}function s(R,j){if(!(R instanceof j))throw new TypeError("Cannot call a class as a function")}function l(R,j){for(var F=0;F<j.length;F++){var M=j[F];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(R,M.key,M)}}function o(R,j){return(o=Object.setPrototypeOf||function(F,M){return F.__proto__=M,F})(R,j)}function c(R){var j=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var F,M=f(R);if(j){var A=f(this).constructor;F=Reflect.construct(M,arguments,A)}else F=M.apply(this,arguments);return u(this,F)}}function u(R,j){return!j||i(j)!=="object"&&typeof j!="function"?function(F){if(F===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F}(R):j}function f(R){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(j){return j.__proto__||Object.getPrototypeOf(j)})(R)}var E=n(18),w=n(3),h=w.LEVEL,g=w.MESSAGE,b=n(20);e.exports=function(R){(function(d,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(C&&C.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),C&&o(d,C)})(A,R);var j,F,M=c(A);function A(){var d,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return s(this,A),(d=M.call(this,C)).name=C.name||"console",d.stderrLevels=d._stringArrayToSet(C.stderrLevels),d.consoleWarnLevels=d._stringArrayToSet(C.consoleWarnLevels),d.eol=C.eol||E.EOL,d.setMaxListeners(30),d}return j=A,(F=[{key:"log",value:function(d,C){var $=this;return r(function(){return $.emit("logged",d)}),this.stderrLevels[d[h]]?(console._stderr?console._stderr.write("".concat(d[g]).concat(this.eol)):console.error(d[g]),void(C&&C())):this.consoleWarnLevels[d[h]]?(console._stderr?console._stderr.write("".concat(d[g]).concat(this.eol)):console.warn(d[g]),void(C&&C())):(console._stdout?console._stdout.write("".concat(d[g]).concat(this.eol)):console.log(d[g]),void(C&&C()))}},{key:"_stringArrayToSet",value:function(d,C){if(!d)return{};if(C=C||"Cannot make set from type other than Array of string elements",!Array.isArray(d))throw new Error(C);return d.reduce(function($,q){if(typeof q!="string")throw new Error(C);return $[q]=!0,$},{})}}])&&l(j.prototype,F),A}(b)}).call(this,n(15).setImmediate)},function(e,t,n){(function(r,i){(function(s,l){if(!s.setImmediate){var o,c,u,f,E,w=1,h={},g=!1,b=s.document,R=Object.getPrototypeOf&&Object.getPrototypeOf(s);R=R&&R.setTimeout?R:s,{}.toString.call(s.process)==="[object process]"?o=function(M){i.nextTick(function(){F(M)})}:function(){if(s.postMessage&&!s.importScripts){var M=!0,A=s.onmessage;return s.onmessage=function(){M=!1},s.postMessage("","*"),s.onmessage=A,M}}()?(f="setImmediate$"+Math.random()+"$",E=function(M){M.source===s&&typeof M.data=="string"&&M.data.indexOf(f)===0&&F(+M.data.slice(f.length))},s.addEventListener?s.addEventListener("message",E,!1):s.attachEvent("onmessage",E),o=function(M){s.postMessage(f+M,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(M){F(M.data)},o=function(M){u.port2.postMessage(M)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,o=function(M){var A=b.createElement("script");A.onreadystatechange=function(){F(M),A.onreadystatechange=null,c.removeChild(A),A=null},c.appendChild(A)}):o=function(M){setTimeout(F,0,M)},R.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var A=new Array(arguments.length-1),d=0;d<A.length;d++)A[d]=arguments[d+1];var C={callback:M,args:A};return h[w]=C,o(w),w++},R.clearImmediate=j}function j(M){delete h[M]}function F(M){if(g)setTimeout(F,0,M);else{var A=h[M];if(A){g=!0;try{(function(d){var C=d.callback,$=d.args;switch($.length){case 0:C();break;case 1:C($[0]);break;case 2:C($[0],$[1]);break;case 3:C($[0],$[1],$[2]);break;default:C.apply(void 0,$)}})(A)}finally{j(M),g=!1}}}}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(62)},function(e,t,n){(function(r,i){var s=n(16);e.exports=A;var l,o=n(42);A.ReadableState=M,n(21).EventEmitter;var c=function(O,p){return O.listeners(p).length},u=n(63),f=n(44).Buffer,E=r.Uint8Array||function(){},w=Object.create(n(17));w.inherits=n(7);var h=n(144),g=void 0;g=h&&h.debuglog?h.debuglog("stream"):function(){};var b,R=n(145),j=n(64);w.inherits(A,u);var F=["error","close","destroy","pause","resume"];function M(O,p){O=O||{};var U=p instanceof(l=l||n(36));this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.readableObjectMode);var V=O.highWaterMark,Q=O.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=V||V===0?V:U&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new R,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.destroyed=!1,this.defaultEncoding=O.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,O.encoding&&(b||(b=n(22).StringDecoder),this.decoder=new b(O.encoding),this.encoding=O.encoding)}function A(O){if(l=l||n(36),!(this instanceof A))return new A(O);this._readableState=new M(O,this),this.readable=!0,O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy)),u.call(this)}function d(O,p,U,V,Q){var ee,ne=O._readableState;return p===null?(ne.reading=!1,function(Y,G){if(!G.ended){if(G.decoder){var S=G.decoder.end();S&&S.length&&(G.buffer.push(S),G.length+=G.objectMode?1:S.length)}G.ended=!0,q(Y)}}(O,ne)):(Q||(ee=function(Y,G){var S;T=G,f.isBuffer(T)||T instanceof E||typeof G=="string"||G===void 0||Y.objectMode||(S=new TypeError("Invalid non-string/buffer chunk"));var T;return S}(ne,p)),ee?O.emit("error",ee):ne.objectMode||p&&p.length>0?(typeof p=="string"||ne.objectMode||Object.getPrototypeOf(p)===f.prototype||(p=function(Y){return f.from(Y)}(p)),V?ne.endEmitted?O.emit("error",new Error("stream.unshift() after end event")):C(O,ne,p,!0):ne.ended?O.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!U?(p=ne.decoder.write(p),ne.objectMode||p.length!==0?C(O,ne,p,!1):m(O,ne)):C(O,ne,p,!1))):V||(ne.reading=!1)),function(Y){return!Y.ended&&(Y.needReadable||Y.length<Y.highWaterMark||Y.length===0)}(ne)}function C(O,p,U,V){p.flowing&&p.length===0&&!p.sync?(O.emit("data",U),O.read(0)):(p.length+=p.objectMode?1:U.length,V?p.buffer.unshift(U):p.buffer.push(U),p.needReadable&&q(O)),m(O,p)}Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(O){this._readableState&&(this._readableState.destroyed=O)}}),A.prototype.destroy=j.destroy,A.prototype._undestroy=j.undestroy,A.prototype._destroy=function(O,p){this.push(null),p(O)},A.prototype.push=function(O,p){var U,V=this._readableState;return V.objectMode?U=!0:typeof O=="string"&&((p=p||V.defaultEncoding)!==V.encoding&&(O=f.from(O,p),p=""),U=!0),d(this,O,p,!1,U)},A.prototype.unshift=function(O){return d(this,O,null,!0,!1)},A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(O){return b||(b=n(22).StringDecoder),this._readableState.decoder=new b(O),this._readableState.encoding=O,this};function $(O,p){return O<=0||p.length===0&&p.ended?0:p.objectMode?1:O!=O?p.flowing&&p.length?p.buffer.head.data.length:p.length:(O>p.highWaterMark&&(p.highWaterMark=function(U){return U>=8388608?U=8388608:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}(O)),O<=p.length?O:p.ended?p.length:(p.needReadable=!0,0))}function q(O){var p=O._readableState;p.needReadable=!1,p.emittedReadable||(g("emitReadable",p.flowing),p.emittedReadable=!0,p.sync?s.nextTick(y,O):y(O))}function y(O){g("emit readable"),O.emit("readable"),W(O)}function m(O,p){p.readingMore||(p.readingMore=!0,s.nextTick(I,O,p))}function I(O,p){for(var U=p.length;!p.reading&&!p.flowing&&!p.ended&&p.length<p.highWaterMark&&(g("maybeReadMore read 0"),O.read(0),U!==p.length);)U=p.length;p.readingMore=!1}function _(O){g("readable nexttick read 0"),O.read(0)}function L(O,p){p.reading||(g("resume read 0"),O.read(0)),p.resumeScheduled=!1,p.awaitDrain=0,O.emit("resume"),W(O),p.flowing&&!p.reading&&O.read(0)}function W(O){var p=O._readableState;for(g("flow",p.flowing);p.flowing&&O.read()!==null;);}function B(O,p){return p.length===0?null:(p.objectMode?U=p.buffer.shift():!O||O>=p.length?(U=p.decoder?p.buffer.join(""):p.buffer.length===1?p.buffer.head.data:p.buffer.concat(p.length),p.buffer.clear()):U=function(V,Q,ee){var ne;return V<Q.head.data.length?(ne=Q.head.data.slice(0,V),Q.head.data=Q.head.data.slice(V)):ne=V===Q.head.data.length?Q.shift():ee?function(Y,G){var S=G.head,T=1,k=S.data;for(Y-=k.length;S=S.next;){var J=S.data,K=Y>J.length?J.length:Y;if(K===J.length?k+=J:k+=J.slice(0,Y),(Y-=K)===0){K===J.length?(++T,S.next?G.head=S.next:G.head=G.tail=null):(G.head=S,S.data=J.slice(K));break}++T}return G.length-=T,k}(V,Q):function(Y,G){var S=f.allocUnsafe(Y),T=G.head,k=1;for(T.data.copy(S),Y-=T.data.length;T=T.next;){var J=T.data,K=Y>J.length?J.length:Y;if(J.copy(S,S.length-Y,0,K),(Y-=K)===0){K===J.length?(++k,T.next?G.head=T.next:G.head=G.tail=null):(G.head=T,T.data=J.slice(K));break}++k}return G.length-=k,S}(V,Q),ne}(O,p.buffer,p.decoder),U);var U}function N(O){var p=O._readableState;if(p.length>0)throw new Error('"endReadable()" called on non-empty stream');p.endEmitted||(p.ended=!0,s.nextTick(D,p,O))}function D(O,p){O.endEmitted||O.length!==0||(O.endEmitted=!0,p.readable=!1,p.emit("end"))}function z(O,p){for(var U=0,V=O.length;U<V;U++)if(O[U]===p)return U;return-1}A.prototype.read=function(O){g("read",O),O=parseInt(O,10);var p=this._readableState,U=O;if(O!==0&&(p.emittedReadable=!1),O===0&&p.needReadable&&(p.length>=p.highWaterMark||p.ended))return g("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?N(this):q(this),null;if((O=$(O,p))===0&&p.ended)return p.length===0&&N(this),null;var V,Q=p.needReadable;return g("need readable",Q),(p.length===0||p.length-O<p.highWaterMark)&&g("length less than watermark",Q=!0),p.ended||p.reading?g("reading or ended",Q=!1):Q&&(g("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(O=$(U,p))),(V=O>0?B(O,p):null)===null?(p.needReadable=!0,O=0):p.length-=O,p.length===0&&(p.ended||(p.needReadable=!0),U!==O&&p.ended&&N(this)),V!==null&&this.emit("data",V),V},A.prototype._read=function(O){this.emit("error",new Error("_read() is not implemented"))},A.prototype.pipe=function(O,p){var U=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=O;break;case 1:V.pipes=[V.pipes,O];break;default:V.pipes.push(O)}V.pipesCount+=1,g("pipe count=%d opts=%j",V.pipesCount,p);var Q=(!p||p.end!==!1)&&O!==i.stdout&&O!==i.stderr?ne:re;function ee(se,fe){g("onunpipe"),se===U&&fe&&fe.hasUnpiped===!1&&(fe.hasUnpiped=!0,g("cleanup"),O.removeListener("close",J),O.removeListener("finish",K),O.removeListener("drain",Y),O.removeListener("error",k),O.removeListener("unpipe",ee),U.removeListener("end",ne),U.removeListener("end",re),U.removeListener("data",T),G=!0,!V.awaitDrain||O._writableState&&!O._writableState.needDrain||Y())}function ne(){g("onend"),O.end()}V.endEmitted?s.nextTick(Q):U.once("end",Q),O.on("unpipe",ee);var Y=function(se){return function(){var fe=se._readableState;g("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&c(se,"data")&&(fe.flowing=!0,W(se))}}(U);O.on("drain",Y);var G=!1,S=!1;function T(se){g("ondata"),S=!1,O.write(se)!==!1||S||((V.pipesCount===1&&V.pipes===O||V.pipesCount>1&&z(V.pipes,O)!==-1)&&!G&&(g("false write response, pause",U._readableState.awaitDrain),U._readableState.awaitDrain++,S=!0),U.pause())}function k(se){g("onerror",se),re(),O.removeListener("error",k),c(O,"error")===0&&O.emit("error",se)}function J(){O.removeListener("finish",K),re()}function K(){g("onfinish"),O.removeListener("close",J),re()}function re(){g("unpipe"),U.unpipe(O)}return U.on("data",T),function(se,fe,ve){if(typeof se.prependListener=="function")return se.prependListener(fe,ve);se._events&&se._events[fe]?o(se._events[fe])?se._events[fe].unshift(ve):se._events[fe]=[ve,se._events[fe]]:se.on(fe,ve)}(O,"error",k),O.once("close",J),O.once("finish",K),O.emit("pipe",U),V.flowing||(g("pipe resume"),U.resume()),O},A.prototype.unpipe=function(O){var p=this._readableState,U={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return O&&O!==p.pipes||(O||(O=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,O&&O.emit("unpipe",this,U)),this;if(!O){var V=p.pipes,Q=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var ee=0;ee<Q;ee++)V[ee].emit("unpipe",this,U);return this}var ne=z(p.pipes,O);return ne===-1||(p.pipes.splice(ne,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),O.emit("unpipe",this,U)),this},A.prototype.on=function(O,p){var U=u.prototype.on.call(this,O,p);if(O==="data")this._readableState.flowing!==!1&&this.resume();else if(O==="readable"){var V=this._readableState;V.endEmitted||V.readableListening||(V.readableListening=V.needReadable=!0,V.emittedReadable=!1,V.reading?V.length&&q(this):s.nextTick(_,this))}return U},A.prototype.addListener=A.prototype.on,A.prototype.resume=function(){var O=this._readableState;return O.flowing||(g("resume"),O.flowing=!0,function(p,U){U.resumeScheduled||(U.resumeScheduled=!0,s.nextTick(L,p,U))}(this,O)),this},A.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this},A.prototype.wrap=function(O){var p=this,U=this._readableState,V=!1;for(var Q in O.on("end",function(){if(g("wrapped end"),U.decoder&&!U.ended){var ne=U.decoder.end();ne&&ne.length&&p.push(ne)}p.push(null)}),O.on("data",function(ne){g("wrapped data"),U.decoder&&(ne=U.decoder.write(ne)),U.objectMode&&ne==null||(U.objectMode||ne&&ne.length)&&(p.push(ne)||(V=!0,O.pause()))}),O)this[Q]===void 0&&typeof O[Q]=="function"&&(this[Q]=function(ne){return function(){return O[ne].apply(O,arguments)}}(Q));for(var ee=0;ee<F.length;ee++)O.on(F[ee],this.emit.bind(this,F[ee]));return this._read=function(ne){g("wrapped _read",ne),V&&(V=!1,O.resume())},this},Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),A._fromList=B}).call(this,n(6),n(2))},function(e,t){},function(e,t,n){var r=n(44).Buffer,i=n(146);e.exports=function(){function s(){(function(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")})(this,s),this.head=null,this.tail=null,this.length=0}return s.prototype.push=function(l){var o={data:l,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},s.prototype.unshift=function(l){var o={data:l,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},s.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},s.prototype.clear=function(){this.head=this.tail=null,this.length=0},s.prototype.join=function(l){if(this.length===0)return"";for(var o=this.head,c=""+o.data;o=o.next;)c+=l+o.data;return c},s.prototype.concat=function(l){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var o,c,u,f=r.allocUnsafe(l>>>0),E=this.head,w=0;E;)o=E.data,c=f,u=w,o.copy(c,u),w+=E.data.length,E=E.next;return f},s}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var s=i.inspect({length:this.length});return this.constructor.name+" "+s})},function(e,t){},function(e,t,n){var r=n(5),i=r.Buffer;function s(o,c){for(var u in o)c[u]=o[u]}function l(o,c,u){return i(o,c,u)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=l),s(i,l),l.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return i(o,c,u)},l.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var f=i(o);return c!==void 0?typeof u=="string"?f.fill(c,u):f.fill(c):f.fill(0),f},l.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return i(o)},l.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}},function(e,t,n){var r=n(13),i=n(3).LEVEL,s=n(20),l=e.exports=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(s.call(this,o),!o.transport||typeof o.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");function c(u){this.emit("error",u,this.transport)}this.transport=o.transport,this.level=this.level||o.transport.level,this.handleExceptions=this.handleExceptions||o.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=c.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(l,s),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);(!this.level||this.levels[this.level]>=this.levels[o[i]])&&this.transport.log(o[i],o.message,o,this._nop),u(null)},l.prototype._writev=function(o,c){for(var u=0;u<o.length;u++)this._accept(o[u])&&(this.transport.log(o[u].chunk[i],o[u].chunk.message,o[u].chunk,this._nop),o[u].callback());return c(null)},l.prototype._deprecated=function(){console.error([this.transport.name+" is a legacy winston transport. Consider upgrading: ","- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
43
|
+
`))},l.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){(function(r,i){function s(y){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(y)}function l(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function o(y,m){for(var I=0;I<m.length;I++){var _=m[I];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}function c(y,m){return(c=Object.setPrototypeOf||function(I,_){return I.__proto__=_,I})(y,m)}function u(y){var m=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var I,_=w(y);if(m){var L=w(this).constructor;I=Reflect.construct(_,arguments,L)}else I=_.apply(this,arguments);return f(this,I)}}function f(y,m){return!m||s(m)!=="object"&&typeof m!="function"?E(y):m}function E(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function w(y){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)})(y)}var h=n(65),g=n(56),b=n(150),R=n(160),j=n(3).MESSAGE,F=n(32),M=F.Stream,A=F.PassThrough,d=n(20),C=n(38)("winston:file"),$=n(18),q=n(188);e.exports=function(y){(function(W,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");W.prototype=Object.create(B&&B.prototype,{constructor:{value:W,writable:!0,configurable:!0}}),B&&c(W,B)})(L,y);var m,I,_=u(L);function L(){var W,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function N(D){for(var z=arguments.length,O=new Array(z>1?z-1:0),p=1;p<z;p++)O[p-1]=arguments[p];O.slice(1).forEach(function(U){if(B[U])throw new Error("Cannot set ".concat(U," and ").concat(D," together"))})}if(l(this,L),(W=_.call(this,B)).name=B.name||"file",W._stream=new A,W._stream.setMaxListeners(30),W._onError=W._onError.bind(E(W)),B.filename||B.dirname)N("filename or dirname","stream"),W._basename=W.filename=B.filename?g.basename(B.filename):"winston.log",W.dirname=B.dirname||g.dirname(B.filename),W.options=B.options||{flags:"a"};else{if(!B.stream)throw new Error("Cannot log to file without filename or stream.");console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),N("stream","filename","maxsize"),W._dest=W._stream.pipe(W._setupStream(B.stream)),W.dirname=g.dirname(W._dest.path)}return W.maxsize=B.maxsize||null,W.rotationFormat=B.rotationFormat||!1,W.zippedArchive=B.zippedArchive||!1,W.maxFiles=B.maxFiles||null,W.eol=B.eol||$.EOL,W.tailable=B.tailable||!1,W._size=0,W._pendingSize=0,W._created=0,W._drain=!1,W._opening=!1,W._ending=!1,W.dirname&&W._createLogDirIfNotExist(W.dirname),W.open(),W}return m=L,(I=[{key:"finishIfEnding",value:function(){var W=this;this._ending&&(this._opening?this.once("open",function(){W._stream.once("finish",function(){return W.emit("finish")}),r(function(){return W._stream.end()})}):(this._stream.once("finish",function(){return W.emit("finish")}),r(function(){return W._stream.end()})))}},{key:"log",value:function(W){var B=this,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return N(),!0;if(this._drain)this._stream.once("drain",function(){B._drain=!1,B.log(W,N)});else{if(!this._rotate){var D="".concat(W[j]).concat(this.eol),z=i.byteLength(D);this._pendingSize+=z,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var O=this._stream.write(D,p.bind(this));return O?N():(this._drain=!0,this._stream.once("drain",function(){B._drain=!1,N()})),C("written",O,this._drain),this.finishIfEnding(),O}this._stream.once("rotate",function(){B._rotate=!1,B.log(W,N)})}function p(){var U=this;this._size+=z,this._pendingSize-=z,C("logged %s %s",this._size,D),this.emit("logged",W),this._opening||this._needsNewFile()&&(this._rotate=!0,this._endStream(function(){return U._rotateFile()}))}}},{key:"query",value:function(W,B){typeof W=="function"&&(B=W,W={}),W=function(V){return(V=V||{}).rows=V.rows||V.limit||10,V.start=V.start||0,V.until=V.until||new Date,s(V.until)!=="object"&&(V.until=new Date(V.until)),V.from=V.from||V.until-864e5,s(V.from)!=="object"&&(V.from=new Date(V.from)),V.order=V.order||"desc",V}(W);var N=g.join(this.dirname,this.filename),D="",z=[],O=0,p=h.createReadStream(N,{encoding:"utf8"});function U(V,Q){try{var ee=JSON.parse(V);(function(ne){if(ne&&s(ne)==="object"){var Y=new Date(ne.timestamp);if(!(W.from&&Y<W.from||W.until&&Y>W.until||W.level&&W.level!==ne.level))return!0}})(ee)&&function(ne){W.rows&&z.length>=W.rows&&W.order!=="desc"?p.readable&&p.destroy():(W.fields&&(ne=W.fields.reduce(function(Y,G){return Y[G]=ne[G],Y},{})),W.order==="desc"&&z.length>=W.rows&&z.shift(),z.push(ne))}(ee)}catch(ne){Q||p.emit("error",ne)}}p.on("error",function(V){if(p.readable&&p.destroy(),B)return V.code!=="ENOENT"?B(V):B(null,z)}),p.on("data",function(V){for(var Q=(V=(D+V).split(/\n+/)).length-1,ee=0;ee<Q;ee++)(!W.start||O>=W.start)&&U(V[ee]),O++;D=V[Q]}),p.on("close",function(){D&&U(D,!0),W.order==="desc"&&(z=z.reverse()),B&&B(null,z)})}},{key:"stream",value:function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=g.join(this.dirname,this.filename),N=new M,D={file:B,start:W.start};return N.destroy=q(D,function(z,O){if(z)return N.emit("error",z);try{N.emit("data",O),O=JSON.parse(O),N.emit("log",O)}catch(p){N.emit("error",p)}}),N}},{key:"open",value:function(){var W=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(B,N){if(B)return W.emit("error",B);C("stat done: %s { size: %s }",W.filename,N),W._size=N,W._dest=W._createStream(W._stream),W._opening=!1,W.once("open",function(){W._stream.eventNames().includes("rotate")?W._stream.emit("rotate"):W._rotate=!1})})))}},{key:"stat",value:function(W){var B=this,N=this._getFile(),D=g.join(this.dirname,N);h.stat(D,function(z,O){return z&&z.code==="ENOENT"?(C("ENOENT ok",D),B.filename=N,W(null,0)):z?(C("err ".concat(z.code," ").concat(D)),W(z)):!O||B._needsNewFile(O.size)?B._incFile(function(){return B.stat(W)}):(B.filename=N,void W(null,O.size))})}},{key:"close",value:function(W){var B=this;this._stream&&this._stream.end(function(){W&&W(),B.emit("flush"),B.emit("closed")})}},{key:"_needsNewFile",value:function(W){return W=W||this._size,this.maxsize&&W>=this.maxsize}},{key:"_onError",value:function(W){this.emit("error",W)}},{key:"_setupStream",value:function(W){return W.on("error",this._onError),W}},{key:"_cleanupStream",value:function(W){return W.removeListener("error",this._onError),W}},{key:"_rotateFile",value:function(){var W=this;this._incFile(function(){return W.open()})}},{key:"_endStream",value:function(){var W=this,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){W._cleanupStream(W._dest),B()})):B()}},{key:"_createStream",value:function(W){var B=this,N=g.join(this.dirname,this.filename);C("create stream start",N,this.options);var D=h.createWriteStream(N,this.options).on("error",function(O){return C(O)}).on("close",function(){return C("close",D.path,D.bytesWritten)}).on("open",function(){C("file open ok",N),B.emit("open",N),W.pipe(D),B.rotatedWhileOpening&&(B._stream=new A,B._stream.setMaxListeners(30),B._rotateFile(),B.rotatedWhileOpening=!1,B._cleanupStream(D),W.end())});if(C("create stream ok",N),this.zippedArchive){var z=R.createGzip();return z.pipe(D),z}return D}},{key:"_incFile",value:function(W){C("_incFile",this.filename);var B=g.extname(this._basename),N=g.basename(this._basename,B);this.tailable?this._checkMaxFilesTailable(B,N,W):(this._created+=1,this._checkMaxFilesIncrementing(B,N,W))}},{key:"_getFile",value:function(){var W=g.extname(this._basename),B=g.basename(this._basename,W),N=this.rotationFormat?this.rotationFormat():this._created,D=!this.tailable&&this._created?"".concat(B).concat(N).concat(W):"".concat(B).concat(W);return this.zippedArchive&&!this.tailable?"".concat(D,".gz"):D}},{key:"_checkMaxFilesIncrementing",value:function(W,B,N){if(!this.maxFiles||this._created<this.maxFiles)return r(N);var D=this._created-this.maxFiles,z=D!==0?D:"",O=this.zippedArchive?".gz":"",p="".concat(B).concat(z).concat(W).concat(O),U=g.join(this.dirname,p);h.unlink(U,N)}},{key:"_checkMaxFilesTailable",value:function(W,B,N){var D=this,z=[];if(this.maxFiles){for(var O=this.zippedArchive?".gz":"",p=this.maxFiles-1;p>1;p--)z.push(function(U,V){var Q=this,ee="".concat(B).concat(U-1).concat(W).concat(O),ne=g.join(this.dirname,ee);h.exists(ne,function(Y){if(!Y)return V(null);ee="".concat(B).concat(U).concat(W).concat(O),h.rename(ne,g.join(Q.dirname,ee),V)})}.bind(this,p));b(z,function(){h.rename(g.join(D.dirname,"".concat(B).concat(W)),g.join(D.dirname,"".concat(B,"1").concat(W).concat(O)),N)})}}},{key:"_createLogDirIfNotExist",value:function(W){h.existsSync(W)||h.mkdirSync(W,{recursive:!0})}}])&&o(m.prototype,I),L}(d)}).call(this,n(15).setImmediate,n(5).Buffer)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(l,o){return(0,r.default)(i.default,l,o)};var r=s(n(151)),i=s(n(155));function s(l){return l&&l.__esModule?l:{default:l}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(45)),i=l(n(25)),s=l(n(30));function l(o){return o&&o.__esModule?o:{default:o}}t.default=(0,s.default)((o,c,u)=>{var f=(0,r.default)(c)?[]:{};o(c,(E,w,h)=>{(0,i.default)(E)((g,...b)=>{b.length<2&&([b]=b),f[w]=b,h(g)})},E=>u(E,f))},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u){return(0,s.isAsync)(u)?function(...f){const E=f.pop();return o(u.apply(this,f),E)}:(0,r.default)(function(f,E){var w;try{w=u.apply(this,f)}catch(h){return E(h)}if(w&&typeof w.then=="function")return o(w,E);E(null,w)})};var r=l(n(153)),i=l(n(154)),s=n(25);function l(u){return u&&u.__esModule?u:{default:u}}function o(u,f){return u.then(E=>{c(f,null,E)},E=>{c(f,E&&E.message?E:new Error(E))})}function c(u,f,E){try{u(f,E)}catch(w){(0,i.default)(h=>{throw h},w)}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...i){var s=i.pop();return r.call(this,i,s)}},e.exports=t.default},function(e,t,n){(function(r,i){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=u,t.wrap=f;var s,l=t.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,o=t.hasSetImmediate=typeof r=="function"&&r,c=t.hasNextTick=typeof i=="object"&&typeof i.nextTick=="function";function u(E){setTimeout(E,0)}function f(E){return(w,...h)=>E(()=>w(...h))}s=l?queueMicrotask:o?r:c?i.nextTick:u,t.default=f(s)}).call(this,n(15).setImmediate,n(2))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(66)),i=s(n(30));function s(l){return l&&l.__esModule?l:{default:l}}t.default=(0,i.default)(function(l,o,c){return(0,r.default)(l,1,o,c)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(67)),i=u(n(157)),s=u(n(68)),l=n(25),o=u(n(159)),c=u(n(46));function u(f){return f&&f.__esModule?f:{default:f}}t.default=f=>(E,w,h)=>{if(h=(0,r.default)(h),f<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!E)return h(null);if((0,l.isAsyncGenerator)(E))return(0,o.default)(E,f,w,h);if((0,l.isAsyncIterable)(E))return(0,o.default)(E[Symbol.asyncIterator](),f,w,h);var g=(0,i.default)(E),b=!1,R=!1,j=0,F=!1;function M(d,C){if(!R)if(j-=1,d)b=!0,h(d);else if(d===!1)b=!0,R=!0;else{if(C===c.default||b&&j<=0)return b=!0,h(null);F||A()}}function A(){for(F=!0;j<f&&!b;){var d=g();if(d===null)return b=!0,void(j<=0&&h(null));j+=1,w(d.value,d.key,(0,s.default)(M))}F=!1}A()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(l){if((0,r.default)(l))return function(w){var h=-1,g=w.length;return function(){return++h<g?{value:w[h],key:h}:null}}(l);var o=(0,i.default)(l);return o?function(w){var h=-1;return function(){var g=w.next();return g.done?null:(h++,{value:g.value,key:h})}}(o):(c=l,u=c?Object.keys(c):[],f=-1,E=u.length,function w(){var h=u[++f];return h==="__proto__"?w():f<E?{value:c[h],key:h}:null});var c,u,f,E};var r=s(n(45)),i=s(n(158));function s(l){return l&&l.__esModule?l:{default:l}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(l,o,c,u){let f=!1,E=!1,w=!1,h=0,g=0;function b(){h>=o||w||f||(w=!0,l.next().then(({value:F,done:M})=>{if(!E&&!f){if(w=!1,M)return f=!0,void(h<=0&&u(null));h++,c(F,g,R),g++,b()}}).catch(j))}function R(F,M){if(h-=1,!E)return F?j(F):F===!1?(f=!0,void(E=!0)):M===s.default||f&&h<=0?(f=!0,u(null)):void b()}function j(F){E||(w=!1,f=!0,u(F))}b()};var r,i=n(46),s=(r=i)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){(function(r){var i=n(5).Buffer,s=n(161).Transform,l=n(169),o=n(13),c=n(74).ok,u=n(5).kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";l.Z_MIN_WINDOWBITS=8,l.Z_MAX_WINDOWBITS=15,l.Z_DEFAULT_WINDOWBITS=15,l.Z_MIN_CHUNK=64,l.Z_MAX_CHUNK=1/0,l.Z_DEFAULT_CHUNK=16384,l.Z_MIN_MEMLEVEL=1,l.Z_MAX_MEMLEVEL=9,l.Z_DEFAULT_MEMLEVEL=8,l.Z_MIN_LEVEL=-1,l.Z_MAX_LEVEL=9,l.Z_DEFAULT_LEVEL=l.Z_DEFAULT_COMPRESSION;for(var E=Object.keys(l),w=0;w<E.length;w++){var h=E[w];h.match(/^Z/)&&Object.defineProperty(t,h,{enumerable:!0,value:l[h],writable:!1})}for(var g={Z_OK:l.Z_OK,Z_STREAM_END:l.Z_STREAM_END,Z_NEED_DICT:l.Z_NEED_DICT,Z_ERRNO:l.Z_ERRNO,Z_STREAM_ERROR:l.Z_STREAM_ERROR,Z_DATA_ERROR:l.Z_DATA_ERROR,Z_MEM_ERROR:l.Z_MEM_ERROR,Z_BUF_ERROR:l.Z_BUF_ERROR,Z_VERSION_ERROR:l.Z_VERSION_ERROR},b=Object.keys(g),R=0;R<b.length;R++){var j=b[R];g[g[j]]=j}function F(B,N,D){var z=[],O=0;function p(){for(var V;(V=B.read())!==null;)z.push(V),O+=V.length;B.once("readable",p)}function U(){var V,Q=null;O>=u?Q=new RangeError(f):V=i.concat(z,O),z=[],B.close(),D(Q,V)}B.on("error",function(V){B.removeListener("end",U),B.removeListener("readable",p),D(V)}),B.on("end",U),B.end(N),p()}function M(B,N){if(typeof N=="string"&&(N=i.from(N)),!i.isBuffer(N))throw new TypeError("Not a string or buffer");var D=B._finishFlushFlag;return B._processChunk(N,D)}function A(B){if(!(this instanceof A))return new A(B);_.call(this,B,l.DEFLATE)}function d(B){if(!(this instanceof d))return new d(B);_.call(this,B,l.INFLATE)}function C(B){if(!(this instanceof C))return new C(B);_.call(this,B,l.GZIP)}function $(B){if(!(this instanceof $))return new $(B);_.call(this,B,l.GUNZIP)}function q(B){if(!(this instanceof q))return new q(B);_.call(this,B,l.DEFLATERAW)}function y(B){if(!(this instanceof y))return new y(B);_.call(this,B,l.INFLATERAW)}function m(B){if(!(this instanceof m))return new m(B);_.call(this,B,l.UNZIP)}function I(B){return B===l.Z_NO_FLUSH||B===l.Z_PARTIAL_FLUSH||B===l.Z_SYNC_FLUSH||B===l.Z_FULL_FLUSH||B===l.Z_FINISH||B===l.Z_BLOCK}function _(B,N){var D=this;if(this._opts=B=B||{},this._chunkSize=B.chunkSize||t.Z_DEFAULT_CHUNK,s.call(this,B),B.flush&&!I(B.flush))throw new Error("Invalid flush flag: "+B.flush);if(B.finishFlush&&!I(B.finishFlush))throw new Error("Invalid flush flag: "+B.finishFlush);if(this._flushFlag=B.flush||l.Z_NO_FLUSH,this._finishFlushFlag=B.finishFlush!==void 0?B.finishFlush:l.Z_FINISH,B.chunkSize&&(B.chunkSize<t.Z_MIN_CHUNK||B.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+B.chunkSize);if(B.windowBits&&(B.windowBits<t.Z_MIN_WINDOWBITS||B.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+B.windowBits);if(B.level&&(B.level<t.Z_MIN_LEVEL||B.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+B.level);if(B.memLevel&&(B.memLevel<t.Z_MIN_MEMLEVEL||B.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+B.memLevel);if(B.strategy&&B.strategy!=t.Z_FILTERED&&B.strategy!=t.Z_HUFFMAN_ONLY&&B.strategy!=t.Z_RLE&&B.strategy!=t.Z_FIXED&&B.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+B.strategy);if(B.dictionary&&!i.isBuffer(B.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new l.Zlib(N);var z=this;this._hadError=!1,this._handle.onerror=function(U,V){L(z),z._hadError=!0;var Q=new Error(U);Q.errno=V,Q.code=t.codes[V],z.emit("error",Q)};var O=t.Z_DEFAULT_COMPRESSION;typeof B.level=="number"&&(O=B.level);var p=t.Z_DEFAULT_STRATEGY;typeof B.strategy=="number"&&(p=B.strategy),this._handle.init(B.windowBits||t.Z_DEFAULT_WINDOWBITS,O,B.memLevel||t.Z_DEFAULT_MEMLEVEL,p,B.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=O,this._strategy=p,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!D._handle},configurable:!0,enumerable:!0})}function L(B,N){N&&r.nextTick(N),B._handle&&(B._handle.close(),B._handle=null)}function W(B){B.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(g),writable:!1}),t.Deflate=A,t.Inflate=d,t.Gzip=C,t.Gunzip=$,t.DeflateRaw=q,t.InflateRaw=y,t.Unzip=m,t.createDeflate=function(B){return new A(B)},t.createInflate=function(B){return new d(B)},t.createDeflateRaw=function(B){return new q(B)},t.createInflateRaw=function(B){return new y(B)},t.createGzip=function(B){return new C(B)},t.createGunzip=function(B){return new $(B)},t.createUnzip=function(B){return new m(B)},t.deflate=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new A(N),B,D)},t.deflateSync=function(B,N){return M(new A(N),B)},t.gzip=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new C(N),B,D)},t.gzipSync=function(B,N){return M(new C(N),B)},t.deflateRaw=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new q(N),B,D)},t.deflateRawSync=function(B,N){return M(new q(N),B)},t.unzip=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new m(N),B,D)},t.unzipSync=function(B,N){return M(new m(N),B)},t.inflate=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new d(N),B,D)},t.inflateSync=function(B,N){return M(new d(N),B)},t.gunzip=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new $(N),B,D)},t.gunzipSync=function(B,N){return M(new $(N),B)},t.inflateRaw=function(B,N,D){return typeof N=="function"&&(D=N,N={}),F(new y(N),B,D)},t.inflateRawSync=function(B,N){return M(new y(N),B)},o.inherits(_,s),_.prototype.params=function(B,N,D){if(B<t.Z_MIN_LEVEL||B>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+B);if(N!=t.Z_FILTERED&&N!=t.Z_HUFFMAN_ONLY&&N!=t.Z_RLE&&N!=t.Z_FIXED&&N!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+N);if(this._level!==B||this._strategy!==N){var z=this;this.flush(l.Z_SYNC_FLUSH,function(){c(z._handle,"zlib binding closed"),z._handle.params(B,N),z._hadError||(z._level=B,z._strategy=N,D&&D())})}else r.nextTick(D)},_.prototype.reset=function(){return c(this._handle,"zlib binding closed"),this._handle.reset()},_.prototype._flush=function(B){this._transform(i.alloc(0),"",B)},_.prototype.flush=function(B,N){var D=this,z=this._writableState;(typeof B=="function"||B===void 0&&!N)&&(N=B,B=l.Z_FULL_FLUSH),z.ended?N&&r.nextTick(N):z.ending?N&&this.once("end",N):z.needDrain?N&&this.once("drain",function(){return D.flush(B,N)}):(this._flushFlag=B,this.write(i.alloc(0),"",N))},_.prototype.close=function(B){L(this,B),r.nextTick(W,this)},_.prototype._transform=function(B,N,D){var z,O=this._writableState,p=(O.ending||O.ended)&&(!B||O.length===B.length);return B===null||i.isBuffer(B)?this._handle?(p?z=this._finishFlushFlag:(z=this._flushFlag,B.length>=O.length&&(this._flushFlag=this._opts.flush||l.Z_NO_FLUSH)),void this._processChunk(B,z,D)):D(new Error("zlib binding closed")):D(new Error("invalid input"))},_.prototype._processChunk=function(B,N,D){var z=B&&B.length,O=this._chunkSize-this._offset,p=0,U=this,V=typeof D=="function";if(!V){var Q,ee=[],ne=0;this.on("error",function(k){Q=k}),c(this._handle,"zlib binding closed");do var Y=this._handle.writeSync(N,B,p,z,this._buffer,this._offset,O);while(!this._hadError&&T(Y[0],Y[1]));if(this._hadError)throw Q;if(ne>=u)throw L(this),new RangeError(f);var G=i.concat(ee,ne);return L(this),G}c(this._handle,"zlib binding closed");var S=this._handle.write(N,B,p,z,this._buffer,this._offset,O);function T(k,J){if(this&&(this.buffer=null,this.callback=null),!U._hadError){var K=O-J;if(c(K>=0,"have should not go down"),K>0){var re=U._buffer.slice(U._offset,U._offset+K);U._offset+=K,V?U.push(re):(ee.push(re),ne+=re.length)}if((J===0||U._offset>=U._chunkSize)&&(O=U._chunkSize,U._offset=0,U._buffer=i.allocUnsafe(U._chunkSize)),J===0){if(p+=z-k,z=k,!V)return!0;var se=U._handle.write(N,B,p,z,U._buffer,U._offset,U._chunkSize);return se.callback=T,void(se.buffer=B)}if(!V)return!1;D()}}S.buffer=B,S.callback=T},o.inherits(A,_),o.inherits(d,_),o.inherits(C,_),o.inherits($,_),o.inherits(q,_),o.inherits(y,_),o.inherits(m,_)}).call(this,n(2))},function(e,t,n){e.exports=i;var r=n(21).EventEmitter;function i(){r.call(this)}n(7)(i,r),i.Readable=n(31),i.Writable=n(73),i.Duplex=n(166),i.Transform=n(167),i.PassThrough=n(168),i.Stream=i,i.prototype.pipe=function(s,l){var o=this;function c(b){s.writable&&s.write(b)===!1&&o.pause&&o.pause()}function u(){o.readable&&o.resume&&o.resume()}o.on("data",c),s.on("drain",u),s._isStdio||l&&l.end===!1||(o.on("end",E),o.on("close",w));var f=!1;function E(){f||(f=!0,s.end())}function w(){f||(f=!0,typeof s.destroy=="function"&&s.destroy())}function h(b){if(g(),r.listenerCount(this,"error")===0)throw b}function g(){o.removeListener("data",c),s.removeListener("drain",u),o.removeListener("end",E),o.removeListener("close",w),o.removeListener("error",h),s.removeListener("error",h),o.removeListener("end",g),o.removeListener("close",g),s.removeListener("close",g)}return o.on("error",h),s.on("error",h),o.on("end",g),o.on("close",g),s.on("close",g),s.emit("pipe",o),s}},function(e,t){},function(e,t,n){var r=n(47).Buffer,i=n(164);e.exports=function(){function s(){(function(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")})(this,s),this.head=null,this.tail=null,this.length=0}return s.prototype.push=function(l){var o={data:l,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},s.prototype.unshift=function(l){var o={data:l,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},s.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},s.prototype.clear=function(){this.head=this.tail=null,this.length=0},s.prototype.join=function(l){if(this.length===0)return"";for(var o=this.head,c=""+o.data;o=o.next;)c+=l+o.data;return c},s.prototype.concat=function(l){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var o,c,u,f=r.allocUnsafe(l>>>0),E=this.head,w=0;E;)o=E.data,c=f,u=w,o.copy(c,u),w+=E.data.length,E=E.next;return f},s}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var s=i.inspect({length:this.length});return this.constructor.name+" "+s})},function(e,t){},function(e,t,n){e.exports=s;var r=n(72),i=n(17);function s(l){if(!(this instanceof s))return new s(l);r.call(this,l)}i.inherits=n(7),i.inherits(s,r),s.prototype._transform=function(l,o,c){c(null,l)}},function(e,t,n){e.exports=n(23)},function(e,t,n){e.exports=n(31).Transform},function(e,t,n){e.exports=n(31).PassThrough},function(e,t,n){(function(r,i){var s=n(74),l=n(171),o=n(172),c=n(175),u=n(178);for(var f in u)t[f]=u[f];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function E(w){if(typeof w!="number"||w<t.DEFLATE||w>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=w,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}E.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,s(this.init_done,"close before init"),s(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||c.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},E.prototype.write=function(w,h,g,b,R,j,F){return this._write(!0,w,h,g,b,R,j,F)},E.prototype.writeSync=function(w,h,g,b,R,j,F){return this._write(!1,w,h,g,b,R,j,F)},E.prototype._write=function(w,h,g,b,R,j,F,M){if(s.equal(arguments.length,8),s(this.init_done,"write before init"),s(this.mode!==t.NONE,"already finalized"),s.equal(!1,this.write_in_progress,"write already in progress"),s.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,s.equal(!1,h===void 0,"must provide flush value"),this.write_in_progress=!0,h!==t.Z_NO_FLUSH&&h!==t.Z_PARTIAL_FLUSH&&h!==t.Z_SYNC_FLUSH&&h!==t.Z_FULL_FLUSH&&h!==t.Z_FINISH&&h!==t.Z_BLOCK)throw new Error("Invalid flush value");if(g==null&&(g=r.alloc(0),R=0,b=0),this.strm.avail_in=R,this.strm.input=g,this.strm.next_in=b,this.strm.avail_out=M,this.strm.output=j,this.strm.next_out=F,this.flush=h,!w)return this._process(),this._checkError()?this._afterSync():void 0;var A=this;return i.nextTick(function(){A._process(),A._after()}),this},E.prototype._afterSync=function(){var w=this.strm.avail_out,h=this.strm.avail_in;return this.write_in_progress=!1,[h,w]},E.prototype._process=function(){var w=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(w=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(w===null)break;if(this.strm.input[w]!==31){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,w++,this.strm.avail_in===1)break;case 1:if(w===null)break;this.strm.input[w]===139?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=c.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=c.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=c.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=c.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},E.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},E.prototype._after=function(){if(this._checkError()){var w=this.strm.avail_out,h=this.strm.avail_in;this.write_in_progress=!1,this.callback(h,w),this.pending_close&&this.close()}},E.prototype._error=function(w){this.strm.msg&&(w=this.strm.msg),this.onerror(w,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},E.prototype.init=function(w,h,g,b,R){s(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),s(w>=8&&w<=15,"invalid windowBits"),s(h>=-1&&h<=9,"invalid compression level"),s(g>=1&&g<=9,"invalid memlevel"),s(b===t.Z_FILTERED||b===t.Z_HUFFMAN_ONLY||b===t.Z_RLE||b===t.Z_FIXED||b===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(h,w,g,b,R),this._setDictionary()},E.prototype.params=function(){throw new Error("deflateParams Not supported")},E.prototype.reset=function(){this._reset(),this._setDictionary()},E.prototype._init=function(w,h,g,b,R){switch(this.level=w,this.windowBits=h,this.memLevel=g,this.strategy=b,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new l,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=c.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=R,this.write_in_progress=!1,this.init_done=!0},E.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},E.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=c.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=E}).call(this,n(5).Buffer,n(2))},function(e,t,n){var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function l(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}e.exports=function(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var c={},u=0;u<10;u++)c["_"+String.fromCharCode(u)]=u;if(Object.getOwnPropertyNames(c).map(function(E){return c[E]}).join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(E){f[E]=E}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(o,c){for(var u,f,E=l(o),w=1;w<arguments.length;w++){for(var h in u=Object(arguments[w]))i.call(u,h)&&(E[h]=u[h]);if(r){f=r(u);for(var g=0;g<f.length;g++)s.call(u,f[g])&&(E[f[g]]=u[f[g]])}}return E}},function(e,t,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){var r,i=n(37),s=n(173),l=n(75),o=n(76),c=n(174);function u(y,m){return y.msg=c[m],m}function f(y){return(y<<1)-(y>4?9:0)}function E(y){for(var m=y.length;--m>=0;)y[m]=0}function w(y){var m=y.state,I=m.pending;I>y.avail_out&&(I=y.avail_out),I!==0&&(i.arraySet(y.output,m.pending_buf,m.pending_out,I,y.next_out),y.next_out+=I,m.pending_out+=I,y.total_out+=I,y.avail_out-=I,m.pending-=I,m.pending===0&&(m.pending_out=0))}function h(y,m){s._tr_flush_block(y,y.block_start>=0?y.block_start:-1,y.strstart-y.block_start,m),y.block_start=y.strstart,w(y.strm)}function g(y,m){y.pending_buf[y.pending++]=m}function b(y,m){y.pending_buf[y.pending++]=m>>>8&255,y.pending_buf[y.pending++]=255&m}function R(y,m){var I,_,L=y.max_chain_length,W=y.strstart,B=y.prev_length,N=y.nice_match,D=y.strstart>y.w_size-262?y.strstart-(y.w_size-262):0,z=y.window,O=y.w_mask,p=y.prev,U=y.strstart+258,V=z[W+B-1],Q=z[W+B];y.prev_length>=y.good_match&&(L>>=2),N>y.lookahead&&(N=y.lookahead);do if(z[(I=m)+B]===Q&&z[I+B-1]===V&&z[I]===z[W]&&z[++I]===z[W+1]){W+=2,I++;do;while(z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&z[++W]===z[++I]&&W<U);if(_=258-(U-W),W=U-258,_>B){if(y.match_start=m,B=_,_>=N)break;V=z[W+B-1],Q=z[W+B]}}while((m=p[m&O])>D&&--L!=0);return B<=y.lookahead?B:y.lookahead}function j(y){var m,I,_,L,W,B,N,D,z,O,p=y.w_size;do{if(L=y.window_size-y.lookahead-y.strstart,y.strstart>=p+(p-262)){i.arraySet(y.window,y.window,p,p,0),y.match_start-=p,y.strstart-=p,y.block_start-=p,m=I=y.hash_size;do _=y.head[--m],y.head[m]=_>=p?_-p:0;while(--I);m=I=p;do _=y.prev[--m],y.prev[m]=_>=p?_-p:0;while(--I);L+=p}if(y.strm.avail_in===0)break;if(B=y.strm,N=y.window,D=y.strstart+y.lookahead,z=L,O=void 0,(O=B.avail_in)>z&&(O=z),I=O===0?0:(B.avail_in-=O,i.arraySet(N,B.input,B.next_in,O,D),B.state.wrap===1?B.adler=l(B.adler,N,O,D):B.state.wrap===2&&(B.adler=o(B.adler,N,O,D)),B.next_in+=O,B.total_in+=O,O),y.lookahead+=I,y.lookahead+y.insert>=3)for(W=y.strstart-y.insert,y.ins_h=y.window[W],y.ins_h=(y.ins_h<<y.hash_shift^y.window[W+1])&y.hash_mask;y.insert&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[W+3-1])&y.hash_mask,y.prev[W&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=W,W++,y.insert--,!(y.lookahead+y.insert<3)););}while(y.lookahead<262&&y.strm.avail_in!==0)}function F(y,m){for(var I,_;;){if(y.lookahead<262){if(j(y),y.lookahead<262&&m===0)return 1;if(y.lookahead===0)break}if(I=0,y.lookahead>=3&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),I!==0&&y.strstart-I<=y.w_size-262&&(y.match_length=R(y,I)),y.match_length>=3)if(_=s._tr_tally(y,y.strstart-y.match_start,y.match_length-3),y.lookahead-=y.match_length,y.match_length<=y.max_lazy_match&&y.lookahead>=3){y.match_length--;do y.strstart++,y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart;while(--y.match_length!=0);y.strstart++}else y.strstart+=y.match_length,y.match_length=0,y.ins_h=y.window[y.strstart],y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+1])&y.hash_mask;else _=s._tr_tally(y,0,y.window[y.strstart]),y.lookahead--,y.strstart++;if(_&&(h(y,!1),y.strm.avail_out===0))return 1}return y.insert=y.strstart<2?y.strstart:2,m===4?(h(y,!0),y.strm.avail_out===0?3:4):y.last_lit&&(h(y,!1),y.strm.avail_out===0)?1:2}function M(y,m){for(var I,_,L;;){if(y.lookahead<262){if(j(y),y.lookahead<262&&m===0)return 1;if(y.lookahead===0)break}if(I=0,y.lookahead>=3&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),y.prev_length=y.match_length,y.prev_match=y.match_start,y.match_length=2,I!==0&&y.prev_length<y.max_lazy_match&&y.strstart-I<=y.w_size-262&&(y.match_length=R(y,I),y.match_length<=5&&(y.strategy===1||y.match_length===3&&y.strstart-y.match_start>4096)&&(y.match_length=2)),y.prev_length>=3&&y.match_length<=y.prev_length){L=y.strstart+y.lookahead-3,_=s._tr_tally(y,y.strstart-1-y.prev_match,y.prev_length-3),y.lookahead-=y.prev_length-1,y.prev_length-=2;do++y.strstart<=L&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+3-1])&y.hash_mask,I=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart);while(--y.prev_length!=0);if(y.match_available=0,y.match_length=2,y.strstart++,_&&(h(y,!1),y.strm.avail_out===0))return 1}else if(y.match_available){if((_=s._tr_tally(y,0,y.window[y.strstart-1]))&&h(y,!1),y.strstart++,y.lookahead--,y.strm.avail_out===0)return 1}else y.match_available=1,y.strstart++,y.lookahead--}return y.match_available&&(_=s._tr_tally(y,0,y.window[y.strstart-1]),y.match_available=0),y.insert=y.strstart<2?y.strstart:2,m===4?(h(y,!0),y.strm.avail_out===0?3:4):y.last_lit&&(h(y,!1),y.strm.avail_out===0)?1:2}function A(y,m,I,_,L){this.good_length=y,this.max_lazy=m,this.nice_length=I,this.max_chain=_,this.func=L}function d(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),E(this.dyn_ltree),E(this.dyn_dtree),E(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),E(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),E(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function C(y){var m;return y&&y.state?(y.total_in=y.total_out=0,y.data_type=2,(m=y.state).pending=0,m.pending_out=0,m.wrap<0&&(m.wrap=-m.wrap),m.status=m.wrap?42:113,y.adler=m.wrap===2?0:1,m.last_flush=0,s._tr_init(m),0):u(y,-2)}function $(y){var m,I=C(y);return I===0&&((m=y.state).window_size=2*m.w_size,E(m.head),m.max_lazy_match=r[m.level].max_lazy,m.good_match=r[m.level].good_length,m.nice_match=r[m.level].nice_length,m.max_chain_length=r[m.level].max_chain,m.strstart=0,m.block_start=0,m.lookahead=0,m.insert=0,m.match_length=m.prev_length=2,m.match_available=0,m.ins_h=0),I}function q(y,m,I,_,L,W){if(!y)return-2;var B=1;if(m===-1&&(m=6),_<0?(B=0,_=-_):_>15&&(B=2,_-=16),L<1||L>9||I!==8||_<8||_>15||m<0||m>9||W<0||W>4)return u(y,-2);_===8&&(_=9);var N=new d;return y.state=N,N.strm=y,N.wrap=B,N.gzhead=null,N.w_bits=_,N.w_size=1<<N.w_bits,N.w_mask=N.w_size-1,N.hash_bits=L+7,N.hash_size=1<<N.hash_bits,N.hash_mask=N.hash_size-1,N.hash_shift=~~((N.hash_bits+3-1)/3),N.window=new i.Buf8(2*N.w_size),N.head=new i.Buf16(N.hash_size),N.prev=new i.Buf16(N.w_size),N.lit_bufsize=1<<L+6,N.pending_buf_size=4*N.lit_bufsize,N.pending_buf=new i.Buf8(N.pending_buf_size),N.d_buf=1*N.lit_bufsize,N.l_buf=3*N.lit_bufsize,N.level=m,N.strategy=W,N.method=I,$(y)}r=[new A(0,0,0,0,function(y,m){var I=65535;for(I>y.pending_buf_size-5&&(I=y.pending_buf_size-5);;){if(y.lookahead<=1){if(j(y),y.lookahead===0&&m===0)return 1;if(y.lookahead===0)break}y.strstart+=y.lookahead,y.lookahead=0;var _=y.block_start+I;if((y.strstart===0||y.strstart>=_)&&(y.lookahead=y.strstart-_,y.strstart=_,h(y,!1),y.strm.avail_out===0)||y.strstart-y.block_start>=y.w_size-262&&(h(y,!1),y.strm.avail_out===0))return 1}return y.insert=0,m===4?(h(y,!0),y.strm.avail_out===0?3:4):(y.strstart>y.block_start&&(h(y,!1),y.strm.avail_out),1)}),new A(4,4,8,4,F),new A(4,5,16,8,F),new A(4,6,32,32,F),new A(4,4,16,16,M),new A(8,16,32,32,M),new A(8,16,128,128,M),new A(8,32,128,256,M),new A(32,128,258,1024,M),new A(32,258,258,4096,M)],t.deflateInit=function(y,m){return q(y,m,8,15,8,0)},t.deflateInit2=q,t.deflateReset=$,t.deflateResetKeep=C,t.deflateSetHeader=function(y,m){return y&&y.state?y.state.wrap!==2?-2:(y.state.gzhead=m,0):-2},t.deflate=function(y,m){var I,_,L,W;if(!y||!y.state||m>5||m<0)return y?u(y,-2):-2;if(_=y.state,!y.output||!y.input&&y.avail_in!==0||_.status===666&&m!==4)return u(y,y.avail_out===0?-5:-2);if(_.strm=y,I=_.last_flush,_.last_flush=m,_.status===42)if(_.wrap===2)y.adler=0,g(_,31),g(_,139),g(_,8),_.gzhead?(g(_,(_.gzhead.text?1:0)+(_.gzhead.hcrc?2:0)+(_.gzhead.extra?4:0)+(_.gzhead.name?8:0)+(_.gzhead.comment?16:0)),g(_,255&_.gzhead.time),g(_,_.gzhead.time>>8&255),g(_,_.gzhead.time>>16&255),g(_,_.gzhead.time>>24&255),g(_,_.level===9?2:_.strategy>=2||_.level<2?4:0),g(_,255&_.gzhead.os),_.gzhead.extra&&_.gzhead.extra.length&&(g(_,255&_.gzhead.extra.length),g(_,_.gzhead.extra.length>>8&255)),_.gzhead.hcrc&&(y.adler=o(y.adler,_.pending_buf,_.pending,0)),_.gzindex=0,_.status=69):(g(_,0),g(_,0),g(_,0),g(_,0),g(_,0),g(_,_.level===9?2:_.strategy>=2||_.level<2?4:0),g(_,3),_.status=113);else{var B=8+(_.w_bits-8<<4)<<8;B|=(_.strategy>=2||_.level<2?0:_.level<6?1:_.level===6?2:3)<<6,_.strstart!==0&&(B|=32),B+=31-B%31,_.status=113,b(_,B),_.strstart!==0&&(b(_,y.adler>>>16),b(_,65535&y.adler)),y.adler=1}if(_.status===69)if(_.gzhead.extra){for(L=_.pending;_.gzindex<(65535&_.gzhead.extra.length)&&(_.pending!==_.pending_buf_size||(_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),w(y),L=_.pending,_.pending!==_.pending_buf_size));)g(_,255&_.gzhead.extra[_.gzindex]),_.gzindex++;_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),_.gzindex===_.gzhead.extra.length&&(_.gzindex=0,_.status=73)}else _.status=73;if(_.status===73)if(_.gzhead.name){L=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),w(y),L=_.pending,_.pending===_.pending_buf_size)){W=1;break}W=_.gzindex<_.gzhead.name.length?255&_.gzhead.name.charCodeAt(_.gzindex++):0,g(_,W)}while(W!==0);_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),W===0&&(_.gzindex=0,_.status=91)}else _.status=91;if(_.status===91)if(_.gzhead.comment){L=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),w(y),L=_.pending,_.pending===_.pending_buf_size)){W=1;break}W=_.gzindex<_.gzhead.comment.length?255&_.gzhead.comment.charCodeAt(_.gzindex++):0,g(_,W)}while(W!==0);_.gzhead.hcrc&&_.pending>L&&(y.adler=o(y.adler,_.pending_buf,_.pending-L,L)),W===0&&(_.status=103)}else _.status=103;if(_.status===103&&(_.gzhead.hcrc?(_.pending+2>_.pending_buf_size&&w(y),_.pending+2<=_.pending_buf_size&&(g(_,255&y.adler),g(_,y.adler>>8&255),y.adler=0,_.status=113)):_.status=113),_.pending!==0){if(w(y),y.avail_out===0)return _.last_flush=-1,0}else if(y.avail_in===0&&f(m)<=f(I)&&m!==4)return u(y,-5);if(_.status===666&&y.avail_in!==0)return u(y,-5);if(y.avail_in!==0||_.lookahead!==0||m!==0&&_.status!==666){var N=_.strategy===2?function(D,z){for(var O;;){if(D.lookahead===0&&(j(D),D.lookahead===0)){if(z===0)return 1;break}if(D.match_length=0,O=s._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,O&&(h(D,!1),D.strm.avail_out===0))return 1}return D.insert=0,z===4?(h(D,!0),D.strm.avail_out===0?3:4):D.last_lit&&(h(D,!1),D.strm.avail_out===0)?1:2}(_,m):_.strategy===3?function(D,z){for(var O,p,U,V,Q=D.window;;){if(D.lookahead<=258){if(j(D),D.lookahead<=258&&z===0)return 1;if(D.lookahead===0)break}if(D.match_length=0,D.lookahead>=3&&D.strstart>0&&(p=Q[U=D.strstart-1])===Q[++U]&&p===Q[++U]&&p===Q[++U]){V=D.strstart+258;do;while(p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&p===Q[++U]&&U<V);D.match_length=258-(V-U),D.match_length>D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=3?(O=s._tr_tally(D,1,D.match_length-3),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(O=s._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),O&&(h(D,!1),D.strm.avail_out===0))return 1}return D.insert=0,z===4?(h(D,!0),D.strm.avail_out===0?3:4):D.last_lit&&(h(D,!1),D.strm.avail_out===0)?1:2}(_,m):r[_.level].func(_,m);if(N!==3&&N!==4||(_.status=666),N===1||N===3)return y.avail_out===0&&(_.last_flush=-1),0;if(N===2&&(m===1?s._tr_align(_):m!==5&&(s._tr_stored_block(_,0,0,!1),m===3&&(E(_.head),_.lookahead===0&&(_.strstart=0,_.block_start=0,_.insert=0))),w(y),y.avail_out===0))return _.last_flush=-1,0}return m!==4?0:_.wrap<=0?1:(_.wrap===2?(g(_,255&y.adler),g(_,y.adler>>8&255),g(_,y.adler>>16&255),g(_,y.adler>>24&255),g(_,255&y.total_in),g(_,y.total_in>>8&255),g(_,y.total_in>>16&255),g(_,y.total_in>>24&255)):(b(_,y.adler>>>16),b(_,65535&y.adler)),w(y),_.wrap>0&&(_.wrap=-_.wrap),_.pending!==0?0:1)},t.deflateEnd=function(y){var m;return y&&y.state?(m=y.state.status)!==42&&m!==69&&m!==73&&m!==91&&m!==103&&m!==113&&m!==666?u(y,-2):(y.state=null,m===113?u(y,-3):0):-2},t.deflateSetDictionary=function(y,m){var I,_,L,W,B,N,D,z,O=m.length;if(!y||!y.state||(W=(I=y.state).wrap)===2||W===1&&I.status!==42||I.lookahead)return-2;for(W===1&&(y.adler=l(y.adler,m,O,0)),I.wrap=0,O>=I.w_size&&(W===0&&(E(I.head),I.strstart=0,I.block_start=0,I.insert=0),z=new i.Buf8(I.w_size),i.arraySet(z,m,O-I.w_size,I.w_size,0),m=z,O=I.w_size),B=y.avail_in,N=y.next_in,D=y.input,y.avail_in=O,y.next_in=0,y.input=m,j(I);I.lookahead>=3;){_=I.strstart,L=I.lookahead-2;do I.ins_h=(I.ins_h<<I.hash_shift^I.window[_+3-1])&I.hash_mask,I.prev[_&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=_,_++;while(--L);I.strstart=_,I.lookahead=2,j(I)}return I.strstart+=I.lookahead,I.block_start=I.strstart,I.insert=I.lookahead,I.lookahead=0,I.match_length=I.prev_length=2,I.match_available=0,y.next_in=N,y.input=D,y.avail_in=B,I.wrap=W,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){var r=n(37);function i(p){for(var U=p.length;--U>=0;)p[U]=0}var s=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var f=new Array(60);i(f);var E=new Array(512);i(E);var w=new Array(256);i(w);var h=new Array(29);i(h);var g,b,R,j=new Array(30);function F(p,U,V,Q,ee){this.static_tree=p,this.extra_bits=U,this.extra_base=V,this.elems=Q,this.max_length=ee,this.has_stree=p&&p.length}function M(p,U){this.dyn_tree=p,this.max_code=0,this.stat_desc=U}function A(p){return p<256?E[p]:E[256+(p>>>7)]}function d(p,U){p.pending_buf[p.pending++]=255&U,p.pending_buf[p.pending++]=U>>>8&255}function C(p,U,V){p.bi_valid>16-V?(p.bi_buf|=U<<p.bi_valid&65535,d(p,p.bi_buf),p.bi_buf=U>>16-p.bi_valid,p.bi_valid+=V-16):(p.bi_buf|=U<<p.bi_valid&65535,p.bi_valid+=V)}function $(p,U,V){C(p,V[2*U],V[2*U+1])}function q(p,U){var V=0;do V|=1&p,p>>>=1,V<<=1;while(--U>0);return V>>>1}function y(p,U,V){var Q,ee,ne=new Array(16),Y=0;for(Q=1;Q<=15;Q++)ne[Q]=Y=Y+V[Q-1]<<1;for(ee=0;ee<=U;ee++){var G=p[2*ee+1];G!==0&&(p[2*ee]=q(ne[G]++,G))}}function m(p){var U;for(U=0;U<286;U++)p.dyn_ltree[2*U]=0;for(U=0;U<30;U++)p.dyn_dtree[2*U]=0;for(U=0;U<19;U++)p.bl_tree[2*U]=0;p.dyn_ltree[512]=1,p.opt_len=p.static_len=0,p.last_lit=p.matches=0}function I(p){p.bi_valid>8?d(p,p.bi_buf):p.bi_valid>0&&(p.pending_buf[p.pending++]=p.bi_buf),p.bi_buf=0,p.bi_valid=0}function _(p,U,V,Q){var ee=2*U,ne=2*V;return p[ee]<p[ne]||p[ee]===p[ne]&&Q[U]<=Q[V]}function L(p,U,V){for(var Q=p.heap[V],ee=V<<1;ee<=p.heap_len&&(ee<p.heap_len&&_(U,p.heap[ee+1],p.heap[ee],p.depth)&&ee++,!_(U,Q,p.heap[ee],p.depth));)p.heap[V]=p.heap[ee],V=ee,ee<<=1;p.heap[V]=Q}function W(p,U,V){var Q,ee,ne,Y,G=0;if(p.last_lit!==0)do Q=p.pending_buf[p.d_buf+2*G]<<8|p.pending_buf[p.d_buf+2*G+1],ee=p.pending_buf[p.l_buf+G],G++,Q===0?$(p,ee,U):($(p,(ne=w[ee])+256+1,U),(Y=s[ne])!==0&&C(p,ee-=h[ne],Y),$(p,ne=A(--Q),V),(Y=l[ne])!==0&&C(p,Q-=j[ne],Y));while(G<p.last_lit);$(p,256,U)}function B(p,U){var V,Q,ee,ne=U.dyn_tree,Y=U.stat_desc.static_tree,G=U.stat_desc.has_stree,S=U.stat_desc.elems,T=-1;for(p.heap_len=0,p.heap_max=573,V=0;V<S;V++)ne[2*V]!==0?(p.heap[++p.heap_len]=T=V,p.depth[V]=0):ne[2*V+1]=0;for(;p.heap_len<2;)ne[2*(ee=p.heap[++p.heap_len]=T<2?++T:0)]=1,p.depth[ee]=0,p.opt_len--,G&&(p.static_len-=Y[2*ee+1]);for(U.max_code=T,V=p.heap_len>>1;V>=1;V--)L(p,ne,V);ee=S;do V=p.heap[1],p.heap[1]=p.heap[p.heap_len--],L(p,ne,1),Q=p.heap[1],p.heap[--p.heap_max]=V,p.heap[--p.heap_max]=Q,ne[2*ee]=ne[2*V]+ne[2*Q],p.depth[ee]=(p.depth[V]>=p.depth[Q]?p.depth[V]:p.depth[Q])+1,ne[2*V+1]=ne[2*Q+1]=ee,p.heap[1]=ee++,L(p,ne,1);while(p.heap_len>=2);p.heap[--p.heap_max]=p.heap[1],function(k,J){var K,re,se,fe,ve,Ce,Se=J.dyn_tree,Ie=J.max_code,Te=J.stat_desc.static_tree,Oe=J.stat_desc.has_stree,De=J.stat_desc.extra_bits,qe=J.stat_desc.extra_base,tt=J.stat_desc.max_length,et=0;for(fe=0;fe<=15;fe++)k.bl_count[fe]=0;for(Se[2*k.heap[k.heap_max]+1]=0,K=k.heap_max+1;K<573;K++)(fe=Se[2*Se[2*(re=k.heap[K])+1]+1]+1)>tt&&(fe=tt,et++),Se[2*re+1]=fe,re>Ie||(k.bl_count[fe]++,ve=0,re>=qe&&(ve=De[re-qe]),Ce=Se[2*re],k.opt_len+=Ce*(fe+ve),Oe&&(k.static_len+=Ce*(Te[2*re+1]+ve)));if(et!==0){do{for(fe=tt-1;k.bl_count[fe]===0;)fe--;k.bl_count[fe]--,k.bl_count[fe+1]+=2,k.bl_count[tt]--,et-=2}while(et>0);for(fe=tt;fe!==0;fe--)for(re=k.bl_count[fe];re!==0;)(se=k.heap[--K])>Ie||(Se[2*se+1]!==fe&&(k.opt_len+=(fe-Se[2*se+1])*Se[2*se],Se[2*se+1]=fe),re--)}}(p,U),y(ne,T,p.bl_count)}function N(p,U,V){var Q,ee,ne=-1,Y=U[1],G=0,S=7,T=4;for(Y===0&&(S=138,T=3),U[2*(V+1)+1]=65535,Q=0;Q<=V;Q++)ee=Y,Y=U[2*(Q+1)+1],++G<S&&ee===Y||(G<T?p.bl_tree[2*ee]+=G:ee!==0?(ee!==ne&&p.bl_tree[2*ee]++,p.bl_tree[32]++):G<=10?p.bl_tree[34]++:p.bl_tree[36]++,G=0,ne=ee,Y===0?(S=138,T=3):ee===Y?(S=6,T=3):(S=7,T=4))}function D(p,U,V){var Q,ee,ne=-1,Y=U[1],G=0,S=7,T=4;for(Y===0&&(S=138,T=3),Q=0;Q<=V;Q++)if(ee=Y,Y=U[2*(Q+1)+1],!(++G<S&&ee===Y)){if(G<T)do $(p,ee,p.bl_tree);while(--G!=0);else ee!==0?(ee!==ne&&($(p,ee,p.bl_tree),G--),$(p,16,p.bl_tree),C(p,G-3,2)):G<=10?($(p,17,p.bl_tree),C(p,G-3,3)):($(p,18,p.bl_tree),C(p,G-11,7));G=0,ne=ee,Y===0?(S=138,T=3):ee===Y?(S=6,T=3):(S=7,T=4)}}i(j);var z=!1;function O(p,U,V,Q){C(p,0+(Q?1:0),3),function(ee,ne,Y,G){I(ee),G&&(d(ee,Y),d(ee,~Y)),r.arraySet(ee.pending_buf,ee.window,ne,Y,ee.pending),ee.pending+=Y}(p,U,V,!0)}t._tr_init=function(p){z||(function(){var U,V,Q,ee,ne,Y=new Array(16);for(Q=0,ee=0;ee<28;ee++)for(h[ee]=Q,U=0;U<1<<s[ee];U++)w[Q++]=ee;for(w[Q-1]=ee,ne=0,ee=0;ee<16;ee++)for(j[ee]=ne,U=0;U<1<<l[ee];U++)E[ne++]=ee;for(ne>>=7;ee<30;ee++)for(j[ee]=ne<<7,U=0;U<1<<l[ee]-7;U++)E[256+ne++]=ee;for(V=0;V<=15;V++)Y[V]=0;for(U=0;U<=143;)u[2*U+1]=8,U++,Y[8]++;for(;U<=255;)u[2*U+1]=9,U++,Y[9]++;for(;U<=279;)u[2*U+1]=7,U++,Y[7]++;for(;U<=287;)u[2*U+1]=8,U++,Y[8]++;for(y(u,287,Y),U=0;U<30;U++)f[2*U+1]=5,f[2*U]=q(U,5);g=new F(u,s,257,286,15),b=new F(f,l,0,30,15),R=new F(new Array(0),o,0,19,7)}(),z=!0),p.l_desc=new M(p.dyn_ltree,g),p.d_desc=new M(p.dyn_dtree,b),p.bl_desc=new M(p.bl_tree,R),p.bi_buf=0,p.bi_valid=0,m(p)},t._tr_stored_block=O,t._tr_flush_block=function(p,U,V,Q){var ee,ne,Y=0;p.level>0?(p.strm.data_type===2&&(p.strm.data_type=function(G){var S,T=4093624447;for(S=0;S<=31;S++,T>>>=1)if(1&T&&G.dyn_ltree[2*S]!==0)return 0;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return 1;for(S=32;S<256;S++)if(G.dyn_ltree[2*S]!==0)return 1;return 0}(p)),B(p,p.l_desc),B(p,p.d_desc),Y=function(G){var S;for(N(G,G.dyn_ltree,G.l_desc.max_code),N(G,G.dyn_dtree,G.d_desc.max_code),B(G,G.bl_desc),S=18;S>=3&&G.bl_tree[2*c[S]+1]===0;S--);return G.opt_len+=3*(S+1)+5+5+4,S}(p),ee=p.opt_len+3+7>>>3,(ne=p.static_len+3+7>>>3)<=ee&&(ee=ne)):ee=ne=V+5,V+4<=ee&&U!==-1?O(p,U,V,Q):p.strategy===4||ne===ee?(C(p,2+(Q?1:0),3),W(p,u,f)):(C(p,4+(Q?1:0),3),function(G,S,T,k){var J;for(C(G,S-257,5),C(G,T-1,5),C(G,k-4,4),J=0;J<k;J++)C(G,G.bl_tree[2*c[J]+1],3);D(G,G.dyn_ltree,S-1),D(G,G.dyn_dtree,T-1)}(p,p.l_desc.max_code+1,p.d_desc.max_code+1,Y+1),W(p,p.dyn_ltree,p.dyn_dtree)),m(p),Q&&I(p)},t._tr_tally=function(p,U,V){return p.pending_buf[p.d_buf+2*p.last_lit]=U>>>8&255,p.pending_buf[p.d_buf+2*p.last_lit+1]=255&U,p.pending_buf[p.l_buf+p.last_lit]=255&V,p.last_lit++,U===0?p.dyn_ltree[2*V]++:(p.matches++,U--,p.dyn_ltree[2*(w[V]+256+1)]++,p.dyn_dtree[2*A(U)]++),p.last_lit===p.lit_bufsize-1},t._tr_align=function(p){C(p,2,3),$(p,256,u),function(U){U.bi_valid===16?(d(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):U.bi_valid>=8&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)}(p)}},function(e,t,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){var r=n(37),i=n(75),s=n(76),l=n(176),o=n(177);function c(M){return(M>>>24&255)+(M>>>8&65280)+((65280&M)<<8)+((255&M)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(M){var A;return M&&M.state?(A=M.state,M.total_in=M.total_out=A.total=0,M.msg="",A.wrap&&(M.adler=1&A.wrap),A.mode=1,A.last=0,A.havedict=0,A.dmax=32768,A.head=null,A.hold=0,A.bits=0,A.lencode=A.lendyn=new r.Buf32(852),A.distcode=A.distdyn=new r.Buf32(592),A.sane=1,A.back=-1,0):-2}function E(M){var A;return M&&M.state?((A=M.state).wsize=0,A.whave=0,A.wnext=0,f(M)):-2}function w(M,A){var d,C;return M&&M.state?(C=M.state,A<0?(d=0,A=-A):(d=1+(A>>4),A<48&&(A&=15)),A&&(A<8||A>15)?-2:(C.window!==null&&C.wbits!==A&&(C.window=null),C.wrap=d,C.wbits=A,E(M))):-2}function h(M,A){var d,C;return M?(C=new u,M.state=C,C.window=null,(d=w(M,A))!==0&&(M.state=null),d):-2}var g,b,R=!0;function j(M){if(R){var A;for(g=new r.Buf32(512),b=new r.Buf32(32),A=0;A<144;)M.lens[A++]=8;for(;A<256;)M.lens[A++]=9;for(;A<280;)M.lens[A++]=7;for(;A<288;)M.lens[A++]=8;for(o(1,M.lens,0,288,g,0,M.work,{bits:9}),A=0;A<32;)M.lens[A++]=5;o(2,M.lens,0,32,b,0,M.work,{bits:5}),R=!1}M.lencode=g,M.lenbits=9,M.distcode=b,M.distbits=5}function F(M,A,d,C){var $,q=M.state;return q.window===null&&(q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new r.Buf8(q.wsize)),C>=q.wsize?(r.arraySet(q.window,A,d-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(($=q.wsize-q.wnext)>C&&($=C),r.arraySet(q.window,A,d-C,$,q.wnext),(C-=$)?(r.arraySet(q.window,A,d-C,C,0),q.wnext=C,q.whave=q.wsize):(q.wnext+=$,q.wnext===q.wsize&&(q.wnext=0),q.whave<q.wsize&&(q.whave+=$))),0}t.inflateReset=E,t.inflateReset2=w,t.inflateResetKeep=f,t.inflateInit=function(M){return h(M,15)},t.inflateInit2=h,t.inflate=function(M,A){var d,C,$,q,y,m,I,_,L,W,B,N,D,z,O,p,U,V,Q,ee,ne,Y,G,S,T=0,k=new r.Buf8(4),J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return-2;(d=M.state).mode===12&&(d.mode=13),y=M.next_out,$=M.output,I=M.avail_out,q=M.next_in,C=M.input,m=M.avail_in,_=d.hold,L=d.bits,W=m,B=I,Y=0;e:for(;;)switch(d.mode){case 1:if(d.wrap===0){d.mode=13;break}for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(2&d.wrap&&_===35615){d.check=0,k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0),_=0,L=0,d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1),!(1&d.wrap)||(((255&_)<<8)+(_>>8))%31){M.msg="incorrect header check",d.mode=30;break}if((15&_)!=8){M.msg="unknown compression method",d.mode=30;break}if(L-=4,ne=8+(15&(_>>>=4)),d.wbits===0)d.wbits=ne;else if(ne>d.wbits){M.msg="invalid window size",d.mode=30;break}d.dmax=1<<ne,M.adler=d.check=1,d.mode=512&_?10:12,_=0,L=0;break;case 2:for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(d.flags=_,(255&d.flags)!=8){M.msg="unknown compression method",d.mode=30;break}if(57344&d.flags){M.msg="unknown header flags set",d.mode=30;break}d.head&&(d.head.text=_>>8&1),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0)),_=0,L=0,d.mode=3;case 3:for(;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.head&&(d.head.time=_),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,k[2]=_>>>16&255,k[3]=_>>>24&255,d.check=s(d.check,k,4,0)),_=0,L=0,d.mode=4;case 4:for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.head&&(d.head.xflags=255&_,d.head.os=_>>8),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0)),_=0,L=0,d.mode=5;case 5:if(1024&d.flags){for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.length=_,d.head&&(d.head.extra_len=_),512&d.flags&&(k[0]=255&_,k[1]=_>>>8&255,d.check=s(d.check,k,2,0)),_=0,L=0}else d.head&&(d.head.extra=null);d.mode=6;case 6:if(1024&d.flags&&((N=d.length)>m&&(N=m),N&&(d.head&&(ne=d.head.extra_len-d.length,d.head.extra||(d.head.extra=new Array(d.head.extra_len)),r.arraySet(d.head.extra,C,q,N,ne)),512&d.flags&&(d.check=s(d.check,C,N,q)),m-=N,q+=N,d.length-=N),d.length))break e;d.length=0,d.mode=7;case 7:if(2048&d.flags){if(m===0)break e;N=0;do ne=C[q+N++],d.head&&ne&&d.length<65536&&(d.head.name+=String.fromCharCode(ne));while(ne&&N<m);if(512&d.flags&&(d.check=s(d.check,C,N,q)),m-=N,q+=N,ne)break e}else d.head&&(d.head.name=null);d.length=0,d.mode=8;case 8:if(4096&d.flags){if(m===0)break e;N=0;do ne=C[q+N++],d.head&&ne&&d.length<65536&&(d.head.comment+=String.fromCharCode(ne));while(ne&&N<m);if(512&d.flags&&(d.check=s(d.check,C,N,q)),m-=N,q+=N,ne)break e}else d.head&&(d.head.comment=null);d.mode=9;case 9:if(512&d.flags){for(;L<16;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(_!==(65535&d.check)){M.msg="header crc mismatch",d.mode=30;break}_=0,L=0}d.head&&(d.head.hcrc=d.flags>>9&1,d.head.done=!0),M.adler=d.check=0,d.mode=12;break;case 10:for(;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}M.adler=d.check=c(_),_=0,L=0,d.mode=11;case 11:if(d.havedict===0)return M.next_out=y,M.avail_out=I,M.next_in=q,M.avail_in=m,d.hold=_,d.bits=L,2;M.adler=d.check=1,d.mode=12;case 12:if(A===5||A===6)break e;case 13:if(d.last){_>>>=7&L,L-=7&L,d.mode=27;break}for(;L<3;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}switch(d.last=1&_,L-=1,3&(_>>>=1)){case 0:d.mode=14;break;case 1:if(j(d),d.mode=20,A===6){_>>>=2,L-=2;break e}break;case 2:d.mode=17;break;case 3:M.msg="invalid block type",d.mode=30}_>>>=2,L-=2;break;case 14:for(_>>>=7&L,L-=7&L;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if((65535&_)!=(_>>>16^65535)){M.msg="invalid stored block lengths",d.mode=30;break}if(d.length=65535&_,_=0,L=0,d.mode=15,A===6)break e;case 15:d.mode=16;case 16:if(N=d.length){if(N>m&&(N=m),N>I&&(N=I),N===0)break e;r.arraySet($,C,q,N,y),m-=N,q+=N,I-=N,y+=N,d.length-=N;break}d.mode=12;break;case 17:for(;L<14;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(d.nlen=257+(31&_),_>>>=5,L-=5,d.ndist=1+(31&_),_>>>=5,L-=5,d.ncode=4+(15&_),_>>>=4,L-=4,d.nlen>286||d.ndist>30){M.msg="too many length or distance symbols",d.mode=30;break}d.have=0,d.mode=18;case 18:for(;d.have<d.ncode;){for(;L<3;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.lens[J[d.have++]]=7&_,_>>>=3,L-=3}for(;d.have<19;)d.lens[J[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,G={bits:d.lenbits},Y=o(0,d.lens,0,19,d.lencode,0,d.work,G),d.lenbits=G.bits,Y){M.msg="invalid code lengths set",d.mode=30;break}d.have=0,d.mode=19;case 19:for(;d.have<d.nlen+d.ndist;){for(;p=(T=d.lencode[_&(1<<d.lenbits)-1])>>>16&255,U=65535&T,!((O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(U<16)_>>>=O,L-=O,d.lens[d.have++]=U;else{if(U===16){for(S=O+2;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(_>>>=O,L-=O,d.have===0){M.msg="invalid bit length repeat",d.mode=30;break}ne=d.lens[d.have-1],N=3+(3&_),_>>>=2,L-=2}else if(U===17){for(S=O+3;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}L-=O,ne=0,N=3+(7&(_>>>=O)),_>>>=3,L-=3}else{for(S=O+7;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}L-=O,ne=0,N=11+(127&(_>>>=O)),_>>>=7,L-=7}if(d.have+N>d.nlen+d.ndist){M.msg="invalid bit length repeat",d.mode=30;break}for(;N--;)d.lens[d.have++]=ne}}if(d.mode===30)break;if(d.lens[256]===0){M.msg="invalid code -- missing end-of-block",d.mode=30;break}if(d.lenbits=9,G={bits:d.lenbits},Y=o(1,d.lens,0,d.nlen,d.lencode,0,d.work,G),d.lenbits=G.bits,Y){M.msg="invalid literal/lengths set",d.mode=30;break}if(d.distbits=6,d.distcode=d.distdyn,G={bits:d.distbits},Y=o(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,G),d.distbits=G.bits,Y){M.msg="invalid distances set",d.mode=30;break}if(d.mode=20,A===6)break e;case 20:d.mode=21;case 21:if(m>=6&&I>=258){M.next_out=y,M.avail_out=I,M.next_in=q,M.avail_in=m,d.hold=_,d.bits=L,l(M,B),y=M.next_out,$=M.output,I=M.avail_out,q=M.next_in,C=M.input,m=M.avail_in,_=d.hold,L=d.bits,d.mode===12&&(d.back=-1);break}for(d.back=0;p=(T=d.lencode[_&(1<<d.lenbits)-1])>>>16&255,U=65535&T,!((O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(p&&!(240&p)){for(V=O,Q=p,ee=U;p=(T=d.lencode[ee+((_&(1<<V+Q)-1)>>V)])>>>16&255,U=65535&T,!(V+(O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}_>>>=V,L-=V,d.back+=V}if(_>>>=O,L-=O,d.back+=O,d.length=U,p===0){d.mode=26;break}if(32&p){d.back=-1,d.mode=12;break}if(64&p){M.msg="invalid literal/length code",d.mode=30;break}d.extra=15&p,d.mode=22;case 22:if(d.extra){for(S=d.extra;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.length+=_&(1<<d.extra)-1,_>>>=d.extra,L-=d.extra,d.back+=d.extra}d.was=d.length,d.mode=23;case 23:for(;p=(T=d.distcode[_&(1<<d.distbits)-1])>>>16&255,U=65535&T,!((O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(!(240&p)){for(V=O,Q=p,ee=U;p=(T=d.distcode[ee+((_&(1<<V+Q)-1)>>V)])>>>16&255,U=65535&T,!(V+(O=T>>>24)<=L);){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}_>>>=V,L-=V,d.back+=V}if(_>>>=O,L-=O,d.back+=O,64&p){M.msg="invalid distance code",d.mode=30;break}d.offset=U,d.extra=15&p,d.mode=24;case 24:if(d.extra){for(S=d.extra;L<S;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}d.offset+=_&(1<<d.extra)-1,_>>>=d.extra,L-=d.extra,d.back+=d.extra}if(d.offset>d.dmax){M.msg="invalid distance too far back",d.mode=30;break}d.mode=25;case 25:if(I===0)break e;if(N=B-I,d.offset>N){if((N=d.offset-N)>d.whave&&d.sane){M.msg="invalid distance too far back",d.mode=30;break}N>d.wnext?(N-=d.wnext,D=d.wsize-N):D=d.wnext-N,N>d.length&&(N=d.length),z=d.window}else z=$,D=y-d.offset,N=d.length;N>I&&(N=I),I-=N,d.length-=N;do $[y++]=z[D++];while(--N);d.length===0&&(d.mode=21);break;case 26:if(I===0)break e;$[y++]=d.length,I--,d.mode=21;break;case 27:if(d.wrap){for(;L<32;){if(m===0)break e;m--,_|=C[q++]<<L,L+=8}if(B-=I,M.total_out+=B,d.total+=B,B&&(M.adler=d.check=d.flags?s(d.check,$,B,y-B):i(d.check,$,B,y-B)),B=I,(d.flags?_:c(_))!==d.check){M.msg="incorrect data check",d.mode=30;break}_=0,L=0}d.mode=28;case 28:if(d.wrap&&d.flags){for(;L<32;){if(m===0)break e;m--,_+=C[q++]<<L,L+=8}if(_!==(4294967295&d.total)){M.msg="incorrect length check",d.mode=30;break}_=0,L=0}d.mode=29;case 29:Y=1;break e;case 30:Y=-3;break e;case 31:return-4;case 32:default:return-2}return M.next_out=y,M.avail_out=I,M.next_in=q,M.avail_in=m,d.hold=_,d.bits=L,(d.wsize||B!==M.avail_out&&d.mode<30&&(d.mode<27||A!==4))&&F(M,M.output,M.next_out,B-M.avail_out)?(d.mode=31,-4):(W-=M.avail_in,B-=M.avail_out,M.total_in+=W,M.total_out+=B,d.total+=B,d.wrap&&B&&(M.adler=d.check=d.flags?s(d.check,$,B,M.next_out-B):i(d.check,$,B,M.next_out-B)),M.data_type=d.bits+(d.last?64:0)+(d.mode===12?128:0)+(d.mode===20||d.mode===15?256:0),(W===0&&B===0||A===4)&&Y===0&&(Y=-5),Y)},t.inflateEnd=function(M){if(!M||!M.state)return-2;var A=M.state;return A.window&&(A.window=null),M.state=null,0},t.inflateGetHeader=function(M,A){var d;return M&&M.state&&2&(d=M.state).wrap?(d.head=A,A.done=!1,0):-2},t.inflateSetDictionary=function(M,A){var d,C=A.length;return M&&M.state?(d=M.state).wrap!==0&&d.mode!==11?-2:d.mode===11&&i(1,A,C,0)!==d.check?-3:F(M,A,C,C)?(d.mode=31,-4):(d.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){e.exports=function(r,i){var s,l,o,c,u,f,E,w,h,g,b,R,j,F,M,A,d,C,$,q,y,m,I,_,L;s=r.state,l=r.next_in,_=r.input,o=l+(r.avail_in-5),c=r.next_out,L=r.output,u=c-(i-r.avail_out),f=c+(r.avail_out-257),E=s.dmax,w=s.wsize,h=s.whave,g=s.wnext,b=s.window,R=s.hold,j=s.bits,F=s.lencode,M=s.distcode,A=(1<<s.lenbits)-1,d=(1<<s.distbits)-1;e:do{j<15&&(R+=_[l++]<<j,j+=8,R+=_[l++]<<j,j+=8),C=F[R&A];t:for(;;){if(R>>>=$=C>>>24,j-=$,($=C>>>16&255)===0)L[c++]=65535&C;else{if(!(16&$)){if(!(64&$)){C=F[(65535&C)+(R&(1<<$)-1)];continue t}if(32&$){s.mode=12;break e}r.msg="invalid literal/length code",s.mode=30;break e}q=65535&C,($&=15)&&(j<$&&(R+=_[l++]<<j,j+=8),q+=R&(1<<$)-1,R>>>=$,j-=$),j<15&&(R+=_[l++]<<j,j+=8,R+=_[l++]<<j,j+=8),C=M[R&d];n:for(;;){if(R>>>=$=C>>>24,j-=$,!(16&($=C>>>16&255))){if(!(64&$)){C=M[(65535&C)+(R&(1<<$)-1)];continue n}r.msg="invalid distance code",s.mode=30;break e}if(y=65535&C,j<($&=15)&&(R+=_[l++]<<j,(j+=8)<$&&(R+=_[l++]<<j,j+=8)),(y+=R&(1<<$)-1)>E){r.msg="invalid distance too far back",s.mode=30;break e}if(R>>>=$,j-=$,y>($=c-u)){if(($=y-$)>h&&s.sane){r.msg="invalid distance too far back",s.mode=30;break e}if(m=0,I=b,g===0){if(m+=w-$,$<q){q-=$;do L[c++]=b[m++];while(--$);m=c-y,I=L}}else if(g<$){if(m+=w+g-$,($-=g)<q){q-=$;do L[c++]=b[m++];while(--$);if(m=0,g<q){q-=$=g;do L[c++]=b[m++];while(--$);m=c-y,I=L}}}else if(m+=g-$,$<q){q-=$;do L[c++]=b[m++];while(--$);m=c-y,I=L}for(;q>2;)L[c++]=I[m++],L[c++]=I[m++],L[c++]=I[m++],q-=3;q&&(L[c++]=I[m++],q>1&&(L[c++]=I[m++]))}else{m=c-y;do L[c++]=L[m++],L[c++]=L[m++],L[c++]=L[m++],q-=3;while(q>2);q&&(L[c++]=L[m++],q>1&&(L[c++]=L[m++]))}break}}break}}while(l<o&&c<f);l-=q=j>>3,R&=(1<<(j-=q<<3))-1,r.next_in=l,r.next_out=c,r.avail_in=l<o?o-l+5:5-(l-o),r.avail_out=c<f?f-c+257:257-(c-f),s.hold=R,s.bits=j}},function(e,t,n){var r=n(37),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(c,u,f,E,w,h,g,b){var R,j,F,M,A,d,C,$,q,y=b.bits,m=0,I=0,_=0,L=0,W=0,B=0,N=0,D=0,z=0,O=0,p=null,U=0,V=new r.Buf16(16),Q=new r.Buf16(16),ee=null,ne=0;for(m=0;m<=15;m++)V[m]=0;for(I=0;I<E;I++)V[u[f+I]]++;for(W=y,L=15;L>=1&&V[L]===0;L--);if(W>L&&(W=L),L===0)return w[h++]=20971520,w[h++]=20971520,b.bits=1,0;for(_=1;_<L&&V[_]===0;_++);for(W<_&&(W=_),D=1,m=1;m<=15;m++)if(D<<=1,(D-=V[m])<0)return-1;if(D>0&&(c===0||L!==1))return-1;for(Q[1]=0,m=1;m<15;m++)Q[m+1]=Q[m]+V[m];for(I=0;I<E;I++)u[f+I]!==0&&(g[Q[u[f+I]]++]=I);if(c===0?(p=ee=g,d=19):c===1?(p=i,U-=257,ee=s,ne-=257,d=256):(p=l,ee=o,d=-1),O=0,I=0,m=_,A=h,B=W,N=0,F=-1,M=(z=1<<W)-1,c===1&&z>852||c===2&&z>592)return 1;for(;;){C=m-N,g[I]<d?($=0,q=g[I]):g[I]>d?($=ee[ne+g[I]],q=p[U+g[I]]):($=96,q=0),R=1<<m-N,_=j=1<<B;do w[A+(O>>N)+(j-=R)]=C<<24|$<<16|q|0;while(j!==0);for(R=1<<m-1;O&R;)R>>=1;if(R!==0?(O&=R-1,O+=R):O=0,I++,--V[m]==0){if(m===L)break;m=u[f+g[I]]}if(m>W&&(O&M)!==F){for(N===0&&(N=W),A+=_,D=1<<(B=m-N);B+N<L&&!((D-=V[B+N])<=0);)B++,D<<=1;if(z+=1<<B,c===1&&z>852||c===2&&z>592)return 1;w[F=O&M]=W<<24|B<<16|A-h|0}}return O!==0&&(w[A+O]=m-N<<24|64<<16|0),b.bits=W,0}},function(e,t,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t){},function(e,t,n){function r(u,f){var E=Object.keys(u);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(u);f&&(w=w.filter(function(h){return Object.getOwnPropertyDescriptor(u,h).enumerable})),E.push.apply(E,w)}return E}function i(u,f,E){return f in u?Object.defineProperty(u,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):u[f]=E,u}function s(u,f){for(var E=0;E<f.length;E++){var w=f[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(u,w.key,w)}}var l=n(5).Buffer,o=n(181).inspect,c=o&&o.custom||"inspect";e.exports=function(){function u(){(function(w,h){if(!(w instanceof h))throw new TypeError("Cannot call a class as a function")})(this,u),this.head=null,this.tail=null,this.length=0}var f,E;return f=u,(E=[{key:"push",value:function(w){var h={data:w,next:null};this.length>0?this.tail.next=h:this.head=h,this.tail=h,++this.length}},{key:"unshift",value:function(w){var h={data:w,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var h=this.head,g=""+h.data;h=h.next;)g+=w+h.data;return g}},{key:"concat",value:function(w){if(this.length===0)return l.alloc(0);for(var h,g,b,R=l.allocUnsafe(w>>>0),j=this.head,F=0;j;)h=j.data,g=R,b=F,l.prototype.copy.call(h,g,b),F+=j.data.length,j=j.next;return R}},{key:"consume",value:function(w,h){var g;return w<this.head.data.length?(g=this.head.data.slice(0,w),this.head.data=this.head.data.slice(w)):g=w===this.head.data.length?this.shift():h?this._getString(w):this._getBuffer(w),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(w){var h=this.head,g=1,b=h.data;for(w-=b.length;h=h.next;){var R=h.data,j=w>R.length?R.length:w;if(j===R.length?b+=R:b+=R.slice(0,w),(w-=j)==0){j===R.length?(++g,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=R.slice(j));break}++g}return this.length-=g,b}},{key:"_getBuffer",value:function(w){var h=l.allocUnsafe(w),g=this.head,b=1;for(g.data.copy(h),w-=g.data.length;g=g.next;){var R=g.data,j=w>R.length?R.length:w;if(R.copy(h,h.length-w,0,j),(w-=j)==0){j===R.length?(++b,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=R.slice(j));break}++b}return this.length-=b,h}},{key:c,value:function(w,h){return o(this,function(g){for(var b=1;b<arguments.length;b++){var R=arguments[b]!=null?arguments[b]:{};b%2?r(Object(R),!0).forEach(function(j){i(g,j,R[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(R)):r(Object(R)).forEach(function(j){Object.defineProperty(g,j,Object.getOwnPropertyDescriptor(R,j))})}return g}({},h,{depth:0,customInspect:!1}))}}])&&s(f.prototype,E),u}()},function(e,t){},function(e,t,n){(function(r){var i;function s(M,A,d){return A in M?Object.defineProperty(M,A,{value:d,enumerable:!0,configurable:!0,writable:!0}):M[A]=d,M}var l=n(49),o=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),E=Symbol("lastPromise"),w=Symbol("handlePromise"),h=Symbol("stream");function g(M,A){return{value:M,done:A}}function b(M){var A=M[o];if(A!==null){var d=M[h].read();d!==null&&(M[E]=null,M[o]=null,M[c]=null,A(g(d,!1)))}}function R(M){r.nextTick(b,M)}var j=Object.getPrototypeOf(function(){}),F=Object.setPrototypeOf((s(i={get stream(){return this[h]},next:function(){var M=this,A=this[u];if(A!==null)return Promise.reject(A);if(this[f])return Promise.resolve(g(void 0,!0));if(this[h].destroyed)return new Promise(function(q,y){r.nextTick(function(){M[u]?y(M[u]):q(g(void 0,!0))})});var d,C=this[E];if(C)d=new Promise(function(q,y){return function(m,I){q.then(function(){y[f]?m(g(void 0,!0)):y[w](m,I)},I)}}(C,this));else{var $=this[h].read();if($!==null)return Promise.resolve(g($,!1));d=new Promise(this[w])}return this[E]=d,d}},Symbol.asyncIterator,function(){return this}),s(i,"return",function(){var M=this;return new Promise(function(A,d){M[h].destroy(null,function(C){C?d(C):A(g(void 0,!0))})})}),i),j);e.exports=function(M){var A,d=Object.create(F,(s(A={},h,{value:M,writable:!0}),s(A,o,{value:null,writable:!0}),s(A,c,{value:null,writable:!0}),s(A,u,{value:null,writable:!0}),s(A,f,{value:M._readableState.endEmitted,writable:!0}),s(A,w,{value:function(C,$){var q=d[h].read();q?(d[E]=null,d[o]=null,d[c]=null,C(g(q,!1))):(d[o]=C,d[c]=$)},writable:!0}),A));return d[E]=null,l(M,function(C){if(C&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"){var $=d[c];return $!==null&&(d[E]=null,d[o]=null,d[c]=null,$(C)),void(d[u]=C)}var q=d[o];q!==null&&(d[E]=null,d[o]=null,d[c]=null,q(g(void 0,!0))),d[f]=!0}),M.on("readable",R.bind(null,d)),d}}).call(this,n(2))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){e.exports=i;var r=n(82);function i(s){if(!(this instanceof i))return new i(s);r.call(this,s)}n(7)(i,r),i.prototype._transform=function(s,l,o){o(null,s)}},function(e,t,n){var r,i=n(26).codes,s=i.ERR_MISSING_ARGS,l=i.ERR_STREAM_DESTROYED;function o(w){if(w)throw w}function c(w,h,g,b){b=function(F){var M=!1;return function(){M||(M=!0,F.apply(void 0,arguments))}}(b);var R=!1;w.on("close",function(){R=!0}),r===void 0&&(r=n(49)),r(w,{readable:h,writable:g},function(F){if(F)return b(F);R=!0,b()});var j=!1;return function(F){if(!R&&!j)return j=!0,function(M){return M.setHeader&&typeof M.abort=="function"}(w)?w.abort():typeof w.destroy=="function"?w.destroy():void b(F||new l("pipe"))}}function u(w){w()}function f(w,h){return w.pipe(h)}function E(w){return w.length?typeof w[w.length-1]!="function"?o:w.pop():o}e.exports=function(){for(var w=arguments.length,h=new Array(w),g=0;g<w;g++)h[g]=arguments[g];var b,R=E(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new s("streams");var j=h.map(function(F,M){var A=M<h.length-1;return c(F,A,M>0,function(d){b||(b=d),d&&j.forEach(u),A||(j.forEach(u),R(b))})});return h.reduce(f)}},function(e,t,n){var r=n(187)(function i(s,l){return(l=l||{}).namespace=s,l.prod=!0,l.dev=!1,l.force||i.force?i.yep(l):i.nope(l)});e.exports=r},function(e,t){var n=[],r=[],i=function(){};function s(g){return!~n.indexOf(g)&&(n.push(g),!0)}function l(g){i=g}function o(g){for(var b=[],R=0;R<n.length;R++)if(n[R].async)b.push(n[R]);else if(n[R](g))return!0;return!!b.length&&new Promise(function(j){Promise.all(b.map(function(F){return F(g)})).then(function(F){j(F.some(Boolean))})})}function c(g){return!~r.indexOf(g)&&(r.push(g),!0)}function u(){i.apply(i,arguments)}function f(g){for(var b=0;b<r.length;b++)g=r[b].apply(r[b],arguments);return g}function E(g,b){var R=Object.prototype.hasOwnProperty;for(var j in b)R.call(b,j)&&(g[j]=b[j]);return g}function w(g){return g.enabled=!1,g.modify=c,g.set=l,g.use=s,E(function(){return!1},g)}function h(g){return g.enabled=!0,g.modify=c,g.set=l,g.use=s,E(function(){var b=Array.prototype.slice.call(arguments,0);return u.call(u,g,f(b,g)),!0},g)}e.exports=function(g){return g.introduce=E,g.enabled=o,g.process=f,g.modify=c,g.write=u,g.nope=w,g.yep=h,g.set=l,g.use=s,g}},function(e,t,n){(function(r){var i=n(65),s=n(22).StringDecoder,l=n(32).Stream;function o(){}e.exports=function(c,u){var f=r.alloc(65536),E=new s("utf8"),w=new l,h="",g=0,b=0;return c.start===-1&&delete c.start,w.readable=!0,w.destroy=function(){w.destroyed=!0,w.emit("end"),w.emit("close")},i.open(c.file,"a+","0644",function(R,j){if(R)return u?u(R):w.emit("error",R),void w.destroy();(function F(){if(!w.destroyed)return i.read(j,f,0,f.length,g,function(M,A){if(M)return u?u(M):w.emit("error",M),void w.destroy();if(!A)return h&&((c.start==null||b>c.start)&&(u?u(null,h):w.emit("line",h)),b++,h=""),setTimeout(F,1e3);var d=E.write(f.slice(0,A));u||w.emit("data",d);for(var C=(d=(h+d).split(/\n+/)).length-1,$=0;$<C;$++)(c.start==null||b>c.start)&&(u?u(null,d[$]):w.emit("line",d[$])),b++;return h=d[C],g+=A,F()});i.close(j,o)})()}),u?w.destroy:w}}).call(this,n(5).Buffer)},function(e,t,n){(function(r,i){function s(M){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(M)}function l(M,A){var d=Object.keys(M);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(M);A&&(C=C.filter(function($){return Object.getOwnPropertyDescriptor(M,$).enumerable})),d.push.apply(d,C)}return d}function o(M){for(var A=1;A<arguments.length;A++){var d=arguments[A]!=null?arguments[A]:{};A%2?l(Object(d),!0).forEach(function(C){c(M,C,d[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(M,Object.getOwnPropertyDescriptors(d)):l(Object(d)).forEach(function(C){Object.defineProperty(M,C,Object.getOwnPropertyDescriptor(d,C))})}return M}function c(M,A,d){return A in M?Object.defineProperty(M,A,{value:d,enumerable:!0,configurable:!0,writable:!0}):M[A]=d,M}function u(M,A){if(!(M instanceof A))throw new TypeError("Cannot call a class as a function")}function f(M,A){for(var d=0;d<A.length;d++){var C=A[d];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(M,C.key,C)}}function E(M,A){return(E=Object.setPrototypeOf||function(d,C){return d.__proto__=C,d})(M,A)}function w(M){var A=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var d,C=g(M);if(A){var $=g(this).constructor;d=Reflect.construct(C,arguments,$)}else d=C.apply(this,arguments);return h(this,d)}}function h(M,A){return!A||s(A)!=="object"&&typeof A!="function"?function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}(M):A}function g(M){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(M)}var b=n(83),R=n(200),j=n(32).Stream,F=n(20);e.exports=function(M){(function(q,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(y&&y.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),y&&E(q,y)})($,M);var A,d,C=w($);function $(){var q,y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return u(this,$),(q=C.call(this,y)).options=y,q.name=y.name||"http",q.ssl=!!y.ssl,q.host=y.host||"localhost",q.port=y.port,q.auth=y.auth,q.path=y.path||"",q.agent=y.agent,q.headers=y.headers||{},q.headers["content-type"]="application/json",q.port||(q.port=q.ssl?443:80),q}return A=$,(d=[{key:"log",value:function(q,y){var m=this;this._request(q,function(I,_){_&&_.statusCode!==200&&(I=new Error("Invalid HTTP Status Code: ".concat(_.statusCode))),I?m.emit("warn",I):m.emit("logged",q)}),y&&r(y)}},{key:"query",value:function(q,y){typeof q=="function"&&(y=q,q={}),(q={method:"query",params:this.normalizeQuery(q)}).params.path&&(q.path=q.params.path,delete q.params.path),q.params.auth&&(q.auth=q.params.auth,delete q.params.auth),this._request(q,function(m,I,_){if(I&&I.statusCode!==200&&(m=new Error("Invalid HTTP Status Code: ".concat(I.statusCode))),m)return y(m);if(typeof _=="string")try{_=JSON.parse(_)}catch(L){return y(L)}y(null,_)})}},{key:"stream",value:function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=new j;(q={method:"stream",params:q}).params.path&&(q.path=q.params.path,delete q.params.path),q.params.auth&&(q.auth=q.params.auth,delete q.params.auth);var m="",I=this._request(q);return y.destroy=function(){return I.destroy()},I.on("data",function(_){for(var L=(_=(m+_).split(/\n+/)).length-1,W=0;W<L;W++)try{y.emit("log",JSON.parse(_[W]))}catch(B){y.emit("error",B)}m=_[L]}),I.on("error",function(_){return y.emit("error",_)}),y}},{key:"_request",value:function(q,y){var m=(q=q||{}).auth||this.auth,I=q.path||this.path||"";delete q.auth,delete q.path;var _=Object.assign({},this.headers);m&&m.bearer&&(_.Authorization="Bearer ".concat(m.bearer));var L=(this.ssl?R:b).request(o(o({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(I.replace(/^\//,"")),headers:_,auth:m&&m.username&&m.password?"".concat(m.username,":").concat(m.password):"",agent:this.agent}));L.on("error",y),L.on("response",function(W){return W.on("end",function(){return y(null,W)}).resume()}),L.end(i.from(JSON.stringify(q),"utf8"))}}])&&f(A.prototype,d),$}(F)}).call(this,n(15).setImmediate,n(5).Buffer)},function(e,t,n){(function(r,i,s){var l=n(84),o=n(7),c=n(85),u=n(31),f=n(191),E=c.IncomingMessage,w=c.readyStates,h=e.exports=function(b){var R,j=this;u.Writable.call(j),j._opts=b,j._body=[],j._headers={},b.auth&&j.setHeader("Authorization","Basic "+new r(b.auth).toString("base64")),Object.keys(b.headers).forEach(function(M){j.setHeader(M,b.headers[M])});var F=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!l.abortController)F=!1,R=!0;else if(b.mode==="prefer-streaming")R=!1;else if(b.mode==="allow-wrong-content-type")R=!l.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");R=!0}j._mode=function(M,A){return l.fetch&&A?"fetch":l.mozchunkedarraybuffer?"moz-chunked-arraybuffer":l.msstream?"ms-stream":l.arraybuffer&&M?"arraybuffer":l.vbArray&&M?"text:vbarray":"text"}(R,F),j._fetchTimer=null,j.on("finish",function(){j._onFinish()})};o(h,u.Writable),h.prototype.setHeader=function(b,R){var j=b.toLowerCase();g.indexOf(j)===-1&&(this._headers[j]={name:b,value:R})},h.prototype.getHeader=function(b){var R=this._headers[b.toLowerCase()];return R?R.value:null},h.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},h.prototype._onFinish=function(){var b=this;if(!b._destroyed){var R=b._opts,j=b._headers,F=null;R.method!=="GET"&&R.method!=="HEAD"&&(F=l.arraybuffer?f(r.concat(b._body)):l.blobConstructor?new i.Blob(b._body.map(function($){return f($)}),{type:(j["content-type"]||{}).value||""}):r.concat(b._body).toString());var M=[];if(Object.keys(j).forEach(function($){var q=j[$].name,y=j[$].value;Array.isArray(y)?y.forEach(function(m){M.push([q,m])}):M.push([q,y])}),b._mode==="fetch"){var A=null;if(l.abortController){var d=new AbortController;A=d.signal,b._fetchAbortController=d,"requestTimeout"in R&&R.requestTimeout!==0&&(b._fetchTimer=i.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},R.requestTimeout))}i.fetch(b._opts.url,{method:b._opts.method,headers:M,body:F||void 0,mode:"cors",credentials:R.withCredentials?"include":"same-origin",signal:A}).then(function($){b._fetchResponse=$,b._connect()},function($){i.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",$)})}else{var C=b._xhr=new i.XMLHttpRequest;try{C.open(b._opts.method,b._opts.url,!0)}catch($){return void s.nextTick(function(){b.emit("error",$)})}"responseType"in C&&(C.responseType=b._mode.split(":")[0]),"withCredentials"in C&&(C.withCredentials=!!R.withCredentials),b._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in R&&(C.timeout=R.requestTimeout,C.ontimeout=function(){b.emit("requestTimeout")}),M.forEach(function($){C.setRequestHeader($[0],$[1])}),b._response=null,C.onreadystatechange=function(){switch(C.readyState){case w.LOADING:case w.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){b._onXHRProgress()}),C.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{C.send(F)}catch($){return void s.nextTick(function(){b.emit("error",$)})}}}},h.prototype._onXHRProgress=function(){(function(b){try{var R=b.status;return R!==null&&R!==0}catch{return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var b=this;b._destroyed||(b._response=new E(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(R){b.emit("error",R)}),b.emit("response",b._response))},h.prototype._write=function(b,R,j){this._body.push(b),j()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,i.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(b,R,j){typeof b=="function"&&(j=b,b=void 0),u.Writable.prototype.end.call(this,b,R,j)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var g=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(5).Buffer,n(6),n(2))},function(e,t,n){var r=n(5).Buffer;e.exports=function(i){if(i instanceof Uint8Array){if(i.byteOffset===0&&i.byteLength===i.buffer.byteLength)return i.buffer;if(typeof i.buffer.slice=="function")return i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}if(r.isBuffer(i)){for(var s=new Uint8Array(i.length),l=i.length,o=0;o<l;o++)s[o]=i[o];return s.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var r={},i=0;i<arguments.length;i++){var s=arguments[i];for(var l in s)n.call(s,l)&&(r[l]=s[l])}return r};var n=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){(function(r,i){var s;(function(l){t&&t.nodeType,r&&r.nodeType;var o=typeof i=="object"&&i;o.global!==o&&o.window!==o&&o.self;var c,u=2147483647,f=/^xn--/,E=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,b=String.fromCharCode;function R(y){throw new RangeError(h[y])}function j(y,m){for(var I=y.length,_=[];I--;)_[I]=m(y[I]);return _}function F(y,m){var I=y.split("@"),_="";return I.length>1&&(_=I[0]+"@",y=I[1]),_+j((y=y.replace(w,".")).split("."),m).join(".")}function M(y){for(var m,I,_=[],L=0,W=y.length;L<W;)(m=y.charCodeAt(L++))>=55296&&m<=56319&&L<W?(64512&(I=y.charCodeAt(L++)))==56320?_.push(((1023&m)<<10)+(1023&I)+65536):(_.push(m),L--):_.push(m);return _}function A(y){return j(y,function(m){var I="";return m>65535&&(I+=b((m-=65536)>>>10&1023|55296),m=56320|1023&m),I+=b(m)}).join("")}function d(y,m){return y+22+75*(y<26)-((m!=0)<<5)}function C(y,m,I){var _=0;for(y=I?g(y/700):y>>1,y+=g(y/m);y>455;_+=36)y=g(y/35);return g(_+36*y/(y+38))}function $(y){var m,I,_,L,W,B,N,D,z,O,p,U=[],V=y.length,Q=0,ee=128,ne=72;for((I=y.lastIndexOf("-"))<0&&(I=0),_=0;_<I;++_)y.charCodeAt(_)>=128&&R("not-basic"),U.push(y.charCodeAt(_));for(L=I>0?I+1:0;L<V;){for(W=Q,B=1,N=36;L>=V&&R("invalid-input"),((D=(p=y.charCodeAt(L++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||D>g((u-Q)/B))&&R("overflow"),Q+=D*B,!(D<(z=N<=ne?1:N>=ne+26?26:N-ne));N+=36)B>g(u/(O=36-z))&&R("overflow"),B*=O;ne=C(Q-W,m=U.length+1,W==0),g(Q/m)>u-ee&&R("overflow"),ee+=g(Q/m),Q%=m,U.splice(Q++,0,ee)}return A(U)}function q(y){var m,I,_,L,W,B,N,D,z,O,p,U,V,Q,ee,ne=[];for(U=(y=M(y)).length,m=128,I=0,W=72,B=0;B<U;++B)(p=y[B])<128&&ne.push(b(p));for(_=L=ne.length,L&&ne.push("-");_<U;){for(N=u,B=0;B<U;++B)(p=y[B])>=m&&p<N&&(N=p);for(N-m>g((u-I)/(V=_+1))&&R("overflow"),I+=(N-m)*V,m=N,B=0;B<U;++B)if((p=y[B])<m&&++I>u&&R("overflow"),p==m){for(D=I,z=36;!(D<(O=z<=W?1:z>=W+26?26:z-W));z+=36)ee=D-O,Q=36-O,ne.push(b(d(O+ee%Q,0))),D=g(ee/Q);ne.push(b(d(D,0))),W=C(I,V,_==L),I=0,++_}++I,++m}return ne.join("")}c={version:"1.4.1",ucs2:{decode:M,encode:A},decode:$,encode:q,toASCII:function(y){return F(y,function(m){return E.test(m)?"xn--"+q(m):m})},toUnicode:function(y){return F(y,function(m){return f.test(m)?$(m.slice(4).toLowerCase()):m})}},(s=function(){return c}.call(t,n,t,r))===void 0||(r.exports=s)})()}).call(this,n(195)(e),n(6))},function(e,t){e.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(e,t,n){e.exports={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}}},function(e,t,n){t.decode=t.parse=n(198),t.encode=t.stringify=n(199)},function(e,t,n){function r(s,l){return Object.prototype.hasOwnProperty.call(s,l)}e.exports=function(s,l,o,c){l=l||"&",o=o||"=";var u={};if(typeof s!="string"||s.length===0)return u;var f=/\+/g;s=s.split(l);var E=1e3;c&&typeof c.maxKeys=="number"&&(E=c.maxKeys);var w=s.length;E>0&&w>E&&(w=E);for(var h=0;h<w;++h){var g,b,R,j,F=s[h].replace(f,"%20"),M=F.indexOf(o);M>=0?(g=F.substr(0,M),b=F.substr(M+1)):(g=F,b=""),R=decodeURIComponent(g),j=decodeURIComponent(b),r(u,R)?i(u[R])?u[R].push(j):u[R]=[u[R],j]:u[R]=j}return u};var i=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"}},function(e,t,n){var r=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};e.exports=function(o,c,u,f){return c=c||"&",u=u||"=",o===null&&(o=void 0),typeof o=="object"?s(l(o),function(E){var w=encodeURIComponent(r(E))+u;return i(o[E])?s(o[E],function(h){return w+encodeURIComponent(r(h))}).join(c):w+encodeURIComponent(r(o[E]))}).join(c):f?encodeURIComponent(r(f))+u+encodeURIComponent(r(o)):""};var i=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function s(o,c){if(o.map)return o.map(c);for(var u=[],f=0;f<o.length;f++)u.push(c(o[f],f));return u}var l=Object.keys||function(o){var c=[];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&c.push(u);return c}},function(e,t,n){var r=n(83),i=n(86),s=e.exports;for(var l in r)r.hasOwnProperty(l)&&(s[l]=r[l]);function o(c){if(typeof c=="string"&&(c=i.parse(c)),c.protocol||(c.protocol="https:"),c.protocol!=="https:")throw new Error('Protocol "'+c.protocol+'" not supported. Expected "https:"');return c}s.request=function(c,u){return c=o(c),r.request.call(this,c,u)},s.get=function(c,u){return c=o(c),r.get.call(this,c,u)}},function(e,t,n){(function(r){function i(b){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(b)}function s(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}function l(b,R){for(var j=0;j<R.length;j++){var F=R[j];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(b,F.key,F)}}function o(b,R){return(o=Object.setPrototypeOf||function(j,F){return j.__proto__=F,j})(b,R)}function c(b){var R=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var j,F=f(b);if(R){var M=f(this).constructor;j=Reflect.construct(F,arguments,M)}else j=F.apply(this,arguments);return u(this,j)}}function u(b,R){return!R||i(R)!=="object"&&typeof R!="function"?function(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}(b):R}function f(b){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(b)}var E=n(87),w=n(3).MESSAGE,h=n(18),g=n(20);e.exports=function(b){(function(A,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(d&&d.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),d&&o(A,d)})(M,b);var R,j,F=c(M);function M(){var A,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(s(this,M),A=F.call(this,d),!d.stream||!E(d.stream))throw new Error("options.stream is required.");return A._stream=d.stream,A._stream.setMaxListeners(1/0),A.isObjectMode=d.stream._writableState.objectMode,A.eol=d.eol||h.EOL,A}return R=M,(j=[{key:"log",value:function(A,d){var C=this;if(r(function(){return C.emit("logged",A)}),this.isObjectMode)return this._stream.write(A),void(d&&d());this._stream.write("".concat(A[w]).concat(this.eol)),d&&d()}}])&&l(R.prototype,j),M}(g)}).call(this,n(15).setImmediate)},function(e,t,n){(function(r){function i(_,L,W){return L in _?Object.defineProperty(_,L,{value:W,enumerable:!0,configurable:!0,writable:!0}):_[L]=W,_}function s(_){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L})(_)}function l(_,L){for(var W=0;W<L.length;W++){var B=L[W];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(_,B.key,B)}}function o(_,L){return(o=Object.setPrototypeOf||function(W,B){return W.__proto__=B,W})(_,L)}function c(_){var L=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var W,B=f(_);if(L){var N=f(this).constructor;W=Reflect.construct(B,arguments,N)}else W=B.apply(this,arguments);return u(this,W)}}function u(_,L){return!L||s(L)!=="object"&&typeof L!="function"?function(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W}(_):L}function f(_){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)})(_)}var E=n(32),w=E.Stream,h=E.Transform,g=n(51),b=n(3),R=b.LEVEL,j=b.SPLAT,F=n(87),M=n(89),A=n(93),d=n(206),C=n(207),$=n(61).warn,q=n(50),y=/%[scdjifoO%]/g,m=function(_){(function(D,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(z&&z.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),z&&o(D,z)})(N,_);var L,W,B=c(N);function N(D){var z;return function(O,p){if(!(O instanceof p))throw new TypeError("Cannot call a class as a function")}(this,N),(z=B.call(this,{objectMode:!0})).configure(D),z}return L=N,(W=[{key:"child",value:function(D){var z=this;return Object.create(z,{write:{value:function(O){var p=Object.assign({},D,O);O instanceof Error&&(p.stack=O.stack,p.message=O.message),z.write(p)}}})}},{key:"configure",value:function(){var D=this,z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},O=z.silent,p=z.format,U=z.defaultMeta,V=z.levels,Q=z.level,ee=Q===void 0?"info":Q,ne=z.exitOnError,Y=ne===void 0||ne,G=z.transports,S=z.colors,T=z.emitErrs,k=z.formatters,J=z.padLevels,K=z.rewriters,re=z.stripColors,se=z.exceptionHandlers,fe=z.rejectionHandlers;if(this.transports.length&&this.clear(),this.silent=O,this.format=p||this.format||n(208)(),this.defaultMeta=U||null,this.levels=V||this.levels||q.npm.levels,this.level=ee,this.exceptions=new M(this),this.rejections=new A(this),this.profilers={},this.exitOnError=Y,G&&(G=Array.isArray(G)?G:[G]).forEach(function(ve){return D.add(ve)}),S||T||k||J||K||re)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
44
|
+
`));se&&this.exceptions.handle(se),fe&&this.rejections.handle(fe)}},{key:"isLevelEnabled",value:function(D){var z=this,O=I(this.levels,D);if(O===null)return!1;var p=I(this.levels,this.level);return p!==null&&(this.transports&&this.transports.length!==0?this.transports.findIndex(function(U){var V=I(z.levels,U.level);return V===null&&(V=p),V>=O})!==-1:p>=O)}},{key:"log",value:function(D,z){for(var O,p,U=arguments.length,V=new Array(U>2?U-2:0),Q=2;Q<U;Q++)V[Q-2]=arguments[Q];if(arguments.length===1)return D[R]=D.level,this._addDefaultMeta(D),this.write(D),this;if(arguments.length===2)return z&&s(z)==="object"?(z[R]=z.level=D,this._addDefaultMeta(z),this.write(z),this):(this.write((i(p={},R,D),i(p,"level",D),i(p,"message",z),p)),this);var ee=V[0];if(s(ee)==="object"&&ee!==null){var ne=z&&z.match&&z.match(y);if(!ne){var Y,G=Object.assign({},this.defaultMeta,ee,(i(Y={},R,D),i(Y,j,V),i(Y,"level",D),i(Y,"message",z),Y));return ee.message&&(G.message="".concat(G.message," ").concat(ee.message)),ee.stack&&(G.stack=ee.stack),this.write(G),this}}return this.write(Object.assign({},this.defaultMeta,(i(O={},R,D),i(O,j,V),i(O,"level",D),i(O,"message",z),O))),this}},{key:"_transform",value:function(D,z,O){if(this.silent)return O();D[R]||(D[R]=D.level),this.levels[D[R]]||this.levels[D[R]]===0||console.error("[winston] Unknown logger level: %s",D[R]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports %j",D);try{this.push(this.format.transform(D,this.format.options))}catch(p){throw p}finally{O()}}},{key:"_final",value:function(D){var z=this.transports.slice();g(z,function(O,p){if(!O||O.finished)return r(p);O.once("finish",p),O.end()},D)}},{key:"add",value:function(D){var z=!F(D)||D.log.length>2?new d({transport:D}):D;if(!z._writableState||!z._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",z),this._onEvent("warn",z),this.pipe(z),D.handleExceptions&&this.exceptions.handle(),D.handleRejections&&this.rejections.handle(),this}},{key:"remove",value:function(D){if(!D)return this;var z=D;return(!F(D)||D.log.length>2)&&(z=this.transports.filter(function(O){return O.transport===D})[0]),z&&this.unpipe(z),this}},{key:"clear",value:function(){return this.unpipe(),this}},{key:"close",value:function(){return this.clear(),this.emit("close"),this}},{key:"setLevels",value:function(){$.deprecated("setLevels")}},{key:"query",value:function(D,z){typeof D=="function"&&(z=D,D={}),D=D||{};var O={},p=Object.assign({},D.query||{});g(this.transports.filter(function(U){return!!U.query}),function(U,V){(function(Q,ee){D.query&&typeof Q.formatQuery=="function"&&(D.query=Q.formatQuery(p)),Q.query(D,function(ne,Y){if(ne)return ee(ne);typeof Q.formatResults=="function"&&(Y=Q.formatResults(Y,D.format)),ee(null,Y)})})(U,function(Q,ee){V&&((ee=Q||ee)&&(O[U.name]=ee),V()),V=null})},function(){return z(null,O)})}},{key:"stream",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},z=new w,O=[];return z._streams=O,z.destroy=function(){for(var p=O.length;p--;)O[p].destroy()},this.transports.filter(function(p){return!!p.stream}).forEach(function(p){var U=p.stream(D);U&&(O.push(U),U.on("log",function(V){V.transport=V.transport||[],V.transport.push(p.name),z.emit("log",V)}),U.on("error",function(V){V.transport=V.transport||[],V.transport.push(p.name),z.emit("error",V)}))}),z}},{key:"startTimer",value:function(){return new C(this)}},{key:"profile",value:function(D){var z=Date.now();if(this.profilers[D]){var O=this.profilers[D];delete this.profilers[D];for(var p=arguments.length,U=new Array(p>1?p-1:0),V=1;V<p;V++)U[V-1]=arguments[V];typeof U[U.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),U.pop());var Q=s(U[U.length-1])==="object"?U.pop():{};return Q.level=Q.level||"info",Q.durationMs=z-O,Q.message=Q.message||D,this.write(Q)}return this.profilers[D]=z,this}},{key:"handleExceptions",value:function(){var D;console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),(D=this.exceptions).handle.apply(D,arguments)}},{key:"unhandleExceptions",value:function(){var D;console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),(D=this.exceptions).unhandle.apply(D,arguments)}},{key:"cli",value:function(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
45
|
+
`))}},{key:"_onEvent",value:function(D,z){z["__winston"+D]||(z["__winston"+D]=function(O){D!=="error"||this.transports.includes(z)||this.add(z),this.emit(D,O,z)}.bind(this),z.on(D,z["__winston"+D]))}},{key:"_addDefaultMeta",value:function(D){this.defaultMeta&&Object.assign(D,this.defaultMeta)}}])&&l(L.prototype,W),N}(h);function I(_,L){var W=_[L];return W||W===0?W:null}Object.defineProperty(m.prototype,"transports",{configurable:!1,enumerable:!0,get:function(){var _=this._readableState.pipes;return Array.isArray(_)?_:[_].filter(Boolean)}}),e.exports=m}).call(this,n(15).setImmediate)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(45)),i=f(n(46)),s=f(n(66)),l=f(n(67)),o=f(n(68)),c=f(n(25)),u=f(n(30));function f(h){return h&&h.__esModule?h:{default:h}}function E(h,g,b){b=(0,l.default)(b);var R=0,j=0,{length:F}=h,M=!1;function A(d,C){d===!1&&(M=!0),M!==!0&&(d?b(d):++j!==F&&C!==i.default||b(null))}for(F===0&&b(null);R<F;R++)g(h[R],R,(0,o.default)(A))}function w(h,g,b){return(0,s.default)(h,1/0,g,b)}t.default=(0,u.default)(function(h,g,b){return((0,r.default)(h)?E:w)(h,(0,c.default)(g),b)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return(i,s,l)=>r(i,l)},e.exports=t.default},function(e,t,n){var r=Object.prototype.toString;e.exports=function(i){if(typeof i.displayName=="string"&&i.constructor.name)return i.displayName;if(typeof i.name=="string"&&i.name)return i.name;if(typeof i=="object"&&i.constructor&&typeof i.constructor.name=="string")return i.constructor.name;var s=i.toString(),l=r.call(i).slice(8,-1);return(s=l==="Function"?s.substring(s.indexOf("(")+1,s.indexOf(")")):l)||"anonymous"}},function(e,t,n){const r=n(13),{LEVEL:i}=n(3),s=n(20),l=e.exports=function(o={}){if(s.call(this,o),!o.transport||typeof o.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=o.transport,this.level=this.level||o.transport.level,this.handleExceptions=this.handleExceptions||o.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=function(c){this.emit("error",c,this.transport)}.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(l,s),l.prototype._write=function(o,c,u){if(this.silent||o.exception===!0&&!this.handleExceptions)return u(null);(!this.level||this.levels[this.level]>=this.levels[o[i]])&&this.transport.log(o[i],o.message,o,this._nop),u(null)},l.prototype._writev=function(o,c){for(let u=0;u<o.length;u++)this._accept(o[u])&&(this.transport.log(o[u].chunk[i],o[u].chunk.message,o[u].chunk,this._nop),o[u].callback());return c(null)},l.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
46
46
|
`))},l.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){function r(s){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(s)}function i(s,l){for(var o=0;o<l.length;o++){var c=l[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(s,c.key,c)}}e.exports=function(){function s(c){if(function(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}(this,s),!c)throw new Error("Logger is required for profiling.");this.logger=c,this.start=Date.now()}var l,o;return l=s,(o=[{key:"done",value:function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];typeof u[u.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),u.pop());var E=r(u[u.length-1])==="object"?u.pop():{};return E.level=E.level||"info",E.durationMs=Date.now()-this.start,this.logger.write(E)}}])&&i(l.prototype,o),s}()},function(e,t,n){(function(r){const i=n(209),{MESSAGE:s}=n(3),l=n(35);function o(c,u){return u instanceof r?u.toString("base64"):typeof u=="bigint"?u.toString():u}e.exports=i((c,u={})=>(c[s]=(u.stable?l.stableStringify:l)(c,u.replacer||o,u.space),c))}).call(this,n(5).Buffer)},function(e,t,n){class r extends Error{constructor(s){super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
47
47
|
Found: ${s.toString().split(`
|
|
48
48
|
`)[0]}
|
|
49
|
-
`),Error.captureStackTrace(this,r)}}e.exports=i=>{if(i.length>2)throw new r(i);function s(o={}){this.options=o}function l(o){return new s(o)}return s.prototype.transform=i,l.Format=s,l}},function(e,t,n){function r(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")}function i(l,o){for(var c=0;c<o.length;c++){var u=o[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}var s=n(88);e.exports=function(){function l(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,l),this.loggers=new Map,this.options=u}var o,c;return o=l,(c=[{key:"add",value:function(u,f){var E=this;if(!this.loggers.has(u)){var w=(f=Object.assign({},f||this.options)).transports||this.options.transports;f.transports=w?w.slice():[];var h=s(f);h.on("close",function(){return E._delete(u)}),this.loggers.set(u,h)}return this.loggers.get(u)}},{key:"get",value:function(u,f){return this.add(u,f)}},{key:"has",value:function(u){return!!this.loggers.has(u)}},{key:"close",value:function(u){var f=this;if(u)return this._removeLogger(u);this.loggers.forEach(function(E,w){return f._removeLogger(w)})}},{key:"_removeLogger",value:function(u){this.loggers.has(u)&&(this.loggers.get(u).close(),this._delete(u))}},{key:"_delete",value:function(u){this.loggers.delete(u)}}])&&i(o.prototype,c),l}()},function(e,t,n){(function(r){const i=n(52),s=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(l,o,c,u){let f,E,w=!1,h=!1;const g=n(94);function b(F){u(o,F)}function R(F,M){let A=`"${o}" ${M}`;throw F&&(A=`${A}`),E&&(A=`${A}. An example of a valid value would be: ${E}`),new i(A)}const j={convertFromBase64:function(){return b("marking for base64 conversion"),w=!0,j},default:function(F){if(typeof F=="number")f=F.toString();else if(Array.isArray(F)||typeof F=="object"&&F!==null)f=JSON.stringify(F);else{if(typeof F!="string")throw new i("values passed to default() must be of Number, String, Array, or Object type");f=F}return b(`setting default value to "${f}"`),j},required:function(F){return F===void 0?(b("marked as required"),h=!0):(b(`setting required flag to ${F}`),h=F),j},example:function(F){return E=F,j}};return Object.entries({...g,...c}).forEach(([F,M])=>{j[F]=function(A){return function(){let d=l[o];if(b(`will be read from the environment using "${A.name}" accessor`),d===void 0)if(f===void 0&&h)b("was not found in the environment, but is required to be set"),R(void 0,"is a required variable, but it was not set");else{if(f===void 0)return void b("was not found in the environment, but is not required. returning undefined");b(`was not found in the environment, parsing default value "${f}" instead`),d=f}h&&(b("verifying variable value is not an empty string"),d.trim().length===0&&R(void 0,"is a required variable, but its value was empty")),w&&(b("verifying variable is a valid base64 string"),d.match(s)||R(d,"should be a valid base64 string if using convertFromBase64"),b("converting from base64 to utf8 string"),d=r.from(d,"base64").toString());const C=[d].concat(Array.prototype.slice.call(arguments));try{b(`passing value "${d}" to "${A.name}" accessor`);const $=A.apply(A,C);return b(`parsed successfully, returning ${$}`),$}catch($){R(d,$.message)}}}(M)}),j}}).call(this,n(5).Buffer)},function(e,t,n){const r=n(33);e.exports=function(i,s){return s=s||",",i.length?r(i).split(s).filter(Boolean):[]}},function(e,t,n){e.exports=function(r){const i=r.toLowerCase();if(i!=="false"&&i!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return i!=="false"}},function(e,t,n){e.exports=function(r){const i=r.toLowerCase();if(["false","0","true","1"].indexOf(i)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(i==="0"||i==="false")}},function(e,t,n){const r=n(95);e.exports=function(i){var s=r(i);if(s>65535)throw new Error("cannot assign a port number greater than 65535");return s}},function(e,t,n){const r=n(33);e.exports=function(i,s){const l=r(i);if(s.indexOf(l)<0)throw new Error(`should be one of [${s.join(", ")}]`);return l}},function(e,t,n){const r=n(54);e.exports=function(i){const s=r(i);if(s>0)throw new Error("should be a negative float");return s}},function(e,t,n){const r=n(54);e.exports=function(i){const s=r(i);if(s<0)throw new Error("should be a positive float");return s}},function(e,t,n){const r=n(53);e.exports=function(i){const s=r(i);if(s>0)throw new Error("should be a negative integer");return s}},function(e,t,n){const r=n(55);e.exports=function(i){var s=r(i);if(!Array.isArray(s))throw new Error("should be a parseable JSON Array");return s}},function(e,t,n){const r=n(55);e.exports=function(i){var s=r(i);if(Array.isArray(s))throw new Error("should be a parseable JSON Object");return s}},function(e,t,n){e.exports=function(r,i){try{RegExp(void 0,i)}catch{throw new Error("invalid regexp flags")}try{return new RegExp(r,i)}catch{throw new Error("should be a valid regexp")}}},function(e,t,n){const r=n(96);e.exports=function(i){return r(i).toString()}},function(e,t,n){const r=n(33),i=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021\u0023-\u005b\u005d-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021-\u005a\u0053-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])+)\])$/;e.exports=function(s){const l=r(s);if(!i.test(l))throw new Error("should be a valid email address");return l}},function(e,t,n){e.exports=function(r,i){return function(s,l){i&&i.match(/prod|production/)||r(`env-var (${s}): ${l}`)}}},function(e,t,n){(function(r){(function(){var i,s,l,o,c,u;typeof performance<"u"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:r!=null&&r.hrtime?(e.exports=function(){return(i()-c)/1e6},s=r.hrtime,o=(i=function(){var f;return 1e9*(f=s())[0]+f[1]})(),u=1e9*r.uptime(),c=o-u):Date.now?(e.exports=function(){return Date.now()-l},l=Date.now()):(e.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(this)}).call(this,n(2))},function(e,t,n){(function(r){(function(i){function s(o){if((o=o===void 0?"utf-8":o)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+o+"') is invalid.")}function l(o,c){if(c=c===void 0?{fatal:!1}:c,(o=o===void 0?"utf-8":o)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+o+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(i.TextEncoder&&i.TextDecoder)return!1;Object.defineProperty(s.prototype,"encoding",{value:"utf-8"}),s.prototype.encode=function(o,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");c=0;for(var u=o.length,f=0,E=Math.max(32,u+(u>>1)+7),w=new Uint8Array(E>>3<<3);c<u;){var h=o.charCodeAt(c++);if(55296<=h&&56319>=h){if(c<u){var g=o.charCodeAt(c);(64512&g)==56320&&(++c,h=((1023&h)<<10)+(1023&g)+65536)}if(55296<=h&&56319>=h)continue}if(f+4>w.length&&(E+=8,E=(E*=1+c/o.length*2)>>3<<3,(g=new Uint8Array(E)).set(w),w=g),(4294967168&h)==0)w[f++]=h;else{if(!(4294965248&h))w[f++]=h>>6&31|192;else if(!(4294901760&h))w[f++]=h>>12&15|224,w[f++]=h>>6&63|128;else{if(4292870144&h)continue;w[f++]=h>>18&7|240,w[f++]=h>>12&63|128,w[f++]=h>>6&63|128}w[f++]=63&h|128}}return w.slice(0,f)},Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(l.prototype,"fatal",{value:!1}),Object.defineProperty(l.prototype,"ignoreBOM",{value:!1}),l.prototype.decode=function(o,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");c=0;for(var u=(o=new Uint8Array(o)).length,f=[];c<u;){var E=o[c++];if(E===0)break;if(!(128&E))f.push(E);else if((224&E)==192){var w=63&o[c++];f.push((31&E)<<6|w)}else if((240&E)==224){w=63&o[c++];var h=63&o[c++];f.push((31&E)<<12|w<<6|h)}else(248&E)==240&&(65535<(E=(7&E)<<18|(w=63&o[c++])<<12|(h=63&o[c++])<<6|63&o[c++])&&(E-=65536,f.push(E>>>10&1023|55296),E=56320|1023&E),f.push(E))}return String.fromCharCode.apply(null,f)},i.TextEncoder=s,i.TextDecoder=l})(typeof window<"u"?window:r!==void 0?r:this)}).call(this,n(6))},function(e,t,n){n.r(t),n.d(t,"AuthClient",function(){return s}),n.d(t,"RtcSignalingClient",function(){return o}),n.d(t,"Credentials",function(){return L}),n.d(t,"IRtcStream",function(){}),n.d(t,"SignalingPromiseClient",function(){return W.SignalingPromiseClient}),n.d(t,"IRtcClientConfigurationV1",function(){}),n.d(t,"IRtcClientConfiguration",function(){}),n.d(t,"IRtcConnectionStatsInfo",function(){}),n.d(t,"IRtcSendConfiguration",function(){}),n.d(t,"IRtcSessionMetricsMessageCounts",function(){}),n.d(t,"IRtcStreamMessage",function(){}),n.d(t,"IRtcStreamPayload",function(){}),n.d(t,"IStreamControl",function(){}),n.d(t,"RtcClient",function(){return Nt}),n.d(t,"RtcClientV1",function(){return Rt}),n.d(t,"createRtcStreamMessage",function(){return De});var r=n(28),i=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class s extends r.a{adminSignup(D,H){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:H,method:"POST",body:JSON.stringify(D)})})}login(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:JSON.stringify(D),allowUnsafeRetries:!0})})}loginWithGoogleToken(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:JSON.stringify(D),allowUnsafeRetries:!0})})}refresh(D,H){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:JSON.stringify({refreshToken:D,tokenExpirationSeconds:H}),allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:JSON.stringify(D)})})}forgotPassword(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:JSON.stringify({email:D})})})}confirmForgotPassword(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:JSON.stringify(D)})})}resendInvitation(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:JSON.stringify({email:D})})})}changePassword({token:D,refreshToken:H,currentPassword:X,newPassword:ie}){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:D,method:"POST",body:JSON.stringify({refreshToken:H,currentPassword:X,newPassword:ie})})})}getDeviceCredentials(D){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:D,method:"POST",allowUnsafeRetries:!0})})}impersonate(D,H){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:D,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({userId:H})})})}createServiceAccount(D,H,X,ie){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:D,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({name:H,roleId:X,tags:ie})})})}getFeatures(D){return i(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:D})).features})}}var l=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class o extends r.a{createPeer(D,H){return l(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:D,method:"POST",body:JSON.stringify(H)})})}getPeers(D){return l(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:D})).items})}refreshPeer(D,H){return l(this,void 0,void 0,function*(){yield this.fetch(`peers/${H}/refresh`,{token:D,method:"POST",allowUnsafeRetries:!0})})}createSession(D,H){return l(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:D,method:"POST",body:JSON.stringify(H)})})}refreshSession(D,H){return l(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/refresh`,{token:D,method:"POST",allowUnsafeRetries:!0})})}deleteSession(D,H){return l(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}`,{token:D,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(D){return l(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:D})).items})}getIceServers(D){return l(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:D})).items})}addSignals(D,H,X){return l(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/add-signals`,{token:D,method:"POST",body:JSON.stringify(X)})})}takeSignals(D,H){return l(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${H}/take-signals`,{token:D,method:"POST"})).items})}}var c=n(1),u=n(8),f=n(14),E=n.n(f),w=n(104),h=n.n(w),g=n(0),b=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class R{constructor(D){this.name="LogReporter",this.type="simple",this.message=D}send(D){return b(this,void 0,void 0,function*(){var H,X;g.a.info(this.message,(H=D.reduce((ie,oe)=>Object.assign(Object.assign({},ie),{[oe.name]:oe.stat}),{}),X=ie=>{const{sum:oe,count:de}=ie,ye=oe/de;return Object.assign(Object.assign({},ie),{average:ye})},Object.keys(H).reduce((ie,oe)=>Object.assign(Object.assign({},ie),{[oe]:X(H[oe])}),{})))})}}var j=n(4),F=n(39);function M(pe){return!!pe.match(/^[a-zA-Z0-9-_.,:?'"()@\/\\#$+ ]{1,255}$/)}var A=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};function d({func:pe,delay:D,immediate:H=!1}){let X=!1,ie=setTimeout(function de(){return A(this,void 0,void 0,function*(){if(X)return;const ye=new Date().getTime();try{oe=pe(),yield oe}finally{if(!X){const be=new Date().getTime();ie=setTimeout(de,Math.max(D-(be-ye),0))}}})},H?0:D),oe=Promise.resolve();return{stop(){return A(this,void 0,void 0,function*(){X=!0,clearTimeout(ie),yield oe})}}}var C=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};const $=n(226),q=!!j.c,y=new class{constructor(pe){this.samplePeriodSeconds=60,this.buffer={},this.reporters=[],this.flushInterval=d({func:()=>this.flushStats(),delay:this.samplePeriodSeconds*c.a.second}),this.tags=this.filterTags((pe==null?void 0:pe.tags)||{app:j.a,version:j.j,namespace:j.i,instanceId:F.a})}shutdown(){return C(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(u.a)(2*c.a.second)})}aggregate(pe,D,H){this.addToBuffer(this.buffer,this.encodeKey({metric:pe,tags:this.filterTags(H||{})}),typeof D=="number"?{min:D,max:D,sum:D,count:1}:D)}increment(pe,D){this.aggregate(pe,1,D)}timer(pe,D,H){return C(this,void 0,void 0,function*(){const X=$(),ie=yield D(),oe=$();return this.aggregate(pe,oe-X,H),ie})}registerStatsReporter(pe){this.reporters.push(pe)}setTag(pe,D){const H=this.filterTags({[pe]:D});this.tags=Object.assign(Object.assign({},this.tags),H)}addToBuffer(pe,D,H){if(pe[D]){const{min:X,max:ie,sum:oe,count:de}=pe[D];pe[D]={min:Math.min(X,H.min),max:Math.max(ie,H.max),sum:oe+H.sum,count:de+H.count}}else pe[D]=H}write(pe){return C(this,void 0,void 0,function*(){yield Promise.all(this.reporters.map(D=>C(this,void 0,void 0,function*(){let H;const X={};switch(D.type){case"simple":for(const[oe,de]of Object.entries(pe)){const{metric:ye}=this.decodeKey(oe);this.addToBuffer(X,this.encodeKey({metric:ye}),de)}H=X;break;case"tagged":H=pe;break;default:(function(oe){throw new Error(`Unreachable type encountered (${oe})`)})(D.type)}const ie=Object.entries(H);if(ie.length>0)return D.send(ie.map(([oe,de])=>{const{metric:ye,tags:be}=this.decodeKey(oe);return{name:ye,tags:Object.assign(Object.assign({},be),this.tags),stat:de}}),this.samplePeriodSeconds).catch(oe=>{g.a.debug(`Failed to write stats to ${D.name}`,{error:oe})})})))})}flushStats(){return C(this,void 0,void 0,function*(){yield this.write(this.buffer),this.buffer={}})}encodeKey(pe){return E()(Object.assign(Object.assign({},pe),Object.keys(pe.tags||{}).length>0?{tags:pe.tags}:{}))}decodeKey(pe){return JSON.parse(pe)}filterTags(pe){return Object.entries(pe||{}).reduce((D,[H,X])=>(M(H)&&M(X)&&(D[H]=X),D),{})}};q||["local","on-prem"].includes(j.i)||y.registerStatsReporter(new R("stats"));var m=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class I extends class{constructor(D){this.options=D,this.cache=new h.a(Object.assign(Object.assign(Object.assign({},D.dispose||D.disposeAfter?{ttlAutopurge:!0}:{}),D),{dispose:(...H)=>{var X;H[2]==="evict"&&y.increment("lru-eviction",{name:D.name}),(X=D.dispose)===null||X===void 0||X.call(D,...H)},disposeAfter:(...H)=>{var X;this.updateStats(),(X=D.disposeAfter)===null||X===void 0||X.call(D,...H)}})),this.stringify=D.fastStringify?JSON.stringify:E.a}set(D,H,X){const ie=this.stringify(D);if(!this.cache.set(ie,H,{ttl:X})){const oe=this.cache.sizeCalculation?this.cache.sizeCalculation(H,ie):"unknown";throw Error(`Value too large (${oe} > ${this.cache.max})`)}this.updateStats()}get(D){const{name:H}=this.options,X=this.stringify(D),ie=this.cache.getRemainingTTL(X);return ie<=0?y.increment("cache-miss",{name:H}):ie!==1/0&&y.aggregate("cache-item-ttl",ie,{name:H}),this.cache.get(X)}delete(D){this.cache.delete(this.stringify(D))}peek(D){return this.cache.peek(this.stringify(D))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(D){this.cache.forEach(D)}purgeStale(){return this.cache.purgeStale()}updateStats(){const{name:D}=this.options;y.aggregate("cache-item-count",this.cache.size,{name:D}),this.cache.calculatedSize!==void 0&&y.aggregate("cache-length",this.cache.calculatedSize,{name:D})}}{constructor(D){if(super(D),this.expireRejectedPromiseValues=D.expireRejectedPromiseValues===void 0||D.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=D.rejectedPromiseValueTtl!==void 0?D.rejectedPromiseValueTtl:c.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(D,H,X){super.set(D,H,X),this.expireRejectedPromiseValues&&H.catch(()=>m(this,void 0,void 0,function*(){yield Object(u.a)(this.rejectedPromiseValueTtl),this.peek(D)===H&&this.delete(D)}))}}var _=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class L{constructor(D,H,X){this.authClient=D,this.email=H,this.password=X,this.tokenTtlMs=1*c.a.hour,this.tokenCache=new I({name:"Credentials-tokenCache",max:100,ttl:this.tokenTtlMs-5*c.a.minute,fastStringify:!0})}getToken(){return _(this,void 0,void 0,function*(){let D=this.tokenCache.get(this.email);return D||(D=(()=>_(this,void 0,void 0,function*(){const{authentication:H}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/c.a.second});if(!H)throw new Error("User account not verified.");return H.accessToken}))(),this.tokenCache.set(this.email,D)),D})}}var W=n(97),B=n(40),N=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class P extends B.a{constructor(D){super(D)}postLanRtcOffer(D){return N(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:JSON.stringify(D)})})}}var z=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};function O(pe){return z(this,void 0,void 0,function*(){return(yield Promise.all(pe.map(D=>D.catch(H=>H)))).filter(D=>D instanceof Error)})}function p(pe){if(pe!==void 0)return pe;throw new Error("Value is undefined")}function U(pe,D){const H=pe.reduce((X,ie)=>[...X,...ie.urls],[]).filter(X=>V(X,D)).sort(X=>Q(X,"udp")?-1:0).shift();if(H)return Object.assign(Object.assign({},p(pe.find(X=>X.urls.includes(H)))),{urls:[H]})}function V(pe,D){switch(D){case"stun":return/^stuns?:/.test(pe);case"turn":return/^turns?:/.test(pe)}}function Q(pe,D){return pe.endsWith(`transport=${D}`)}var ee=n(9),ne=n(24),Y=n(229);class G extends Error{constructor(D,H){super(`Deadline expired after ${D}ms + ${H}ms`)}}class S{static withDeadline(D,H){const X=new Promise((ie,oe)=>{setTimeout(()=>{oe(new G(H,this.grpcCallDeadlineSlopMs))},H+this.grpcCallDeadlineSlopMs)});return Promise.race([D,X])}}S.grpcCallDeadlineSlopMs=500*c.a.millisecond;var T=n(29);const k={ordered:!1,maxPacketLifeTime:300*c.a.millisecond},J={ordered:!0},K={ordered:!0},re={ordered:!1,maxRetransmits:0},se={ordered:!1,maxRetransmits:0},fe=pe=>"received"in pe&&pe.received!==void 0,ve=pe=>!("received"in pe)||pe.received===void 0,Ce=2*c.a.second;function Se(pe,D={}){const H=Array.from(pe.values()),X=H.filter(fe),ie=X.length>0,oe=Math.max(...X.map(ce=>ce.received));let de;if(ie){const ce=H.length,le=X.length,Re=X.map(Le=>Le.received-Le.sent),{standardDeviation:Me,mean:xe,jitter:ze}=function(Le){const ke=Le.length;if(ke===0)return{mean:NaN,standardDeviation:-1,jitter:NaN};const $e=Le.reduce((Qe,st)=>Qe+st,0)/ke,qe=Math.sqrt(Le.map(Qe=>Math.pow(Qe-$e,2)).reduce((Qe,st)=>Qe+st)/ke);if(ke===1)return{mean:$e,standardDeviation:qe,jitter:NaN};let Je=0;for(let Qe=1;Qe<ke;Qe++)Je+=Math.abs(Le[Qe]-Le[Qe-1]);return{mean:$e,standardDeviation:qe,jitter:Je/(ke-1)}}(Re),Xe=H.filter(Le=>Le.sent<oe-Ce),Ze=Xe.filter(ve),Ke=Ze.length===0?0:Ze.length/Xe.length;de={pingsSent:ce,pongsReceived:le,average:xe,standardDeviation:Me,jitter:ze,max:Math.max(...Re),min:Math.min(...Re),loss:Ke}}else de=null;const{temporalNow:ye=Date.now()}=D,be=(ie?oe:ye)-4*Ce;return Array.from(pe.entries()).forEach(ce=>{const[le,Re]=ce;Re.sent<be&&pe.delete(le)}),de}function Ie({entityId:pe,streamName:D,streamType:H}){return`${pe}.${D}.${H}`}var Te=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class Oe{constructor(D,H){this.sessionId=D,this.connection=H,this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=D,this.connection=H}updateRemoteMessagesCounts(D){if(D.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const H of D.payload.streamsInfo.items)this.counts.remoteSent.set(H.streamId,H.sentCount),this.counts.remoteReceived.set(H.streamId,H.receivedCount)}}getLocalStreamsInfo(D){const{localSent:H,localReceived:X}=this.counts;return{items:[...new Set([...H.keys(),...X.keys()])].map(ie=>{var oe,de;return{streamId:ie,sentCount:(oe=H.get(ie))!==null&&oe!==void 0?oe:0,receivedCount:(de=X.get(ie))!==null&&de!==void 0?de:0}}),timestamp:D}}incrementLocalSent(D){const{localSent:H}=this.counts,X=Ie(D.header.stream);H.set(X,(H.get(X)||0)+1)}incrementLocalReceived(D){const{localReceived:H}=this.counts,X=Ie(D.header.stream),ie=H.get(X)||0;if(ie===0){const{streamName:oe,streamType:de}=D.header.stream;g.a.debug("RTC client received first message for stream",{streamName:oe,streamType:de})}H.set(X,ie+1)}uploadMetrics(){return Te(this,void 0,void 0,function*(){const{sessionId:D}=this,H=yield this.connection.peerConnection.getStats(),X={};H.forEach(ce=>X[ce.id]=ce),g.a.debug("rtc-stats",Object.assign(Object.assign({},X),{sessionId:D}));const{localSent:ie,localReceived:oe,remoteSent:de,remoteReceived:ye}=this.counts,be=[...new Set([...ie.keys(),...oe.keys()])].reduce((ce,le)=>{const Re=ie.get(le),Me=oe.get(le),xe=de.get(le),ze=ye.get(le);return Object.assign(Object.assign({},ce),{[`local-${le}-sent`]:Re,[`local-${le}-received`]:Me,[`remote-${le}-sent`]:xe,[`remote-${le}-received`]:ze})},{sessionId:D});g.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},be))})}}function De(pe,D,H){return{header:{stream:pe,created:Date.now(),frameId:H||""},payload:D}}function Ye(pe){return new Set(["disconnected","failed","closed"]).has(pe.iceConnectionState)}function nt(pe){switch(pe.header.stream.streamType){case"twist":{const{twist:D}=pe.payload;if(!D)throw Error("twist not in payload of RTC message with type twist");return{header:pe.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},D.linear),angular:Object.assign({x:0,y:0,z:0},D.angular)}}}}case"pose":{const{pose:D}=pe.payload;if(!D)throw Error("pose not in payload of RTC message with type pose");return{header:pe.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},D.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},D.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:D}=pe.payload;if(!D)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const H=new Array(36).fill(0);return D.covariance.forEach((X,ie)=>{if(ie>=36)throw Error("covariance contains more than 36 elements");H[ie]=X}),{header:pe.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},D.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},D.pose.rotation)},covariance:H}}}}case"point":{const{point:D}=pe.payload;if(!D)throw Error("point not in payload of RTC message with type point");return{header:pe.header,payload:{point:Object.assign({x:0,y:0,z:0},D)}}}default:return pe}}var tt=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class bt{constructor(D,H,X){this.peerConnection=D,this.config=H,this.dataChannelNotifier=X,this.connectTimeoutMs=20*c.a.second,this.iceGatheringTimeoutMs=15*c.a.second,this.pingUpdateTimeoutMs=1*c.a.second,this.pingV2UpdateTimeoutMs=250*c.a.millisecond,this.pingV2MetricsGatherTimeoutMs=1*c.a.second,this.streamsInfoUpdateTimeoutMs=2*c.a.second,this.reassemblyTimeoutMs=500*c.a.millisecond,this.reassemblyTableCleanupMs=1*c.a.second,this.heartbeatTimeoutMs=20*c.a.millisecond,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1,this.pingV2Map=new Map,this.sendPingV2=()=>{const{latestTryOnceStreamChannel:oe}=this;if(!oe)return;const de=new Date().getTime(),ye=Object(Y.a)();this.sendSystemMessage(oe,{type:"ping-v2",payload:{timestamp:de,id:ye}}),this.pingV2Map.set(ye,{sent:de})},this.gatherPingV2Metrics=()=>{const oe=Se(this.pingV2Map);if(oe){const de=this.getRemoteDeviceId();this.pingInfo=oe,y.aggregate("rtc-ping-average",oe.average,Object.assign({},de?{deviceId:de}:{})),y.aggregate("rtc-ping-loss",oe.loss,Object.assign({},de?{deviceId:de}:{})),y.aggregate("rtc-jitter",oe.jitter,Object.assign({},de?{deviceId:de}:{}))}};const{isOffer:ie}=H.baseConfig;ie?this.initializeChannels(D):D.ondatachannel=oe=>{switch(oe.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=oe.channel;break;case"stream.reliable":this.reliableStreamChannel=oe.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=oe.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=oe.channel;break;case"heartbeat":return void(this.heartbeatChannel=oe.channel);default:return void this.dataChannelNotifier(oe.channel)}this.setupChannel(oe.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:oe}=this;oe&&this.sendSystemMessage(oe,{type:"ping"})},this.pingUpdateTimeoutMs),this.pingV2UpdateTimeout=setInterval(this.sendPingV2,this.pingV2UpdateTimeoutMs),this.pingV2MetricsGatherTimeout=setInterval(this.gatherPingV2Metrics,this.pingV2MetricsGatherTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:oe}=this;oe&&this.sendSystemMessage(oe,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const oe=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((de,ye,be)=>{oe>ye+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(de)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:oe}=this;oe&&oe.readyState==="open"&&oe.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(D){return tt(this,void 0,void 0,function*(){const{peerConnection:H}=this,{track:X}=this.config.baseConfig,ie=(()=>{try{return JSON.parse(D.getPayload())}catch{return}})();if(!ie)return void g.a.error("Received unparseable signal.");g.a.debug("Handling signal",{description:ie});const{sdp:oe,type:de}=ie;if(!oe||!de)return void g.a.warn("Received non-SDP signal");const{signalingState:ye,connectionState:be}=H;if(ye!=="stable"||be!=="connected")if(H.remoteDescription)g.a.warn(`Received SDP after remote description was set: ${oe}`);else{if(de==="offer"){if(ye!=="stable")return void g.a.warn("Received offer SDP when signaling is ongoing.");yield H.setRemoteDescription(ie);const ce=yield H.createAnswer();yield H.setLocalDescription(ce);const le=D.clone();return X==null||X("Answer Received",le),le.setPayload(JSON.stringify(ce)),le.setReceiverId(D.getSenderId()),le.setSenderId(D.getReceiverId()),le}if(de==="answer"){if(ye==="stable")return void g.a.warn("Received answer SDP when signaling hasn't started.");yield H.setRemoteDescription(ie)}}else g.a.warn(`Received SDP when already connected: ${oe}`)})}send(D,H){const X=this.getChannelFromLabel(H.channelLabel);X?this.sendOnChannel(X,D):g.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(D){this.sendSystemMessage(p(this.reliableStreamChannel),{type:"stream-control",streamControl:D})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:D,latestTtlStreamChannel:H,latestTryOnceStreamChannel:X,latestReliableStreamChannel:ie}=this;return(D==null?void 0:D.readyState)==="open"&&(H==null?void 0:H.readyState)==="open"&&(X==null?void 0:X.readyState)==="open"&&(ie==null?void 0:ie.readyState)==="open"}close(){return tt(this,void 0,void 0,function*(){if(this.closeCalled)return;this.closeCalled=!0,this.sessionMetrics&&(yield this.sessionMetrics.uploadMetrics()),lt(this.pingUpdateTimeout),lt(this.pingV2UpdateTimeout),lt(this.pingV2MetricsGatherTimeout),lt(this.reassemblyTableCleanupTimeout),lt(this.streamsInfoUpdateTimeout),lt(this.heartbeatTimeout);const{peerConnection:D,reliableStreamChannel:H,latestTtlStreamChannel:X,latestTryOnceStreamChannel:ie,latestReliableStreamChannel:oe}=this;D.close(),H==null||H.close(),X==null||X.close(),ie==null||ie.close(),oe==null||oe.close()})}getPing(){return this.pingTimeMs}getPingInfo(){return this.pingInfo}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var D;return(D=this.config.remoteConfig)===null||D===void 0?void 0:D.sessionCreatedTimestamp}setSessionCreatedTimestamp(D){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=D)}getSessionId(){var D;return(D=this.config.remoteConfig)===null||D===void 0?void 0:D.sessionId}setSessionId(D){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=D,this.sessionMetrics=new Oe(D,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var D;return(D=this.config.baseConfig)===null||D===void 0?void 0:D.remoteDeviceId}setRemoteDeviceId(D){this.config.baseConfig.remoteDeviceId=D}getSessionMetricsMessageCounts(){var D;return(D=this.sessionMetrics)===null||D===void 0?void 0:D.counts}getConnectionStatsInfo(){return tt(this,void 0,void 0,function*(){const{peerConnection:D}=this;if(!D)return;const H=yield D.getStats(null),X=[];H.forEach(be=>{X.push(be)});const ie=X.find(be=>be.type==="transport");if(!ie)return;const oe=X.find(be=>(be.type==="candidate-pair"||be.type==="candidatepair")&&be.id===ie.selectedCandidatePairId);if(!oe)return;const de=X.find(be=>be.id===oe.localCandidateId),ye=X.find(be=>be.id===oe.remoteCandidateId);return de&&ye&&(de.address=de.address||de.ip,ye.address=ye.address||ye.ip,de.address!==void 0&&ye.address!==void 0)?{transport:ie,localCandidate:de,remoteCandidate:ye}:void 0})}initializeChannels(D){this.heartbeatChannel=D.createDataChannel("heartbeat",se),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=D.createDataChannel("stream.latest-ttl",k),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=D.createDataChannel("stream.reliable",J),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=D.createDataChannel("stream.latest-reliable",K),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=D.createDataChannel("stream.latest-try-once",re),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var D,H,X;return tt(this,void 0,void 0,function*(){const{gotOffer:ie}=this,{peerConnection:oe,config:de}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const ye=(D=this.config.remoteConfig)===null||D===void 0?void 0:D.sessionId;if(ie)return void g.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,Ye(this.peerConnection))return void g.a.debug("Failed to generate offer because the peer connection was inactive.");const be=de.baseConfig.track;oe.onicecandidate=()=>{this.hasIceCandidate=!0},oe.oniceconnectionstatechange=()=>tt(this,void 0,void 0,function*(){const xe=oe.iceConnectionState;if(xe==="connected"||xe==="completed"){const ze=yield this.getConnectionStatsInfo(),Xe=ze?function(Ze){const Ke=Ze.localCandidate.candidateType,Le=Ze.remoteCandidate.candidateType;return Ke==="host"&&Le==="host"?"local":Ke==="relay"||Le==="relay"?"TURN":"STUN"}(ze):void 0;g.a.info(`ICE connection state changed to ${xe}`,{sessionId:ye,connectionStatsInfo:ze,iceMode:Xe}),be==null||be("ICE connection state change",{iceConnectionState:xe,sessionId:ye,connectionStatsInfo:ze,iceMode:Xe})}}),yield oe.setLocalDescription(yield oe.createOffer());const ce=new Date().getTime();for(;;){const xe=new Date().getTime()-ce;if(xe>this.connectTimeoutMs)return void g.a.debug("Failed to generate offer because ICE gathering timed out.");if(xe>this.iceGatheringTimeoutMs&&this.hasIceCandidate){g.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:xe}),be==null||be("ICE gathering partially completed",{sessionId:ye,iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:xe});break}if(oe.iceGatheringState==="complete"){g.a.debug("ICE gathering complete",{iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:xe}),be==null||be("ICE gathering completed",{sessionId:ye,iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:xe});break}yield Object(u.a)(.1*c.a.second)}const le=(H=this.peerConnection.getConfiguration().iceServers)!==null&&H!==void 0?H:[];for(const xe of le)"credentialType"in xe&&(xe.credentialType=void 0);const Re=JSON.stringify(le),Me=new ee.Signal;return Me.setPayload(JSON.stringify(oe.localDescription)),Me.setSenderId(this.config.baseConfig.localPeerId),Me.setReceiverId(this.config.baseConfig.remotePeerId),Me.setIceServers(Re),Me.setIceTransportPolicy((X=this.peerConnection.getConfiguration().iceTransportPolicy)!==null&&X!==void 0?X:"all"),this.config.baseConfig.sessionType!==void 0?Me.setSessionType(this.config.baseConfig.sessionType):Me.setSessionType(ee.SessionType.TELEOP),g.a.debug("Sending offer signal with description",{description:Me.getPayload()}),Me})}getLanOffer(){return tt(this,void 0,void 0,function*(){const{peerConnection:D,gotOffer:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if(H)return void g.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,Ye(this.peerConnection))return void g.a.debug("Failed to generate offer because the peer connection was inactive.");yield D.setLocalDescription(yield D.createOffer());const X=new Date().getTime();for(;;){if(new Date().getTime()-X>this.iceGatheringTimeoutMs)return void g.a.debug("Failed to generate offer because ICE gathering timed out.");if(D.iceGatheringState==="complete")break;yield Object(u.a)(.1*c.a.second)}const ie=D.localDescription;if(ie)return g.a.debug("Sending LAN offer signal with description",{description:ie}),ie;g.a.error("Failed to generate LAN offer description")})}handleLanAnswer(D){return tt(this,void 0,void 0,function*(){const{peerConnection:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield H.setRemoteDescription(D)})}getChannelFromLabel(D){switch(D){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(D,H){let X;try{X=Object(T.encode)(JSON.stringify(H))}catch(ie){return void g.a.warn("Failed to encode RTC message",{error:ie})}try{D.send(X),this.sessionMetrics&&this.sessionMetrics.incrementLocalSent(H)}catch(ie){g.a.warn("Failed to send message to channel",{error:ie,channel:D.label})}}channelNotRecognized(D){return D!==this.latestTtlStreamChannel&&D!==this.latestReliableStreamChannel&&D!==this.latestTryOnceStreamChannel&&D!==this.reliableStreamChannel}setupChannel(D){D.onmessage=H=>{if(this.channelNotRecognized(D))return void g.a.warn("Received message on unrecognized data channel.");let X;try{X=JSON.parse(Object(T.decode)(H.data))}catch(ie){return void g.a.warn("Received unparseable message on RTC stream data channel",{error:ie,channel:D.label})}X.communicationType==="message-chunk"?this.receiveChannelMessageChunk(D,X):this.receiveChannelMessage(D,X)},D.onerror=H=>{g.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:D.label})},D.onopen=()=>{g.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:D.label})},D.onclose=()=>{const H={bufferedAmount:D.bufferedAmount,sessionId:this.getSessionId(),channelLabel:D.label};this.closeCalled===!1?g.a.debug("Unexpected channel closed",H):g.a.debug("Channel closed",H)}}receiveChannelMessage(D,H){const{config:X}=this,{remotePeerId:ie}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),H=nt(H),this.sessionMetrics&&this.sessionMetrics.incrementLocalReceived(H),this.handleSystemMessage(D,H)||(D===this.latestTryOnceStreamChannel||D===this.latestTtlStreamChannel||D===this.latestReliableStreamChannel)&&!this.isLatestMessage(H)||X.baseConfig.receive(ie,H)}receiveChannelMessageChunk(D,H){const X=this.reassemblyTable.get(H.id)||[];if(X.push(H),X.length===H.total){const ie=function(oe){const de=oe.sort((ye,be)=>ye.seq<be.seq?-1:1).map(ye=>ye.part).reduce((ye,be)=>ye+be);try{return JSON.parse(de)}catch{return void g.a.warn("Could not reassemble RTC message chunks")}}(X);return ie&&this.receiveChannelMessage(D,ie),void this.reassemblyTable.delete(H.id)}this.reassemblyTable.set(H.id,X),this.reassemblyTableLastTimestamp.set(H.id,new Date().getTime())}handleSystemMessage(D,H){var X,ie;const{config:oe}=this,{baseConfig:de}=oe,{remotePeerId:ye,remoteDeviceId:be}=de;switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(D,{type:"pong",timestamp:p(H.payload.ping)}),!0;case"pong":{const ce=new Date().getTime()-p(H.payload.pong);return this.pingTimeMs=ce,y.aggregate("rtc-ping-time",ce,Object.assign({},be?{deviceId:be}:{})),!0}case"ping-v2":return this.sendPingV2(),!0;case"pong-v2":{const ce=p(H.payload.pongV2),le=this.pingV2Map.get(ce.id);return(le==null?void 0:le.sent)!==ce.timestamp&&g.a.warn("Pong timestamp doesn't match stored value",{currentEntry:le,pong:ce}),this.pingV2Map.set(ce.id,{sent:ce.timestamp,received:new Date().getTime()}),!0}case"streams-info":{const{sessionMetrics:ce}=this,le=(X=H.payload.streamsInfo)===null||X===void 0?void 0:X.timestamp;return!!le&&(ce==null||ce.updateRemoteMessagesCounts(H),(ie=de.onStreamsInfoUpdate)===null||ie===void 0||ie.call(de,ye,le),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(D,H){var X;const{localUserId:ie,localPeerId:oe}=this.config.baseConfig;if(D.readyState!=="open")return;const de={entityId:ie??oe,streamName:`$.${H.type}`,streamType:H.type};let ye;switch(H.type){case"ping":ye={ping:new Date().getTime()};break;case"pong":ye={pong:H.timestamp};break;case"ping-v2":ye={pingV2:H.payload};break;case"pong-v2":ye={pongV2:H.payload};break;case"stream-control":ye={streamControl:H.streamControl};break;case"streams-info":ye={streamsInfo:(X=this.sessionMetrics)===null||X===void 0?void 0:X.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(D,De(de,ye))}isLatestMessage(D){const H=Ie(D.header.stream),X=(this.streamLatestTimestamp.get(H)||0)<=D.header.created;return X&&this.streamLatestTimestamp.set(H,D.header.created),X}}function lt(pe){pe&&clearInterval(pe)}function _t(){g.a.debug("forceGarbageCollection() triggered"),queueMicrotask(()=>{let pe=document.createElement("img");pe.src=window.URL.createObjectURL(new Blob([new ArrayBuffer(5e7)])),pe.onerror=function(){window.URL.revokeObjectURL(this.src),pe=null}})}function It(pe){try{return pe instanceof Error?`${pe.name}: ${pe.message}`:typeof pe=="object"?JSON.stringify(pe):String(pe)}catch{return"Unknown error"}}function Et(pe){var D,H;return{userId:(D=pe.getUserId())===null||D===void 0?void 0:D.getValue(),deviceId:(H=pe.getDeviceId())===null||H===void 0?void 0:H.getValue(),organizationId:pe.getOrganizationId(),id:pe.getPeerId(),capabilities:[],capabilitySet:{}}}var Ue=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class Nt{constructor(D){this.config=D,this.grpcCallDeadline=5*c.a.second,this.refreshIntervalDelayMs=2*c.a.second,this.iceServersTtl=30*c.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new Map,this.isOutgoingConnection=new Map,this.peerDataChannelListeners=[],this.rtcInstancesConstructed=0;const{refreshIntervalDelayMs:H}=this;this.refreshInterval=d({func:()=>Ue(this,void 0,void 0,function*(){try{yield this.update()}catch(X){g.a.warn("RTC refresh failed",{error:X})}}),delay:H,immediate:!0})}send(D,H,X){const ie=this.getActiveConnection(D);ie?ie.isReady()?ie.send(H,X):g.a.warn("Send called with unready connection."):g.a.warn("Send called with no connection.")}controlRemoteStream(D,H){const X=this.getActiveConnection(D);X?X.isReady()?X.controlRemoteStream(H):g.a.warn("controlRemoteStream called with unready connection."):g.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return Ue(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(u.a)(.1*c.a.second);return Et(this.localPeer)})}connect(D,H){var X,ie,oe;return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:de,signalingClient:ye}=this.config,{localPeer:be,receiveSignalStream:ce,iceServers:le}=this;if(!be||!ce||!le)return void g.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(D))return void g.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.get(D))return void g.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.set(D,!0);const Re=function(Le,ke,$e){const{rtcIceTransportPolicies:qe,rtcIceServerProtocol:Je,useAllServers:Qe}=ke||{},st=Le.map(at=>Object.assign(Object.assign({},at),{urls:at.urls.filter(ct=>{const et=(qe===void 0||qe.some(Mt=>V(ct,Mt)))&&(Je===void 0||Q(ct,Je));return et||g.a.debug(`Ignoring ICE server: ${ct}`,{organizationId:$e}),et})})).filter(({urls:at})=>at.filter(ct=>ct).length>0);return Qe?st:[U(st,"stun"),U(st,"turn")].filter(at=>at!==void 0).map(at=>p(at))}(le,H);g.a.debug("Received ICE servers:",le),g.a.debug("Using ICE servers:",Re);const Me=new bt(yield this.createRTCPeerConnection(Re),{baseConfig:{isOffer:!0,isLan:!1,receive:(Le,ke)=>this.config.receive(Le,ke),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Le,ke)=>{var $e,qe;return(qe=($e=this.config).onStreamsInfoUpdate)===null||qe===void 0?void 0:qe.call($e,Le,ke)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(X=be.getUserId())===null||X===void 0?void 0:X.getValue(),localPeerId:be.getPeerId(),remotePeerId:D,sessionType:this.config.sessionType},remoteConfig:{}},Le=>this.onCustomDataChannel(D,Le)),xe=yield Me.getOffer();if(!xe)return g.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(D);g.a.debug("Sending offer."),de==null||de("Sending offer",xe);const ze=new ee.SendSignalRequest;ze.setSignal(xe);const Xe=yield(()=>Ue(this,void 0,void 0,function*(){try{return yield S.withDeadline(ye.sendSignal(ze,yield this.getMetadata({})),this.grpcCallDeadline)}catch(Le){g.a.warn("Error when sending signal",{error:Le})}}))();if(!this.isOutgoingConnection.get(D))return void g.a.debug("No offer set after receiving offer signal response.");g.a.debug("Offer sent.");const Ze=(ie=Xe==null?void 0:Xe.getSessionId())===null||ie===void 0?void 0:ie.getValue(),Ke=(oe=Xe==null?void 0:Xe.getSessionCreatedTimestamp())===null||oe===void 0?void 0:oe.getValue();return Ze&&Ke?(Me.setSessionId(Ze),Me.setSessionCreatedTimestamp(Ke),this.isOutgoingConnection.delete(D),this.connections.push(Me),this.isConnectionInitiator.set(Me,!0),this.setupHandlers(Me),Ze):(g.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(D))})}connectLan(D){var H,X;return Ue(this,void 0,void 0,function*(){const ie=new P(D),oe=new bt(yield this.createRTCPeerConnection([]),{baseConfig:{isOffer:!0,isLan:!0,receive:(ce,le)=>this.config.receive(ce,le),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ce,le)=>{var Re,Me;return(Me=(Re=this.config).onStreamsInfoUpdate)===null||Me===void 0?void 0:Me.call(Re,ce,le)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(X=(H=this.localPeer)===null||H===void 0?void 0:H.getUserId())===null||X===void 0?void 0:X.getValue(),localPeerId:"lan_client",remotePeerId:D}},ce=>this.onCustomDataChannel(D,ce)),de=yield oe.getLanOffer();if(!de)return g.a.warn("Could not generate LAN offer"),!1;const ye=yield ie.postLanRtcOffer({offer:JSON.stringify(de)}),be=new RTCSessionDescription(JSON.parse(ye.answer));return yield oe.handleLanAnswer(be),this.localConnections.push(oe),this.isConnectionInitiator.set(oe,!0),Object(Y.a)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(D,H,X,ie,oe){const de=this.getActiveConnection(D);if(de&&this.isConnectionInitiator.has(de)){const be=de.peerConnection.createDataChannel("custom."+H,X);return ie&&(be.binaryType="arraybuffer"),oe(D,be),()=>{}}const ye=(be,ce)=>{D===be&&ce.label==="custom."+H&&oe(D,ce)};return this.peerDataChannelListeners.push(ye),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(be=>be!==ye)}}onCustomDataChannel(D,H){this.peerDataChannelListeners.forEach(X=>X(D,H))}getConnectionStatus(D){if(this.isOutgoingConnection.get(D))return"connecting";const H=this.getActiveConnection(D);return H?H.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(D){return Ue(this,void 0,void 0,function*(){const H=this.getActiveConnection(D);if(H)return yield H.getConnectionStatsInfo()})}disconnect(D){return Ue(this,void 0,void 0,function*(){const H=this.getActiveConnection(D);H&&(yield H.close())})}getPeers(){return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:D}=this.config,H=yield(()=>Ue(this,void 0,void 0,function*(){try{return yield S.withDeadline(D.getPeers(new ee.GetPeersRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(oe){g.a.warn("Error when getting peers",{error:oe})}}))();if(!H)return[];const X=H.getPeersList();if(!X)return[];const ie=oe=>{var de,ye;return(ye=(de=oe.getPeerCreatedTimestamp())===null||de===void 0?void 0:de.getValue())!==null&&ye!==void 0?ye:0};return X.sort((oe,de)=>ie(de)-ie(oe)).map(oe=>Et(oe))})}getSessions(){return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:D}=this.config,H=yield(()=>Ue(this,void 0,void 0,function*(){try{return yield S.withDeadline(D.getPeers(new ee.GetPeersRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(oe){g.a.warn("Error when getting peers",{error:oe})}}))();if(!H)return{};const X=H.getPeersList(),ie={};for(const oe of X)ie[oe.getPeerId()]=oe.getSessionIdsList();return ie})}getPing(D){const H=this.getActiveConnection(D);if(H)return H.getPing();g.a.warn("Attempted to get ping time from inactive peer.")}getPingInfo(D){const H=this.getActiveConnection(D);if(H)return H.getPingInfo();g.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(D){const H=this.getActiveConnection(D);if(H)return H.getLastMessageTimestamp();g.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(D){const H=this.getActiveConnection(D);if(H)return H.getSessionMetricsMessageCounts();g.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:D,receiveSignalStream:H,iceServers:X}=this;return!!(D&&H&&X)}shutdown(){return Ue(this,void 0,void 0,function*(){g.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const D=this.connections;this.connections=[],yield this.closeConnections(D);const{localPeer:H}=this;if(!H||this.config.lanOnlyMode)return;const{signalingClient:X}=this.config;yield(()=>Ue(this,void 0,void 0,function*(){try{const ie=new ee.DeletePeerRequest;ie.setPeerId(H.getPeerId()),yield S.withDeadline(X.deletePeer(ie,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ie){return void g.a.warn("Error deleting local peer",{error:ie})}}))()})}createPeer(){return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:D}=this.config,H=yield(()=>Ue(this,void 0,void 0,function*(){try{return yield S.withDeadline(D.createPeer(new ee.CreatePeerRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ie){const oe=ie;g.a.debug("createPeer failed",{error:oe});const de=It(oe);throw new Error(`Was not able to create peer: ${de}`)}}))(),X=H==null?void 0:H.getPeer();if(!X)throw new Error("Response did not provide peer.");return this.localPeer=X})}createReceiveSignalStream(){return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:D}=this.config,{localPeer:H,iceServers:X}=this;if(!H||!X)return;const{receiveSignalStream:ie}=this;ie&&ie.cancel();const oe=new ee.ReceiveSignalStreamRequest;oe.setPeerId(H.getPeerId());const de=yield(()=>Ue(this,void 0,void 0,function*(){try{return D.receiveSignalStream(oe,yield this.getMetadata({hasDeadline:!1}))}catch(ye){g.a.debug("createReceiveSignalStream failed",{error:ye});const be=It(ye);throw new Error(`Unable to create receive signal stream: ${be}`)}}))();if(!de)throw new Error("Response did not provide stream.");return de.on("data",ye=>Ue(this,void 0,void 0,function*(){var be,ce,le,Re;const Me=ye.getSignal(),xe=(be=Me==null?void 0:Me.getSessionId())===null||be===void 0?void 0:be.getValue(),ze=Me==null?void 0:Me.getSenderId(),Xe=Me==null?void 0:Me.getReceiverId(),Ze=(ce=Me==null?void 0:Me.getSessionCreatedTimestamp())===null||ce===void 0?void 0:ce.getValue();if(!(Me&&xe&&ze&&Xe&&Ze))return void g.a.warn("Received signal with missing information.");const Ke=this.getActiveConnection(ze);if(Ke)if(Ke.getSessionId()!==xe){if(g.a.debug("Received signal: different session for a peer we're already connected to."),(Ke.getSessionCreatedTimestamp()||0)>Ze)return;const Le=new bt(yield this.createRTCPeerConnection(X),{baseConfig:{isOffer:!1,isLan:!1,receive:(ke,$e)=>this.config.receive(ke,$e),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ke,$e)=>{var qe,Je;return(Je=(qe=this.config).onStreamsInfoUpdate)===null||Je===void 0?void 0:Je.call(qe,ke,$e)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(Re=H.getUserId())===null||Re===void 0?void 0:Re.getValue(),remotePeerId:ze},remoteConfig:{sessionId:xe,sessionCreatedTimestamp:Ze}},ke=>this.onCustomDataChannel(ze,ke));yield Le.handleSignal(Me),this.connections.push(Le)}else g.a.debug("Received signal: for an existing connection."),yield Ke.handleSignal(Me);else{g.a.debug("Received signal: new connection.");const Le=new bt(yield this.createRTCPeerConnection(X),{baseConfig:{isOffer:!1,isLan:!1,receive:(ke,$e)=>this.config.receive(ke,$e),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ke,$e)=>{var qe,Je;return(Je=(qe=this.config).onStreamsInfoUpdate)===null||Je===void 0?void 0:Je.call(qe,ke,$e)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(le=H.getUserId())===null||le===void 0?void 0:le.getValue(),remotePeerId:ze},remoteConfig:{sessionId:xe,sessionCreatedTimestamp:Ze}},ke=>this.onCustomDataChannel(ze,ke));yield Le.handleSignal(Me),this.connections.push(Le)}})),de.on("end",()=>{de.cancel(),this.receiveSignalStream=void 0}),de.on("error",ye=>{switch(ye.code){case ne.StatusCode.CANCELLED:case ne.StatusCode.UNAVAILABLE:case ne.StatusCode.UNKNOWN:g.a.debug("Receive signal stream error",{error:ye});break;case ne.StatusCode.UNAUTHENTICATED:g.a.warn("Receive signal stream error",{error:ye});break;default:g.a.error("Receive signal stream error",{error:ye})}de.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=de})}createRTCPeerConnection(D){var H;return Ue(this,void 0,void 0,function*(){const X=(H=this.config.alternateRTCPeerConnection)!==null&&H!==void 0?H:window.RTCPeerConnection;if(!X)throw function(){const{userAgent:ie}=navigator;return ie.includes("Firefox/")?"Firefox":ie.includes("Edg/")?"Edge":ie.includes("Chrome/")?"Chrome":ie.includes("Safari/")?"Safari":ie.includes("MSIE/")||ie.includes("Trident/")?"IE":"Other"}()!=="Chrome"?new Error("WebRTC is not enabled. Please try again with the latest version of Google Chrome."):new Error("WebRTC is not enabled. Please ensure WebRTC is not disabled by ad blocking software.");this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||_t();try{return new X({iceServers:D})}catch(ie){throw g.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),ie}})}closeConnections(D){return Ue(this,void 0,void 0,function*(){const H=yield O(D.map(X=>Ue(this,void 0,void 0,function*(){yield X.close()})));for(const X of H)g.a.warn("Request to close session failed",{error:X})})}getActiveConnection(D){return this.getConnections().find(H=>H.getRemotePeerId()===D&&H.isActive())}update(){var D;return Ue(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(ye=>ye.isActive()),this.config.lanOnlyMode)return;const{signalingClient:H}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers){const ye=[];return this.localPeer||ye.push(this.createPeer()),this.iceServers||ye.push(this.updateIceServers()),yield Promise.all(ye),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()))}yield this.closeConnections(this.connections.filter(ye=>!ye.isActive())),this.connections=this.connections.filter(ye=>ye.isActive());const{localPeer:X}=this,ie=this.connections.filter(ye=>ye.getSessionId).map(ye=>p(ye.getSessionId()));X.setSessionIdsList(ie);const oe=new ee.RefreshPeerRequest;oe.setPeer(X);try{yield S.withDeadline(H.refreshPeer(oe,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ye){ye.code===ne.StatusCode.NOT_FOUND?(g.a.warn("Peer expired, creating new peer",{peerId:X.getPeerId()}),yield this.reset()):g.a.warn("Error calling RefreshPeer",{error:ye})}const de=yield this.getPeers();for(const ye of this.connections)ye.setRemoteDeviceId((D=de.find(be=>be.id===ye.getRemotePeerId()))===null||D===void 0?void 0:D.deviceId)})}reset(){return Ue(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection=new Map,yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:D,iceServersTtl:H}=this,X=new Date().getTime();if(!D||X-D>H)try{const ie=(yield S.withDeadline(this.config.signalingClient.getIceServers(new ee.GetIceServersRequest,yield this.getMetadata({})),this.grpcCallDeadline)).getIceServers();this.iceServers=JSON.parse(ie),this.iceServersLastUpdate=X}catch(ie){g.a.warn("Error in updateIceServers",{error:ie})}})}setupHandlers(D){const{peerConnection:H}=D,X=D.getSessionCreatedTimestamp();H.onconnectionstatechange=()=>Ue(this,void 0,void 0,function*(){const ie=H.connectionState;if(!X)return;const oe=D.getRemoteDeviceId();switch(ie){case"connected":y.aggregate("rtc-connect-time",new Date().getTime()-X,Object.assign({},oe?{deviceId:oe}:{}));break;case"failed":y.increment("rtc-connect-failed",Object.assign({},oe?{deviceId:oe}:{}))}})}getMetadata(D){return Ue(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:H}=this.config,{grpcCallDeadline:X}=this,{hasDeadline:ie}=D,oe=ie===!1?void 0:new Date().getTime()+X;try{return{authorization:yield H(),deadline:oe}}catch(de){throw g.a.error("getToken() failed",{error:de}),new Error("Cannot get authorization token")}})}}var rt=n(10),ot=n(11),jt=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class pt{constructor(D,H){this.sessionId=D,this.connection=H,this.sentMessagesCounts=new Map,this.receivedMessagesCounts=new Map,this.sessionId=D,this.connection=H}incrementMessageSent(D){const H=Ie(D.header.stream);this.sentMessagesCounts.set(H,(this.sentMessagesCounts.get(H)||0)+1)}incrementMessageReceived(D){const H=Ie(D.header.stream);this.receivedMessagesCounts.set(H,(this.receivedMessagesCounts.get(H)||0)+1)}uploadMetrics(){return jt(this,void 0,void 0,function*(){const{sessionId:D}=this,H=yield this.connection.peerConnection.getStats(),X={};H.forEach(oe=>X[oe.id]=oe),g.a.debug("rtc-stats",Object.assign(Object.assign({},X),{sessionId:D}));const ie=[...new Set(Array.from(this.sentMessagesCounts.keys()).concat(Array.from(this.receivedMessagesCounts.keys())))].reduce((oe,de)=>{const ye=this.sentMessagesCounts.get(de),be=this.receivedMessagesCounts.get(de);return Object.assign(Object.assign({},oe),{[`${de}-sent`]:ye,[`${de}-received`]:be})},{sessionId:D});g.a.debug("rtc-message-report",ie)})}}function Ct(pe,D){return Ie(pe)===Ie(D)}var ut=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class Tt{constructor(D,H){this.peerConnection=D,this.config=H,this.connectTimeoutMs=10*c.a.second,this.gatherIceTimeoutMs=5*c.a.second,this.pingUpdateTimeoutMs=2*c.a.second,this.streamLatestTimestamp=new Map,this.closeCalled=!1,this.connectCalled=!1,this.sentOffer=!1,this.receivedIceCandidate=!1;const{isOffer:X}=H;X?this.initializeChannels(D):D.ondatachannel=ie=>{switch(ie.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ie.channel;break;case"stream.reliable":this.reliableStreamChannel=ie.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ie.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ie.channel}this.setupChannel(ie.channel)},this.sessionMetrics=new pt(this.getSessionId(),this)}connect(){return ut(this,void 0,void 0,function*(){if(this.connectCalled)return;this.connectCalled=!0,this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ie}=this;ie&&this.sendSystemMessage(ie,{type:"ping"})},this.pingUpdateTimeoutMs),this.connectTimeout=setTimeout(()=>ut(this,void 0,void 0,function*(){this.isReady()||(g.a.warn("RTC connect timed out, closing connection"),yield this.close())}),this.connectTimeoutMs);const{peerConnection:D,config:{isOffer:H,sessionId:X}}=this;if(H){const ie=yield D.createOffer();yield D.setLocalDescription(ie)}H&&(this.gatherIceTimeout=setTimeout(()=>ut(this,void 0,void 0,function*(){this.sentOffer||(g.a.warn("ICE gathering timed out"),this.receivedIceCandidate?(g.a.warn("Attempting to connect with partial ICE candidate pool"),yield this.sendOffer()):yield this.close())}),this.gatherIceTimeoutMs),D.onicecandidate=ie=>ut(this,void 0,void 0,function*(){ie.candidate?this.receivedIceCandidate=!0:yield this.sendOffer()}),D.onicegatheringstatechange=()=>ut(this,void 0,void 0,function*(){D.iceGatheringState==="complete"&&(yield this.sendOffer())}),D.onnegotiationneeded=()=>{g.a.debug("Negotiation needed",{sessionId:X})})})}handleSignal(D){return ut(this,void 0,void 0,function*(){const{peerConnection:H,config:{sessionId:X,sendSignal:ie}}=this,{description:oe}=JSON.parse(D.payload);if(g.a.debug("Handling signal",{sessionId:X,description:JSON.stringify(oe)}),oe)if(H.signalingState!=="stable"||H.connectionState!=="connected")if(H.remoteDescription)g.a.warn(`Received SDP signal during negotiation when remote description is already set: ${JSON.stringify(D)}`);else if(oe.type==="offer"){yield H.setRemoteDescription(oe);const de=yield H.createAnswer();yield H.setLocalDescription(de),yield ie({payload:JSON.stringify({description:de})})}else oe.type==="answer"&&(yield H.setRemoteDescription(oe));else g.a.warn(`Received SDP signal when signaling is stable and connected: ${JSON.stringify(D)}`);else g.a.warn(`Received non-SDP signal: ${JSON.stringify(D)}`)})}send(D,H){const X=this.getChannelFromLabel(H.channelLabel);X?this.sendOnChannel(X,D):g.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(D){this.sendSystemMessage(p(this.reliableStreamChannel),{type:"stream-control",streamControl:D})}isActive(){return new Set(["new","connecting","connected"]).has(this.peerConnection.connectionState)}isReady(){const{peerConnection:D,latestTtlStreamChannel:H,reliableStreamChannel:X,latestTryOnceStreamChannel:ie}=this;return!!(X&&H&&ie)&&D.connectionState==="connected"&&X.readyState==="open"&&H.readyState==="open"&&ie.readyState==="open"}isClosed(){const{peerConnection:D,reliableStreamChannel:H,latestTryOnceStreamChannel:X,latestTtlStreamChannel:ie}=this;return!(D.connectionState!=="closed"||H!==void 0&&H.readyState!=="closed"||X!==void 0&&X.readyState!=="closed"||ie!==void 0&&ie.readyState!=="closed")}needsClosing(){const{peerConnection:D,latestTtlStreamChannel:H,reliableStreamChannel:X,latestTryOnceStreamChannel:ie}=this;if(this.isClosed())return!1;const oe=new Set(["closing","closed"]),de=ye=>ye&&oe.has(ye.readyState);return Ye(D)||de(H)||de(X)||de(ie)}close(){return ut(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield this.sessionMetrics.uploadMetrics(),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.connectTimeout&&clearTimeout(this.connectTimeout),this.gatherIceTimeout&&clearTimeout(this.gatherIceTimeout),this.peerConnection.close())})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionId(){return this.config.sessionId}getRemotePeer(){return this.config.remotePeer}initializeChannels(D){this.latestTtlStreamChannel=D.createDataChannel("stream.latest-ttl",k),this.reliableStreamChannel=D.createDataChannel("stream.reliable",J),this.latestReliableStreamChannel=D.createDataChannel("stream.latest-reliable",K),this.latestTryOnceStreamChannel=D.createDataChannel("stream.latest-try-once",re),this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}sendOffer(){return ut(this,void 0,void 0,function*(){if(this.sentOffer||(this.sentOffer=!0,Ye(this.peerConnection)))return;const{peerConnection:D,config:{sendSignal:H}}=this,X=yield D.createOffer();yield D.setLocalDescription(X);const ie={payload:JSON.stringify({description:X})};yield H(ie)})}getChannelFromLabel(D){switch(D){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(D,H){let X;try{X=Object(T.encode)(JSON.stringify(H))}catch(ie){return void g.a.warn("Failed to encode RTC message",{error:ie})}try{D.send(X),this.sessionMetrics.incrementMessageSent(H)}catch(ie){g.a.warn("Failed to send message to channel",{error:ie,channel:D.label})}}channelNotRecognized(D){return D!==this.latestTtlStreamChannel&&D!==this.latestReliableStreamChannel&&D!==this.latestTryOnceStreamChannel&&D!==this.reliableStreamChannel}setupChannel(D){D.onmessage=H=>{if(this.channelNotRecognized(D))return void g.a.warn("Received message on unrecognized data channel.");let X;try{X=JSON.parse(Object(T.decode)(H.data))}catch(ie){return void g.a.warn("Received unparseable RTC message",{error:ie,channel:D.label})}if(this.lastMessageTimestamp=new Date().getTime(),X=nt(X),this.sessionMetrics.incrementMessageReceived(X),!this.handleSystemMessage(D,X)){if(!this.hasCapabilities(X))return void g.a.warn("Received RTC message that was not within the capability scope of the connection.");(D===this.latestTryOnceStreamChannel||D===this.latestTtlStreamChannel||D===this.latestReliableStreamChannel)&&!this.isLatestMessage(X)||this.config.receive(this.config.remotePeer.id,X)}},D.onerror=H=>{g.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:D.label})},D.onopen=()=>{g.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:D.label})},D.onclose=()=>{const H={bufferedAmount:D.bufferedAmount,sessionId:this.getSessionId(),channelLabel:D.label};this.closeCalled===!1?g.a.debug("Unexpected channel closed",H):g.a.debug("Channel closed",H)}}handleSystemMessage(D,H){switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(D,{type:"pong",timestamp:p(H.payload.ping)}),!0;case"pong":{const X=new Date().getTime()-p(H.payload.pong);return this.pingTimeMs=X,y.aggregate("rtc-ping-time",X),!0}case"stream-control":return!0;default:return!1}}sendSystemMessage(D,H){if(D.readyState!=="open")return;const X={entityId:p(this.config.localPeer.deviceId||this.config.localPeer.userId),streamName:`$.${H.type}`,streamType:H.type};let ie;switch(H.type){case"ping":ie={ping:new Date().getTime()};break;case"pong":ie={pong:H.timestamp};break;case"stream-control":ie={streamControl:H.streamControl}}this.sendOnChannel(D,De(X,ie))}hasCapabilities(D){var H,X;const{localPeer:ie,remotePeer:oe}=this.config,de=(H=ie.capabilitySet.streaming)===null||H===void 0?void 0:H.streams,ye=de&&de.some(le=>le.receive&&Ct(le.stream,D.header.stream)),be=(X=oe.capabilitySet.streaming)===null||X===void 0?void 0:X.streams,ce=be&&be.some(le=>le.send&&Ct(le.stream,D.header.stream));return ye||ce}isLatestMessage(D){const H=Ie(D.header.stream),X=(this.streamLatestTimestamp.get(H)||0)<=D.header.created;return X&&this.streamLatestTimestamp.set(H,D.header.created),X}}var Fe=function(pe,D,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Re){Re(le)})).then(de,ye)}be((X=X.apply(pe,D||[])).next())})};class Rt{constructor(D){this.config=D,this.connections=[],this.connectingSessions=new Map,this.rtcInstancesConstructed=0,this.updateInterval=d({func:()=>Fe(this,void 0,void 0,function*(){try{yield this.update()}catch(H){g.a.warn("RTC update failed",{error:H})}}),delay:250*c.a.millisecond,immediate:!0}),this.localPeer=this.createPeer()}send(D,H,X){const ie=this.getActiveConnection(D);ie?ie.isReady()?ie.send(H,X):g.a.warn("Attempted to send with an active connection to that peer which was not yet ready."):g.a.warn("Attempted to send with no active connection to that peer.")}controlRemoteStream(D,H){const X=this.getActiveConnection(D);X?X.isReady()?X.controlRemoteStream(H):g.a.warn("Attempted to control remote stream with an active connection to that peer which was not yet ready."):g.a.warn("Attempted to control remote stream with no active connection to that peer.")}connect(D){return Fe(this,void 0,void 0,function*(){const H=yield this.getLocalPeer();if(this.getActiveConnection(D))return void g.a.warn("Attempted to connect to peer with an already active connection.");let X;try{X=yield this.config.signalingClient.createSession(yield this.config.getToken(),{offerPeerId:H.id,answerPeerId:D})}catch(ie){Object(ot.a)(ie,rt.a,oe=>oe.statusCode===404),g.a.warn("Attempted to connect to peer that does not exist.")}if(X)for(this.connectingSessions.set(X.id,new Date().getTime()),yield this.connectToSession(X);;)switch(yield Object(u.a)(.1),this.getConnectionStatus(D)){case"connecting":continue;case"connected":return X.id;case"disconnected":return}})}getConnectionStatus(D){const H=this.getActiveConnection(D);return H?H.isReady()?"connected":"connecting":"disconnected"}getIceMode(D){const H=this.getActiveConnection(D);if(H)return H.iceMode}disconnect(D){return Fe(this,void 0,void 0,function*(){const H=this.getActiveConnection(D);H&&(yield this.closeConnection(H))})}getLocalPeer(){return Fe(this,void 0,void 0,function*(){return yield this.localPeer})}getPeers(){return Fe(this,void 0,void 0,function*(){return yield this.config.signalingClient.getPeers(yield this.config.getToken())})}getPing(D){const H=this.getActiveConnection(D);if(H)return H.getPing();g.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(D){const H=this.getActiveConnection(D);if(H)return H.getLastMessageTimestamp();g.a.warn("Attempted to get ping time from inactive peer.")}shutdown(){return Fe(this,void 0,void 0,function*(){yield this.updateInterval.stop();const D=this.connections;this.connections=[],yield this.closeConnections(D)})}closeConnection(D){return Fe(this,void 0,void 0,function*(){this.connectingSessions.delete(D.getSessionId()),yield D.close();try{yield this.config.signalingClient.deleteSession(yield this.config.getToken(),D.getSessionId())}catch(H){Object(ot.a)(H,rt.a,X=>X.statusCode===404)}})}getSessions(){return Fe(this,void 0,void 0,function*(){const D=yield this.getLocalPeer();return(yield this.config.signalingClient.getSessions(yield this.config.getToken())).filter(H=>H.offer.peer.id===D.id||H.answer.peer.id===D.id)})}createPeer(){return Fe(this,void 0,void 0,function*(){return yield this.config.signalingClient.createPeer(yield this.config.getToken(),{capabilitySet:this.config.capabilitySet||{}})})}createRTCPeerConnection(D={}){return Fe(this,void 0,void 0,function*(){const H=this.config.alternateRTCPeerConnection||RTCPeerConnection;this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||_t();try{return new H(Object.assign({iceServers:yield this.config.signalingClient.getIceServers(yield this.config.getToken())},D))}catch(X){throw g.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),X}})}closeConnections(D){return Fe(this,void 0,void 0,function*(){const H=yield O(D.map(X=>Fe(this,void 0,void 0,function*(){yield this.closeConnection(X)})));for(const X of H)g.a.warn("Request to close session failed",{error:X})})}reset(){return Fe(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.connectingSessions=new Map,this.localPeer=this.createPeer(),yield this.localPeer})}getActiveConnection(D){return this.connections.find(H=>H.getRemotePeer().id===D&&H.isActive())}update(){return Fe(this,void 0,void 0,function*(){const D=yield this.getLocalPeer();try{yield this.config.signalingClient.refreshPeer(yield this.config.getToken(),D.id)}catch(H){Object(ot.a)(H,rt.a,X=>X.statusCode===404),g.a.warn("Peer expired, creating new peer",{peerId:D.id}),yield this.reset()}yield this.handleSessions(yield this.getSessions())})}handleSessions(D){return Fe(this,void 0,void 0,function*(){yield this.syncConnectionsAndSessions(D);const H=D.map(X=>({session:X,connection:this.connections.find(ie=>ie.getSessionId()===X.id)}));yield Promise.all(H.map(({session:X,connection:ie})=>Fe(this,void 0,void 0,function*(){return yield this.maintainConnection(X,ie)})))})}syncConnectionsAndSessions(D){return Fe(this,void 0,void 0,function*(){const H=new Set(D.map(oe=>oe.id)),X=oe=>H.has(oe.getSessionId())||this.connectingSessions.has(oe.getSessionId());this.connections=this.connections.filter(oe=>X(oe));const ie=this.connections.filter(oe=>!X(oe)||oe.needsClosing());yield Promise.all(ie.map(oe=>Fe(this,void 0,void 0,function*(){yield this.closeConnection(oe)})))})}maintainConnection(D,H){return Fe(this,void 0,void 0,function*(){const X=yield this.getLocalPeer(),ie=D.offer.peer.id===X.id;if(H){if(H.isReady())try{yield this.config.signalingClient.refreshSession(yield this.config.getToken(),D.id)}catch(oe){Object(ot.a)(oe,rt.a,de=>de.statusCode===404),g.a.debug("Refresh session not found",{sessionId:D.id})}else if(H.isActive())try{yield this.consumeSignals(H)}catch(oe){g.a.warn("Failed to ingest signals, closing connection",{error:oe}),yield this.closeConnection(H)}}else{if(ie)return;yield this.connectToSession(D)}})}connectToSession(D){return Fe(this,void 0,void 0,function*(){const H=yield this.getLocalPeer(),X=D.offer.peer.id===H.id,ie=yield this.createRTCPeerConnection(),oe=new Tt(ie,{localPeer:X?D.offer.peer:D.answer.peer,remotePeer:X?D.answer.peer:D.offer.peer,sessionId:D.id,isOffer:X,sendSignal:de=>this.sendSignal(D.id,de),receive:(de,ye)=>this.config.receive(de,ye)});if(this.connections.find(de=>de.getSessionId()===D.id))return g.a.warn("connectToSession called on a session that already has a connection.",{sessionId:D.id}),void(yield oe.close());this.setupHandlers(oe),this.connections.push(oe);try{yield oe.connect()}catch(de){g.a.warn("Failed to handle negotiation, closing connection",{error:de}),yield this.closeConnection(oe)}})}setupHandlers(D){const{peerConnection:H}=D,X=D.getSessionId();H.onconnectionstatechange=()=>Fe(this,void 0,void 0,function*(){const ie=this.connectingSessions.get(X);if(ie===void 0)return;const oe=H.connectionState;switch(Ye(H)&&this.connectingSessions.delete(X),oe){case"connected":{this.connectingSessions.delete(X);const de=new Date().getTime()-ie;y.aggregate("rtc-connect-time",de);break}case"failed":y.increment("rtc-connect-failed"),yield this.closeConnection(D)}})}consumeSignals(D){return Fe(this,void 0,void 0,function*(){let H=[];try{H=yield this.config.signalingClient.takeSignals(yield this.config.getToken(),D.getSessionId())}catch(X){Object(ot.a)(X,rt.a,ie=>ie.statusCode===404)}for(const X of H)yield D.handleSignal(X)})}sendSignal(D,H){return Fe(this,void 0,void 0,function*(){try{yield this.config.signalingClient.addSignals(yield this.config.getToken(),D,{signals:[H]})}catch(X){Object(ot.a)(X,rt.a,ie=>ie.statusCode===404)}})}}},function(e,t,n){var r={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const s=new Uint8Array(16);function l(){if(!i&&(i=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}const o=[];for(let u=0;u<256;++u)o.push((u+256).toString(16).slice(1));function c(u,f=0){return(o[u[f+0]]+o[u[f+1]]+o[u[f+2]]+o[u[f+3]]+"-"+o[u[f+4]]+o[u[f+5]]+"-"+o[u[f+6]]+o[u[f+7]]+"-"+o[u[f+8]]+o[u[f+9]]+"-"+o[u[f+10]]+o[u[f+11]]+o[u[f+12]]+o[u[f+13]]+o[u[f+14]]+o[u[f+15]]).toLowerCase()}t.a=function(u,f,E){if(r.randomUUID&&!f&&!u)return r.randomUUID();const w=(u=u||{}).random||(u.rng||l)();if(w[6]=15&w[6]|64,w[8]=63&w[8]|128,f){E=E||0;for(let h=0;h<16;++h)f[E+h]=w[h];return f}return c(w)}},,function(e,t,n){n.r(t),n.d(t,"LogClient",function(){return o});var r=n(28),i=n(11),s=n(10),l=function(c,u,f,E){return new(f||(f=Promise))(function(w,h){function g(j){try{R(E.next(j))}catch(F){h(F)}}function b(j){try{R(E.throw(j))}catch(F){h(F)}}function R(j){var F;j.done?w(j.value):(F=j.value,F instanceof f?F:new f(function(M){M(F)})).then(g,b)}R((E=E.apply(c,u||[])).next())})};class o extends r.a{log(u){return l(this,void 0,void 0,function*(){const f=o.token;try{yield this.fetch("logs",{token:f,method:"POST",body:JSON.stringify({logs:u}),allowUnsafeRetries:!0})}catch(E){Object(i.a)(E,s.a,w=>w.statusCode===401&&f!==void 0),o.token===f&&delete o.token,yield this.log(u)}})}}}])})})(dist);function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}let FORMANT_API_URL="https://api.formant.io";typeof window<"u"&&(FORMANT_API_URL=window.FORMANT_API_URL||FORMANT_API_URL);let urlParams$2=new URLSearchParams("");typeof window<"u"&&(urlParams$2=new URLSearchParams(window.location.search));const envDev=urlParams$2.get("formant_dev");envDev&&(FORMANT_API_URL="https://api-dev.formant.io");const envStage=urlParams$2.get("formant_stage");envStage&&(FORMANT_API_URL="https://api-stage.formant.io");const envLocal=urlParams$2.get("formant_local");envLocal&&(FORMANT_API_URL="https://api.formant.local");const millisecond=1,second=1e3,minute=60*second,hour=60*minute,day=24*hour,week=7*day,month=30*day,year=365*day,duration={millisecond,second,minute,hour,day,week,month,year};function filterDataByType(e,t){return e.filter(n=>t.includes(n.type))}function filterDataByTime(e,t,n){const r=t.getTime(),i=n.getTime();return e.map(s=>({...s,points:s.points.filter(([l])=>l>=r&&l<i)})).filter(({points:s})=>s.length>0)}function fork(e){}class StoreCache{constructor({capacity:t,timeout:n}={}){Ae(this,"entries",new Map);Ae(this,"metadata",new Map);Ae(this,"capacity");Ae(this,"timeout");this.capacity=t||1e4,this.timeout=n||duration.minute}get(t,n){const r=this.keyToCacheKey(t),i=this.entries.get(r),s=this.metadata.get(r);return(i===void 0||s&&(s==null?void 0:s.expiration.getTime())<Date.now())&&!(s!=null&&s.generating)&&n&&this.generate(t,n()),i===void 0&&s&&s.lastValue!==void 0?s.lastValue:i}set(t,n){const r=this.keyToCacheKey(t);this.metadata.set(r,{generating:!1,expiration:new Date(Date.now()+this.timeout),lastValue:n}),this.entries.set(r,n),this.metadata.size>this.capacity&&this.deleteOldestEntry()}clear(){this.entries.clear(),[...this.metadata.values()].forEach(t=>t.generating=!1)}clearKey(t){this.metadata.delete(t),this.entries.delete(t)}keyToCacheKey(t){return JSON.stringify(t)}deleteOldestEntry(){if(this.metadata.size<1)return;const[t]=[...this.metadata.entries()].reduce(([n,r],[i,s])=>s.expiration.getTime()<r.expiration.getTime()?[i,s]:[n,r]);this.clearKey(t)}generate(t,n){const r=this.keyToCacheKey(t),i=this.metadata.get(r)||{};this.metadata.set(r,{...i,generating:!0,expiration:new Date(Date.now()+this.timeout)}),setTimeout(()=>{n.then(s=>{const l=this.metadata.get(r);!(l!=null&&l.generating)||this.set(t,s)})},0)}}class QueryStore{constructor(){Ae(this,"queryStoreCache",new StoreCache({capacity:1e4,timeout:20*duration.second}));Ae(this,"liveQueryStoreCache",new StoreCache({capacity:1e4,timeout:200*duration.millisecond}))}moduleQuery(t,n,r,i,s,l=!1){const o={...t,names:[...n],types:[...r]},c=this.query(o,i,s,l);return c===void 0||c==="too much data"?c:filterDataByType(c,r)}query(t,n,r,i=!1){const s={...t,start:dateFns.startOfMinute(n).toISOString(),end:i?r.toISOString():dateFns.addMinutes(dateFns.roundToNearestMinutes(r),1).toISOString(),latestOnly:i},l=r>dateFns.addSeconds(new Date,-20);let o;return l?o=this.liveQueryCache(s):o=this.queryCache(s),!o||o==="too much data"||i?o:filterDataByTime(o,n,r)}queryCache(t){return this.queryStoreCache.get(t,async()=>{try{return await Fleet.queryTelemetry(t)}catch(n){throw n}})}liveQueryCache(t){return this.liveQueryStoreCache.get(t,async()=>{try{return await Fleet.queryTelemetry(t)}catch(n){throw n}})}}const queryStore=new QueryStore;class App{static sendAppMessage(t){window.parent.postMessage(t,"*")}static getCurrentModuleContext(){let t=new URLSearchParams("");return typeof window<"u"&&(t=new URLSearchParams(window.location.search)),t.get("module")}static async getCurrentModuleConfiguration(){let t=new URLSearchParams("");typeof window<"u"&&(t=new URLSearchParams(window.location.search));const n=t.get("configuration");return n===null||n.trim()===""?void 0:(await(await fetch(`${FORMANT_API_URL}/v1/admin/module-configurations/`+n,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).configuration}static isModule(){return this.getCurrentModuleContext()!==null}static goToTime(t){this.sendAppMessage({type:"go_to_time",time:t.getTime()})}static goToDevice(t){this.sendAppMessage({type:"go_to_device",deviceId:t})}static showMessage(t){this.sendAppMessage({type:"show_message",message:t})}static requestModuleData(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"request_module_data",module:t})}static setModuleDateTimeRange(t,n){const r=this.getCurrentModuleContext();if(!r)throw new Error("No module context");this.sendAppMessage({type:"set_module_data_time_range",module:r,before:t,after:n||0})}static refreshAuthToken(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"refresh_auth_token",module:t})}static sendChannelData(t,n){const r=this.getCurrentModuleContext();if(!r)throw new Error("No module context");this.sendAppMessage({type:"send_channel_data",source:r,channel:t,data:n})}static setupModuleMenus(t){const n=this.getCurrentModuleContext();if(!n)throw new Error("No module context");this.sendAppMessage({type:"setup_module_menus",module:n,menus:t})}static addMenuListener(t){window.addEventListener("message",n=>{const r=n.data;r.type==="module_menu_item_clicked"&&t(r.menu)})}static addAccessTokenRefreshListener(t){window.addEventListener("message",n=>{const r=n.data;r.type==="auth_token"&&t(r.token)})}static addModuleDataListener(t){const n=this.getCurrentModuleContext();n&&this.sendAppMessage({type:"request_module_data",module:n}),window.addEventListener("message",r=>{const i=r.data;i.type==="module_data"&&t({streams:i.streams,time:i.time,queryRange:i.queryRange})})}static addOverviewDeviceListener(t){this.sendAppMessage({type:"request_devices"});const n=r=>{const i=r.data;i.type==="overview_devices"&&t(i.data)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}static addStreamListener(t,n,r){const i=s=>{const l=s.data;if(l.type==="module_data"){const{start:o,end:c}=l.queryRange;r(queryStore.moduleQuery({},t,n,new Date(o),new Date(c),!1))}};return window.addEventListener("message",i),()=>window.removeEventListener("message",i)}static addModuleConfigurationListener(t){window.addEventListener("message",n=>{const r=n.data;r.type==="module_configuration"&&t(r)})}static addChannelDataListener(t,n){window.addEventListener("message",r=>{const i=r.data;i.type==="channel_data"&&i.channel===t&&n({source:i.source,data:i.data})})}static async prompt(t,n){return new Promise(r=>{const i=Math.random().toString();this.sendAppMessage({type:"prompt",promptId:i,schema:t,okText:n==null?void 0:n.okText,cancelText:n==null?void 0:n.cancelText});const s=l=>{const o=l.data;o.type==="prompt_response"&&o.promptId===i&&r(o.data),window.removeEventListener("message",s)};window.addEventListener("message",s)})}}const je=class{static async login(t,n){try{const r=await fetch(`${FORMANT_API_URL}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:n}),headers:{"Content-Type":"application/json"}}),i=await r.json();if(r.status!==200)throw new Error(i.message);return await je.loginWithToken(i.authentication.accessToken,i.authentication.refreshToken),i.authentication}catch(r){return je.waitingForAuth.forEach(i=>i(!1)),je.waitingForAuth=[],Promise.reject(r)}}static async loginWithToken(t,n){const r=JSON.parse(atob(t.split(".")[1]));try{let i;if(je.isShareToken=r["formant:claims"]&&r["formant:claims"].type=="share",r["formant:claims"]&&(je.currentOrganization=r["formant:claims"].organizationId),r["custom:organization_id"]&&(je.currentOrganization=r["custom:organization_id"]),je.isShareToken||(i=r.sub),r["formant:claims"]&&r["formant:claims"].userId&&(i=r["formant:claims"].userId),i){const s=await fetch(`${FORMANT_API_URL}/v1/admin/users/${i}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),l=await s.json();if(s.status!==200)throw new Error(l.message);je.currentUser=l}je.token=t,je.waitingForAuth.forEach(s=>s(!0))}catch(i){console.error(i),je.waitingForAuth.forEach(s=>s(!1))}je.waitingForAuth=[],n&&(je.refreshToken=n,setInterval(async()=>{if(je.refreshToken){const s=await(await fetch(`${FORMANT_API_URL}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:je.refreshToken})})).json();je.token=s.authentication.accessToken}},1e3*60*60))}static isAuthenticated(){return je.token!==void 0}static getCurrentUser(){return je.currentUser}static async waitTilAuthenticated(){return je.token!==void 0?!0:new Promise(t=>{je.waitingForAuth.push(function(n){t(n)})})}static async listenForRefresh(){App.addAccessTokenRefreshListener(t=>{this.loginWithToken(t)}),setInterval(async()=>{App.refreshAuthToken()},1e3*60*60)}static async forgotPassword(t){await fetch(`${FORMANT_API_URL}/v1/admin/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:t}),headers:{"Content-Type":"application/json"}})}static async confirmForgotPassword(t){return(await fetch(`${FORMANT_API_URL}/v1/admin/auth/confirm-forgot-password`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).ok}static async respondToNewPasswordRequiredChallenge(t){return await(await fetch(`${FORMANT_API_URL}/v1/admin/auth/respond-to-new-password-required-challenge`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}static async loginWithGoogle(t){return await(await fetch(`${FORMANT_API_URL}/v1/admin/auth/login-google`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}static async refresh(t){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})})).json();await je.loginWithToken(r.authentication.accessToken,t)}};let Authentication=je;Ae(Authentication,"token"),Ae(Authentication,"refreshToken"),Ae(Authentication,"currentUser"),Ae(Authentication,"currentOrganization"),Ae(Authentication,"isShareToken",!1),Ae(Authentication,"defaultDeviceId"),Ae(Authentication,"waitingForAuth",[]);function delay(e){return new Promise(t=>setTimeout(t,e))}class DataChannel{constructor(t){Ae(this,"ready",!1);Ae(this,"listeners",[]);Ae(this,"openListeners",[]);Ae(this,"closeListeners",[]);Ae(this,"errorListeners",[]);Ae(this,"binaryListeners",[]);Ae(this,"error");Ae(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.ready=!0,this.openListeners.forEach(n=>n())},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(n=>n())},this.dataChannel.onerror=n=>{console.error(n),this.error="An error occurred in DataChannel",this.errorListeners.forEach(r=>r(n))},this.dataChannel.onmessage=n=>{this.listeners.forEach(r=>{const i=new Uint8Array(n.data),s=this.decoder.decode(i);r(s)}),this.binaryListeners.forEach(r=>{r(new Uint8Array(n.data))})}}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(n=>n!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(n=>n!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(n=>n!==t)}async waitTilReady(){return this.ready?!0:new Promise((n,r)=>{let i=window.setInterval(()=>{this.ready&&(window.clearInterval(i),n(!0)),this.error&&r(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(n,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const n=this.binaryListeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(n,1)}}class CaptureStream{constructor(t){Ae(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=r.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}class Manipulator{constructor(t,n){Ae(this,"currentListeners",[]);Ae(this,"onRealtimeMessage",(t,n)=>{n.payload.jointState&&this.currentListeners.forEach(r=>{n.payload.jointState&&r(n.payload.jointState)})});this.device=t,this.config=n}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,n,r){Ae(this,"channel");Ae(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=n,this.timeout=r}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);Ae(this,"RESPONSE_SUCCESS_BYTE",0);Ae(this,"decoder",new TextDecoder)}generateBinaryId(){const n=new Uint8Array(16);for(let r=0;r<n.length;r++)n[r]=Math.floor(Math.random()*256);return n}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(n=>{const i=n.slice(0,16).toString();if(i.length===0)throw new Error("Invalid response");const s=n.slice(16);if(s.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(i)&&this.requestIdToResponseMap.set(i,s)})}async request(n){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:i,timeout:s}=this;await r.waitTilReady();const l=this.generateBinaryId(),o=l.toString();i.set(o,!0),r.sendBinary(new Uint8Array([...l,...n]));const c=new Date().getTime();for(;new Date().getTime()<c+s;)if(await delay(50),i.has(o)){const u=i.get(o);if(u!==!0){i.delete(o);const f=u[0]===this.RESPONSE_SUCCESS_BYTE,E=u.slice(1);if(f)return E;throw console.error({name:"AdapterError",message:this.decoder.decode(E)}),new Error("Binary request datachannel adapter error")}}throw i.delete(o),console.error({name:"TimeoutError",message:`Request timed out after ${s/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const n=JSON.parse(t),{id:r,data:i,error:s}=n;if(!r)throw new Error("Invalid response");if(!i&&!s)throw new Error("Invalid response");this.requestIdToResponseMap.has(r)&&this.requestIdToResponseMap.set(r,n)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:r,timeout:i}=this;await n.waitTilReady();const s=this.generateTextId();r.set(s,!0),n.send(JSON.stringify({id:s,data:t}));const l=new Date().getTime();for(;new Date().getTime()<l+i;)if(await delay(50),r.has(s)){const o=r.get(s);if(o!==!0){r.delete(s);const{data:c,error:u}=o;if(c)return c;if(u)throw console.error({name:"AdapterError",message:u}),new Error("Text request datachannel adapter error")}}throw r.delete(s),console.error({name:"TimeoutError",message:`Request timed out after ${i/1e3} seconds`}),new Error("Text request datachannel request timed out")}}var domain;function EventHandlers(){}EventHandlers.prototype=Object.create(null);function EventEmitter(){EventEmitter.init.call(this)}EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&domain.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function e(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};function $getMaxListeners(e){return e._maxListeners===void 0?EventEmitter.defaultMaxListeners:e._maxListeners}EventEmitter.prototype.getMaxListeners=function e(){return $getMaxListeners(this)};function emitNone(e,t,n){if(t)e.call(n);else for(var r=e.length,i=arrayClone(e,r),s=0;s<r;++s)i[s].call(n)}function emitOne(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,s=arrayClone(e,i),l=0;l<i;++l)s[l].call(n,r)}function emitTwo(e,t,n,r,i){if(t)e.call(n,r,i);else for(var s=e.length,l=arrayClone(e,s),o=0;o<s;++o)l[o].call(n,r,i)}function emitThree(e,t,n,r,i,s){if(t)e.call(n,r,i,s);else for(var l=e.length,o=arrayClone(e,l),c=0;c<l;++c)o[c].call(n,r,i,s)}function emitMany(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,s=arrayClone(e,i),l=0;l<i;++l)s[l].apply(n,r)}EventEmitter.prototype.emit=function e(t){var n,r,i,s,l,o,c,u=t==="error";if(o=this._events,o)u=u&&o.error==null;else if(!u)return!1;if(c=this.domain,u){if(n=arguments[1],c)n||(n=new Error('Uncaught, unspecified "error" event')),n.domainEmitter=this,n.domain=c,n.domainThrown=!1,c.emit("error",n);else{if(n instanceof Error)throw n;var f=new Error('Uncaught, unspecified "error" event. ('+n+")");throw f.context=n,f}return!1}if(r=o[t],!r)return!1;var E=typeof r=="function";switch(i=arguments.length,i){case 1:emitNone(r,E,this);break;case 2:emitOne(r,E,this,arguments[1]);break;case 3:emitTwo(r,E,this,arguments[1],arguments[2]);break;case 4:emitThree(r,E,this,arguments[1],arguments[2],arguments[3]);break;default:for(s=new Array(i-1),l=1;l<i;l++)s[l-1]=arguments[l];emitMany(r,E,this,s)}return!0};function _addListener(e,t,n,r){var i,s,l;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(s=e._events,s?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),l=s[t]):(s=e._events=new EventHandlers,e._eventsCount=0),!l)l=s[t]=n,++e._eventsCount;else if(typeof l=="function"?l=s[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(i=$getMaxListeners(e),i&&i>0&&l.length>i)){l.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=l.length,emitWarning(o)}return e}function emitWarning(e){typeof console.warn=="function"?console.warn(e):console.log(e)}EventEmitter.prototype.addListener=function e(t,n){return _addListener(this,t,n,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function e(t,n){return _addListener(this,t,n,!0)};function _onceWrap(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}EventEmitter.prototype.once=function e(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,_onceWrap(this,t,n)),this},EventEmitter.prototype.prependOnceListener=function e(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,_onceWrap(this,t,n)),this},EventEmitter.prototype.removeListener=function e(t,n){var r,i,s,l,o;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(r=i[t],!r)return this;if(r===n||r.listener&&r.listener===n)--this._eventsCount===0?this._events=new EventHandlers:(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(s=-1,l=r.length;l-- >0;)if(r[l]===n||r[l].listener&&r[l].listener===n){o=r[l].listener,s=l;break}if(s<0)return this;if(r.length===1){if(r[0]=void 0,--this._eventsCount===0)return this._events=new EventHandlers,this;delete i[t]}else spliceOne(r,s);i.removeListener&&this.emit("removeListener",t,o||n)}return this},EventEmitter.prototype.removeAllListeners=function e(t){var n,r;if(r=this._events,!r)return this;if(!r.removeListener)return arguments.length===0?(this._events=new EventHandlers,this._eventsCount=0):r[t]&&(--this._eventsCount===0?this._events=new EventHandlers:delete r[t]),this;if(arguments.length===0){for(var i=Object.keys(r),s=0,l;s<i.length;++s)l=i[s],l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n)do this.removeListener(t,n[n.length-1]);while(n[0]);return this},EventEmitter.prototype.listeners=function e(t){var n,r,i=this._events;return i?(n=i[t],n?typeof n=="function"?r=[n.listener||n]:r=unwrapListeners(n):r=[]):r=[],r},EventEmitter.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):listenerCount$1.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount$1;function listenerCount$1(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}EventEmitter.prototype.eventNames=function e(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}function arrayClone(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}const urlParams$1=new URLSearchParams(window.location.search),rtcClientVersion=urlParams$1.get("rtc_client"),SessionType={Teleop:1,Observe:3};class Device extends EventEmitter{constructor(n,r,i){super();Ae(this,"rtcClient");Ae(this,"remoteDevicePeerId");Ae(this,"realtimeListeners",[]);Ae(this,"connectionMonitorInterval");Ae(this,"handleMessage",(n,r)=>{this.realtimeListeners.forEach(i=>i(n,r))});this.id=n,this.name=r,this.organizationId=i}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(){let n=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const r=await n.json();if(!r.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const i=r.state.reportedConfiguration.version;return n=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${i}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await n.json()).document}async getFileUrl(n){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[n]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async startRealtimeConnection(n){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{let r;if(rtcClientVersion==="1"?r=new distExports.RtcClientV1({signalingClient:new distExports.RtcSignalingClient(FORMANT_API_URL+"/v1/signaling"),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:this.handleMessage}):r=new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:this.handleMessage,sessionType:n}),r.isReady)for(;!r.isReady();)await delay(100);const s=(await r.getPeers()).find(l=>l.deviceId===this.id);if(!s)throw new Error("Cannot find peer, is the robot offline?");for(this.remoteDevicePeerId=s.id,await r.connect(this.remoteDevicePeerId);r.getConnectionStatus(this.remoteDevicePeerId)!=="connected";)await delay(100);this.rtcClient=r,this.emit("connect"),this.initConnectionMonitoring()}}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{this.isV2Signaling(this.rtcClient)&&(!this.rtcClient||!this.remoteDevicePeerId||await this.rtcClient.getConnectionStatsInfo(this.remoteDevicePeerId)===void 0)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(n=>{console.error(n)}))},1e3)}isV2Signaling(n){return n.getConnectionStatsInfo!==void 0}stopConnectionMonitoring(){clearInterval(this.connectionMonitorInterval),this.connectionMonitorInterval=void 0}async sendRealtimeMessage(n,r={channelLabel:"stream.reliable"}){const i=defined(this.rtcClient,"Realtime connection has not been started"),s=await this.getRemotePeer();i.send(defined(s).id,n,r)}addRealtimeListener(n){this.realtimeListeners.push(n)}removeRealtimeListener(n){const r=this.realtimeListeners.indexOf(n);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeAudioStreams(){var i,s,l;const n=await this.getConfiguration(),r=[];for(const o of((i=n.teleop)==null?void 0:i.hardwareStreams)??[])o.rtcStreamType==="audio-chunk"&&r.push({name:o.name});for(const o of((s=n.teleop)==null?void 0:s.rosStreams)??[])o.topicType=="audio_common_msgs/AudioData"&&r.push({name:o.topicName});for(const o of((l=n.teleop)==null?void 0:l.customStreams)??[])o.rtcStreamType==="audio-chunk"&&r.push({name:o.name});return r}async getRealtimeVideoStreams(){var i,s,l;const n=await this.getConfiguration(),r=[];for(const o of((i=n.teleop)==null?void 0:i.hardwareStreams)??[])o.rtcStreamType==="h264-video-frame"&&r.push({name:o.name});for(const o of((s=n.teleop)==null?void 0:s.rosStreams)??[])o.topicType=="formant/H264VideoFrame"&&r.push({name:o.topicName}),(o.topicType==="sensor_msgs/Image"||o.topicType==="sensor_msgs/CompressedImage")&&o.encodeVideo&&r.push({name:o.topicName});for(const o of((l=n.teleop)==null?void 0:l.customStreams)??[])o.rtcStreamType==="h264-video-frame"&&r.push({name:o.name});return r}async getRealtimeManipulators(){const n=await this.getConfiguration(),r=[];for(const i of n.teleop.rosStreams??[])i.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:i.topicName},plannedJointStateStream:i.plannedTopic?{name:i.plannedTopic}:void 0,planValidStream:i.planValidTopic?{name:i.planValidTopic}:void 0,endEffectorStream:i.endEffectorTopic?{name:i.endEffectorTopic}:void 0,endEffectorLinkName:i.endEffectorLinkName,baseReferenceFrame:i.baseReferenceFrame,localFrame:i.localFrame}));return r}async startListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n,enablePriorityUpload:!0,pipeline:"telemetry"})}async changeStreamAudioType(n,r){const i=defined(this.rtcClient,"Realtime connection has not been started"),s=await this.getRemotePeer();i.controlRemoteStream(defined(s).id,{streamName:n,setAudioFormat:r})}async disableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){const r=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(i=>i.deviceId===this.id);return defined(r,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){if(this.rtcClient)this.stopConnectionMonitoring(),await this.rtcClient.disconnect(this.id),this.rtcClient=void 0;else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){let n=await Fleet.getPeers(),r=await Fleet.getRealtimeSessions(),i=n.find(s=>s.deviceId===this.id);return i?r[i.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(i=>({name:i.name,id:i.id,command:i.command,description:i.description,parameterEnabled:i.parameterEnabled,parameterValue:i.parameterValue,parameterMeta:i.parameterMeta,enabled:i.enabled}))}async sendCommand(n,r,i,s){var E;const o=(await this.getAvailableCommands()).find(w=>w.name===n);if(!o)throw new Error(`Could not find command with name "${n}"`);let c="";r===void 0?o.parameterEnabled&&o.parameterValue&&(c=o.parameterValue):c=r;let u={value:c,scrubberTime:(i||new Date).toISOString(),meta:{...o.parameterMeta,...s}};return await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:o.id,organizationId:this.organizationId,deviceId:this.id,command:o.command,parameter:u,userId:(E=Authentication.currentUser)==null?void 0:E.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async getCommand(n){return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${n}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCustomDataChannel(n,r){if(rtcClientVersion==="1")throw new Error("createCustomDataChannel is not supported in rtcClientVersion 1");const i=defined(this.rtcClient,"Realtime connection has not been started"),s=await this.getRemotePeer(),l=await new Promise(o=>{i.createCustomDataChannel(defined(s).id,n,{ordered:!0,...r},!1,(c,u)=>{const f=new DataChannel(u);o(f)})});return await l.waitTilReady(),l}createCustomRequestDataChannel(n,r=3e3){return new TextRequestDataChannel(this,n,r)}createCustomBinaryRequestDataChannel(n,r=3e3){return new BinaryRequestDataChannel(this,n,r)}async createCaptureStream(n){const i=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:n,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(i)}async getTelemetry(n,r,i,s){return await Fleet.getTelemetry(this.id,n,r,i,s)}async getTelemetryStreams(){var c,u;const n=await this.getConfiguration(),r=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),i=[],s=[];return(u=(c=n.telemetry)==null?void 0:c.streams)==null||u.forEach(f=>{f.disabled!==!0&&i.push(f.name),f.onDemand===!0&&s.push(f.name)}),console.log(s),(await r.json()).items.filter(f=>!i.includes(f)).map(f=>({name:f,onDemand:s.includes(f)}))}async createInterventionRequest(n,r,i,s){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:n,interventionType:r,time:new Date().toISOString(),deviceId:this.id,tags:s,data:i}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(n,r,i){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:n,interventionType:r,data:i}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async getAnnotationCount(n,r){return await Fleet.getAnnotationCount({...n,deviceIds:[this.id]},r)}async getAnnotationCountByIntervals(n,r,i){return await Fleet.getAnnotationCountByIntervals({...n,deviceIds:[this.id]},r,i)}async eventsCounter(n,r,i,s,l){return await Fleet.eventsCounter(n,r,i,s,{...l,deviceIds:[this.id]})}async createShareLink(n,r){return n.scope.deviceIds=[this.id],await Fleet.createShareLink(n,r)}}class PeerDevice{constructor(t){Ae(this,"rtcClient");Ae(this,"remoteDevicePeerId");Ae(this,"realtimeListeners",[]);Ae(this,"id");Ae(this,"handleMessage",(t,n)=>{this.realtimeListeners.forEach(r=>r(t,n))});this.peerUrl=t}async getLatestTelemetry(){const n=await(await fetch(`${this.peerUrl}/telemetry`)).json();return Object.entries(n).map(([i,s])=>({deviceId:this.id,streamName:i,streamType:"json",currentValue:s,currentValueTime:s.timestamp,tags:{}}))}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.document}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}async startRealtimeConnection(t){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{const n=new distExports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage,sessionType:t});for(await n.connectLan(this.peerUrl);n.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=n}}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const n=this.realtimeListeners.indexOf(t);if(n===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(n,1)}async getRealtimeVideoStreams(){const t=await this.getConfiguration(),n=[];for(const r of t.teleop.hardwareStreams??[])r.rtcStreamType==="h264-video-frame"&&n.push({name:r.name});for(const r of t.teleop.rosStreams??[])r.topicType=="formant/H264VideoFrame"&&n.push({name:r.topicName}),(r.topicType==="sensor_msgs/Image"||r.topicType==="sensor_msgs/CompressedImage")&&r.encodeVideo&&n.push({name:r.topicName});for(const r of t.teleop.customStreams??[])r.rtcStreamType==="h264-video-frame"&&n.push({name:r.name});return n}async getRealtimeManipulators(){const t=await this.getConfiguration(),n=[];for(const r of t.teleop.rosStreams??[])r.topicType=="sensor_msgs/JointState"&&n.push(new Manipulator(this,{currentJointStateStream:{name:r.topicName},plannedJointStateStream:r.plannedTopic?{name:r.plannedTopic}:void 0,planValidStream:r.planValidTopic?{name:r.planValidTopic}:void 0,endEffectorStream:r.endEffectorTopic?{name:r.endEffectorTopic}:void 0,endEffectorLinkName:r.endEffectorLinkName,baseReferenceFrame:r.baseReferenceFrame,localFrame:r.localFrame}));return n}async startListeningToRealtimeVideo(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){if(this.rtcClient)await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async createCustomDataChannel(t,n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer(),s=await new Promise(l=>{r.createCustomDataChannel(defined(i).id,t,{ordered:!0,...n},!1,(o,c)=>{const u=new DataChannel(c);l(u)})});return await s.waitTilReady(),s}createCustomRequestDataChannel(t,n=3e3){return new TextRequestDataChannel(this,t,n)}createCustomBinaryRequestDataChannel(t,n=3e3){return new BinaryRequestDataChannel(this,t,n)}}const Ge=class{static async setDefaultDevice(t){Ge.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Ge.defaultDeviceId)throw new Error("No known default device");const i=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(l=>l.id===Ge.defaultDeviceId).name,s=new Device(Ge.defaultDeviceId,i,defined(Authentication.currentOrganization));return Ge.knownContext.push(new WeakRef(s)),s}static async getPeerDevice(t){const n=new PeerDevice(t);return n.id=await n.getDeviceId(),n}static async getDevice(t){if(!Authentication.token)throw new Error("Not authenticated");const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),i=r.name,s=new Device(t,i,r.organizationId);return Ge.knownContext.push(new WeakRef(s)),s}static async getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return n.items,n.items.map(r=>new Device(r.id,r.name,r.organizationId))}static async queryDevices(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(i=>new Device(i.id,i.name,i.organizationId))}static async getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const r=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await Ge.getDevices()).filter(s=>r.includes(s.id))}static async getPeers(){if(!Authentication.token)throw new Error("Not authenticated");return await new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getPeers()}static async getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");return await new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getSessions()}static async getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const r=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(s=>s.deviceId);return(await Ge.getDevices()).filter(s=>r.includes(s.id))}static async getLatestTelemetry(t){let n=t;return t&&!Array.isArray(t)&&(t=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getTelemetry(t,n,r,i,s){let l=t;Array.isArray(t)||(l=[t]);let o=n;return Array.isArray(n)||(o=[n]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:l,end:i.toISOString(),names:o,start:r.toISOString(),tags:s}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getFileUrl(t){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(r.fileUrls.length===0)throw new Error("File not found");return r.fileUrls[0]}static async queryTelemetry(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async aggregateTelemetry(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).aggregates}static async queryEvents(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getEvent(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getCurrentGroup(){if(!Authentication.token)throw new Error("Not authenticated");let t=new URLSearchParams("");typeof window<"u"&&(t=new URLSearchParams(window.location.search));const n=t.get("group");if(n===null||n.trim()==="")return;const r=await fetch(`${FORMANT_API_URL}/v1/admin/groups/`+n,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),{tagKey:i,tagValue:s}=await r.json();return await this.queryDevices({tags:{[i]:[s]},enabled:!0,type:"default"})}static async getAnnotationCount(t,n){return(await this.queryEvents({...t,eventTypes:["annotation"]})).filter(l=>!!l.tags&&Object.keys(l.tags).includes(n)).reduce((l,o)=>{const c=o.tags[n];return c in l?(l[c]+=1,l):(l[c]=1,l)},{})}static async getAnnotationCountByIntervals(t,n,r){const{end:i,start:s}=t,o=aggregateByDateFunctions[r].interval({start:new Date(s),end:new Date(i)}),c=o.map((f,E)=>{const w=new Date(f).toISOString(),h=E===o.length-1?new Date(Date.now()).toISOString():new Date(o[E+1]);return this.getAnnotationCount({...t,start:w,end:h},n)}),u=await Promise.all(c);return o.map((f,E)=>({date:new Date(f).toISOString(),annotations:u[E]}))}static async getStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.filter(r=>r.enabled)}static async patchStream(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/streams/${t.id}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getViews(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/views`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async patchView(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/views/${t.id}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async eventsCounter(t,n,r,i,s){const l=aggregateByDateFunctions[n];return await Promise.all(Array(r).fill(0).map(async(o,c)=>{const u=new Date(i),f=l.sub(l.start(u),r-c-1),E=l.sub(l.end(u),r-c-1),w=formatTimeFrameText(f.toLocaleDateString(),E.toLocaleDateString()),h=await Ge.queryEvents({...s,eventTypes:t,start:new Date(f).toISOString(),end:new Date(E).toISOString()});return{date:w,events:h}}))}static async getAnalyticsModules(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/analytics-modules`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getAnalyticStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getTaskReportTables(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-reports`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async queryAnalytics(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getAnalyticsRows(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/rows`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getTaskReportRows(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-report-rows`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async createShareLink(t,n){if(!Authentication.token)throw new Error("Not authenticated");const i=(await this.getViews()).filter(c=>c.name===n);if(i.length===0)return console.warn("View does not exist or it is misspell"),null;const s=await fetch(`${FORMANT_API_URL}/v1/admin/shares`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=FORMANT_API_URL.replace("api","app"),{code:o}=await s.json();return`${l}/shares/${o}#${serializeHash({viewId:i[0].id})}`}};let Fleet=Ge;Ae(Fleet,"defaultDeviceId"),Ae(Fleet,"knownContext",[]);class KeyValue{static async set(t,n){try{const r=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),i=await r.json();if(r.status!==200)throw new Error(i.message)}catch(r){throw r}}static async get(t){try{const n=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await n.json();if(n.status!==200)throw new Error(r.message);return r.value}catch(n){throw n}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await t.json();if(t.status!==200)throw new Error(n.message);return n.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(n){throw n}}}const vailableAggregationIntervals=["day","week","month","year","hour","minute","quarter"],aggregateFunctions=["interval","start","end","sub","get"];function getVariance(e){return e.count<2?0:e.sumOfSquares/(e.count-1)}function getStandardDeviation(e){return Math.sqrt(getVariance(e))}function getMax(e){return e.max}function getMin(e){return e.min}function getAverage(e){return e.count===0?-1:e.sum/e.count}function getSum(e){return e.sum}function getCount(e){return e.count}const aggregateFunctionMap={min:getMin,max:getMax,"standard deviation":getStandardDeviation,average:getAverage,sum:getSum,count:getCount},aggregateByDateFunctions={day:{interval:dateFns__namespace.eachDayOfInterval,start:dateFns__namespace.startOfDay,end:dateFns__namespace.endOfDay,sub:dateFns__namespace.subDays,get:dateFns__namespace.getDay},week:{interval:dateFns__namespace.eachWeekOfInterval,start:dateFns__namespace.startOfWeek,end:dateFns__namespace.endOfWeek,sub:dateFns__namespace.subWeeks,get:dateFns__namespace.getWeek},month:{interval:dateFns__namespace.eachMonthOfInterval,start:dateFns__namespace.startOfMonth,end:dateFns__namespace.endOfMonth,sub:dateFns__namespace.subMonths,get:dateFns__namespace.getMonth},year:{interval:dateFns__namespace.eachYearOfInterval,start:dateFns__namespace.startOfYear,end:dateFns__namespace.endOfYear,sub:dateFns__namespace.subYears,get:dateFns__namespace.getYear},hour:{interval:dateFns__namespace.eachHourOfInterval,start:dateFns__namespace.startOfHour,end:dateFns__namespace.endOfHour,sub:dateFns__namespace.subHours,get:dateFns__namespace.getHours},minute:{interval:dateFns__namespace.eachMinuteOfInterval,start:dateFns__namespace.startOfMinute,end:dateFns__namespace.endOfMinute,sub:dateFns__namespace.subMinutes,get:dateFns__namespace.getMinutes},quarter:{interval:dateFns__namespace.eachQuarterOfInterval,start:dateFns__namespace.startOfQuarter,end:dateFns__namespace.endOfQuarter,sub:dateFns__namespace.subQuarters,get:dateFns__namespace.getQuarter}},formatTimeFrameText=(e,t)=>e.split("/")[0]+"/"+e.split("/")[1]+"–"+t.split("/")[0]+"/"+t.split("/")[1];function getZeroINumericSet(){return{min:Number.MAX_SAFE_INTEGER,max:0,sum:0,count:0,sumOfSquares:0}}function reduceNumericStreamAggregates(e){return e.aggregates.reduce((t,n)=>{const r=n[1];return combineNumericAggregates(r,t)},getZeroINumericSet())}function reduceNumericSetStreamAggregates(e,t){var n;return(n=e.aggregates.reduce((r,i)=>{const s=i[1];return combineNumericSetAggregates(s,r)},{})[t])==null?void 0:n.value}function combineNumericAggregates(e,t){return{min:Math.min(e.min,t.min),max:Math.max(e.max,t.max),sum:e.sum+t.sum,count:e.count+t.count,sumOfSquares:e.sumOfSquares+t.sumOfSquares}}function combineNumericSetAggregates(e,t){return Object.keys(e).reduce((n,r)=>{var i;return{...n,[r]:{value:combineNumericAggregates(e[r].value,((i=t[r])==null?void 0:i.value)??getZeroINumericSet()),unit:e[r].unit}}},{})}const timeout=e=>new Promise(t=>setTimeout(t,e*1e3));function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch{try{return cachedSetTimeout.call(null,e,0)}catch{return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch{try{return cachedClearTimeout.call(null,e)}catch{return cachedClearTimeout.call(this,e)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function nextTick(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser$1=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding$1(e){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(e){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$1.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(e){var t=performanceNow.call(performance$1)*.001,n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n=n-e[0],r=r-e[1],r<0&&(n--,r+=1e9)),[n,r]}var startTime=new Date;function uptime(){var e=new Date,t=e-startTime;return t/1e3}var browser$1$1={nextTick,title,browser:browser$1,env,argv,version,versions,on,addListener,once,off,removeListener,removeAllListeners,emit,binding:binding$1,cwd,chdir,umask,hrtime,platform,release,config,uptime},inherits;typeof Object.create=="function"?inherits=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:inherits=function(t,n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t};const inherits$1=inherits;var formatRegExp=/%[sdj%]/g;function format(e){if(!isString(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(inspect(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=String(e).replace(formatRegExp,function(o){if(o==="%%")return"%";if(n>=i)return o;switch(o){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return o}}),l=r[n];n<i;l=r[++n])isNull(l)||!isObject(l)?s+=" "+l:s+=" "+inspect(l);return s}function deprecate(e,t){if(isUndefined(global$1.process))return function(){return deprecate(e,t).apply(this,arguments)};if(browser$1$1.noDeprecation===!0)return e;var n=!1;function r(){if(!n){if(browser$1$1.throwDeprecation)throw new Error(t);browser$1$1.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}return r}var debugs={},debugEnviron;function debuglog(e){if(isUndefined(debugEnviron)&&(debugEnviron=browser$1$1.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var t=0;debugs[e]=function(){var n=format.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else debugs[e]=function(){};return debugs[e]}function inspect(e,t){var n={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),isBoolean(t)?n.showHidden=t:t&&_extend(n,t),isUndefined(n.showHidden)&&(n.showHidden=!1),isUndefined(n.depth)&&(n.depth=2),isUndefined(n.colors)&&(n.colors=!1),isUndefined(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=stylizeWithColor),formatValue(n,e,n.depth)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(e,t){var n=inspect.styles[t];return n?"\x1B["+inspect.colors[n][0]+"m"+e+"\x1B["+inspect.colors[n][1]+"m":e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var t={};return e.forEach(function(n,r){t[n]=!0}),t}function formatValue(e,t,n){if(e.customInspect&&t&&isFunction(t.inspect)&&t.inspect!==inspect&&!(t.constructor&&t.constructor.prototype===t)){var r=t.inspect(n,e);return isString(r)||(r=formatValue(e,r,n)),r}var i=formatPrimitive(e,t);if(i)return i;var s=Object.keys(t),l=arrayToHash(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),isError(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return formatError(t);if(s.length===0){if(isFunction(t)){var o=t.name?": "+t.name:"";return e.stylize("[Function"+o+"]","special")}if(isRegExp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(isDate(t))return e.stylize(Date.prototype.toString.call(t),"date");if(isError(t))return formatError(t)}var c="",u=!1,f=["{","}"];if(isArray(t)&&(u=!0,f=["[","]"]),isFunction(t)){var E=t.name?": "+t.name:"";c=" [Function"+E+"]"}if(isRegExp(t)&&(c=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(c=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(c=" "+formatError(t)),s.length===0&&(!u||t.length==0))return f[0]+c+f[1];if(n<0)return isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var w;return u?w=formatArray(e,t,n,l,s):w=s.map(function(h){return formatProperty(e,t,n,l,h,u)}),e.seen.pop(),reduceToSingleString(w,c,f)}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,n,r,i){for(var s=[],l=0,o=t.length;l<o;++l)hasOwnProperty(t,String(l))?s.push(formatProperty(e,t,n,r,String(l),!0)):s.push("");return i.forEach(function(c){c.match(/^\d+$/)||s.push(formatProperty(e,t,n,r,c,!0))}),s}function formatProperty(e,t,n,r,i,s){var l,o,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?c.set?o=e.stylize("[Getter/Setter]","special"):o=e.stylize("[Getter]","special"):c.set&&(o=e.stylize("[Setter]","special")),hasOwnProperty(r,i)||(l="["+i+"]"),o||(e.seen.indexOf(c.value)<0?(isNull(n)?o=formatValue(e,c.value,null):o=formatValue(e,c.value,n-1),o.indexOf(`
|
|
49
|
+
`),Error.captureStackTrace(this,r)}}e.exports=i=>{if(i.length>2)throw new r(i);function s(o={}){this.options=o}function l(o){return new s(o)}return s.prototype.transform=i,l.Format=s,l}},function(e,t,n){function r(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")}function i(l,o){for(var c=0;c<o.length;c++){var u=o[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}var s=n(88);e.exports=function(){function l(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,l),this.loggers=new Map,this.options=u}var o,c;return o=l,(c=[{key:"add",value:function(u,f){var E=this;if(!this.loggers.has(u)){var w=(f=Object.assign({},f||this.options)).transports||this.options.transports;f.transports=w?w.slice():[];var h=s(f);h.on("close",function(){return E._delete(u)}),this.loggers.set(u,h)}return this.loggers.get(u)}},{key:"get",value:function(u,f){return this.add(u,f)}},{key:"has",value:function(u){return!!this.loggers.has(u)}},{key:"close",value:function(u){var f=this;if(u)return this._removeLogger(u);this.loggers.forEach(function(E,w){return f._removeLogger(w)})}},{key:"_removeLogger",value:function(u){this.loggers.has(u)&&(this.loggers.get(u).close(),this._delete(u))}},{key:"_delete",value:function(u){this.loggers.delete(u)}}])&&i(o.prototype,c),l}()},function(e,t,n){(function(r){const i=n(52),s=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(l,o,c,u){let f,E,w=!1,h=!1;const g=n(94);function b(F){u(o,F)}function R(F,M){let A=`"${o}" ${M}`;throw F&&(A=`${A}`),E&&(A=`${A}. An example of a valid value would be: ${E}`),new i(A)}const j={convertFromBase64:function(){return b("marking for base64 conversion"),w=!0,j},default:function(F){if(typeof F=="number")f=F.toString();else if(Array.isArray(F)||typeof F=="object"&&F!==null)f=JSON.stringify(F);else{if(typeof F!="string")throw new i("values passed to default() must be of Number, String, Array, or Object type");f=F}return b(`setting default value to "${f}"`),j},required:function(F){return F===void 0?(b("marked as required"),h=!0):(b(`setting required flag to ${F}`),h=F),j},example:function(F){return E=F,j}};return Object.entries({...g,...c}).forEach(([F,M])=>{j[F]=function(A){return function(){let d=l[o];if(b(`will be read from the environment using "${A.name}" accessor`),d===void 0)if(f===void 0&&h)b("was not found in the environment, but is required to be set"),R(void 0,"is a required variable, but it was not set");else{if(f===void 0)return void b("was not found in the environment, but is not required. returning undefined");b(`was not found in the environment, parsing default value "${f}" instead`),d=f}h&&(b("verifying variable value is not an empty string"),d.trim().length===0&&R(void 0,"is a required variable, but its value was empty")),w&&(b("verifying variable is a valid base64 string"),d.match(s)||R(d,"should be a valid base64 string if using convertFromBase64"),b("converting from base64 to utf8 string"),d=r.from(d,"base64").toString());const C=[d].concat(Array.prototype.slice.call(arguments));try{b(`passing value "${d}" to "${A.name}" accessor`);const $=A.apply(A,C);return b(`parsed successfully, returning ${$}`),$}catch($){R(d,$.message)}}}(M)}),j}}).call(this,n(5).Buffer)},function(e,t,n){const r=n(33);e.exports=function(i,s){return s=s||",",i.length?r(i).split(s).filter(Boolean):[]}},function(e,t,n){e.exports=function(r){const i=r.toLowerCase();if(i!=="false"&&i!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return i!=="false"}},function(e,t,n){e.exports=function(r){const i=r.toLowerCase();if(["false","0","true","1"].indexOf(i)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(i==="0"||i==="false")}},function(e,t,n){const r=n(95);e.exports=function(i){var s=r(i);if(s>65535)throw new Error("cannot assign a port number greater than 65535");return s}},function(e,t,n){const r=n(33);e.exports=function(i,s){const l=r(i);if(s.indexOf(l)<0)throw new Error(`should be one of [${s.join(", ")}]`);return l}},function(e,t,n){const r=n(54);e.exports=function(i){const s=r(i);if(s>0)throw new Error("should be a negative float");return s}},function(e,t,n){const r=n(54);e.exports=function(i){const s=r(i);if(s<0)throw new Error("should be a positive float");return s}},function(e,t,n){const r=n(53);e.exports=function(i){const s=r(i);if(s>0)throw new Error("should be a negative integer");return s}},function(e,t,n){const r=n(55);e.exports=function(i){var s=r(i);if(!Array.isArray(s))throw new Error("should be a parseable JSON Array");return s}},function(e,t,n){const r=n(55);e.exports=function(i){var s=r(i);if(Array.isArray(s))throw new Error("should be a parseable JSON Object");return s}},function(e,t,n){e.exports=function(r,i){try{RegExp(void 0,i)}catch{throw new Error("invalid regexp flags")}try{return new RegExp(r,i)}catch{throw new Error("should be a valid regexp")}}},function(e,t,n){const r=n(96);e.exports=function(i){return r(i).toString()}},function(e,t,n){const r=n(33),i=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021\u0023-\u005b\u005d-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021-\u005a\u0053-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])+)\])$/;e.exports=function(s){const l=r(s);if(!i.test(l))throw new Error("should be a valid email address");return l}},function(e,t,n){e.exports=function(r,i){return function(s,l){i&&i.match(/prod|production/)||r(`env-var (${s}): ${l}`)}}},function(e,t,n){(function(r){(function(){var i,s,l,o,c,u;typeof performance<"u"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:r!=null&&r.hrtime?(e.exports=function(){return(i()-c)/1e6},s=r.hrtime,o=(i=function(){var f;return 1e9*(f=s())[0]+f[1]})(),u=1e9*r.uptime(),c=o-u):Date.now?(e.exports=function(){return Date.now()-l},l=Date.now()):(e.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(this)}).call(this,n(2))},function(e,t,n){(function(r){(function(i){function s(o){if((o=o===void 0?"utf-8":o)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+o+"') is invalid.")}function l(o,c){if(c=c===void 0?{fatal:!1}:c,(o=o===void 0?"utf-8":o)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+o+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(i.TextEncoder&&i.TextDecoder)return!1;Object.defineProperty(s.prototype,"encoding",{value:"utf-8"}),s.prototype.encode=function(o,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");c=0;for(var u=o.length,f=0,E=Math.max(32,u+(u>>1)+7),w=new Uint8Array(E>>3<<3);c<u;){var h=o.charCodeAt(c++);if(55296<=h&&56319>=h){if(c<u){var g=o.charCodeAt(c);(64512&g)==56320&&(++c,h=((1023&h)<<10)+(1023&g)+65536)}if(55296<=h&&56319>=h)continue}if(f+4>w.length&&(E+=8,E=(E*=1+c/o.length*2)>>3<<3,(g=new Uint8Array(E)).set(w),w=g),(4294967168&h)==0)w[f++]=h;else{if(!(4294965248&h))w[f++]=h>>6&31|192;else if(!(4294901760&h))w[f++]=h>>12&15|224,w[f++]=h>>6&63|128;else{if(4292870144&h)continue;w[f++]=h>>18&7|240,w[f++]=h>>12&63|128,w[f++]=h>>6&63|128}w[f++]=63&h|128}}return w.slice(0,f)},Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(l.prototype,"fatal",{value:!1}),Object.defineProperty(l.prototype,"ignoreBOM",{value:!1}),l.prototype.decode=function(o,c){if((c=c===void 0?{stream:!1}:c).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");c=0;for(var u=(o=new Uint8Array(o)).length,f=[];c<u;){var E=o[c++];if(E===0)break;if(!(128&E))f.push(E);else if((224&E)==192){var w=63&o[c++];f.push((31&E)<<6|w)}else if((240&E)==224){w=63&o[c++];var h=63&o[c++];f.push((31&E)<<12|w<<6|h)}else(248&E)==240&&(65535<(E=(7&E)<<18|(w=63&o[c++])<<12|(h=63&o[c++])<<6|63&o[c++])&&(E-=65536,f.push(E>>>10&1023|55296),E=56320|1023&E),f.push(E))}return String.fromCharCode.apply(null,f)},i.TextEncoder=s,i.TextDecoder=l})(typeof window<"u"?window:r!==void 0?r:this)}).call(this,n(6))},function(e,t,n){n.r(t),n.d(t,"AuthClient",function(){return s}),n.d(t,"RtcSignalingClient",function(){return o}),n.d(t,"Credentials",function(){return L}),n.d(t,"IRtcStream",function(){}),n.d(t,"SignalingPromiseClient",function(){return W.SignalingPromiseClient}),n.d(t,"IRtcClientConfigurationV1",function(){}),n.d(t,"IRtcClientConfiguration",function(){}),n.d(t,"IRtcConnectionStatsInfo",function(){}),n.d(t,"IRtcSendConfiguration",function(){}),n.d(t,"IRtcSessionMetricsMessageCounts",function(){}),n.d(t,"IRtcStreamMessage",function(){}),n.d(t,"IRtcStreamPayload",function(){}),n.d(t,"IStreamControl",function(){}),n.d(t,"RtcClient",function(){return Mt}),n.d(t,"RtcClientV1",function(){return Tt}),n.d(t,"createRtcStreamMessage",function(){return De});var r=n(28),i=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class s extends r.a{adminSignup(P,H){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:H,method:"POST",body:JSON.stringify(P)})})}login(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:JSON.stringify(P),allowUnsafeRetries:!0})})}loginWithGoogleToken(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:JSON.stringify(P),allowUnsafeRetries:!0})})}refresh(P,H){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:JSON.stringify({refreshToken:P,tokenExpirationSeconds:H}),allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:JSON.stringify(P)})})}forgotPassword(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:JSON.stringify({email:P})})})}confirmForgotPassword(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:JSON.stringify(P)})})}resendInvitation(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:JSON.stringify({email:P})})})}changePassword({token:P,refreshToken:H,currentPassword:X,newPassword:ie}){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:P,method:"POST",body:JSON.stringify({refreshToken:H,currentPassword:X,newPassword:ie})})})}getDeviceCredentials(P){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:P,method:"POST",allowUnsafeRetries:!0})})}impersonate(P,H){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:P,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({userId:H})})})}createServiceAccount(P,H,X,ie){return i(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:P,method:"POST",allowUnsafeRetries:!0,body:JSON.stringify({name:H,roleId:X,tags:ie})})})}getFeatures(P){return i(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:P})).features})}}var l=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class o extends r.a{createPeer(P,H){return l(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:P,method:"POST",body:JSON.stringify(H)})})}getPeers(P){return l(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:P})).items})}refreshPeer(P,H){return l(this,void 0,void 0,function*(){yield this.fetch(`peers/${H}/refresh`,{token:P,method:"POST",allowUnsafeRetries:!0})})}createSession(P,H){return l(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:P,method:"POST",body:JSON.stringify(H)})})}refreshSession(P,H){return l(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/refresh`,{token:P,method:"POST",allowUnsafeRetries:!0})})}deleteSession(P,H){return l(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}`,{token:P,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(P){return l(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:P})).items})}getIceServers(P){return l(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:P})).items})}addSignals(P,H,X){return l(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/add-signals`,{token:P,method:"POST",body:JSON.stringify(X)})})}takeSignals(P,H){return l(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${H}/take-signals`,{token:P,method:"POST"})).items})}}var c=n(1),u=n(8),f=n(14),E=n.n(f),w=n(104),h=n.n(w),g=n(0),b=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class R{constructor(P){this.name="LogReporter",this.type="simple",this.message=P}send(P){return b(this,void 0,void 0,function*(){var H,X;g.a.info(this.message,(H=P.reduce((ie,oe)=>Object.assign(Object.assign({},ie),{[oe.name]:oe.stat}),{}),X=ie=>{const{sum:oe,count:de}=ie,ye=oe/de;return Object.assign(Object.assign({},ie),{average:ye})},Object.keys(H).reduce((ie,oe)=>Object.assign(Object.assign({},ie),{[oe]:X(H[oe])}),{})))})}}var j=n(4),F=n(39);function M(pe){return!!pe.match(/^[a-zA-Z0-9-_.,:?'"()@\/\\#$+ ]{1,255}$/)}var A=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};function d({func:pe,delay:P,immediate:H=!1}){let X=!1,ie=setTimeout(function de(){return A(this,void 0,void 0,function*(){if(X)return;const ye=new Date().getTime();try{oe=pe(),yield oe}finally{if(!X){const be=new Date().getTime();ie=setTimeout(de,Math.max(P-(be-ye),0))}}})},H?0:P),oe=Promise.resolve();return{stop(){return A(this,void 0,void 0,function*(){X=!0,clearTimeout(ie),yield oe})}}}var C=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};const $=n(226),q=!!j.c,y=new class{constructor(pe){this.samplePeriodSeconds=60,this.buffer={},this.reporters=[],this.flushInterval=d({func:()=>this.flushStats(),delay:this.samplePeriodSeconds*c.a.second}),this.tags=this.filterTags((pe==null?void 0:pe.tags)||{app:j.a,version:j.j,namespace:j.i,instanceId:F.a})}shutdown(){return C(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(u.a)(2*c.a.second)})}aggregate(pe,P,H){this.addToBuffer(this.buffer,this.encodeKey({metric:pe,tags:this.filterTags(H||{})}),typeof P=="number"?{min:P,max:P,sum:P,count:1}:P)}increment(pe,P){this.aggregate(pe,1,P)}timer(pe,P,H){return C(this,void 0,void 0,function*(){const X=$(),ie=yield P(),oe=$();return this.aggregate(pe,oe-X,H),ie})}registerStatsReporter(pe){this.reporters.push(pe)}setTag(pe,P){const H=this.filterTags({[pe]:P});this.tags=Object.assign(Object.assign({},this.tags),H)}addToBuffer(pe,P,H){if(pe[P]){const{min:X,max:ie,sum:oe,count:de}=pe[P];pe[P]={min:Math.min(X,H.min),max:Math.max(ie,H.max),sum:oe+H.sum,count:de+H.count}}else pe[P]=H}write(pe){return C(this,void 0,void 0,function*(){yield Promise.all(this.reporters.map(P=>C(this,void 0,void 0,function*(){let H;const X={};switch(P.type){case"simple":for(const[oe,de]of Object.entries(pe)){const{metric:ye}=this.decodeKey(oe);this.addToBuffer(X,this.encodeKey({metric:ye}),de)}H=X;break;case"tagged":H=pe;break;default:(function(oe){throw new Error(`Unreachable type encountered (${oe})`)})(P.type)}const ie=Object.entries(H);if(ie.length>0)return P.send(ie.map(([oe,de])=>{const{metric:ye,tags:be}=this.decodeKey(oe);return{name:ye,tags:Object.assign(Object.assign({},be),this.tags),stat:de}}),this.samplePeriodSeconds).catch(oe=>{g.a.debug(`Failed to write stats to ${P.name}`,{error:oe})})})))})}flushStats(){return C(this,void 0,void 0,function*(){yield this.write(this.buffer),this.buffer={}})}encodeKey(pe){return E()(Object.assign(Object.assign({},pe),Object.keys(pe.tags||{}).length>0?{tags:pe.tags}:{}))}decodeKey(pe){return JSON.parse(pe)}filterTags(pe){return Object.entries(pe||{}).reduce((P,[H,X])=>(M(H)&&M(X)&&(P[H]=X),P),{})}};q||["local","on-prem"].includes(j.i)||y.registerStatsReporter(new R("stats"));var m=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class I extends class{constructor(P){this.options=P,this.cache=new h.a(Object.assign(Object.assign(Object.assign({},P.dispose||P.disposeAfter?{ttlAutopurge:!0}:{}),P),{dispose:(...H)=>{var X;H[2]==="evict"&&y.increment("lru-eviction",{name:P.name}),(X=P.dispose)===null||X===void 0||X.call(P,...H)},disposeAfter:(...H)=>{var X;this.updateStats(),(X=P.disposeAfter)===null||X===void 0||X.call(P,...H)}})),this.stringify=P.fastStringify?JSON.stringify:E.a}set(P,H,X){const ie=this.stringify(P);if(!this.cache.set(ie,H,{ttl:X})){const oe=this.cache.sizeCalculation?this.cache.sizeCalculation(H,ie):"unknown";throw Error(`Value too large (${oe} > ${this.cache.max})`)}this.updateStats()}get(P){const{name:H}=this.options,X=this.stringify(P),ie=this.cache.getRemainingTTL(X);return ie<=0?y.increment("cache-miss",{name:H}):ie!==1/0&&y.aggregate("cache-item-ttl",ie,{name:H}),this.cache.get(X)}delete(P){this.cache.delete(this.stringify(P))}peek(P){return this.cache.peek(this.stringify(P))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(P){this.cache.forEach(P)}purgeStale(){return this.cache.purgeStale()}updateStats(){const{name:P}=this.options;y.aggregate("cache-item-count",this.cache.size,{name:P}),this.cache.calculatedSize!==void 0&&y.aggregate("cache-length",this.cache.calculatedSize,{name:P})}}{constructor(P){if(super(P),this.expireRejectedPromiseValues=P.expireRejectedPromiseValues===void 0||P.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=P.rejectedPromiseValueTtl!==void 0?P.rejectedPromiseValueTtl:c.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(P,H,X){super.set(P,H,X),this.expireRejectedPromiseValues&&H.catch(()=>m(this,void 0,void 0,function*(){yield Object(u.a)(this.rejectedPromiseValueTtl),this.peek(P)===H&&this.delete(P)}))}}var _=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class L{constructor(P,H,X){this.authClient=P,this.email=H,this.password=X,this.tokenTtlMs=1*c.a.hour,this.tokenCache=new I({name:"Credentials-tokenCache",max:100,ttl:this.tokenTtlMs-5*c.a.minute,fastStringify:!0})}getToken(){return _(this,void 0,void 0,function*(){let P=this.tokenCache.get(this.email);return P||(P=(()=>_(this,void 0,void 0,function*(){const{authentication:H}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/c.a.second});if(!H)throw new Error("User account not verified.");return H.accessToken}))(),this.tokenCache.set(this.email,P)),P})}}var W=n(97),B=n(40),N=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class D extends B.a{constructor(P){super(P)}postLanRtcOffer(P){return N(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:JSON.stringify(P)})})}}var z=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};function O(pe){return z(this,void 0,void 0,function*(){return(yield Promise.all(pe.map(P=>P.catch(H=>H)))).filter(P=>P instanceof Error)})}function p(pe){if(pe!==void 0)return pe;throw new Error("Value is undefined")}function U(pe,P){const H=pe.reduce((X,ie)=>[...X,...ie.urls],[]).filter(X=>V(X,P)).sort(X=>Q(X,"udp")?-1:0).shift();if(H)return Object.assign(Object.assign({},p(pe.find(X=>X.urls.includes(H)))),{urls:[H]})}function V(pe,P){switch(P){case"stun":return/^stuns?:/.test(pe);case"turn":return/^turns?:/.test(pe)}}function Q(pe,P){return pe.endsWith(`transport=${P}`)}var ee=n(9),ne=n(24),Y=n(229);class G extends Error{constructor(P,H){super(`Deadline expired after ${P}ms + ${H}ms`)}}class S{static withDeadline(P,H){const X=new Promise((ie,oe)=>{setTimeout(()=>{oe(new G(H,this.grpcCallDeadlineSlopMs))},H+this.grpcCallDeadlineSlopMs)});return Promise.race([P,X])}}S.grpcCallDeadlineSlopMs=500*c.a.millisecond;var T=n(29);const k={ordered:!1,maxPacketLifeTime:300*c.a.millisecond},J={ordered:!0},K={ordered:!0},re={ordered:!1,maxRetransmits:0},se={ordered:!1,maxRetransmits:0},fe=pe=>"received"in pe&&pe.received!==void 0,ve=pe=>!("received"in pe)||pe.received===void 0,Ce=2*c.a.second;function Se(pe,P={}){const H=Array.from(pe.values()),X=H.filter(fe),ie=X.length>0,oe=Math.max(...X.map(ce=>ce.received));let de;if(ie){const ce=H.length,le=X.length,Ae=X.map(xe=>xe.received-xe.sent),{standardDeviation:Me,mean:je,jitter:Fe}=function(xe){const Be=xe.length;if(Be===0)return{mean:NaN,standardDeviation:-1,jitter:NaN};const Ge=xe.reduce((Je,at)=>Je+at,0)/Be,Ze=Math.sqrt(xe.map(Je=>Math.pow(Je-Ge,2)).reduce((Je,at)=>Je+at)/Be);if(Be===1)return{mean:Ge,standardDeviation:Ze,jitter:NaN};let Xe=0;for(let Je=1;Je<Be;Je++)Xe+=Math.abs(xe[Je]-xe[Je-1]);return{mean:Ge,standardDeviation:Ze,jitter:Xe/(Be-1)}}(Ae),Ke=H.filter(xe=>xe.sent<oe-Ce),$e=Ke.filter(ve),Ye=$e.length===0?0:$e.length/Ke.length;de={pingsSent:ce,pongsReceived:le,average:je,standardDeviation:Me,jitter:Fe,max:Math.max(...Ae),min:Math.min(...Ae),loss:Ye}}else de=null;const{temporalNow:ye=Date.now()}=P,be=(ie?oe:ye)-4*Ce;return Array.from(pe.entries()).forEach(ce=>{const[le,Ae]=ce;Ae.sent<be&&pe.delete(le)}),de}function Ie({entityId:pe,streamName:P,streamType:H}){return`${pe}.${P}.${H}`}var Te=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class Oe{constructor(P,H){this.sessionId=P,this.connection=H,this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=P,this.connection=H}updateRemoteMessagesCounts(P){if(P.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const H of P.payload.streamsInfo.items)this.counts.remoteSent.set(H.streamId,H.sentCount),this.counts.remoteReceived.set(H.streamId,H.receivedCount)}}getLocalStreamsInfo(P){const{localSent:H,localReceived:X}=this.counts;return{items:[...new Set([...H.keys(),...X.keys()])].map(ie=>{var oe,de;return{streamId:ie,sentCount:(oe=H.get(ie))!==null&&oe!==void 0?oe:0,receivedCount:(de=X.get(ie))!==null&&de!==void 0?de:0}}),timestamp:P}}incrementLocalSent(P){const{localSent:H}=this.counts,X=Ie(P.header.stream);H.set(X,(H.get(X)||0)+1)}incrementLocalReceived(P){const{localReceived:H}=this.counts,X=Ie(P.header.stream),ie=H.get(X)||0;if(ie===0){const{streamName:oe,streamType:de}=P.header.stream;g.a.debug("RTC client received first message for stream",{streamName:oe,streamType:de})}H.set(X,ie+1)}uploadMetrics(){return Te(this,void 0,void 0,function*(){const{sessionId:P}=this,H=yield this.connection.peerConnection.getStats(),X={};H.forEach(ce=>X[ce.id]=ce),g.a.debug("rtc-stats",Object.assign(Object.assign({},X),{sessionId:P}));const{localSent:ie,localReceived:oe,remoteSent:de,remoteReceived:ye}=this.counts,be=[...new Set([...ie.keys(),...oe.keys()])].reduce((ce,le)=>{const Ae=ie.get(le),Me=oe.get(le),je=de.get(le),Fe=ye.get(le);return Object.assign(Object.assign({},ce),{[`local-${le}-sent`]:Ae,[`local-${le}-received`]:Me,[`remote-${le}-sent`]:je,[`remote-${le}-received`]:Fe})},{sessionId:P});g.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},be))})}}function De(pe,P,H){return{header:{stream:pe,created:Date.now(),frameId:H||""},payload:P}}function qe(pe){return new Set(["disconnected","failed","closed"]).has(pe.iceConnectionState)}function tt(pe){switch(pe.header.stream.streamType){case"twist":{const{twist:P}=pe.payload;if(!P)throw Error("twist not in payload of RTC message with type twist");return{header:pe.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},P.linear),angular:Object.assign({x:0,y:0,z:0},P.angular)}}}}case"pose":{const{pose:P}=pe.payload;if(!P)throw Error("pose not in payload of RTC message with type pose");return{header:pe.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},P.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},P.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:P}=pe.payload;if(!P)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const H=new Array(36).fill(0);return P.covariance.forEach((X,ie)=>{if(ie>=36)throw Error("covariance contains more than 36 elements");H[ie]=X}),{header:pe.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},P.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},P.pose.rotation)},covariance:H}}}}case"point":{const{point:P}=pe.payload;if(!P)throw Error("point not in payload of RTC message with type point");return{header:pe.header,payload:{point:Object.assign({x:0,y:0,z:0},P)}}}default:return pe}}var et=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class yt{constructor(P,H,X){this.peerConnection=P,this.config=H,this.dataChannelNotifier=X,this.connectTimeoutMs=20*c.a.second,this.iceGatheringTimeoutMs=15*c.a.second,this.pingUpdateTimeoutMs=1*c.a.second,this.pingV2UpdateTimeoutMs=250*c.a.millisecond,this.pingV2MetricsGatherTimeoutMs=1*c.a.second,this.streamsInfoUpdateTimeoutMs=2*c.a.second,this.reassemblyTimeoutMs=500*c.a.millisecond,this.reassemblyTableCleanupMs=1*c.a.second,this.heartbeatTimeoutMs=20*c.a.millisecond,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1,this.pingV2Map=new Map,this.sendPingV2=()=>{const{latestTryOnceStreamChannel:oe}=this;if(!oe)return;const de=new Date().getTime(),ye=Object(Y.a)();this.sendSystemMessage(oe,{type:"ping-v2",payload:{timestamp:de,id:ye}}),this.pingV2Map.set(ye,{sent:de})},this.gatherPingV2Metrics=()=>{const oe=Se(this.pingV2Map);if(oe){const de=this.getRemoteDeviceId();this.pingInfo=oe,y.aggregate("rtc-ping-average",oe.average,Object.assign({},de?{deviceId:de}:{})),y.aggregate("rtc-ping-loss",oe.loss,Object.assign({},de?{deviceId:de}:{})),y.aggregate("rtc-jitter",oe.jitter,Object.assign({},de?{deviceId:de}:{}))}};const{isOffer:ie}=H.baseConfig;ie?this.initializeChannels(P):P.ondatachannel=oe=>{switch(oe.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=oe.channel;break;case"stream.reliable":this.reliableStreamChannel=oe.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=oe.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=oe.channel;break;case"heartbeat":return void(this.heartbeatChannel=oe.channel);default:return void this.dataChannelNotifier(oe.channel)}this.setupChannel(oe.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:oe}=this;oe&&this.sendSystemMessage(oe,{type:"ping"})},this.pingUpdateTimeoutMs),this.pingV2UpdateTimeout=setInterval(this.sendPingV2,this.pingV2UpdateTimeoutMs),this.pingV2MetricsGatherTimeout=setInterval(this.gatherPingV2Metrics,this.pingV2MetricsGatherTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:oe}=this;oe&&this.sendSystemMessage(oe,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const oe=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((de,ye,be)=>{oe>ye+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(de)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:oe}=this;oe&&oe.readyState==="open"&&oe.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(P){return et(this,void 0,void 0,function*(){const{peerConnection:H}=this,{track:X}=this.config.baseConfig,ie=(()=>{try{return JSON.parse(P.getPayload())}catch{return}})();if(!ie)return void g.a.error("Received unparseable signal.");g.a.debug("Handling signal",{description:ie});const{sdp:oe,type:de}=ie;if(!oe||!de)return void g.a.warn("Received non-SDP signal");const{signalingState:ye,connectionState:be}=H;if(ye!=="stable"||be!=="connected")if(H.remoteDescription)g.a.warn(`Received SDP after remote description was set: ${oe}`);else{if(de==="offer"){if(ye!=="stable")return void g.a.warn("Received offer SDP when signaling is ongoing.");yield H.setRemoteDescription(ie);const ce=yield H.createAnswer();yield H.setLocalDescription(ce);const le=P.clone();return X==null||X("Answer Received",le),le.setPayload(JSON.stringify(ce)),le.setReceiverId(P.getSenderId()),le.setSenderId(P.getReceiverId()),le}if(de==="answer"){if(ye==="stable")return void g.a.warn("Received answer SDP when signaling hasn't started.");yield H.setRemoteDescription(ie)}}else g.a.warn(`Received SDP when already connected: ${oe}`)})}send(P,H){const X=this.getChannelFromLabel(H.channelLabel);X?this.sendOnChannel(X,P):g.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(P){this.sendSystemMessage(p(this.reliableStreamChannel),{type:"stream-control",streamControl:P})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:P,latestTtlStreamChannel:H,latestTryOnceStreamChannel:X,latestReliableStreamChannel:ie}=this;return(P==null?void 0:P.readyState)==="open"&&(H==null?void 0:H.readyState)==="open"&&(X==null?void 0:X.readyState)==="open"&&(ie==null?void 0:ie.readyState)==="open"}close(){return et(this,void 0,void 0,function*(){if(this.closeCalled)return;this.closeCalled=!0,this.sessionMetrics&&(yield this.sessionMetrics.uploadMetrics()),st(this.pingUpdateTimeout),st(this.pingV2UpdateTimeout),st(this.pingV2MetricsGatherTimeout),st(this.reassemblyTableCleanupTimeout),st(this.streamsInfoUpdateTimeout),st(this.heartbeatTimeout);const{peerConnection:P,reliableStreamChannel:H,latestTtlStreamChannel:X,latestTryOnceStreamChannel:ie,latestReliableStreamChannel:oe}=this;P.close(),H==null||H.close(),X==null||X.close(),ie==null||ie.close(),oe==null||oe.close()})}getPing(){return this.pingTimeMs}getPingInfo(){return this.pingInfo}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var P;return(P=this.config.remoteConfig)===null||P===void 0?void 0:P.sessionCreatedTimestamp}setSessionCreatedTimestamp(P){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=P)}getSessionId(){var P;return(P=this.config.remoteConfig)===null||P===void 0?void 0:P.sessionId}setSessionId(P){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=P,this.sessionMetrics=new Oe(P,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var P;return(P=this.config.baseConfig)===null||P===void 0?void 0:P.remoteDeviceId}setRemoteDeviceId(P){this.config.baseConfig.remoteDeviceId=P}getSessionMetricsMessageCounts(){var P;return(P=this.sessionMetrics)===null||P===void 0?void 0:P.counts}getConnectionStatsInfo(){return et(this,void 0,void 0,function*(){const{peerConnection:P}=this;if(!P)return;const H=yield P.getStats(null),X=[];H.forEach(be=>{X.push(be)});const ie=X.find(be=>be.type==="transport");if(!ie)return;const oe=X.find(be=>(be.type==="candidate-pair"||be.type==="candidatepair")&&be.id===ie.selectedCandidatePairId);if(!oe)return;const de=X.find(be=>be.id===oe.localCandidateId),ye=X.find(be=>be.id===oe.remoteCandidateId);return de&&ye&&(de.address=de.address||de.ip,ye.address=ye.address||ye.ip,de.address!==void 0&&ye.address!==void 0)?{transport:ie,localCandidate:de,remoteCandidate:ye}:void 0})}initializeChannels(P){this.heartbeatChannel=P.createDataChannel("heartbeat",se),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=P.createDataChannel("stream.latest-ttl",k),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=P.createDataChannel("stream.reliable",J),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=P.createDataChannel("stream.latest-reliable",K),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=P.createDataChannel("stream.latest-try-once",re),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var P,H,X;return et(this,void 0,void 0,function*(){const{gotOffer:ie}=this,{peerConnection:oe,config:de}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const ye=(P=this.config.remoteConfig)===null||P===void 0?void 0:P.sessionId;if(ie)return void g.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,qe(this.peerConnection))return void g.a.debug("Failed to generate offer because the peer connection was inactive.");const be=de.baseConfig.track;oe.onicecandidate=()=>{this.hasIceCandidate=!0},oe.oniceconnectionstatechange=()=>et(this,void 0,void 0,function*(){const je=oe.iceConnectionState;if(je==="connected"||je==="completed"){const Fe=yield this.getConnectionStatsInfo(),Ke=Fe?function($e){const Ye=$e.localCandidate.candidateType,xe=$e.remoteCandidate.candidateType;return Ye==="host"&&xe==="host"?"local":Ye==="relay"||xe==="relay"?"TURN":"STUN"}(Fe):void 0;g.a.info(`ICE connection state changed to ${je}`,{sessionId:ye,connectionStatsInfo:Fe,iceMode:Ke}),be==null||be("ICE connection state change",{iceConnectionState:je,sessionId:ye,connectionStatsInfo:Fe,iceMode:Ke})}}),yield oe.setLocalDescription(yield oe.createOffer());const ce=new Date().getTime();for(;;){const je=new Date().getTime()-ce;if(je>this.connectTimeoutMs)return void g.a.debug("Failed to generate offer because ICE gathering timed out.");if(je>this.iceGatheringTimeoutMs&&this.hasIceCandidate){g.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:je}),be==null||be("ICE gathering partially completed",{sessionId:ye,iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:je});break}if(oe.iceGatheringState==="complete"){g.a.debug("ICE gathering complete",{iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:je}),be==null||be("ICE gathering completed",{sessionId:ye,iceTransportPolicy:oe.getConfiguration().iceTransportPolicy,waitTime:je});break}yield Object(u.a)(.1*c.a.second)}const le=(H=this.peerConnection.getConfiguration().iceServers)!==null&&H!==void 0?H:[];for(const je of le)"credentialType"in je&&(je.credentialType=void 0);const Ae=JSON.stringify(le),Me=new ee.Signal;return Me.setPayload(JSON.stringify(oe.localDescription)),Me.setSenderId(this.config.baseConfig.localPeerId),Me.setReceiverId(this.config.baseConfig.remotePeerId),Me.setIceServers(Ae),Me.setIceTransportPolicy((X=this.peerConnection.getConfiguration().iceTransportPolicy)!==null&&X!==void 0?X:"all"),this.config.baseConfig.sessionType!==void 0?Me.setSessionType(this.config.baseConfig.sessionType):Me.setSessionType(ee.SessionType.TELEOP),g.a.debug("Sending offer signal with description",{description:Me.getPayload()}),Me})}getLanOffer(){return et(this,void 0,void 0,function*(){const{peerConnection:P,gotOffer:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if(H)return void g.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,qe(this.peerConnection))return void g.a.debug("Failed to generate offer because the peer connection was inactive.");yield P.setLocalDescription(yield P.createOffer());const X=new Date().getTime();for(;;){if(new Date().getTime()-X>this.iceGatheringTimeoutMs)return void g.a.debug("Failed to generate offer because ICE gathering timed out.");if(P.iceGatheringState==="complete")break;yield Object(u.a)(.1*c.a.second)}const ie=P.localDescription;if(ie)return g.a.debug("Sending LAN offer signal with description",{description:ie}),ie;g.a.error("Failed to generate LAN offer description")})}handleLanAnswer(P){return et(this,void 0,void 0,function*(){const{peerConnection:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield H.setRemoteDescription(P)})}getChannelFromLabel(P){switch(P){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(P,H){let X;try{X=Object(T.encode)(JSON.stringify(H))}catch(ie){return void g.a.warn("Failed to encode RTC message",{error:ie})}try{P.send(X),this.sessionMetrics&&this.sessionMetrics.incrementLocalSent(H)}catch(ie){g.a.warn("Failed to send message to channel",{error:ie,channel:P.label})}}channelNotRecognized(P){return P!==this.latestTtlStreamChannel&&P!==this.latestReliableStreamChannel&&P!==this.latestTryOnceStreamChannel&&P!==this.reliableStreamChannel}setupChannel(P){P.onmessage=H=>{if(this.channelNotRecognized(P))return void g.a.warn("Received message on unrecognized data channel.");let X;try{X=JSON.parse(Object(T.decode)(H.data))}catch(ie){return void g.a.warn("Received unparseable message on RTC stream data channel",{error:ie,channel:P.label})}X.communicationType==="message-chunk"?this.receiveChannelMessageChunk(P,X):this.receiveChannelMessage(P,X)},P.onerror=H=>{g.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:P.label})},P.onopen=()=>{g.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:P.label})},P.onclose=()=>{const H={bufferedAmount:P.bufferedAmount,sessionId:this.getSessionId(),channelLabel:P.label};this.closeCalled===!1?g.a.debug("Unexpected channel closed",H):g.a.debug("Channel closed",H)}}receiveChannelMessage(P,H){const{config:X}=this,{remotePeerId:ie}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),H=tt(H),this.sessionMetrics&&this.sessionMetrics.incrementLocalReceived(H),this.handleSystemMessage(P,H)||(P===this.latestTryOnceStreamChannel||P===this.latestTtlStreamChannel||P===this.latestReliableStreamChannel)&&!this.isLatestMessage(H)||X.baseConfig.receive(ie,H)}receiveChannelMessageChunk(P,H){const X=this.reassemblyTable.get(H.id)||[];if(X.push(H),X.length===H.total){const ie=function(oe){const de=oe.sort((ye,be)=>ye.seq<be.seq?-1:1).map(ye=>ye.part).reduce((ye,be)=>ye+be);try{return JSON.parse(de)}catch{return void g.a.warn("Could not reassemble RTC message chunks")}}(X);return ie&&this.receiveChannelMessage(P,ie),void this.reassemblyTable.delete(H.id)}this.reassemblyTable.set(H.id,X),this.reassemblyTableLastTimestamp.set(H.id,new Date().getTime())}handleSystemMessage(P,H){var X,ie;const{config:oe}=this,{baseConfig:de}=oe,{remotePeerId:ye,remoteDeviceId:be}=de;switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(P,{type:"pong",timestamp:p(H.payload.ping)}),!0;case"pong":{const ce=new Date().getTime()-p(H.payload.pong);return this.pingTimeMs=ce,y.aggregate("rtc-ping-time",ce,Object.assign({},be?{deviceId:be}:{})),!0}case"ping-v2":return this.sendPingV2(),!0;case"pong-v2":{const ce=p(H.payload.pongV2),le=this.pingV2Map.get(ce.id);return(le==null?void 0:le.sent)!==ce.timestamp&&g.a.warn("Pong timestamp doesn't match stored value",{currentEntry:le,pong:ce}),this.pingV2Map.set(ce.id,{sent:ce.timestamp,received:new Date().getTime()}),!0}case"streams-info":{const{sessionMetrics:ce}=this,le=(X=H.payload.streamsInfo)===null||X===void 0?void 0:X.timestamp;return!!le&&(ce==null||ce.updateRemoteMessagesCounts(H),(ie=de.onStreamsInfoUpdate)===null||ie===void 0||ie.call(de,ye,le),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(P,H){var X;const{localUserId:ie,localPeerId:oe}=this.config.baseConfig;if(P.readyState!=="open")return;const de={entityId:ie??oe,streamName:`$.${H.type}`,streamType:H.type};let ye;switch(H.type){case"ping":ye={ping:new Date().getTime()};break;case"pong":ye={pong:H.timestamp};break;case"ping-v2":ye={pingV2:H.payload};break;case"pong-v2":ye={pongV2:H.payload};break;case"stream-control":ye={streamControl:H.streamControl};break;case"streams-info":ye={streamsInfo:(X=this.sessionMetrics)===null||X===void 0?void 0:X.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(P,De(de,ye))}isLatestMessage(P){const H=Ie(P.header.stream),X=(this.streamLatestTimestamp.get(H)||0)<=P.header.created;return X&&this.streamLatestTimestamp.set(H,P.header.created),X}}function st(pe){pe&&clearInterval(pe)}function bt(){g.a.debug("forceGarbageCollection() triggered"),queueMicrotask(()=>{let pe=document.createElement("img");pe.src=window.URL.createObjectURL(new Blob([new ArrayBuffer(5e7)])),pe.onerror=function(){window.URL.revokeObjectURL(this.src),pe=null}})}function Ot(pe){try{return pe instanceof Error?`${pe.name}: ${pe.message}`:typeof pe=="object"?JSON.stringify(pe):String(pe)}catch{return"Unknown error"}}function St(pe){var P,H;return{userId:(P=pe.getUserId())===null||P===void 0?void 0:P.getValue(),deviceId:(H=pe.getDeviceId())===null||H===void 0?void 0:H.getValue(),organizationId:pe.getOrganizationId(),id:pe.getPeerId(),capabilities:[],capabilitySet:{}}}var ke=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class Mt{constructor(P){this.config=P,this.grpcCallDeadline=5*c.a.second,this.refreshIntervalDelayMs=2*c.a.second,this.iceServersTtl=30*c.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new Map,this.isOutgoingConnection=new Map,this.peerDataChannelListeners=[],this.rtcInstancesConstructed=0;const{refreshIntervalDelayMs:H}=this;this.refreshInterval=d({func:()=>ke(this,void 0,void 0,function*(){try{yield this.update()}catch(X){g.a.warn("RTC refresh failed",{error:X})}}),delay:H,immediate:!0})}send(P,H,X){const ie=this.getActiveConnection(P);ie?ie.isReady()?ie.send(H,X):g.a.warn("Send called with unready connection."):g.a.warn("Send called with no connection.")}controlRemoteStream(P,H){const X=this.getActiveConnection(P);X?X.isReady()?X.controlRemoteStream(H):g.a.warn("controlRemoteStream called with unready connection."):g.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return ke(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(u.a)(.1*c.a.second);return St(this.localPeer)})}connect(P,H){var X,ie,oe;return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:de,signalingClient:ye}=this.config,{localPeer:be,receiveSignalStream:ce,iceServers:le}=this;if(!be||!ce||!le)return void g.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(P))return void g.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.get(P))return void g.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.set(P,!0);const Ae=function(xe,Be,Ge){const{rtcIceTransportPolicies:Ze,rtcIceServerProtocol:Xe,useAllServers:Je}=Be||{},at=xe.map(ot=>Object.assign(Object.assign({},ot),{urls:ot.urls.filter(ut=>{const Qe=(Ze===void 0||Ze.some(Ct=>V(ut,Ct)))&&(Xe===void 0||Q(ut,Xe));return Qe||g.a.debug(`Ignoring ICE server: ${ut}`,{organizationId:Ge}),Qe})})).filter(({urls:ot})=>ot.filter(ut=>ut).length>0);return Je?at:[U(at,"stun"),U(at,"turn")].filter(ot=>ot!==void 0).map(ot=>p(ot))}(le,H);g.a.debug("Received ICE servers:",le),g.a.debug("Using ICE servers:",Ae);const Me=new yt(yield this.createRTCPeerConnection(Ae),{baseConfig:{isOffer:!0,isLan:!1,receive:(xe,Be)=>this.config.receive(xe,Be),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(xe,Be)=>{var Ge,Ze;return(Ze=(Ge=this.config).onStreamsInfoUpdate)===null||Ze===void 0?void 0:Ze.call(Ge,xe,Be)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(X=be.getUserId())===null||X===void 0?void 0:X.getValue(),localPeerId:be.getPeerId(),remotePeerId:P,sessionType:this.config.sessionType},remoteConfig:{}},xe=>this.onCustomDataChannel(P,xe)),je=yield Me.getOffer();if(!je)return g.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(P);g.a.debug("Sending offer."),de==null||de("Sending offer",je);const Fe=new ee.SendSignalRequest;Fe.setSignal(je);const Ke=yield(()=>ke(this,void 0,void 0,function*(){try{return yield S.withDeadline(ye.sendSignal(Fe,yield this.getMetadata({})),this.grpcCallDeadline)}catch(xe){g.a.warn("Error when sending signal",{error:xe})}}))();if(!this.isOutgoingConnection.get(P))return void g.a.debug("No offer set after receiving offer signal response.");g.a.debug("Offer sent.");const $e=(ie=Ke==null?void 0:Ke.getSessionId())===null||ie===void 0?void 0:ie.getValue(),Ye=(oe=Ke==null?void 0:Ke.getSessionCreatedTimestamp())===null||oe===void 0?void 0:oe.getValue();return $e&&Ye?(Me.setSessionId($e),Me.setSessionCreatedTimestamp(Ye),this.isOutgoingConnection.delete(P),this.connections.push(Me),this.isConnectionInitiator.set(Me,!0),this.setupHandlers(Me),$e):(g.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(P))})}connectLan(P){var H,X;return ke(this,void 0,void 0,function*(){const ie=new D(P),oe=new yt(yield this.createRTCPeerConnection([]),{baseConfig:{isOffer:!0,isLan:!0,receive:(ce,le)=>this.config.receive(ce,le),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ce,le)=>{var Ae,Me;return(Me=(Ae=this.config).onStreamsInfoUpdate)===null||Me===void 0?void 0:Me.call(Ae,ce,le)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(X=(H=this.localPeer)===null||H===void 0?void 0:H.getUserId())===null||X===void 0?void 0:X.getValue(),localPeerId:"lan_client",remotePeerId:P}},ce=>this.onCustomDataChannel(P,ce)),de=yield oe.getLanOffer();if(!de)return g.a.warn("Could not generate LAN offer"),!1;const ye=yield ie.postLanRtcOffer({offer:JSON.stringify(de)}),be=new RTCSessionDescription(JSON.parse(ye.answer));return yield oe.handleLanAnswer(be),this.localConnections.push(oe),this.isConnectionInitiator.set(oe,!0),Object(Y.a)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(P,H,X,ie,oe){const de=this.getActiveConnection(P);if(de&&this.isConnectionInitiator.has(de)){const be=de.peerConnection.createDataChannel("custom."+H,X);return ie&&(be.binaryType="arraybuffer"),oe(P,be),()=>{}}const ye=(be,ce)=>{P===be&&ce.label==="custom."+H&&oe(P,ce)};return this.peerDataChannelListeners.push(ye),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(be=>be!==ye)}}onCustomDataChannel(P,H){this.peerDataChannelListeners.forEach(X=>X(P,H))}getConnectionStatus(P){if(this.isOutgoingConnection.get(P))return"connecting";const H=this.getActiveConnection(P);return H?H.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(P){return ke(this,void 0,void 0,function*(){const H=this.getActiveConnection(P);if(H)return yield H.getConnectionStatsInfo()})}disconnect(P){return ke(this,void 0,void 0,function*(){const H=this.getActiveConnection(P);H&&(yield H.close())})}getPeers(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:P}=this.config,H=yield(()=>ke(this,void 0,void 0,function*(){try{return yield S.withDeadline(P.getPeers(new ee.GetPeersRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(oe){g.a.warn("Error when getting peers",{error:oe})}}))();if(!H)return[];const X=H.getPeersList();if(!X)return[];const ie=oe=>{var de,ye;return(ye=(de=oe.getPeerCreatedTimestamp())===null||de===void 0?void 0:de.getValue())!==null&&ye!==void 0?ye:0};return X.sort((oe,de)=>ie(de)-ie(oe)).map(oe=>St(oe))})}getSessions(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:P}=this.config,H=yield(()=>ke(this,void 0,void 0,function*(){try{return yield S.withDeadline(P.getPeers(new ee.GetPeersRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(oe){g.a.warn("Error when getting peers",{error:oe})}}))();if(!H)return{};const X=H.getPeersList(),ie={};for(const oe of X)ie[oe.getPeerId()]=oe.getSessionIdsList();return ie})}getPing(P){const H=this.getActiveConnection(P);if(H)return H.getPing();g.a.warn("Attempted to get ping time from inactive peer.")}getPingInfo(P){const H=this.getActiveConnection(P);if(H)return H.getPingInfo();g.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(P){const H=this.getActiveConnection(P);if(H)return H.getLastMessageTimestamp();g.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(P){const H=this.getActiveConnection(P);if(H)return H.getSessionMetricsMessageCounts();g.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:P,receiveSignalStream:H,iceServers:X}=this;return!!(P&&H&&X)}shutdown(){return ke(this,void 0,void 0,function*(){g.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const P=this.connections;this.connections=[],yield this.closeConnections(P);const{localPeer:H}=this;if(!H||this.config.lanOnlyMode)return;const{signalingClient:X}=this.config;yield(()=>ke(this,void 0,void 0,function*(){try{const ie=new ee.DeletePeerRequest;ie.setPeerId(H.getPeerId()),yield S.withDeadline(X.deletePeer(ie,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ie){return void g.a.warn("Error deleting local peer",{error:ie})}}))()})}createPeer(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:P}=this.config,H=yield(()=>ke(this,void 0,void 0,function*(){try{return yield S.withDeadline(P.createPeer(new ee.CreatePeerRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ie){const oe=ie;g.a.debug("createPeer failed",{error:oe});const de=Ot(oe);throw new Error(`Was not able to create peer: ${de}`)}}))(),X=H==null?void 0:H.getPeer();if(!X)throw new Error("Response did not provide peer.");return this.localPeer=X})}createReceiveSignalStream(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:P}=this.config,{localPeer:H,iceServers:X}=this;if(!H||!X)return;const{receiveSignalStream:ie}=this;ie&&ie.cancel();const oe=new ee.ReceiveSignalStreamRequest;oe.setPeerId(H.getPeerId());const de=yield(()=>ke(this,void 0,void 0,function*(){try{return P.receiveSignalStream(oe,yield this.getMetadata({hasDeadline:!1}))}catch(ye){g.a.debug("createReceiveSignalStream failed",{error:ye});const be=Ot(ye);throw new Error(`Unable to create receive signal stream: ${be}`)}}))();if(!de)throw new Error("Response did not provide stream.");return de.on("data",ye=>ke(this,void 0,void 0,function*(){var be,ce,le,Ae;const Me=ye.getSignal(),je=(be=Me==null?void 0:Me.getSessionId())===null||be===void 0?void 0:be.getValue(),Fe=Me==null?void 0:Me.getSenderId(),Ke=Me==null?void 0:Me.getReceiverId(),$e=(ce=Me==null?void 0:Me.getSessionCreatedTimestamp())===null||ce===void 0?void 0:ce.getValue();if(!(Me&&je&&Fe&&Ke&&$e))return void g.a.warn("Received signal with missing information.");const Ye=this.getActiveConnection(Fe);if(Ye)if(Ye.getSessionId()!==je){if(g.a.debug("Received signal: different session for a peer we're already connected to."),(Ye.getSessionCreatedTimestamp()||0)>$e)return;const xe=new yt(yield this.createRTCPeerConnection(X),{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,Ge)=>this.config.receive(Be,Ge),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,Ge)=>{var Ze,Xe;return(Xe=(Ze=this.config).onStreamsInfoUpdate)===null||Xe===void 0?void 0:Xe.call(Ze,Be,Ge)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(Ae=H.getUserId())===null||Ae===void 0?void 0:Ae.getValue(),remotePeerId:Fe},remoteConfig:{sessionId:je,sessionCreatedTimestamp:$e}},Be=>this.onCustomDataChannel(Fe,Be));yield xe.handleSignal(Me),this.connections.push(xe)}else g.a.debug("Received signal: for an existing connection."),yield Ye.handleSignal(Me);else{g.a.debug("Received signal: new connection.");const xe=new yt(yield this.createRTCPeerConnection(X),{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,Ge)=>this.config.receive(Be,Ge),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,Ge)=>{var Ze,Xe;return(Xe=(Ze=this.config).onStreamsInfoUpdate)===null||Xe===void 0?void 0:Xe.call(Ze,Be,Ge)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(le=H.getUserId())===null||le===void 0?void 0:le.getValue(),remotePeerId:Fe},remoteConfig:{sessionId:je,sessionCreatedTimestamp:$e}},Be=>this.onCustomDataChannel(Fe,Be));yield xe.handleSignal(Me),this.connections.push(xe)}})),de.on("end",()=>{de.cancel(),this.receiveSignalStream=void 0}),de.on("error",ye=>{switch(ye.code){case ne.StatusCode.CANCELLED:case ne.StatusCode.UNAVAILABLE:case ne.StatusCode.UNKNOWN:g.a.debug("Receive signal stream error",{error:ye});break;case ne.StatusCode.UNAUTHENTICATED:g.a.warn("Receive signal stream error",{error:ye});break;default:g.a.error("Receive signal stream error",{error:ye})}de.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=de})}createRTCPeerConnection(P){var H;return ke(this,void 0,void 0,function*(){const X=(H=this.config.alternateRTCPeerConnection)!==null&&H!==void 0?H:window.RTCPeerConnection;if(!X)throw function(){const{userAgent:ie}=navigator;return ie.includes("Firefox/")?"Firefox":ie.includes("Edg/")?"Edge":ie.includes("Chrome/")?"Chrome":ie.includes("Safari/")?"Safari":ie.includes("MSIE/")||ie.includes("Trident/")?"IE":"Other"}()!=="Chrome"?new Error("WebRTC is not enabled. Please try again with the latest version of Google Chrome."):new Error("WebRTC is not enabled. Please ensure WebRTC is not disabled by ad blocking software.");this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||bt();try{return new X({iceServers:P})}catch(ie){throw g.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),ie}})}closeConnections(P){return ke(this,void 0,void 0,function*(){const H=yield O(P.map(X=>ke(this,void 0,void 0,function*(){yield X.close()})));for(const X of H)g.a.warn("Request to close session failed",{error:X})})}getActiveConnection(P){return this.getConnections().find(H=>H.getRemotePeerId()===P&&H.isActive())}update(){var P;return ke(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(ye=>ye.isActive()),this.config.lanOnlyMode)return;const{signalingClient:H}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers){const ye=[];return this.localPeer||ye.push(this.createPeer()),this.iceServers||ye.push(this.updateIceServers()),yield Promise.all(ye),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()))}yield this.closeConnections(this.connections.filter(ye=>!ye.isActive())),this.connections=this.connections.filter(ye=>ye.isActive());const{localPeer:X}=this,ie=this.connections.filter(ye=>ye.getSessionId).map(ye=>p(ye.getSessionId()));X.setSessionIdsList(ie);const oe=new ee.RefreshPeerRequest;oe.setPeer(X);try{yield S.withDeadline(H.refreshPeer(oe,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ye){ye.code===ne.StatusCode.NOT_FOUND?(g.a.warn("Peer expired, creating new peer",{peerId:X.getPeerId()}),yield this.reset()):g.a.warn("Error calling RefreshPeer",{error:ye})}const de=yield this.getPeers();for(const ye of this.connections)ye.setRemoteDeviceId((P=de.find(be=>be.id===ye.getRemotePeerId()))===null||P===void 0?void 0:P.deviceId)})}reset(){return ke(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection=new Map,yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:P,iceServersTtl:H}=this,X=new Date().getTime();if(!P||X-P>H)try{const ie=(yield S.withDeadline(this.config.signalingClient.getIceServers(new ee.GetIceServersRequest,yield this.getMetadata({})),this.grpcCallDeadline)).getIceServers();this.iceServers=JSON.parse(ie),this.iceServersLastUpdate=X}catch(ie){g.a.warn("Error in updateIceServers",{error:ie})}})}setupHandlers(P){const{peerConnection:H}=P,X=P.getSessionCreatedTimestamp();H.onconnectionstatechange=()=>ke(this,void 0,void 0,function*(){const ie=H.connectionState;if(!X)return;const oe=P.getRemoteDeviceId();switch(ie){case"connected":y.aggregate("rtc-connect-time",new Date().getTime()-X,Object.assign({},oe?{deviceId:oe}:{}));break;case"failed":y.increment("rtc-connect-failed",Object.assign({},oe?{deviceId:oe}:{}))}})}getMetadata(P){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:H}=this.config,{grpcCallDeadline:X}=this,{hasDeadline:ie}=P,oe=ie===!1?void 0:new Date().getTime()+X;try{return{authorization:yield H(),deadline:oe}}catch(de){throw g.a.error("getToken() failed",{error:de}),new Error("Cannot get authorization token")}})}}var nt=n(10),it=n(11),Nt=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class dt{constructor(P,H){this.sessionId=P,this.connection=H,this.sentMessagesCounts=new Map,this.receivedMessagesCounts=new Map,this.sessionId=P,this.connection=H}incrementMessageSent(P){const H=Ie(P.header.stream);this.sentMessagesCounts.set(H,(this.sentMessagesCounts.get(H)||0)+1)}incrementMessageReceived(P){const H=Ie(P.header.stream);this.receivedMessagesCounts.set(H,(this.receivedMessagesCounts.get(H)||0)+1)}uploadMetrics(){return Nt(this,void 0,void 0,function*(){const{sessionId:P}=this,H=yield this.connection.peerConnection.getStats(),X={};H.forEach(oe=>X[oe.id]=oe),g.a.debug("rtc-stats",Object.assign(Object.assign({},X),{sessionId:P}));const ie=[...new Set(Array.from(this.sentMessagesCounts.keys()).concat(Array.from(this.receivedMessagesCounts.keys())))].reduce((oe,de)=>{const ye=this.sentMessagesCounts.get(de),be=this.receivedMessagesCounts.get(de);return Object.assign(Object.assign({},oe),{[`${de}-sent`]:ye,[`${de}-received`]:be})},{sessionId:P});g.a.debug("rtc-message-report",ie)})}}function It(pe,P){return Ie(pe)===Ie(P)}var lt=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class Et{constructor(P,H){this.peerConnection=P,this.config=H,this.connectTimeoutMs=10*c.a.second,this.gatherIceTimeoutMs=5*c.a.second,this.pingUpdateTimeoutMs=2*c.a.second,this.streamLatestTimestamp=new Map,this.closeCalled=!1,this.connectCalled=!1,this.sentOffer=!1,this.receivedIceCandidate=!1;const{isOffer:X}=H;X?this.initializeChannels(P):P.ondatachannel=ie=>{switch(ie.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ie.channel;break;case"stream.reliable":this.reliableStreamChannel=ie.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ie.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ie.channel}this.setupChannel(ie.channel)},this.sessionMetrics=new dt(this.getSessionId(),this)}connect(){return lt(this,void 0,void 0,function*(){if(this.connectCalled)return;this.connectCalled=!0,this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ie}=this;ie&&this.sendSystemMessage(ie,{type:"ping"})},this.pingUpdateTimeoutMs),this.connectTimeout=setTimeout(()=>lt(this,void 0,void 0,function*(){this.isReady()||(g.a.warn("RTC connect timed out, closing connection"),yield this.close())}),this.connectTimeoutMs);const{peerConnection:P,config:{isOffer:H,sessionId:X}}=this;if(H){const ie=yield P.createOffer();yield P.setLocalDescription(ie)}H&&(this.gatherIceTimeout=setTimeout(()=>lt(this,void 0,void 0,function*(){this.sentOffer||(g.a.warn("ICE gathering timed out"),this.receivedIceCandidate?(g.a.warn("Attempting to connect with partial ICE candidate pool"),yield this.sendOffer()):yield this.close())}),this.gatherIceTimeoutMs),P.onicecandidate=ie=>lt(this,void 0,void 0,function*(){ie.candidate?this.receivedIceCandidate=!0:yield this.sendOffer()}),P.onicegatheringstatechange=()=>lt(this,void 0,void 0,function*(){P.iceGatheringState==="complete"&&(yield this.sendOffer())}),P.onnegotiationneeded=()=>{g.a.debug("Negotiation needed",{sessionId:X})})})}handleSignal(P){return lt(this,void 0,void 0,function*(){const{peerConnection:H,config:{sessionId:X,sendSignal:ie}}=this,{description:oe}=JSON.parse(P.payload);if(g.a.debug("Handling signal",{sessionId:X,description:JSON.stringify(oe)}),oe)if(H.signalingState!=="stable"||H.connectionState!=="connected")if(H.remoteDescription)g.a.warn(`Received SDP signal during negotiation when remote description is already set: ${JSON.stringify(P)}`);else if(oe.type==="offer"){yield H.setRemoteDescription(oe);const de=yield H.createAnswer();yield H.setLocalDescription(de),yield ie({payload:JSON.stringify({description:de})})}else oe.type==="answer"&&(yield H.setRemoteDescription(oe));else g.a.warn(`Received SDP signal when signaling is stable and connected: ${JSON.stringify(P)}`);else g.a.warn(`Received non-SDP signal: ${JSON.stringify(P)}`)})}send(P,H){const X=this.getChannelFromLabel(H.channelLabel);X?this.sendOnChannel(X,P):g.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(P){this.sendSystemMessage(p(this.reliableStreamChannel),{type:"stream-control",streamControl:P})}isActive(){return new Set(["new","connecting","connected"]).has(this.peerConnection.connectionState)}isReady(){const{peerConnection:P,latestTtlStreamChannel:H,reliableStreamChannel:X,latestTryOnceStreamChannel:ie}=this;return!!(X&&H&&ie)&&P.connectionState==="connected"&&X.readyState==="open"&&H.readyState==="open"&&ie.readyState==="open"}isClosed(){const{peerConnection:P,reliableStreamChannel:H,latestTryOnceStreamChannel:X,latestTtlStreamChannel:ie}=this;return!(P.connectionState!=="closed"||H!==void 0&&H.readyState!=="closed"||X!==void 0&&X.readyState!=="closed"||ie!==void 0&&ie.readyState!=="closed")}needsClosing(){const{peerConnection:P,latestTtlStreamChannel:H,reliableStreamChannel:X,latestTryOnceStreamChannel:ie}=this;if(this.isClosed())return!1;const oe=new Set(["closing","closed"]),de=ye=>ye&&oe.has(ye.readyState);return qe(P)||de(H)||de(X)||de(ie)}close(){return lt(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield this.sessionMetrics.uploadMetrics(),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.connectTimeout&&clearTimeout(this.connectTimeout),this.gatherIceTimeout&&clearTimeout(this.gatherIceTimeout),this.peerConnection.close())})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionId(){return this.config.sessionId}getRemotePeer(){return this.config.remotePeer}initializeChannels(P){this.latestTtlStreamChannel=P.createDataChannel("stream.latest-ttl",k),this.reliableStreamChannel=P.createDataChannel("stream.reliable",J),this.latestReliableStreamChannel=P.createDataChannel("stream.latest-reliable",K),this.latestTryOnceStreamChannel=P.createDataChannel("stream.latest-try-once",re),this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}sendOffer(){return lt(this,void 0,void 0,function*(){if(this.sentOffer||(this.sentOffer=!0,qe(this.peerConnection)))return;const{peerConnection:P,config:{sendSignal:H}}=this,X=yield P.createOffer();yield P.setLocalDescription(X);const ie={payload:JSON.stringify({description:X})};yield H(ie)})}getChannelFromLabel(P){switch(P){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(P,H){let X;try{X=Object(T.encode)(JSON.stringify(H))}catch(ie){return void g.a.warn("Failed to encode RTC message",{error:ie})}try{P.send(X),this.sessionMetrics.incrementMessageSent(H)}catch(ie){g.a.warn("Failed to send message to channel",{error:ie,channel:P.label})}}channelNotRecognized(P){return P!==this.latestTtlStreamChannel&&P!==this.latestReliableStreamChannel&&P!==this.latestTryOnceStreamChannel&&P!==this.reliableStreamChannel}setupChannel(P){P.onmessage=H=>{if(this.channelNotRecognized(P))return void g.a.warn("Received message on unrecognized data channel.");let X;try{X=JSON.parse(Object(T.decode)(H.data))}catch(ie){return void g.a.warn("Received unparseable RTC message",{error:ie,channel:P.label})}if(this.lastMessageTimestamp=new Date().getTime(),X=tt(X),this.sessionMetrics.incrementMessageReceived(X),!this.handleSystemMessage(P,X)){if(!this.hasCapabilities(X))return void g.a.warn("Received RTC message that was not within the capability scope of the connection.");(P===this.latestTryOnceStreamChannel||P===this.latestTtlStreamChannel||P===this.latestReliableStreamChannel)&&!this.isLatestMessage(X)||this.config.receive(this.config.remotePeer.id,X)}},P.onerror=H=>{g.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:P.label})},P.onopen=()=>{g.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:P.label})},P.onclose=()=>{const H={bufferedAmount:P.bufferedAmount,sessionId:this.getSessionId(),channelLabel:P.label};this.closeCalled===!1?g.a.debug("Unexpected channel closed",H):g.a.debug("Channel closed",H)}}handleSystemMessage(P,H){switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(P,{type:"pong",timestamp:p(H.payload.ping)}),!0;case"pong":{const X=new Date().getTime()-p(H.payload.pong);return this.pingTimeMs=X,y.aggregate("rtc-ping-time",X),!0}case"stream-control":return!0;default:return!1}}sendSystemMessage(P,H){if(P.readyState!=="open")return;const X={entityId:p(this.config.localPeer.deviceId||this.config.localPeer.userId),streamName:`$.${H.type}`,streamType:H.type};let ie;switch(H.type){case"ping":ie={ping:new Date().getTime()};break;case"pong":ie={pong:H.timestamp};break;case"stream-control":ie={streamControl:H.streamControl}}this.sendOnChannel(P,De(X,ie))}hasCapabilities(P){var H,X;const{localPeer:ie,remotePeer:oe}=this.config,de=(H=ie.capabilitySet.streaming)===null||H===void 0?void 0:H.streams,ye=de&&de.some(le=>le.receive&&It(le.stream,P.header.stream)),be=(X=oe.capabilitySet.streaming)===null||X===void 0?void 0:X.streams,ce=be&&be.some(le=>le.send&&It(le.stream,P.header.stream));return ye||ce}isLatestMessage(P){const H=Ie(P.header.stream),X=(this.streamLatestTimestamp.get(H)||0)<=P.header.created;return X&&this.streamLatestTimestamp.set(H,P.header.created),X}}var Ue=function(pe,P,H,X){return new(H||(H=Promise))(function(ie,oe){function de(ce){try{be(X.next(ce))}catch(le){oe(le)}}function ye(ce){try{be(X.throw(ce))}catch(le){oe(le)}}function be(ce){var le;ce.done?ie(ce.value):(le=ce.value,le instanceof H?le:new H(function(Ae){Ae(le)})).then(de,ye)}be((X=X.apply(pe,P||[])).next())})};class Tt{constructor(P){this.config=P,this.connections=[],this.connectingSessions=new Map,this.rtcInstancesConstructed=0,this.updateInterval=d({func:()=>Ue(this,void 0,void 0,function*(){try{yield this.update()}catch(H){g.a.warn("RTC update failed",{error:H})}}),delay:250*c.a.millisecond,immediate:!0}),this.localPeer=this.createPeer()}send(P,H,X){const ie=this.getActiveConnection(P);ie?ie.isReady()?ie.send(H,X):g.a.warn("Attempted to send with an active connection to that peer which was not yet ready."):g.a.warn("Attempted to send with no active connection to that peer.")}controlRemoteStream(P,H){const X=this.getActiveConnection(P);X?X.isReady()?X.controlRemoteStream(H):g.a.warn("Attempted to control remote stream with an active connection to that peer which was not yet ready."):g.a.warn("Attempted to control remote stream with no active connection to that peer.")}connect(P){return Ue(this,void 0,void 0,function*(){const H=yield this.getLocalPeer();if(this.getActiveConnection(P))return void g.a.warn("Attempted to connect to peer with an already active connection.");let X;try{X=yield this.config.signalingClient.createSession(yield this.config.getToken(),{offerPeerId:H.id,answerPeerId:P})}catch(ie){Object(it.a)(ie,nt.a,oe=>oe.statusCode===404),g.a.warn("Attempted to connect to peer that does not exist.")}if(X)for(this.connectingSessions.set(X.id,new Date().getTime()),yield this.connectToSession(X);;)switch(yield Object(u.a)(.1),this.getConnectionStatus(P)){case"connecting":continue;case"connected":return X.id;case"disconnected":return}})}getConnectionStatus(P){const H=this.getActiveConnection(P);return H?H.isReady()?"connected":"connecting":"disconnected"}getIceMode(P){const H=this.getActiveConnection(P);if(H)return H.iceMode}disconnect(P){return Ue(this,void 0,void 0,function*(){const H=this.getActiveConnection(P);H&&(yield this.closeConnection(H))})}getLocalPeer(){return Ue(this,void 0,void 0,function*(){return yield this.localPeer})}getPeers(){return Ue(this,void 0,void 0,function*(){return yield this.config.signalingClient.getPeers(yield this.config.getToken())})}getPing(P){const H=this.getActiveConnection(P);if(H)return H.getPing();g.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(P){const H=this.getActiveConnection(P);if(H)return H.getLastMessageTimestamp();g.a.warn("Attempted to get ping time from inactive peer.")}shutdown(){return Ue(this,void 0,void 0,function*(){yield this.updateInterval.stop();const P=this.connections;this.connections=[],yield this.closeConnections(P)})}closeConnection(P){return Ue(this,void 0,void 0,function*(){this.connectingSessions.delete(P.getSessionId()),yield P.close();try{yield this.config.signalingClient.deleteSession(yield this.config.getToken(),P.getSessionId())}catch(H){Object(it.a)(H,nt.a,X=>X.statusCode===404)}})}getSessions(){return Ue(this,void 0,void 0,function*(){const P=yield this.getLocalPeer();return(yield this.config.signalingClient.getSessions(yield this.config.getToken())).filter(H=>H.offer.peer.id===P.id||H.answer.peer.id===P.id)})}createPeer(){return Ue(this,void 0,void 0,function*(){return yield this.config.signalingClient.createPeer(yield this.config.getToken(),{capabilitySet:this.config.capabilitySet||{}})})}createRTCPeerConnection(P={}){return Ue(this,void 0,void 0,function*(){const H=this.config.alternateRTCPeerConnection||RTCPeerConnection;this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||bt();try{return new H(Object.assign({iceServers:yield this.config.signalingClient.getIceServers(yield this.config.getToken())},P))}catch(X){throw g.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),X}})}closeConnections(P){return Ue(this,void 0,void 0,function*(){const H=yield O(P.map(X=>Ue(this,void 0,void 0,function*(){yield this.closeConnection(X)})));for(const X of H)g.a.warn("Request to close session failed",{error:X})})}reset(){return Ue(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.connectingSessions=new Map,this.localPeer=this.createPeer(),yield this.localPeer})}getActiveConnection(P){return this.connections.find(H=>H.getRemotePeer().id===P&&H.isActive())}update(){return Ue(this,void 0,void 0,function*(){const P=yield this.getLocalPeer();try{yield this.config.signalingClient.refreshPeer(yield this.config.getToken(),P.id)}catch(H){Object(it.a)(H,nt.a,X=>X.statusCode===404),g.a.warn("Peer expired, creating new peer",{peerId:P.id}),yield this.reset()}yield this.handleSessions(yield this.getSessions())})}handleSessions(P){return Ue(this,void 0,void 0,function*(){yield this.syncConnectionsAndSessions(P);const H=P.map(X=>({session:X,connection:this.connections.find(ie=>ie.getSessionId()===X.id)}));yield Promise.all(H.map(({session:X,connection:ie})=>Ue(this,void 0,void 0,function*(){return yield this.maintainConnection(X,ie)})))})}syncConnectionsAndSessions(P){return Ue(this,void 0,void 0,function*(){const H=new Set(P.map(oe=>oe.id)),X=oe=>H.has(oe.getSessionId())||this.connectingSessions.has(oe.getSessionId());this.connections=this.connections.filter(oe=>X(oe));const ie=this.connections.filter(oe=>!X(oe)||oe.needsClosing());yield Promise.all(ie.map(oe=>Ue(this,void 0,void 0,function*(){yield this.closeConnection(oe)})))})}maintainConnection(P,H){return Ue(this,void 0,void 0,function*(){const X=yield this.getLocalPeer(),ie=P.offer.peer.id===X.id;if(H){if(H.isReady())try{yield this.config.signalingClient.refreshSession(yield this.config.getToken(),P.id)}catch(oe){Object(it.a)(oe,nt.a,de=>de.statusCode===404),g.a.debug("Refresh session not found",{sessionId:P.id})}else if(H.isActive())try{yield this.consumeSignals(H)}catch(oe){g.a.warn("Failed to ingest signals, closing connection",{error:oe}),yield this.closeConnection(H)}}else{if(ie)return;yield this.connectToSession(P)}})}connectToSession(P){return Ue(this,void 0,void 0,function*(){const H=yield this.getLocalPeer(),X=P.offer.peer.id===H.id,ie=yield this.createRTCPeerConnection(),oe=new Et(ie,{localPeer:X?P.offer.peer:P.answer.peer,remotePeer:X?P.answer.peer:P.offer.peer,sessionId:P.id,isOffer:X,sendSignal:de=>this.sendSignal(P.id,de),receive:(de,ye)=>this.config.receive(de,ye)});if(this.connections.find(de=>de.getSessionId()===P.id))return g.a.warn("connectToSession called on a session that already has a connection.",{sessionId:P.id}),void(yield oe.close());this.setupHandlers(oe),this.connections.push(oe);try{yield oe.connect()}catch(de){g.a.warn("Failed to handle negotiation, closing connection",{error:de}),yield this.closeConnection(oe)}})}setupHandlers(P){const{peerConnection:H}=P,X=P.getSessionId();H.onconnectionstatechange=()=>Ue(this,void 0,void 0,function*(){const ie=this.connectingSessions.get(X);if(ie===void 0)return;const oe=H.connectionState;switch(qe(H)&&this.connectingSessions.delete(X),oe){case"connected":{this.connectingSessions.delete(X);const de=new Date().getTime()-ie;y.aggregate("rtc-connect-time",de);break}case"failed":y.increment("rtc-connect-failed"),yield this.closeConnection(P)}})}consumeSignals(P){return Ue(this,void 0,void 0,function*(){let H=[];try{H=yield this.config.signalingClient.takeSignals(yield this.config.getToken(),P.getSessionId())}catch(X){Object(it.a)(X,nt.a,ie=>ie.statusCode===404)}for(const X of H)yield P.handleSignal(X)})}sendSignal(P,H){return Ue(this,void 0,void 0,function*(){try{yield this.config.signalingClient.addSignals(yield this.config.getToken(),P,{signals:[H]})}catch(X){Object(it.a)(X,nt.a,ie=>ie.statusCode===404)}})}}},function(e,t,n){var r={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const s=new Uint8Array(16);function l(){if(!i&&(i=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}const o=[];for(let u=0;u<256;++u)o.push((u+256).toString(16).slice(1));function c(u,f=0){return(o[u[f+0]]+o[u[f+1]]+o[u[f+2]]+o[u[f+3]]+"-"+o[u[f+4]]+o[u[f+5]]+"-"+o[u[f+6]]+o[u[f+7]]+"-"+o[u[f+8]]+o[u[f+9]]+"-"+o[u[f+10]]+o[u[f+11]]+o[u[f+12]]+o[u[f+13]]+o[u[f+14]]+o[u[f+15]]).toLowerCase()}t.a=function(u,f,E){if(r.randomUUID&&!f&&!u)return r.randomUUID();const w=(u=u||{}).random||(u.rng||l)();if(w[6]=15&w[6]|64,w[8]=63&w[8]|128,f){E=E||0;for(let h=0;h<16;++h)f[E+h]=w[h];return f}return c(w)}},,function(e,t,n){n.r(t),n.d(t,"LogClient",function(){return o});var r=n(28),i=n(11),s=n(10),l=function(c,u,f,E){return new(f||(f=Promise))(function(w,h){function g(j){try{R(E.next(j))}catch(F){h(F)}}function b(j){try{R(E.throw(j))}catch(F){h(F)}}function R(j){var F;j.done?w(j.value):(F=j.value,F instanceof f?F:new f(function(M){M(F)})).then(g,b)}R((E=E.apply(c,u||[])).next())})};class o extends r.a{log(u){return l(this,void 0,void 0,function*(){const f=o.token;try{yield this.fetch("logs",{token:f,method:"POST",body:JSON.stringify({logs:u}),allowUnsafeRetries:!0})}catch(E){Object(i.a)(E,s.a,w=>w.statusCode===401&&f!==void 0),o.token===f&&delete o.token,yield this.log(u)}})}}}])})})(dist);var distExports=dist.exports;function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}let FORMANT_API_URL="https://api.formant.io";typeof window<"u"&&(FORMANT_API_URL=window.FORMANT_API_URL||FORMANT_API_URL);let urlParams$2=new URLSearchParams("");typeof window<"u"&&(urlParams$2=new URLSearchParams(window.location.search));const envDev=urlParams$2.get("formant_dev");envDev&&(FORMANT_API_URL="https://api-dev.formant.io");const envStage=urlParams$2.get("formant_stage");envStage&&(FORMANT_API_URL="https://api-stage.formant.io");const envLocal=urlParams$2.get("formant_local");envLocal&&(FORMANT_API_URL="https://api.formant.local");const millisecond=1,second=1e3,minute=60*second,hour=60*minute,day=24*hour,week=7*day,month=30*day,year=365*day,duration={millisecond,second,minute,hour,day,week,month,year};function filterDataByType(e,t){return e.filter(n=>t.includes(n.type))}function filterDataByTime(e,t,n){const r=t.getTime(),i=n.getTime();return e.map(s=>({...s,points:s.points.filter(([l])=>l>=r&&l<i)})).filter(({points:s})=>s.length>0)}function fork(e){}class StoreCache{constructor({capacity:t,timeout:n}={}){Re(this,"entries",new Map);Re(this,"metadata",new Map);Re(this,"capacity");Re(this,"timeout");this.capacity=t||1e4,this.timeout=n||duration.minute}get(t,n){const r=this.keyToCacheKey(t),i=this.entries.get(r),s=this.metadata.get(r);return(i===void 0||s&&(s==null?void 0:s.expiration.getTime())<Date.now())&&!(s!=null&&s.generating)&&n&&this.generate(t,n()),i===void 0&&s&&s.lastValue!==void 0?s.lastValue:i}set(t,n){const r=this.keyToCacheKey(t);this.metadata.set(r,{generating:!1,expiration:new Date(Date.now()+this.timeout),lastValue:n}),this.entries.set(r,n),this.metadata.size>this.capacity&&this.deleteOldestEntry()}clear(){this.entries.clear(),[...this.metadata.values()].forEach(t=>t.generating=!1)}clearKey(t){this.metadata.delete(t),this.entries.delete(t)}keyToCacheKey(t){return JSON.stringify(t)}deleteOldestEntry(){if(this.metadata.size<1)return;const[t]=[...this.metadata.entries()].reduce(([n,r],[i,s])=>s.expiration.getTime()<r.expiration.getTime()?[i,s]:[n,r]);this.clearKey(t)}generate(t,n){const r=this.keyToCacheKey(t),i=this.metadata.get(r)||{};this.metadata.set(r,{...i,generating:!0,expiration:new Date(Date.now()+this.timeout)}),setTimeout(()=>{n.then(s=>{const l=this.metadata.get(r);!(l!=null&&l.generating)||this.set(t,s)})},0)}}class QueryStore{constructor(){Re(this,"queryStoreCache",new StoreCache({capacity:1e4,timeout:20*duration.second}));Re(this,"liveQueryStoreCache",new StoreCache({capacity:1e4,timeout:200*duration.millisecond}))}moduleQuery(t,n,r,i,s,l=!1){const o={...t,names:[...n],types:[...r]},c=this.query(o,i,s,l);return c===void 0||c==="too much data"?c:filterDataByType(c,r)}query(t,n,r,i=!1){const s={...t,start:dateFns.startOfMinute(n).toISOString(),end:i?r.toISOString():dateFns.addMinutes(dateFns.roundToNearestMinutes(r),1).toISOString(),latestOnly:i},l=r>dateFns.addSeconds(new Date,-20);let o;return l?o=this.liveQueryCache(s):o=this.queryCache(s),!o||o==="too much data"||i?o:filterDataByTime(o,n,r)}queryCache(t){return this.queryStoreCache.get(t,async()=>{try{return await Fleet.queryTelemetry(t)}catch(n){throw n}})}liveQueryCache(t){return this.liveQueryStoreCache.get(t,async()=>{try{return await Fleet.queryTelemetry(t)}catch(n){throw n}})}}const queryStore=new QueryStore;class App{static sendAppMessage(t){window.parent.postMessage(t,"*")}static getCurrentModuleContext(){let t=new URLSearchParams("");return typeof window<"u"&&(t=new URLSearchParams(window.location.search)),t.get("module")}static async getCurrentModuleConfiguration(){let t=new URLSearchParams("");typeof window<"u"&&(t=new URLSearchParams(window.location.search));const n=t.get("configuration");return n===null||n.trim()===""?void 0:(await(await fetch(`${FORMANT_API_URL}/v1/admin/module-configurations/`+n,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).configuration}static isModule(){return this.getCurrentModuleContext()!==null}static goToTime(t){this.sendAppMessage({type:"go_to_time",time:t.getTime()})}static goToDevice(t){this.sendAppMessage({type:"go_to_device",deviceId:t})}static showMessage(t){this.sendAppMessage({type:"show_message",message:t})}static requestModuleData(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"request_module_data",module:t})}static setModuleDateTimeRange(t,n){const r=this.getCurrentModuleContext();if(!r)throw new Error("No module context");this.sendAppMessage({type:"set_module_data_time_range",module:r,before:t,after:n||0})}static refreshAuthToken(){const t=this.getCurrentModuleContext();if(!t)throw new Error("No module context");this.sendAppMessage({type:"refresh_auth_token",module:t})}static sendChannelData(t,n){const r=this.getCurrentModuleContext();if(!r)throw new Error("No module context");this.sendAppMessage({type:"send_channel_data",source:r,channel:t,data:n})}static setupModuleMenus(t){const n=this.getCurrentModuleContext();if(!n)throw new Error("No module context");this.sendAppMessage({type:"setup_module_menus",module:n,menus:t})}static addMenuListener(t){window.addEventListener("message",n=>{const r=n.data;r.type==="module_menu_item_clicked"&&t(r.menu)})}static addAccessTokenRefreshListener(t){window.addEventListener("message",n=>{const r=n.data;r.type==="auth_token"&&t(r.token)})}static addModuleDataListener(t){const n=this.getCurrentModuleContext();n&&this.sendAppMessage({type:"request_module_data",module:n}),window.addEventListener("message",r=>{const i=r.data;i.type==="module_data"&&t({streams:i.streams,time:i.time,queryRange:i.queryRange})})}static addOverviewDeviceListener(t){this.sendAppMessage({type:"request_devices"});const n=r=>{const i=r.data;i.type==="overview_devices"&&t(i.data)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}static addStreamListener(t,n,r){const i=s=>{const l=s.data;if(l.type==="module_data"){const{start:o,end:c}=l.queryRange;r(queryStore.moduleQuery({},t,n,new Date(o),new Date(c),!1))}};return window.addEventListener("message",i),()=>window.removeEventListener("message",i)}static addModuleConfigurationListener(t){window.addEventListener("message",n=>{const r=n.data;r.type==="module_configuration"&&t(r)})}static addChannelDataListener(t,n){window.addEventListener("message",r=>{const i=r.data;i.type==="channel_data"&&i.channel===t&&n({source:i.source,data:i.data})})}static async prompt(t,n){return new Promise(r=>{const i=Math.random().toString();this.sendAppMessage({type:"prompt",promptId:i,schema:t,okText:n==null?void 0:n.okText,cancelText:n==null?void 0:n.cancelText});const s=l=>{const o=l.data;o.type==="prompt_response"&&o.promptId===i&&r(o.data),window.removeEventListener("message",s)};window.addEventListener("message",s)})}static async getDate(t,n){return new Promise(r=>{this.sendAppMessage({type:"request_date",minTime:t,maxTime:n});const i=s=>{const l=s.data;l.type==="date_response"&&r(l.data),window.removeEventListener("message",i)};window.addEventListener("message",i)})}}class AuthenticationStore{constructor({apiUrl:t,refreshAuthToken:n,addAccessTokenRefreshListener:r}){Re(this,"_refreshToken");Re(this,"_isShareToken",!1);Re(this,"_currentOrganization");Re(this,"_currentUser");Re(this,"_defaultDeviceId");Re(this,"_token");Re(this,"_waitingForAuth",new Set);Re(this,"_refreshTimer");Re(this,"_apiUrl");Re(this,"_refreshAuthToken");Re(this,"_addAccessTokenRefreshListener");this._apiUrl=t,this._refreshAuthToken=n,this._addAccessTokenRefreshListener=r}get token(){return this._token}get currentUser(){return this._currentUser}get currentOrganization(){return this._currentOrganization}get defaultDeviceId(){return this._defaultDeviceId}get refreshToken(){return this._refreshToken}get isShareToken(){return this._isShareToken}async login(t,n){try{const r=await fetch(`${this._apiUrl}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:n}),headers:{"Content-Type":"application/json"}}),i=await r.json();if(r.status!==200)throw new Error(i.message);return await this.loginWithToken(i.authentication.accessToken,i.authentication.refreshToken),i.authentication}catch(r){return console.error("login() failed",{err:r}),this._waitingForAuth.forEach(i=>i(!1)),this._waitingForAuth.clear(),Promise.reject(r)}}async loginWithToken(t,n){var i;const r=JSON.parse(atob(t.split(".")[1]));try{let s;if(this._isShareToken=r["formant:claims"]&&r["formant:claims"].type=="share",r["formant:claims"]&&(this._currentOrganization=r["formant:claims"].organizationId),r["custom:organization_id"]&&(this._currentOrganization=r["custom:organization_id"]),this._isShareToken||(s=r.sub),r["formant:claims"]&&r["formant:claims"].userId&&(s=r["formant:claims"].userId),s&&((i=this._currentUser)==null?void 0:i.id)!==s){const l=await fetch(`${this._apiUrl}/v1/admin/users/${s}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),o=await l.json();if(l.status!==200)throw new Error(o.message);this._currentUser=o}this._token=t,this._waitingForAuth.forEach(l=>l(!0))}catch(s){console.error("loginWithToken() failed",{err:s}),this._waitingForAuth.forEach(l=>l(!1))}finally{this._waitingForAuth.clear()}n&&(this._refreshToken=n,setInterval(async()=>{if(this._refreshToken){const l=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this._refreshToken})})).json();this._token=l.authentication.accessToken}},1e3*60*60))}isAuthenticated(){return this._token!==void 0}getCurrentUser(){return this._currentUser}async waitTilAuthenticated(){return this.token!==void 0?!0:new Promise(t=>{this._waitingForAuth.add(t)})}async listenForRefresh(){const n=()=>{this._refreshTimer=void 0,this._refreshAuthToken()};this._addAccessTokenRefreshListener(r=>{this._refreshTimer&&clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(n,36e5),this.loginWithToken(r)}),this._refreshTimer=setTimeout(n,36e5)}async forgotPassword(t){await fetch(`${this._apiUrl}/v1/admin/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:t}),headers:{"Content-Type":"application/json"}})}async confirmForgotPassword(t){return(await fetch(`${this._apiUrl}/v1/admin/auth/confirm-forgot-password`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).ok}async respondToNewPasswordRequiredChallenge(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/respond-to-new-password-required-challenge`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async loginWithGoogle(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/login-google`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async refresh(t){const r=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})})).json();await this.loginWithToken(r.authentication.accessToken,t)}}const Authentication=new AuthenticationStore({apiUrl:FORMANT_API_URL,refreshAuthToken:App.refreshAuthToken,addAccessTokenRefreshListener:App.addAccessTokenRefreshListener});function delay(e){return new Promise(t=>setTimeout(t,e))}class DataChannel{constructor(t){Re(this,"ready",!1);Re(this,"listeners",[]);Re(this,"openListeners",[]);Re(this,"closeListeners",[]);Re(this,"errorListeners",[]);Re(this,"binaryListeners",[]);Re(this,"error");Re(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.ready=!0,this.openListeners.forEach(n=>n())},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(n=>n())},this.dataChannel.onerror=n=>{console.error(n),this.error="An error occurred in DataChannel",this.errorListeners.forEach(r=>r(n))},this.dataChannel.onmessage=n=>{this.listeners.forEach(r=>{const i=new Uint8Array(n.data),s=this.decoder.decode(i);r(s)}),this.binaryListeners.forEach(r=>{r(new Uint8Array(n.data))})}}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(n=>n!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(n=>n!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(n=>n!==t)}async waitTilReady(){return this.ready?!0:new Promise((n,r)=>{let i=window.setInterval(()=>{this.ready&&(window.clearInterval(i),n(!0)),this.error&&r(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(n,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const n=this.binaryListeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(n,1)}}class CaptureStream{constructor(t){Re(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=r.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}class Manipulator{constructor(t,n){Re(this,"currentListeners",[]);Re(this,"onRealtimeMessage",(t,n)=>{n.payload.jointState&&this.currentListeners.forEach(r=>{n.payload.jointState&&r(n.payload.jointState)})});this.device=t,this.config=n}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,n,r){Re(this,"channel");Re(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=n,this.timeout=r}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);Re(this,"RESPONSE_SUCCESS_BYTE",0);Re(this,"decoder",new TextDecoder)}generateBinaryId(){const n=new Uint8Array(16);for(let r=0;r<n.length;r++)n[r]=Math.floor(Math.random()*256);return n}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(n=>{const i=n.slice(0,16).toString();if(i.length===0)throw new Error("Invalid response");const s=n.slice(16);if(s.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(i)&&this.requestIdToResponseMap.set(i,s)})}async request(n){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:i,timeout:s}=this;await r.waitTilReady();const l=this.generateBinaryId(),o=l.toString();i.set(o,!0),r.sendBinary(new Uint8Array([...l,...n]));const c=new Date().getTime();for(;new Date().getTime()<c+s;)if(await delay(50),i.has(o)){const u=i.get(o);if(u!==!0){i.delete(o);const f=u[0]===this.RESPONSE_SUCCESS_BYTE,E=u.slice(1);if(f)return E;throw console.error({name:"AdapterError",message:this.decoder.decode(E)}),new Error("Binary request datachannel adapter error")}}throw i.delete(o),console.error({name:"TimeoutError",message:`Request timed out after ${s/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const n=JSON.parse(t),{id:r,data:i,error:s}=n;if(!r)throw new Error("Invalid response");if(!i&&!s)throw new Error("Invalid response");this.requestIdToResponseMap.has(r)&&this.requestIdToResponseMap.set(r,n)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:r,timeout:i}=this;await n.waitTilReady();const s=this.generateTextId();r.set(s,!0),n.send(JSON.stringify({id:s,data:t}));const l=new Date().getTime();for(;new Date().getTime()<l+i;)if(await delay(50),r.has(s)){const o=r.get(s);if(o!==!0){r.delete(s);const{data:c,error:u}=o;if(c)return c;if(u)throw console.error({name:"AdapterError",message:u}),new Error("Text request datachannel adapter error")}}throw r.delete(s),console.error({name:"TimeoutError",message:`Request timed out after ${i/1e3} seconds`}),new Error("Text request datachannel request timed out")}}var domain;function EventHandlers(){}EventHandlers.prototype=Object.create(null);function EventEmitter(){EventEmitter.init.call(this)}EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&domain.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function e(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};function $getMaxListeners(e){return e._maxListeners===void 0?EventEmitter.defaultMaxListeners:e._maxListeners}EventEmitter.prototype.getMaxListeners=function e(){return $getMaxListeners(this)};function emitNone(e,t,n){if(t)e.call(n);else for(var r=e.length,i=arrayClone(e,r),s=0;s<r;++s)i[s].call(n)}function emitOne(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,s=arrayClone(e,i),l=0;l<i;++l)s[l].call(n,r)}function emitTwo(e,t,n,r,i){if(t)e.call(n,r,i);else for(var s=e.length,l=arrayClone(e,s),o=0;o<s;++o)l[o].call(n,r,i)}function emitThree(e,t,n,r,i,s){if(t)e.call(n,r,i,s);else for(var l=e.length,o=arrayClone(e,l),c=0;c<l;++c)o[c].call(n,r,i,s)}function emitMany(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,s=arrayClone(e,i),l=0;l<i;++l)s[l].apply(n,r)}EventEmitter.prototype.emit=function e(t){var n,r,i,s,l,o,c,u=t==="error";if(o=this._events,o)u=u&&o.error==null;else if(!u)return!1;if(c=this.domain,u){if(n=arguments[1],c)n||(n=new Error('Uncaught, unspecified "error" event')),n.domainEmitter=this,n.domain=c,n.domainThrown=!1,c.emit("error",n);else{if(n instanceof Error)throw n;var f=new Error('Uncaught, unspecified "error" event. ('+n+")");throw f.context=n,f}return!1}if(r=o[t],!r)return!1;var E=typeof r=="function";switch(i=arguments.length,i){case 1:emitNone(r,E,this);break;case 2:emitOne(r,E,this,arguments[1]);break;case 3:emitTwo(r,E,this,arguments[1],arguments[2]);break;case 4:emitThree(r,E,this,arguments[1],arguments[2],arguments[3]);break;default:for(s=new Array(i-1),l=1;l<i;l++)s[l-1]=arguments[l];emitMany(r,E,this,s)}return!0};function _addListener(e,t,n,r){var i,s,l;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(s=e._events,s?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),l=s[t]):(s=e._events=new EventHandlers,e._eventsCount=0),!l)l=s[t]=n,++e._eventsCount;else if(typeof l=="function"?l=s[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(i=$getMaxListeners(e),i&&i>0&&l.length>i)){l.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=l.length,emitWarning(o)}return e}function emitWarning(e){typeof console.warn=="function"?console.warn(e):console.log(e)}EventEmitter.prototype.addListener=function e(t,n){return _addListener(this,t,n,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function e(t,n){return _addListener(this,t,n,!0)};function _onceWrap(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}EventEmitter.prototype.once=function e(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,_onceWrap(this,t,n)),this},EventEmitter.prototype.prependOnceListener=function e(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,_onceWrap(this,t,n)),this},EventEmitter.prototype.removeListener=function e(t,n){var r,i,s,l,o;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(r=i[t],!r)return this;if(r===n||r.listener&&r.listener===n)--this._eventsCount===0?this._events=new EventHandlers:(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(s=-1,l=r.length;l-- >0;)if(r[l]===n||r[l].listener&&r[l].listener===n){o=r[l].listener,s=l;break}if(s<0)return this;if(r.length===1){if(r[0]=void 0,--this._eventsCount===0)return this._events=new EventHandlers,this;delete i[t]}else spliceOne(r,s);i.removeListener&&this.emit("removeListener",t,o||n)}return this},EventEmitter.prototype.removeAllListeners=function e(t){var n,r;if(r=this._events,!r)return this;if(!r.removeListener)return arguments.length===0?(this._events=new EventHandlers,this._eventsCount=0):r[t]&&(--this._eventsCount===0?this._events=new EventHandlers:delete r[t]),this;if(arguments.length===0){for(var i=Object.keys(r),s=0,l;s<i.length;++s)l=i[s],l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n)do this.removeListener(t,n[n.length-1]);while(n[0]);return this},EventEmitter.prototype.listeners=function e(t){var n,r,i=this._events;return i?(n=i[t],n?typeof n=="function"?r=[n.listener||n]:r=unwrapListeners(n):r=[]):r=[],r},EventEmitter.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):listenerCount$1.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount$1;function listenerCount$1(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}EventEmitter.prototype.eventNames=function e(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}function arrayClone(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}const urlParams$1=new URLSearchParams(window.location.search),rtcClientVersion=urlParams$1.get("rtc_client"),SessionType={Teleop:1,Observe:3};class Device extends EventEmitter{constructor(n,r,i){super();Re(this,"rtcClient");Re(this,"remoteDevicePeerId");Re(this,"realtimeListeners",[]);Re(this,"connectionMonitorInterval");Re(this,"handleMessage",(n,r)=>{this.realtimeListeners.forEach(i=>i(n,r))});this.id=n,this.name=r,this.organizationId=i}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(){let n=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const r=await n.json();if(!r.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const i=r.state.reportedConfiguration.version;return n=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${i}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await n.json()).document}async getFileUrl(n){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[n]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async startRealtimeConnection(n){if(!this.rtcClient||this.connectionMonitorInterval===void 0){let r;if(rtcClientVersion==="1"?r=new distExports.RtcClientV1({signalingClient:new distExports.RtcSignalingClient(FORMANT_API_URL+"/v1/signaling"),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:this.handleMessage}):r=new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:this.handleMessage,sessionType:n}),r.isReady)for(;!r.isReady();)await delay(100);const s=(await r.getPeers()).find(l=>l.deviceId===this.id);if(!s)throw new Error("Cannot find peer, is the robot offline?");for(this.remoteDevicePeerId=s.id,await r.connect(this.remoteDevicePeerId);r.getConnectionStatus(this.remoteDevicePeerId)!=="connected";)await delay(100);this.rtcClient=r,this.emit("connect"),this.initConnectionMonitoring()}else throw new Error(`Already created realtime connection to device ${this.id}`)}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{if(!this.isV2Signaling(this.rtcClient))return;const r=this.rtcClient.getConnections().find(s=>s.getRemotePeerId()===this.remoteDevicePeerId&&s.isActive());let i=!1;r===void 0||!r.isReady()?(console.debug(`${new Date().toISOString()} :: data channel closed`),i=!0):console.debug(`${new Date().toISOString()} :: data channel appears active`),(!this.rtcClient||!this.remoteDevicePeerId||await this.rtcClient.getConnectionStatsInfo(this.remoteDevicePeerId)===void 0||i)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(s=>{console.error(s)}))},1e3)}isV2Signaling(n){return n.getConnectionStatsInfo!==void 0}stopConnectionMonitoring(){clearInterval(this.connectionMonitorInterval),this.connectionMonitorInterval=void 0}async sendRealtimeMessage(n,r={channelLabel:"stream.reliable"}){const i=defined(this.rtcClient,"Realtime connection has not been started"),s=await this.getRemotePeer();i.send(defined(s).id,n,r)}addRealtimeListener(n){this.realtimeListeners.push(n)}removeRealtimeListener(n){const r=this.realtimeListeners.indexOf(n);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeAudioStreams(){var i,s,l;const n=await this.getConfiguration(),r=[];for(const o of((i=n.teleop)==null?void 0:i.hardwareStreams)??[])o.rtcStreamType==="audio-chunk"&&r.push({name:o.name});for(const o of((s=n.teleop)==null?void 0:s.rosStreams)??[])o.topicType=="audio_common_msgs/AudioData"&&r.push({name:o.topicName});for(const o of((l=n.teleop)==null?void 0:l.customStreams)??[])o.rtcStreamType==="audio-chunk"&&r.push({name:o.name});return r}async getRealtimeVideoStreams(){var i,s,l;const n=await this.getConfiguration(),r=[];for(const o of((i=n.teleop)==null?void 0:i.hardwareStreams)??[])o.rtcStreamType==="h264-video-frame"&&r.push({name:o.name});for(const o of((s=n.teleop)==null?void 0:s.rosStreams)??[])o.topicType=="formant/H264VideoFrame"&&r.push({name:o.topicName}),(o.topicType==="sensor_msgs/Image"||o.topicType==="sensor_msgs/CompressedImage")&&o.encodeVideo&&r.push({name:o.topicName});for(const o of((l=n.teleop)==null?void 0:l.customStreams)??[])o.rtcStreamType==="h264-video-frame"&&r.push({name:o.name});return r}async getRealtimeManipulators(){const n=await this.getConfiguration(),r=[];for(const i of n.teleop.rosStreams??[])i.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:i.topicName},plannedJointStateStream:i.plannedTopic?{name:i.plannedTopic}:void 0,planValidStream:i.planValidTopic?{name:i.planValidTopic}:void 0,endEffectorStream:i.endEffectorTopic?{name:i.endEffectorTopic}:void 0,endEffectorLinkName:i.endEffectorLinkName,baseReferenceFrame:i.baseReferenceFrame,localFrame:i.localFrame}));return r}async startListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n,enablePriorityUpload:!0,pipeline:"telemetry"})}async changeStreamAudioType(n,r){const i=defined(this.rtcClient,"Realtime connection has not been started"),s=await this.getRemotePeer();i.controlRemoteStream(defined(s).id,{streamName:n,setAudioFormat:r})}async disableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();r.controlRemoteStream(defined(i).id,{streamName:n,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){const r=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(i=>i.deviceId===this.id);return defined(r,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){if(this.rtcClient)this.stopConnectionMonitoring(),await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){let n=await Fleet.getPeers(),r=await Fleet.getRealtimeSessions(),i=n.find(s=>s.deviceId===this.id);return i?r[i.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(i=>({name:i.name,id:i.id,command:i.command,description:i.description,parameterEnabled:i.parameterEnabled,parameterValue:i.parameterValue,parameterMeta:i.parameterMeta,enabled:i.enabled}))}async sendCommand(n,r,i,s){var E;const o=(await this.getAvailableCommands()).find(w=>w.name===n);if(!o)throw new Error(`Could not find command with name "${n}"`);let c="";r===void 0?o.parameterEnabled&&o.parameterValue&&(c=o.parameterValue):c=r;let u={value:c,scrubberTime:(i||new Date).toISOString(),meta:{...o.parameterMeta,...s}};return await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:o.id,organizationId:this.organizationId,deviceId:this.id,command:o.command,parameter:u,userId:(E=Authentication.currentUser)==null?void 0:E.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async getCommand(n){return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${n}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCustomDataChannel(n,r){if(rtcClientVersion==="1")throw new Error("createCustomDataChannel is not supported in rtcClientVersion 1");const i=defined(this.rtcClient,"Realtime connection has not been started"),s=await this.getRemotePeer(),l=await new Promise(o=>{i.createCustomDataChannel(defined(s).id,n,{ordered:!0,...r},!1,(c,u)=>{const f=new DataChannel(u);o(f)})});return await l.waitTilReady(),l}createCustomRequestDataChannel(n,r=3e3){return new TextRequestDataChannel(this,n,r)}createCustomBinaryRequestDataChannel(n,r=3e3){return new BinaryRequestDataChannel(this,n,r)}async createCaptureStream(n){const i=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:n,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(i)}async getTelemetry(n,r,i,s){return await Fleet.getTelemetry(this.id,n,r,i,s)}async getTelemetryStreams(){var c,u;const n=await this.getConfiguration(),r=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),i=[],s=[];return(u=(c=n.telemetry)==null?void 0:c.streams)==null||u.forEach(f=>{f.disabled!==!0&&i.push(f.name),f.onDemand===!0&&s.push(f.name)}),console.log(s),(await r.json()).items.filter(f=>!i.includes(f)).map(f=>({name:f,onDemand:s.includes(f)}))}async createInterventionRequest(n,r,i,s){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:n,interventionType:r,time:new Date().toISOString(),deviceId:this.id,tags:s,data:i}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(n,r,i){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:n,interventionType:r,data:i}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async getAnnotationCount(n,r){return await Fleet.getAnnotationCount({...n,deviceIds:[this.id]},r)}async getAnnotationCountByIntervals(n,r,i){return await Fleet.getAnnotationCountByIntervals({...n,deviceIds:[this.id]},r,i)}async eventsCounter(n,r,i,s,l){return await Fleet.eventsCounter(n,r,i,s,{...l,deviceIds:[this.id]})}async createShareLink(n,r){return n.scope.deviceIds=[this.id],await Fleet.createShareLink(n,r)}}class PeerDevice{constructor(t){Re(this,"rtcClient");Re(this,"remoteDevicePeerId");Re(this,"realtimeListeners",[]);Re(this,"id");Re(this,"handleMessage",(t,n)=>{this.realtimeListeners.forEach(r=>r(t,n))});this.peerUrl=t}async getLatestTelemetry(){const n=await(await fetch(`${this.peerUrl}/telemetry`)).json();return Object.entries(n).map(([i,s])=>({deviceId:this.id,streamName:i,streamType:"json",currentValue:s,currentValueTime:s.timestamp,tags:{}}))}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/configuration`)).json()).agent_config.document}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}async startRealtimeConnection(t){if(this.rtcClient)throw new Error(`Already created realtime connection to device ${this.id}`);{const n=new distExports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage,sessionType:t});for(await n.connectLan(this.peerUrl);n.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=n}}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const n=this.realtimeListeners.indexOf(t);if(n===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(n,1)}async getRealtimeVideoStreams(){const t=await this.getConfiguration(),n=[];for(const r of t.teleop.hardwareStreams??[])r.rtcStreamType==="h264-video-frame"&&n.push({name:r.name});for(const r of t.teleop.rosStreams??[])r.topicType=="formant/H264VideoFrame"&&n.push({name:r.topicName}),(r.topicType==="sensor_msgs/Image"||r.topicType==="sensor_msgs/CompressedImage")&&r.encodeVideo&&n.push({name:r.topicName});for(const r of t.teleop.customStreams??[])r.rtcStreamType==="h264-video-frame"&&n.push({name:r.name});return n}async getRealtimeManipulators(){const t=await this.getConfiguration(),n=[];for(const r of t.teleop.rosStreams??[])r.topicType=="sensor_msgs/JointState"&&n.push(new Manipulator(this,{currentJointStateStream:{name:r.topicName},plannedJointStateStream:r.plannedTopic?{name:r.plannedTopic}:void 0,planValidStream:r.planValidTopic?{name:r.planValidTopic}:void 0,endEffectorStream:r.endEffectorTopic?{name:r.endEffectorTopic}:void 0,endEffectorLinkName:r.endEffectorLinkName,baseReferenceFrame:r.baseReferenceFrame,localFrame:r.localFrame}));return n}async startListeningToRealtimeVideo(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const n=defined(this.rtcClient,"Realtime connection has not been started"),r=await this.getRemotePeer();n.controlRemoteStream(defined(r).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){if(this.rtcClient)await this.rtcClient.disconnect(this.id);else throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async createCustomDataChannel(t,n){const r=defined(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer(),s=await new Promise(l=>{r.createCustomDataChannel(defined(i).id,t,{ordered:!0,...n},!1,(o,c)=>{const u=new DataChannel(c);l(u)})});return await s.waitTilReady(),s}createCustomRequestDataChannel(t,n=3e3){return new TextRequestDataChannel(this,t,n)}createCustomBinaryRequestDataChannel(t,n=3e3){return new BinaryRequestDataChannel(this,t,n)}}const Ve=class{static async setDefaultDevice(t){Ve.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Ve.defaultDeviceId)throw new Error("No known default device");const i=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(l=>l.id===Ve.defaultDeviceId).name,s=new Device(Ve.defaultDeviceId,i,defined(Authentication.currentOrganization));return Ve.knownContext.push(new WeakRef(s)),s}static async getPeerDevice(t){const n=new PeerDevice(t);return n.id=await n.getDeviceId(),n}static async getDevice(t){if(!Authentication.token)throw new Error("Not authenticated");const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),i=r.name,s=new Device(t,i,r.organizationId);return Ve.knownContext.push(new WeakRef(s)),s}static async getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return n.items,n.items.map(r=>new Device(r.id,r.name,r.organizationId))}static async queryDevices(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(i=>new Device(i.id,i.name,i.organizationId))}static async getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const r=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await Ve.getDevices()).filter(s=>r.includes(s.id))}static async getPeers(){if(!Authentication.token)throw new Error("Not authenticated");return await new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getPeers()}static async getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");return await new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL,null,null),getToken:async()=>defined(Authentication.token,"Realtime when user isn't authorized"),receive:()=>{}}).getSessions()}static async getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const r=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(s=>s.deviceId);return(await Ve.getDevices()).filter(s=>r.includes(s.id))}static async getLatestTelemetry(t){let n=t;return t&&!Array.isArray(t)&&(t=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getTelemetry(t,n,r,i,s){let l=t;Array.isArray(t)||(l=[t]);let o=n;return Array.isArray(n)||(o=[n]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:l,end:i.toISOString(),names:o,start:r.toISOString(),tags:s}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getFileUrl(t){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(r.fileUrls.length===0)throw new Error("File not found");return r.fileUrls[0]}static async queryTelemetry(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async aggregateTelemetry(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).aggregates}static async queryEvents(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getEvent(t){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getCurrentGroup(){if(!Authentication.token)throw new Error("Not authenticated");let t=new URLSearchParams("");typeof window<"u"&&(t=new URLSearchParams(window.location.search));const n=t.get("group");if(n===null||n.trim()==="")return;const r=await fetch(`${FORMANT_API_URL}/v1/admin/groups/`+n,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),{tagKey:i,tagValue:s}=await r.json();return await this.queryDevices({tags:{[i]:[s]},enabled:!0,type:"default"})}static async getAnnotationCount(t,n){return(await this.queryEvents({...t,eventTypes:["annotation"]})).filter(l=>!!l.tags&&Object.keys(l.tags).includes(n)).reduce((l,o)=>{const c=o.tags[n];return c in l?(l[c]+=1,l):(l[c]=1,l)},{})}static async getAnnotationCountByIntervals(t,n,r){const{end:i,start:s}=t,o=aggregateByDateFunctions[r].interval({start:new Date(s),end:new Date(i)}),c=o.map((f,E)=>{const w=new Date(f).toISOString(),h=E===o.length-1?new Date(Date.now()).toISOString():new Date(o[E+1]);return this.getAnnotationCount({...t,start:w,end:h},n)}),u=await Promise.all(c);return o.map((f,E)=>({date:new Date(f).toISOString(),annotations:u[E]}))}static async getStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.filter(r=>r.enabled)}static async patchStream(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/streams/${t.id}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getViews(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/views`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async patchView(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/views/${t.id}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async eventsCounter(t,n,r,i,s){const l=aggregateByDateFunctions[n];return await Promise.all(Array(r).fill(0).map(async(o,c)=>{const u=new Date(i),f=l.sub(l.start(u),r-c-1),E=l.sub(l.end(u),r-c-1),w=formatTimeFrameText(f.toLocaleDateString(),E.toLocaleDateString()),h=await Ve.queryEvents({...s,eventTypes:t,start:new Date(f).toISOString(),end:new Date(E).toISOString()});return{date:w,events:h}}))}static async getAnalyticsModules(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/analytics-modules`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getAnalyticStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async getTaskReportTables(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-reports`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async queryAnalytics(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getAnalyticsRows(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/rows`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getTaskReportRows(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-report-rows`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async createShareLink(t,n){if(!Authentication.token)throw new Error("Not authenticated");const i=(await this.getViews()).filter(c=>c.name===n);if(i.length===0)return console.warn("View does not exist or it is misspell"),null;const s=await fetch(`${FORMANT_API_URL}/v1/admin/shares`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=FORMANT_API_URL.replace("api","app"),{code:o}=await s.json();return`${l}/shares/${o}#${serializeHash({viewId:i[0].id})}`}};let Fleet=Ve;Re(Fleet,"defaultDeviceId"),Re(Fleet,"knownContext",[]);class KeyValue{static async set(t,n){try{const r=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),i=await r.json();if(r.status!==200)throw new Error(i.message)}catch(r){throw r}}static async get(t){try{const n=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await n.json();if(n.status!==200)throw new Error(r.message);return r.value}catch(n){throw n}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await t.json();if(t.status!==200)throw new Error(n.message);return n.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(n){throw n}}}const vailableAggregationIntervals=["day","week","month","year","hour","minute","quarter"],aggregateFunctions=["interval","start","end","sub","get"];function getVariance(e){return e.count<2?0:e.sumOfSquares/(e.count-1)}function getStandardDeviation(e){return Math.sqrt(getVariance(e))}function getMax(e){return e.max}function getMin(e){return e.min}function getAverage(e){return e.count===0?-1:e.sum/e.count}function getSum(e){return e.sum}function getCount(e){return e.count}const aggregateFunctionMap={min:getMin,max:getMax,"standard deviation":getStandardDeviation,average:getAverage,sum:getSum,count:getCount},aggregateByDateFunctions={day:{interval:dateFns__namespace.eachDayOfInterval,start:dateFns__namespace.startOfDay,end:dateFns__namespace.endOfDay,sub:dateFns__namespace.subDays,get:dateFns__namespace.getDay},week:{interval:dateFns__namespace.eachWeekOfInterval,start:dateFns__namespace.startOfWeek,end:dateFns__namespace.endOfWeek,sub:dateFns__namespace.subWeeks,get:dateFns__namespace.getWeek},month:{interval:dateFns__namespace.eachMonthOfInterval,start:dateFns__namespace.startOfMonth,end:dateFns__namespace.endOfMonth,sub:dateFns__namespace.subMonths,get:dateFns__namespace.getMonth},year:{interval:dateFns__namespace.eachYearOfInterval,start:dateFns__namespace.startOfYear,end:dateFns__namespace.endOfYear,sub:dateFns__namespace.subYears,get:dateFns__namespace.getYear},hour:{interval:dateFns__namespace.eachHourOfInterval,start:dateFns__namespace.startOfHour,end:dateFns__namespace.endOfHour,sub:dateFns__namespace.subHours,get:dateFns__namespace.getHours},minute:{interval:dateFns__namespace.eachMinuteOfInterval,start:dateFns__namespace.startOfMinute,end:dateFns__namespace.endOfMinute,sub:dateFns__namespace.subMinutes,get:dateFns__namespace.getMinutes},quarter:{interval:dateFns__namespace.eachQuarterOfInterval,start:dateFns__namespace.startOfQuarter,end:dateFns__namespace.endOfQuarter,sub:dateFns__namespace.subQuarters,get:dateFns__namespace.getQuarter}},formatTimeFrameText=(e,t)=>e.split("/")[0]+"/"+e.split("/")[1]+"–"+t.split("/")[0]+"/"+t.split("/")[1];function getZeroINumericSet(){return{min:Number.MAX_SAFE_INTEGER,max:0,sum:0,count:0,sumOfSquares:0}}function reduceNumericStreamAggregates(e){return e.aggregates.reduce((t,n)=>{const r=n[1];return combineNumericAggregates(r,t)},getZeroINumericSet())}function reduceNumericSetStreamAggregates(e,t){var n;return(n=e.aggregates.reduce((r,i)=>{const s=i[1];return combineNumericSetAggregates(s,r)},{})[t])==null?void 0:n.value}function combineNumericAggregates(e,t){return{min:Math.min(e.min,t.min),max:Math.max(e.max,t.max),sum:e.sum+t.sum,count:e.count+t.count,sumOfSquares:e.sumOfSquares+t.sumOfSquares}}function combineNumericSetAggregates(e,t){return Object.keys(e).reduce((n,r)=>{var i;return{...n,[r]:{value:combineNumericAggregates(e[r].value,((i=t[r])==null?void 0:i.value)??getZeroINumericSet()),unit:e[r].unit}}},{})}const timeout=e=>new Promise(t=>setTimeout(t,e*1e3));function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch{try{return cachedSetTimeout.call(null,e,0)}catch{return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch{try{return cachedClearTimeout.call(null,e)}catch{return cachedClearTimeout.call(this,e)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function nextTick(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser$1=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding$1(e){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(e){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$1.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(e){var t=performanceNow.call(performance$1)*.001,n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n=n-e[0],r=r-e[1],r<0&&(n--,r+=1e9)),[n,r]}var startTime=new Date;function uptime(){var e=new Date,t=e-startTime;return t/1e3}var browser$1$1={nextTick,title,browser:browser$1,env,argv,version,versions,on,addListener,once,off,removeListener,removeAllListeners,emit,binding:binding$1,cwd,chdir,umask,hrtime,platform,release,config,uptime},inherits;typeof Object.create=="function"?inherits=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:inherits=function(t,n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t};const inherits$1=inherits;var formatRegExp=/%[sdj%]/g;function format(e){if(!isString(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(inspect(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=String(e).replace(formatRegExp,function(o){if(o==="%%")return"%";if(n>=i)return o;switch(o){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return o}}),l=r[n];n<i;l=r[++n])isNull(l)||!isObject(l)?s+=" "+l:s+=" "+inspect(l);return s}function deprecate(e,t){if(isUndefined(global$1.process))return function(){return deprecate(e,t).apply(this,arguments)};if(browser$1$1.noDeprecation===!0)return e;var n=!1;function r(){if(!n){if(browser$1$1.throwDeprecation)throw new Error(t);browser$1$1.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}return r}var debugs={},debugEnviron;function debuglog(e){if(isUndefined(debugEnviron)&&(debugEnviron=browser$1$1.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var t=0;debugs[e]=function(){var n=format.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else debugs[e]=function(){};return debugs[e]}function inspect(e,t){var n={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),isBoolean(t)?n.showHidden=t:t&&_extend(n,t),isUndefined(n.showHidden)&&(n.showHidden=!1),isUndefined(n.depth)&&(n.depth=2),isUndefined(n.colors)&&(n.colors=!1),isUndefined(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=stylizeWithColor),formatValue(n,e,n.depth)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(e,t){var n=inspect.styles[t];return n?"\x1B["+inspect.colors[n][0]+"m"+e+"\x1B["+inspect.colors[n][1]+"m":e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var t={};return e.forEach(function(n,r){t[n]=!0}),t}function formatValue(e,t,n){if(e.customInspect&&t&&isFunction(t.inspect)&&t.inspect!==inspect&&!(t.constructor&&t.constructor.prototype===t)){var r=t.inspect(n,e);return isString(r)||(r=formatValue(e,r,n)),r}var i=formatPrimitive(e,t);if(i)return i;var s=Object.keys(t),l=arrayToHash(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),isError(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return formatError(t);if(s.length===0){if(isFunction(t)){var o=t.name?": "+t.name:"";return e.stylize("[Function"+o+"]","special")}if(isRegExp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(isDate(t))return e.stylize(Date.prototype.toString.call(t),"date");if(isError(t))return formatError(t)}var c="",u=!1,f=["{","}"];if(isArray(t)&&(u=!0,f=["[","]"]),isFunction(t)){var E=t.name?": "+t.name:"";c=" [Function"+E+"]"}if(isRegExp(t)&&(c=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(c=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(c=" "+formatError(t)),s.length===0&&(!u||t.length==0))return f[0]+c+f[1];if(n<0)return isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var w;return u?w=formatArray(e,t,n,l,s):w=s.map(function(h){return formatProperty(e,t,n,l,h,u)}),e.seen.pop(),reduceToSingleString(w,c,f)}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,n,r,i){for(var s=[],l=0,o=t.length;l<o;++l)hasOwnProperty(t,String(l))?s.push(formatProperty(e,t,n,r,String(l),!0)):s.push("");return i.forEach(function(c){c.match(/^\d+$/)||s.push(formatProperty(e,t,n,r,c,!0))}),s}function formatProperty(e,t,n,r,i,s){var l,o,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?c.set?o=e.stylize("[Getter/Setter]","special"):o=e.stylize("[Getter]","special"):c.set&&(o=e.stylize("[Setter]","special")),hasOwnProperty(r,i)||(l="["+i+"]"),o||(e.seen.indexOf(c.value)<0?(isNull(n)?o=formatValue(e,c.value,null):o=formatValue(e,c.value,n-1),o.indexOf(`
|
|
50
50
|
`)>-1&&(s?o=o.split(`
|
|
51
51
|
`).map(function(u){return" "+u}).join(`
|
|
52
52
|
`).substr(2):o=`
|
|
@@ -55,4 +55,4 @@ Found: ${s.toString().split(`
|
|
|
55
55
|
`))):o=e.stylize("[Circular]","special")),isUndefined(l)){if(s&&i.match(/^\d+$/))return o;l=JSON.stringify(""+i),l.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(l=l.substr(1,l.length-2),l=e.stylize(l,"name")):(l=l.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),l=e.stylize(l,"string"))}return l+": "+o}function reduceToSingleString(e,t,n){var r=e.reduce(function(i,s){return s.indexOf(`
|
|
56
56
|
`)>=0,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(t===""?"":t+`
|
|
57
57
|
`)+" "+e.join(`,
|
|
58
|
-
`)+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return typeof e=="boolean"}function isNull(e){return e===null}function isNumber(e){return typeof e=="number"}function isString(e){return typeof e=="string"}function isUndefined(e){return e===void 0}function isRegExp(e){return isObject(e)&&objectToString(e)==="[object RegExp]"}function isObject(e){return typeof e=="object"&&e!==null}function isDate(e){return isObject(e)&&objectToString(e)==="[object Date]"}function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}function isFunction(e){return typeof e=="function"}function objectToString(e){return Object.prototype.toString.call(e)}function _extend(e,t){if(!t||!isObject(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BufferList(){this.head=null,this.tail=null,this.length=0}BufferList.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},BufferList.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},BufferList.prototype.concat=function(e){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;for(var t=Buffer.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var isBufferEncoding=Buffer.isEncoding||function(e){switch(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 assertEncoding(e){if(e&&!isBufferEncoding(e))throw new Error("Unknown encoding: "+e)}function StringDecoder(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0}StringDecoder.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,t="";continue}if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived),t+=e.toString(this.encoding,0,r);var r=t.length-1,i=t.charCodeAt(r);if(i>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,r)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Readable.ReadableState=ReadableState;var debug=debuglog("stream");inherits$1(Readable,EventEmitter);function prependListener(e,t,n){if(typeof e.prependListener=="function")return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function listenerCount(e,t){return e.listeners(t).length}function ReadableState(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Duplex&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,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.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new StringDecoder(e.encoding),this.encoding=e.encoding)}function Readable(e){if(!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),EventEmitter.call(this)}Readable.prototype.push=function(e,t){var n=this._readableState;return!n.objectMode&&typeof e=="string"&&(t=t||n.defaultEncoding,t!==n.encoding&&(e=Buffer.from(e,t),t="")),readableAddChunk(this,n,e,t,!1)},Readable.prototype.unshift=function(e){var t=this._readableState;return readableAddChunk(this,t,e,"",!0)},Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};function readableAddChunk(e,t,n,r,i){var s=chunkInvalid(t,n);if(s)e.emit("error",s);else if(n===null)t.reading=!1,onEofChunk(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var l=new Error("stream.push() after EOF");e.emit("error",l)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else{var c;t.decoder&&!i&&!r&&(n=t.decoder.write(n),c=!t.objectMode&&n.length===0),i||(t.reading=!1),c||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&emitReadable(e))),maybeReadMore(e,t)}else i||(t.reading=!1);return needMoreData(t)}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Readable.prototype.setEncoding=function(e){return this._readableState.decoder=new StringDecoder(e),this._readableState.encoding=e,this};var MAX_HWM=8388608;function computeNewHighWaterMark(e){return e>=MAX_HWM?e=MAX_HWM:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Readable.prototype.read=function(e){debug("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return debug("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?endReadable(this):emitReadable(this),null;if(e=howMuchToRead(e,t),e===0&&t.ended)return t.length===0&&endReadable(this),null;var r=t.needReadable;debug("need readable",r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,debug("length less than watermark",r)),t.ended||t.reading?(r=!1,debug("reading or ended",r)):r&&(debug("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(n,t)));var i;return e>0?i=fromList(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&endReadable(this)),i!==null&&this.emit("data",i),i};function chunkInvalid(e,t){var n=null;return!Buffer.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==void 0&&!e.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(debug("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){debug("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(debug("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}Readable.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e);break}r.pipesCount+=1,debug("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||t.end!==!1,s=i?o:f;r.endEmitted?nextTick(s):n.once("end",s),e.on("unpipe",l);function l(j){debug("onunpipe"),j===n&&f()}function o(){debug("onend"),e.end()}var c=pipeOnDrain(n);e.on("drain",c);var u=!1;function f(){debug("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",l),n.removeListener("end",o),n.removeListener("end",f),n.removeListener("data",w),u=!0,r.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}var E=!1;n.on("data",w);function w(j){debug("ondata"),E=!1;var F=e.write(j);F===!1&&!E&&((r.pipesCount===1&&r.pipes===e||r.pipesCount>1&&indexOf(r.pipes,e)!==-1)&&!u&&(debug("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,E=!0),n.pause())}function h(j){debug("onerror",j),R(),e.removeListener("error",h),listenerCount(e,"error")===0&&e.emit("error",j)}prependListener(e,"error",h);function g(){e.removeListener("finish",b),R()}e.once("close",g);function b(){debug("onfinish"),e.removeListener("close",g),R()}e.once("finish",b);function R(){debug("unpipe"),n.unpipe(e)}return e.emit("pipe",n),r.flowing||(debug("pipe resume"),n.resume()),e};function pipeOnDrain(e){return function(){var t=e._readableState;debug("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&e.listeners("data").length&&(t.flowing=!0,flow(e))}}Readable.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var s=indexOf(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},Readable.prototype.on=function(e,t){var n=EventEmitter.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var r=this._readableState;!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&emitReadable(this):nextTick(nReadingNextTick,this))}return n},Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(e){debug("readable nexttick read 0"),e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(debug("resume"),e.flowing=!0,resume(this,e)),this};function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,nextTick(resume_,e,t))}function resume_(e,t){t.reading||(debug("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(e){var t=e._readableState;for(debug("flow",t.flowing);t.flowing&&e.read()!==null;);}Readable.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(debug("wrapped end"),t.decoder&&!t.ended){var l=t.decoder.end();l&&l.length&&r.push(l)}r.push(null)}),e.on("data",function(l){if(debug("wrapped data"),t.decoder&&(l=t.decoder.write(l)),!(t.objectMode&&l==null)&&!(!t.objectMode&&(!l||!l.length))){var o=r.push(l);o||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(l){return function(){return e[l].apply(e,arguments)}}(i));var s=["error","close","destroy","pause","resume"];return forEach(s,function(l){e.on(l,r.emit.bind(r,l))}),r._read=function(l){debug("wrapped _read",l),n&&(n=!1,e.resume())},r},Readable._fromList=fromList;function fromList(e,t){if(t.length===0)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(t.decoder?n=t.buffer.join(""):t.buffer.length===1?n=t.buffer.head.data:n=t.buffer.concat(t.length),t.buffer.clear()):n=fromListPartial(e,t.buffer,t.decoder),n}function fromListPartial(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?r=t.shift():r=n?copyFromBufferString(e,t):copyFromBuffer(e,t),r}function copyFromBufferString(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var s=n.data,l=e>s.length?s.length:e;if(l===s.length?i+=s:i+=s.slice(0,e),e-=l,e===0){l===s.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(l));break}++r}return t.length-=r,i}function copyFromBuffer(e,t){var n=Buffer.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var s=r.data,l=e>s.length?s.length:e;if(s.copy(n,n.length-e,0,l),e-=l,e===0){l===s.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(l));break}++i}return t.length-=i,n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,nextTick(endReadableNT,t,e))}function endReadableNT(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function forEach(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function indexOf(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Writable.WritableState=WritableState,inherits$1(Writable,EventEmitter);function nop(){}function WriteReq(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function WritableState(e,t){Object.defineProperty(this,"buffer",{get:deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Duplex&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){onwrite(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function e(){for(var t=this.bufferedRequest,n=[];t;)n.push(t),t=t.next;return n};function Writable(e){if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev)),EventEmitter.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(e,t){var n=new Error("write after end");e.emit("error",n),nextTick(t,n)}function validChunk(e,t,n,r){var i=!0,s=!1;return n===null?s=new TypeError("May not write null values to stream"):!Buffer.isBuffer(n)&&typeof n!="string"&&n!==void 0&&!t.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),nextTick(r,s),i=!1),i}Writable.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),typeof n!="function"&&(n=nop),r.ended?writeAfterEnd(this,n):validChunk(this,r,e,n)&&(r.pendingcb++,i=writeOrBuffer(this,r,e,t,n)),i},Writable.prototype.cork=function(){var e=this._writableState;e.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function e(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function decodeChunk(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Buffer.from(t,n)),t}function writeOrBuffer(e,t,n,r,i){n=decodeChunk(t,n,r),Buffer.isBuffer(n)&&(r="buffer");var s=t.objectMode?1:n.length;t.length+=s;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var o=t.lastBufferedRequest;t.lastBufferedRequest=new WriteReq(n,r,i),o?o.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,s,n,r,i);return l}function doWrite(e,t,n,r,i,s,l){t.writelen=r,t.writecb=l,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function onwriteError(e,t,n,r,i){--t.pendingcb,n?nextTick(i,r):i(r),e._writableState.errorEmitted=!0,e.emit("error",r)}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(onwriteStateUpdate(n),t)onwriteError(e,n,r,t,i);else{var s=needFinish(n);!s&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&clearBuffer(e,n),r?nextTick(afterWrite,e,n,s,i):afterWrite(e,n,s,i)}}function afterWrite(e,t,n,r){n||onwriteDrain(e,t),t.pendingcb--,r(),finishMaybe(e,t)}function onwriteDrain(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),s=t.corkedRequestsFree;s.entry=n;for(var l=0;n;)i[l]=n,n=n.next,l+=1;doWrite(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 CorkedRequest(t)}else{for(;n;){var o=n.chunk,c=n.encoding,u=n.callback,f=t.objectMode?1:o.length;if(doWrite(e,t,!1,f,o,c,u),n=n.next,t.writing)break}n===null&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}Writable.prototype._write=function(e,t,n){n(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,n){var r=this._writableState;typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),!r.ending&&!r.finished&&endWritable(this,r,n)};function needFinish(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function prefinish(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function finishMaybe(e,t){var n=needFinish(t);return n&&(t.pendingcb===0?(prefinish(e,t),t.finished=!0,e.emit("finish")):prefinish(e,t)),n}function endWritable(e,t,n){t.ending=!0,finishMaybe(e,t),n&&(t.finished?nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}inherits$1(Duplex,Readable);for(var keys=Object.keys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);Readable.call(this,e),Writable.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||nextTick(onEndNT,this)}function onEndNT(e){e.end()}inherits$1(Transform,Duplex);function TransformState(e){this.afterTransform=function(t,n){return afterTransform(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function afterTransform(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,n!=null&&e.push(n),i(t);var s=e._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&e._read(s.highWaterMark)}function Transform(e){if(!(this instanceof Transform))return new Transform(e);Duplex.call(this,e),this._transformState=new TransformState(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(n){done(t,n)}):done(t)})}Transform.prototype.push=function(e,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,e,t)},Transform.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Transform.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Transform.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};function done(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}inherits$1(PassThrough,Transform);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);Transform.call(this,e)}PassThrough.prototype._transform=function(e,t,n){n(null,e)},inherits$1(Stream,EventEmitter),Stream.Readable=Readable,Stream.Writable=Writable,Stream.Duplex=Duplex,Stream.Transform=Transform,Stream.PassThrough=PassThrough,Stream.Stream=Stream;function Stream(){EventEmitter.call(this)}Stream.prototype.pipe=function(e,t){var n=this;function r(f){e.writable&&e.write(f)===!1&&n.pause&&n.pause()}n.on("data",r);function i(){n.readable&&n.resume&&n.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(n.on("end",l),n.on("close",o));var s=!1;function l(){s||(s=!0,e.end())}function o(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}function c(f){if(u(),EventEmitter.listenerCount(this,"error")===0)throw f}n.on("error",c),e.on("error",c);function u(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",o),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e};const msg={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function arraySet(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var s=0;s<r;s++)e[i+s]=t[n+s]}var Buf8=Uint8Array,Buf16=Uint16Array,Buf32=Int32Array,Z_FIXED$2=4,Z_BINARY$1=0,Z_TEXT$1=1,Z_UNKNOWN$2=2;function zero$1(e){for(var t=e.length;--t>=0;)e[t]=0}var STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);var static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);var _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);var base_length=new Array(LENGTH_CODES$1);zero$1(base_length);var base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function d_code(e){return e<256?_dist_code[e]:_dist_code[256+(e>>>7)]}function put_short(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function send_bits(e,t,n){e.bi_valid>Buf_size-n?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>Buf_size-e.bi_valid,e.bi_valid+=n-Buf_size):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function send_code(e,t,n){send_bits(e,n[t*2],n[t*2+1])}function bi_reverse(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function bi_flush(e){e.bi_valid===16?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function gen_bitlen(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length,u,f,E,w,h,g,b=0;for(w=0;w<=MAX_BITS$1;w++)e.bl_count[w]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<HEAP_SIZE$1;u++)f=e.heap[u],w=n[n[f*2+1]*2+1]+1,w>c&&(w=c,b++),n[f*2+1]=w,!(f>r)&&(e.bl_count[w]++,h=0,f>=o&&(h=l[f-o]),g=n[f*2],e.opt_len+=g*(w+h),s&&(e.static_len+=g*(i[f*2+1]+h)));if(b!==0){do{for(w=c-1;e.bl_count[w]===0;)w--;e.bl_count[w]--,e.bl_count[w+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(w=c;w!==0;w--)for(f=e.bl_count[w];f!==0;)E=e.heap[--u],!(E>r)&&(n[E*2+1]!==w&&(e.opt_len+=(w-n[E*2+1])*n[E*2],n[E*2+1]=w),f--)}}function gen_codes(e,t,n){var r=new Array(MAX_BITS$1+1),i=0,s,l;for(s=1;s<=MAX_BITS$1;s++)r[s]=i=i+n[s-1]<<1;for(l=0;l<=t;l++){var o=e[l*2+1];o!==0&&(e[l*2]=bi_reverse(r[o]++,o))}}function tr_static_init(){var e,t,n,r,i,s=new Array(MAX_BITS$1+1);for(n=0,r=0;r<LENGTH_CODES$1-1;r++)for(base_length[r]=n,e=0;e<1<<extra_lbits[r];e++)_length_code[n++]=r;for(_length_code[n-1]=r,i=0,r=0;r<16;r++)for(base_dist[r]=i,e=0;e<1<<extra_dbits[r];e++)_dist_code[i++]=r;for(i>>=7;r<D_CODES$1;r++)for(base_dist[r]=i<<7,e=0;e<1<<extra_dbits[r]-7;e++)_dist_code[256+i++]=r;for(t=0;t<=MAX_BITS$1;t++)s[t]=0;for(e=0;e<=143;)static_ltree[e*2+1]=8,e++,s[8]++;for(;e<=255;)static_ltree[e*2+1]=9,e++,s[9]++;for(;e<=279;)static_ltree[e*2+1]=7,e++,s[7]++;for(;e<=287;)static_ltree[e*2+1]=8,e++,s[8]++;for(gen_codes(static_ltree,L_CODES$1+1,s),e=0;e<D_CODES$1;e++)static_dtree[e*2+1]=5,static_dtree[e*2]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)}function init_block(e){var t;for(t=0;t<L_CODES$1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<D_CODES$1;t++)e.dyn_dtree[t*2]=0;for(t=0;t<BL_CODES$1;t++)e.bl_tree[t*2]=0;e.dyn_ltree[END_BLOCK*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function bi_windup(e){e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function copy_block(e,t,n,r){bi_windup(e),r&&(put_short(e,n),put_short(e,~n)),arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function smaller(e,t,n,r){var i=t*2,s=n*2;return e[i]<e[s]||e[i]===e[s]&&r[t]<=r[n]}function pqdownheap(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&smaller(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!smaller(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function compress_block(e,t,n){var r,i,s=0,l,o;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+s*2]<<8|e.pending_buf[e.d_buf+s*2+1],i=e.pending_buf[e.l_buf+s],s++,r===0?send_code(e,i,t):(l=_length_code[i],send_code(e,l+LITERALS$1+1,t),o=extra_lbits[l],o!==0&&(i-=base_length[l],send_bits(e,i,o)),r--,l=d_code(r),send_code(e,l,n),o=extra_dbits[l],o!==0&&(r-=base_dist[l],send_bits(e,r,o)));while(s<e.last_lit);send_code(e,END_BLOCK,t)}function build_tree(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems,l,o,c=-1,u;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,l=0;l<s;l++)n[l*2]!==0?(e.heap[++e.heap_len]=c=l,e.depth[l]=0):n[l*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=c,l=e.heap_len>>1;l>=1;l--)pqdownheap(e,n,l);u=s;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=o,n[u*2]=n[l*2]+n[o*2],e.depth[u]=(e.depth[l]>=e.depth[o]?e.depth[l]:e.depth[o])+1,n[l*2+1]=n[o*2+1]=u,e.heap[1]=u++,pqdownheap(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,t),gen_codes(n,c,e.bl_count)}function scan_tree(e,t,n){var r,i=-1,s,l=t[0*2+1],o=0,c=7,u=4;for(l===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)s=l,l=t[(r+1)*2+1],!(++o<c&&s===l)&&(o<u?e.bl_tree[s*2]+=o:s!==0?(s!==i&&e.bl_tree[s*2]++,e.bl_tree[REP_3_6*2]++):o<=10?e.bl_tree[REPZ_3_10*2]++:e.bl_tree[REPZ_11_138*2]++,o=0,i=s,l===0?(c=138,u=3):s===l?(c=6,u=3):(c=7,u=4))}function send_tree(e,t,n){var r,i=-1,s,l=t[0*2+1],o=0,c=7,u=4;for(l===0&&(c=138,u=3),r=0;r<=n;r++)if(s=l,l=t[(r+1)*2+1],!(++o<c&&s===l)){if(o<u)do send_code(e,s,e.bl_tree);while(--o!==0);else s!==0?(s!==i&&(send_code(e,s,e.bl_tree),o--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,o-3,2)):o<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,o-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,o-11,7));o=0,i=s,l===0?(c=138,u=3):s===l?(c=6,u=3):(c=7,u=4)}}function build_bl_tree(e){var t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=BL_CODES$1-1;t>=3&&e.bl_tree[bl_order[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function send_all_trees(e,t,n,r){var i;for(send_bits(e,t-257,5),send_bits(e,n-1,5),send_bits(e,r-4,4),i=0;i<r;i++)send_bits(e,e.bl_tree[bl_order[i]*2+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,n-1)}function detect_data_type(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Z_BINARY$1;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Z_TEXT$1;for(n=32;n<LITERALS$1;n++)if(e.dyn_ltree[n*2]!==0)return Z_TEXT$1;return Z_BINARY$1}var static_init_done=!1;function _tr_init(e){static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)}function _tr_stored_block(e,t,n,r){send_bits(e,(STORED_BLOCK<<1)+(r?1:0),3),copy_block(e,t,n,!0)}function _tr_align(e){send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)}function _tr_flush_block(e,t,n,r){var i,s,l=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$2&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),l=build_bl_tree(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&t!==-1?_tr_stored_block(e,t,n,r):e.strategy===Z_FIXED$2||s===i?(send_bits(e,(STATIC_TREES<<1)+(r?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(r?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),r&&bi_windup(e)}function _tr_tally(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(_length_code[n]+LITERALS$1+1)*2]++,e.dyn_dtree[d_code(t)*2]++),e.last_lit===e.lit_bufsize-1}function adler32(e,t,n,r){for(var i=e&65535|0,s=e>>>16&65535|0,l=0;n!==0;){l=n>2e3?2e3:n,n-=l;do i=i+t[r++]|0,s=s+i|0;while(--l);i%=65521,s%=65521}return i|s<<16|0}function makeTable(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var crcTable=makeTable();function crc32(e,t,n,r){var i=crcTable,s=r+n;e^=-1;for(var l=r;l<s;l++)e=e>>>8^i[(e^t[l])&255];return e^-1}var Z_NO_FLUSH$1=0,Z_PARTIAL_FLUSH$1=1,Z_FULL_FLUSH$1=3,Z_FINISH$2=4,Z_BLOCK$2=5,Z_OK$2=0,Z_STREAM_END$2=1,Z_STREAM_ERROR$2=-2,Z_DATA_ERROR$2=-3,Z_BUF_ERROR$2=-5,Z_DEFAULT_COMPRESSION$1=-1,Z_FILTERED$1=1,Z_HUFFMAN_ONLY$1=2,Z_RLE$1=3,Z_FIXED$1=4,Z_UNKNOWN$1=2,Z_DEFLATED$2=8,MAX_MEM_LEVEL=9,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3;function err(e,t){return e.msg=msg[t],t}function rank(e){return(e<<1)-(e>4?9:0)}function zero(e){for(var t=e.length;--t>=0;)e[t]=0}function flush_pending(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function flush_block_only(e,t){_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)}function put_byte(e,t){e.pending_buf[e.pending++]=t}function putShortMSB(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function read_buf(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,arraySet(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=adler32(e.adler,t,i,n):e.state.wrap===2&&(e.adler=crc32(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function longest_match(e,t){var n=e.max_chain_length,r=e.strstart,i,s,l=e.prev_length,o=e.nice_match,c=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,u=e.window,f=e.w_mask,E=e.prev,w=e.strstart+MAX_MATCH,h=u[r+l-1],g=u[r+l];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(u[i+l]!==g||u[i+l-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<w);if(s=MAX_MATCH-(w-r),r=w-MAX_MATCH,s>l){if(e.match_start=t,l=s,s>=o)break;h=u[r+l-1],g=u[r+l]}}while((t=E[t&f])>c&&--n!==0);return l<=e.lookahead?l:e.lookahead}function fill_window(e){var t=e.w_size,n,r,i,s,l;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-MIN_LOOKAHEAD)){arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);s+=t}if(e.strm.avail_in===0)break;if(r=read_buf(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=r,e.lookahead+e.insert>=MIN_MATCH)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+MIN_MATCH-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&e.strm.avail_in!==0)}function deflate_stored(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fill_window(e),e.lookahead===0&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,flush_block_only(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-MIN_LOOKAHEAD&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):(e.strstart>e.block_start&&(flush_block_only(e,!1),e.strm.avail_out===0),BS_NEED_MORE)}function deflate_fast(e,t){for(var n,r;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n)),e.match_length>=MIN_MATCH)if(r=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_slow(e,t){for(var n,r,i;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n),e.match_length<=5&&(e.strategy===Z_FILTERED$1||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-MIN_MATCH,r=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}else if(e.match_available){if(r=_tr_tally(e,0,e.window[e.strstart-1]),r&&flush_block_only(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_rle(e,t){for(var n,r,i,s,l=e.window;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(i=e.strstart-1,r=l[i],r===l[++i]&&r===l[++i]&&r===l[++i])){s=e.strstart+MAX_MATCH;do;while(r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&i<s);e.match_length=MAX_MATCH-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(n=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_huff(e,t){for(var n;;){if(e.lookahead===0&&(fill_window(e),e.lookahead===0)){if(t===Z_NO_FLUSH$1)return BS_NEED_MORE;break}if(e.match_length=0,n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var configuration_table;configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(e){e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0}function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Buf16(HEAP_SIZE*2),this.dyn_dtree=new Buf16((2*D_CODES+1)*2),this.bl_tree=new Buf16((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Buf16(MAX_BITS+1),this.heap=new Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function deflateResetKeep(e){var t;return!e||!e.state?err(e,Z_STREAM_ERROR$2):(e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN$1,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?INIT_STATE:BUSY_STATE,e.adler=t.wrap===2?0:1,t.last_flush=Z_NO_FLUSH$1,_tr_init(t),Z_OK$2)}function deflateReset(e){var t=deflateResetKeep(e);return t===Z_OK$2&&lm_init(e.state),t}function deflateInit2(e,t,n,r,i,s){if(!e)return Z_STREAM_ERROR$2;var l=1;if(t===Z_DEFAULT_COMPRESSION$1&&(t=6),r<0?(l=0,r=-r):r>15&&(l=2,r-=16),i<1||i>MAX_MEM_LEVEL||n!==Z_DEFLATED$2||r<8||r>15||t<0||t>9||s<0||s>Z_FIXED$1)return err(e,Z_STREAM_ERROR$2);r===8&&(r=9);var o=new DeflateState;return e.state=o,o.strm=e,o.wrap=l,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+MIN_MATCH-1)/MIN_MATCH),o.window=new Buf8(o.w_size*2),o.head=new Buf16(o.hash_size),o.prev=new Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=(1+2)*o.lit_bufsize,o.level=t,o.strategy=s,o.method=n,deflateReset(e)}function deflate(e,t){var n,r,i,s;if(!e||!e.state||t>Z_BLOCK$2||t<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===FINISH_STATE&&t!==Z_FINISH$2)return err(e,e.avail_out===0?Z_BUF_ERROR$2:Z_STREAM_ERROR$2);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===INIT_STATE)if(r.wrap===2)e.adler=0,put_byte(r,31),put_byte(r,139),put_byte(r,8),r.gzhead?(put_byte(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),put_byte(r,r.gzhead.time&255),put_byte(r,r.gzhead.time>>8&255),put_byte(r,r.gzhead.time>>16&255),put_byte(r,r.gzhead.time>>24&255),put_byte(r,r.level===9?2:r.strategy>=Z_HUFFMAN_ONLY$1||r.level<2?4:0),put_byte(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(put_byte(r,r.gzhead.extra.length&255),put_byte(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=crc32(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=EXTRA_STATE):(put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,r.level===9?2:r.strategy>=Z_HUFFMAN_ONLY$1||r.level<2?4:0),put_byte(r,OS_CODE),r.status=BUSY_STATE);else{var l=Z_DEFLATED$2+(r.w_bits-8<<4)<<8,o=-1;r.strategy>=Z_HUFFMAN_ONLY$1||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,l|=o<<6,r.strstart!==0&&(l|=PRESET_DICT),l+=31-l%31,r.status=BUSY_STATE,putShortMSB(r,l),r.strstart!==0&&(putShortMSB(r,e.adler>>>16),putShortMSB(r,e.adler&65535)),e.adler=1}if(r.status===EXTRA_STATE)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),flush_pending(e),i=r.pending,r.pending===r.pending_buf_size));)put_byte(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=NAME_STATE)}else r.status=NAME_STATE;if(r.status===NAME_STATE)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),flush_pending(e),i=r.pending,r.pending===r.pending_buf_size)){s=1;break}r.gzindex<r.gzhead.name.length?s=r.gzhead.name.charCodeAt(r.gzindex++)&255:s=0,put_byte(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),s===0&&(r.gzindex=0,r.status=COMMENT_STATE)}else r.status=COMMENT_STATE;if(r.status===COMMENT_STATE)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),flush_pending(e),i=r.pending,r.pending===r.pending_buf_size)){s=1;break}r.gzindex<r.gzhead.comment.length?s=r.gzhead.comment.charCodeAt(r.gzindex++)&255:s=0,put_byte(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),s===0&&(r.status=HCRC_STATE)}else r.status=HCRC_STATE;if(r.status===HCRC_STATE&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&flush_pending(e),r.pending+2<=r.pending_buf_size&&(put_byte(r,e.adler&255),put_byte(r,e.adler>>8&255),e.adler=0,r.status=BUSY_STATE)):r.status=BUSY_STATE),r.pending!==0){if(flush_pending(e),e.avail_out===0)return r.last_flush=-1,Z_OK$2}else if(e.avail_in===0&&rank(t)<=rank(n)&&t!==Z_FINISH$2)return err(e,Z_BUF_ERROR$2);if(r.status===FINISH_STATE&&e.avail_in!==0)return err(e,Z_BUF_ERROR$2);if(e.avail_in!==0||r.lookahead!==0||t!==Z_NO_FLUSH$1&&r.status!==FINISH_STATE){var c=r.strategy===Z_HUFFMAN_ONLY$1?deflate_huff(r,t):r.strategy===Z_RLE$1?deflate_rle(r,t):configuration_table[r.level].func(r,t);if((c===BS_FINISH_STARTED||c===BS_FINISH_DONE)&&(r.status=FINISH_STATE),c===BS_NEED_MORE||c===BS_FINISH_STARTED)return e.avail_out===0&&(r.last_flush=-1),Z_OK$2;if(c===BS_BLOCK_DONE&&(t===Z_PARTIAL_FLUSH$1?_tr_align(r):t!==Z_BLOCK$2&&(_tr_stored_block(r,0,0,!1),t===Z_FULL_FLUSH$1&&(zero(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),flush_pending(e),e.avail_out===0))return r.last_flush=-1,Z_OK$2}return t!==Z_FINISH$2?Z_OK$2:r.wrap<=0?Z_STREAM_END$2:(r.wrap===2?(put_byte(r,e.adler&255),put_byte(r,e.adler>>8&255),put_byte(r,e.adler>>16&255),put_byte(r,e.adler>>24&255),put_byte(r,e.total_in&255),put_byte(r,e.total_in>>8&255),put_byte(r,e.total_in>>16&255),put_byte(r,e.total_in>>24&255)):(putShortMSB(r,e.adler>>>16),putShortMSB(r,e.adler&65535)),flush_pending(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Z_OK$2:Z_STREAM_END$2)}function deflateEnd(e){var t;return!e||!e.state?Z_STREAM_ERROR$2:(t=e.state.status,t!==INIT_STATE&&t!==EXTRA_STATE&&t!==NAME_STATE&&t!==COMMENT_STATE&&t!==HCRC_STATE&&t!==BUSY_STATE&&t!==FINISH_STATE?err(e,Z_STREAM_ERROR$2):(e.state=null,t===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$2))}var BAD$1=30,TYPE$1=12;function inflate_fast(e,t){var n,r,i,s,l,o,c,u,f,E,w,h,g,b,R,j,F,M,A,d,C,$,q,y,m;n=e.state,r=e.next_in,y=e.input,i=r+(e.avail_in-5),s=e.next_out,m=e.output,l=s-(t-e.avail_out),o=s+(e.avail_out-257),c=n.dmax,u=n.wsize,f=n.whave,E=n.wnext,w=n.window,h=n.hold,g=n.bits,b=n.lencode,R=n.distcode,j=(1<<n.lenbits)-1,F=(1<<n.distbits)-1;e:do{g<15&&(h+=y[r++]<<g,g+=8,h+=y[r++]<<g,g+=8),M=b[h&j];t:for(;;){if(A=M>>>24,h>>>=A,g-=A,A=M>>>16&255,A===0)m[s++]=M&65535;else if(A&16){d=M&65535,A&=15,A&&(g<A&&(h+=y[r++]<<g,g+=8),d+=h&(1<<A)-1,h>>>=A,g-=A),g<15&&(h+=y[r++]<<g,g+=8,h+=y[r++]<<g,g+=8),M=R[h&F];n:for(;;){if(A=M>>>24,h>>>=A,g-=A,A=M>>>16&255,A&16){if(C=M&65535,A&=15,g<A&&(h+=y[r++]<<g,g+=8,g<A&&(h+=y[r++]<<g,g+=8)),C+=h&(1<<A)-1,C>c){e.msg="invalid distance too far back",n.mode=BAD$1;break e}if(h>>>=A,g-=A,A=s-l,C>A){if(A=C-A,A>f&&n.sane){e.msg="invalid distance too far back",n.mode=BAD$1;break e}if($=0,q=w,E===0){if($+=u-A,A<d){d-=A;do m[s++]=w[$++];while(--A);$=s-C,q=m}}else if(E<A){if($+=u+E-A,A-=E,A<d){d-=A;do m[s++]=w[$++];while(--A);if($=0,E<d){A=E,d-=A;do m[s++]=w[$++];while(--A);$=s-C,q=m}}}else if($+=E-A,A<d){d-=A;do m[s++]=w[$++];while(--A);$=s-C,q=m}for(;d>2;)m[s++]=q[$++],m[s++]=q[$++],m[s++]=q[$++],d-=3;d&&(m[s++]=q[$++],d>1&&(m[s++]=q[$++]))}else{$=s-C;do m[s++]=m[$++],m[s++]=m[$++],m[s++]=m[$++],d-=3;while(d>2);d&&(m[s++]=m[$++],d>1&&(m[s++]=m[$++]))}}else if(A&64){e.msg="invalid distance code",n.mode=BAD$1;break e}else{M=R[(M&65535)+(h&(1<<A)-1)];continue n}break}}else if(A&64)if(A&32){n.mode=TYPE$1;break e}else{e.msg="invalid literal/length code",n.mode=BAD$1;break e}else{M=b[(M&65535)+(h&(1<<A)-1)];continue t}break}}while(r<i&&s<o);d=g>>3,r-=d,g-=d<<3,h&=(1<<g)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=s<o?257+(o-s):257-(s-o),n.hold=h,n.bits=g}var MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function inflate_table(e,t,n,r,i,s,l,o){var c=o.bits,u=0,f=0,E=0,w=0,h=0,g=0,b=0,R=0,j=0,F=0,M,A,d,C,$,q=null,y=0,m,I=new Buf16(MAXBITS+1),_=new Buf16(MAXBITS+1),L=null,W=0,B,N,P;for(u=0;u<=MAXBITS;u++)I[u]=0;for(f=0;f<r;f++)I[t[n+f]]++;for(h=c,w=MAXBITS;w>=1&&I[w]===0;w--);if(h>w&&(h=w),w===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(E=1;E<w&&I[E]===0;E++);for(h<E&&(h=E),R=1,u=1;u<=MAXBITS;u++)if(R<<=1,R-=I[u],R<0)return-1;if(R>0&&(e===CODES$1||w!==1))return-1;for(_[1]=0,u=1;u<MAXBITS;u++)_[u+1]=_[u]+I[u];for(f=0;f<r;f++)t[n+f]!==0&&(l[_[t[n+f]]++]=f);if(e===CODES$1?(q=L=l,m=19):e===LENS$1?(q=lbase,y-=257,L=lext,W-=257,m=256):(q=dbase,L=dext,m=-1),F=0,f=0,u=E,$=s,g=h,b=0,d=-1,j=1<<h,C=j-1,e===LENS$1&&j>ENOUGH_LENS$1||e===DISTS$1&&j>ENOUGH_DISTS$1)return 1;for(;;){B=u-b,l[f]<m?(N=0,P=l[f]):l[f]>m?(N=L[W+l[f]],P=q[y+l[f]]):(N=32+64,P=0),M=1<<u-b,A=1<<g,E=A;do A-=M,i[$+(F>>b)+A]=B<<24|N<<16|P|0;while(A!==0);for(M=1<<u-1;F&M;)M>>=1;if(M!==0?(F&=M-1,F+=M):F=0,f++,--I[u]===0){if(u===w)break;u=t[n+l[f]]}if(u>h&&(F&C)!==d){for(b===0&&(b=h),$+=E,g=u-b,R=1<<g;g+b<w&&(R-=I[g+b],!(R<=0));)g++,R<<=1;if(j+=1<<g,e===LENS$1&&j>ENOUGH_LENS$1||e===DISTS$1&&j>ENOUGH_DISTS$1)return 1;d=F&C,i[d]=h<<24|g<<16|$-s|0}}return F!==0&&(i[$+F]=u-b<<24|64<<16|0),o.bits=h,0}var CODES=0,LENS=1,DISTS=2,Z_FINISH$1=4,Z_BLOCK$1=5,Z_TREES$1=6,Z_OK$1=0,Z_STREAM_END$1=1,Z_NEED_DICT$1=2,Z_STREAM_ERROR$1=-2,Z_DATA_ERROR$1=-3,Z_MEM_ERROR=-4,Z_BUF_ERROR$1=-5,Z_DEFLATED$1=8,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,SYNC=32,ENOUGH_LENS=852,ENOUGH_DISTS=592;function zswap32(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Buf16(320),this.work=new Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function inflateResetKeep(e){var t;return!e||!e.state?Z_STREAM_ERROR$1:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=HEAD,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Buf32(ENOUGH_LENS),t.distcode=t.distdyn=new Buf32(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1)}function inflateReset(e){var t;return!e||!e.state?Z_STREAM_ERROR$1:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e))}function inflateReset2(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Z_STREAM_ERROR$1:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))}function inflateInit2(e,t){var n,r;return e?(r=new InflateState,e.state=r,r.window=null,n=inflateReset2(e,t),n!==Z_OK$1&&(e.state=null),n):Z_STREAM_ERROR$1}var virgin=!0,lenfix,distfix;function fixedtables(e){if(virgin){var t;for(lenfix=new Buf32(512),distfix=new Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inflate_table(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inflate_table(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5}function updatewindow(e,t,n,r){var i,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Buf8(s.wsize)),r>=s.wsize?(arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),arraySet(s.window,t,n-r,i,s.wnext),r-=i,r?(arraySet(s.window,t,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}function inflate(e,t){var n,r,i,s,l,o,c,u,f,E,w,h,g,b,R=0,j,F,M,A,d,C,$,q,y=new Buf8(4),m,I,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),l=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,f=n.bits,E=o,w=c,q=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(n.wrap===0){n.mode=TYPEDO;break}for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(n.wrap&2&&u===35615){n.check=0,y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0),u=0,f=0,n.mode=FLAGS;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((u&15)!==Z_DEFLATED$1){e.msg="unknown compression method",n.mode=BAD;break}if(u>>>=4,f-=4,$=(u&15)+8,n.wbits===0)n.wbits=$;else if($>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<$,e.adler=n.check=1,n.mode=u&512?DICTID:TYPE,u=0,f=0;break;case FLAGS:for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(n.flags=u,(n.flags&255)!==Z_DEFLATED$1){e.msg="unknown compression method",n.mode=BAD;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0)),u=0,f=0,n.mode=TIME;case TIME:for(;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.head&&(n.head.time=u),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,y[2]=u>>>16&255,y[3]=u>>>24&255,n.check=crc32(n.check,y,4,0)),u=0,f=0,n.mode=OS;case OS:for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0)),u=0,f=0,n.mode=EXLEN;case EXLEN:if(n.flags&1024){for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0)),u=0,f=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(n.flags&1024&&(h=n.length,h>o&&(h=o),h&&(n.head&&($=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),arraySet(n.head.extra,r,s,h,$)),n.flags&512&&(n.check=crc32(n.check,r,h,s)),o-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(n.flags&2048){if(o===0)break e;h=0;do $=r[s+h++],n.head&&$&&n.length<65536&&(n.head.name+=String.fromCharCode($));while($&&h<o);if(n.flags&512&&(n.check=crc32(n.check,r,h,s)),o-=h,s+=h,$)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(n.flags&4096){if(o===0)break e;h=0;do $=r[s+h++],n.head&&$&&n.length<65536&&(n.head.comment+=String.fromCharCode($));while($&&h<o);if(n.flags&512&&(n.check=crc32(n.check,r,h,s)),o-=h,s+=h,$)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(n.flags&512){for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=BAD;break}u=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}e.adler=n.check=zswap32(u),u=0,f=0,n.mode=DICT;case DICT:if(n.havedict===0)return e.next_out=l,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=f,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK$1||t===Z_TREES$1)break e;case TYPEDO:if(n.last){u>>>=f&7,f-=f&7,n.mode=CHECK;break}for(;f<3;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}switch(n.last=u&1,u>>>=1,f-=1,u&3){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES$1){u>>>=2,f-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}u>>>=2,f-=2;break;case STORED:for(u>>>=f&7,f-=f&7;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=u&65535,u=0,f=0,n.mode=COPY_,t===Z_TREES$1)break e;case COPY_:n.mode=COPY;case COPY:if(h=n.length,h){if(h>o&&(h=o),h>c&&(h=c),h===0)break e;arraySet(i,r,s,h,l),o-=h,s+=h,c-=h,l+=h,n.length-=h;break}n.mode=TYPE;break;case TABLE:for(;f<14;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(n.nlen=(u&31)+257,u>>>=5,f-=5,n.ndist=(u&31)+1,u>>>=5,f-=5,n.ncode=(u&15)+4,u>>>=4,f-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;f<3;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.lens[_[n.have++]]=u&7,u>>>=3,f-=3}for(;n.have<19;)n.lens[_[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,m={bits:n.lenbits},q=inflate_table(CODES,n.lens,0,19,n.lencode,0,n.work,m),n.lenbits=m.bits,q){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;R=n.lencode[u&(1<<n.lenbits)-1],j=R>>>24,F=R>>>16&255,M=R&65535,!(j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(M<16)u>>>=j,f-=j,n.lens[n.have++]=M;else{if(M===16){for(I=j+2;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(u>>>=j,f-=j,n.have===0){e.msg="invalid bit length repeat",n.mode=BAD;break}$=n.lens[n.have-1],h=3+(u&3),u>>>=2,f-=2}else if(M===17){for(I=j+3;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=j,f-=j,$=0,h=3+(u&7),u>>>=3,f-=3}else{for(I=j+7;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=j,f-=j,$=0,h=11+(u&127),u>>>=7,f-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;h--;)n.lens[n.have++]=$}}if(n.mode===BAD)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,m={bits:n.lenbits},q=inflate_table(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,m),n.lenbits=m.bits,q){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,m={bits:n.distbits},q=inflate_table(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,m),n.distbits=m.bits,q){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES$1)break e;case LEN_:n.mode=LEN;case LEN:if(o>=6&&c>=258){e.next_out=l,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=f,inflate_fast(e,w),l=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,f=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;R=n.lencode[u&(1<<n.lenbits)-1],j=R>>>24,F=R>>>16&255,M=R&65535,!(j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(F&&!(F&240)){for(A=j,d=F,C=M;R=n.lencode[C+((u&(1<<A+d)-1)>>A)],j=R>>>24,F=R>>>16&255,M=R&65535,!(A+j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=A,f-=A,n.back+=A}if(u>>>=j,f-=j,n.back+=j,n.length=M,F===0){n.mode=LIT;break}if(F&32){n.back=-1,n.mode=TYPE;break}if(F&64){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=F&15,n.mode=LENEXT;case LENEXT:if(n.extra){for(I=n.extra;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;R=n.distcode[u&(1<<n.distbits)-1],j=R>>>24,F=R>>>16&255,M=R&65535,!(j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(!(F&240)){for(A=j,d=F,C=M;R=n.distcode[C+((u&(1<<A+d)-1)>>A)],j=R>>>24,F=R>>>16&255,M=R&65535,!(A+j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=A,f-=A,n.back+=A}if(u>>>=j,f-=j,n.back+=j,F&64){e.msg="invalid distance code",n.mode=BAD;break}n.offset=M,n.extra=F&15,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(I=n.extra;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(c===0)break e;if(h=w-c,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}h>n.wnext?(h-=n.wnext,g=n.wsize-h):g=n.wnext-h,h>n.length&&(h=n.length),b=n.window}else b=i,g=l-n.offset,h=n.length;h>c&&(h=c),c-=h,n.length-=h;do i[l++]=b[g++];while(--h);n.length===0&&(n.mode=LEN);break;case LIT:if(c===0)break e;i[l++]=n.length,c--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;f<32;){if(o===0)break e;o--,u|=r[s++]<<f,f+=8}if(w-=c,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?crc32(n.check,i,w,l-w):adler32(n.check,i,w,l-w)),w=c,(n.flags?u:zswap32(u))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}u=0,f=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=BAD;break}u=0,f=0}n.mode=DONE;case DONE:q=Z_STREAM_END$1;break e;case BAD:q=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR;case SYNC:default:return Z_STREAM_ERROR$1}return e.next_out=l,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=f,(n.wsize||w!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,w-e.avail_out),E-=e.avail_in,w-=e.avail_out,e.total_in+=E,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?crc32(n.check,i,w,e.next_out-w):adler32(n.check,i,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(E===0&&w===0||t===Z_FINISH$1)&&q===Z_OK$1&&(q=Z_BUF_ERROR$1),q}function inflateEnd(e){if(!e||!e.state)return Z_STREAM_ERROR$1;var t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1}var NONE=0,DEFLATE=1,INFLATE=2,GZIP=3,GUNZIP=4,DEFLATERAW=5,INFLATERAW=6,UNZIP=7,Z_NO_FLUSH=0,Z_PARTIAL_FLUSH=1,Z_SYNC_FLUSH=2,Z_FULL_FLUSH=3,Z_FINISH=4,Z_BLOCK=5,Z_TREES=6,Z_OK=0,Z_STREAM_END=1,Z_NEED_DICT=2,Z_ERRNO=-1,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_BUF_ERROR=-5,Z_NO_COMPRESSION=0,Z_BEST_SPEED=1,Z_BEST_COMPRESSION=9,Z_DEFAULT_COMPRESSION=-1,Z_FILTERED=1,Z_HUFFMAN_ONLY=2,Z_RLE=3,Z_FIXED=4,Z_DEFAULT_STRATEGY=0,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN=2,Z_DEFLATED=8;function Zlib$1(e){if(e<DEFLATE||e>UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}Zlib$1.prototype.init=function(e,t,n,r,i){this.windowBits=e,this.level=t,this.memLevel=n,this.strategy=r,(this.mode===GZIP||this.mode===GUNZIP)&&(this.windowBits+=16),this.mode===UNZIP&&(this.windowBits+=32),(this.mode===DEFLATERAW||this.mode===INFLATERAW)&&(this.windowBits=-this.windowBits),this.strm=new ZStream;var s;switch(this.mode){case DEFLATE:case GZIP:case DEFLATERAW:s=deflateInit2(this.strm,this.level,Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case INFLATE:case GUNZIP:case INFLATERAW:case UNZIP:s=inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(s!==Z_OK){this._error(s);return}this.write_in_progress=!1,this.init_done=!0},Zlib$1.prototype.params=function(){throw new Error("deflateParams Not supported")},Zlib$1.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===NONE)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},Zlib$1.prototype.write=function(e,t,n,r,i,s,l){this._writeCheck(),this.write_in_progress=!0;var o=this;return browser$1$1.nextTick(function(){o.write_in_progress=!1;var c=o._write(e,t,n,r,i,s,l);o.callback(c[0],c[1]),o.pending_close&&o.close()}),this};function bufferSet(e,t){for(var n=0;n<e.length;n++)this[t+n]=e[n]}Zlib$1.prototype.writeSync=function(e,t,n,r,i,s,l){return this._writeCheck(),this._write(e,t,n,r,i,s,l)},Zlib$1.prototype._write=function(e,t,n,r,i,s,l){if(this.write_in_progress=!0,e!==Z_NO_FLUSH&&e!==Z_PARTIAL_FLUSH&&e!==Z_SYNC_FLUSH&&e!==Z_FULL_FLUSH&&e!==Z_FINISH&&e!==Z_BLOCK)throw new Error("Invalid flush value");t==null&&(t=new Buffer(0),r=0,n=0),i._set?i.set=i._set:i.set=bufferSet;var o=this.strm;o.avail_in=r,o.input=t,o.next_in=n,o.avail_out=l,o.output=i,o.next_out=s;var c;switch(this.mode){case DEFLATE:case GZIP:case DEFLATERAW:c=deflate(o,e);break;case UNZIP:case INFLATE:case GUNZIP:case INFLATERAW:c=inflate(o,e);break;default:throw new Error("Unknown mode "+this.mode)}return c!==Z_STREAM_END&&c!==Z_OK&&this._error(c),this.write_in_progress=!1,[o.avail_in,o.avail_out]},Zlib$1.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,this.mode===DEFLATE||this.mode===GZIP||this.mode===DEFLATERAW?deflateEnd(this.strm):inflateEnd(this.strm),this.mode=NONE};var status;Zlib$1.prototype.reset=function(){switch(this.mode){case DEFLATE:case DEFLATERAW:status=deflateReset(this.strm);break;case INFLATE:case INFLATERAW:status=inflateReset(this.strm);break}status!==Z_OK&&this._error(status)},Zlib$1.prototype._error=function(e){this.onerror(msg[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()};const _binding=Object.freeze(Object.defineProperty({__proto__:null,DEFLATE,DEFLATERAW,GUNZIP,GZIP,INFLATE,INFLATERAW,NONE,UNZIP,Z_BEST_COMPRESSION,Z_BEST_SPEED,Z_BINARY,Z_BLOCK,Z_BUF_ERROR,Z_DATA_ERROR,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED,Z_ERRNO,Z_FILTERED,Z_FINISH,Z_FIXED,Z_FULL_FLUSH,Z_HUFFMAN_ONLY,Z_NEED_DICT,Z_NO_COMPRESSION,Z_NO_FLUSH,Z_OK,Z_PARTIAL_FLUSH,Z_RLE,Z_STREAM_END,Z_STREAM_ERROR,Z_SYNC_FLUSH,Z_TEXT,Z_TREES,Z_UNKNOWN,Zlib:Zlib$1},Symbol.toStringTag,{value:"Module"}));function assert(e,t){if(!e)throw new Error(t)}var binding={};Object.keys(_binding).forEach(function(e){binding[e]=_binding[e]}),binding.Z_MIN_WINDOWBITS=8,binding.Z_MAX_WINDOWBITS=15,binding.Z_DEFAULT_WINDOWBITS=15,binding.Z_MIN_CHUNK=64,binding.Z_MAX_CHUNK=1/0,binding.Z_DEFAULT_CHUNK=16*1024,binding.Z_MIN_MEMLEVEL=1,binding.Z_MAX_MEMLEVEL=9,binding.Z_DEFAULT_MEMLEVEL=8,binding.Z_MIN_LEVEL=-1,binding.Z_MAX_LEVEL=9,binding.Z_DEFAULT_LEVEL=binding.Z_DEFAULT_COMPRESSION;var codes={Z_OK:binding.Z_OK,Z_STREAM_END:binding.Z_STREAM_END,Z_NEED_DICT:binding.Z_NEED_DICT,Z_ERRNO:binding.Z_ERRNO,Z_STREAM_ERROR:binding.Z_STREAM_ERROR,Z_DATA_ERROR:binding.Z_DATA_ERROR,Z_MEM_ERROR:binding.Z_MEM_ERROR,Z_BUF_ERROR:binding.Z_BUF_ERROR,Z_VERSION_ERROR:binding.Z_VERSION_ERROR};Object.keys(codes).forEach(function(e){codes[codes[e]]=e});function deflateSync(e,t){return zlibBufferSync(new Deflate(t),e)}function inflateSync(e,t){return zlibBufferSync(new Inflate(t),e)}function zlibBufferSync(e,t){if(typeof t=="string"&&(t=new Buffer(t)),!Buffer.isBuffer(t))throw new TypeError("Not a string or buffer");var n=binding.Z_FINISH;return e._processChunk(t,n)}function Deflate(e){if(!(this instanceof Deflate))return new Deflate(e);Zlib.call(this,e,binding.DEFLATE)}function Inflate(e){if(!(this instanceof Inflate))return new Inflate(e);Zlib.call(this,e,binding.INFLATE)}function Gzip(e){if(!(this instanceof Gzip))return new Gzip(e);Zlib.call(this,e,binding.GZIP)}function Gunzip(e){if(!(this instanceof Gunzip))return new Gunzip(e);Zlib.call(this,e,binding.GUNZIP)}function DeflateRaw(e){if(!(this instanceof DeflateRaw))return new DeflateRaw(e);Zlib.call(this,e,binding.DEFLATERAW)}function InflateRaw(e){if(!(this instanceof InflateRaw))return new InflateRaw(e);Zlib.call(this,e,binding.INFLATERAW)}function Unzip(e){if(!(this instanceof Unzip))return new Unzip(e);Zlib.call(this,e,binding.UNZIP)}function Zlib(e,t){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||binding.Z_DEFAULT_CHUNK,Transform.call(this,e),e.flush&&e.flush!==binding.Z_NO_FLUSH&&e.flush!==binding.Z_PARTIAL_FLUSH&&e.flush!==binding.Z_SYNC_FLUSH&&e.flush!==binding.Z_FULL_FLUSH&&e.flush!==binding.Z_FINISH&&e.flush!==binding.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||binding.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<binding.Z_MIN_CHUNK||e.chunkSize>binding.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<binding.Z_MIN_WINDOWBITS||e.windowBits>binding.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<binding.Z_MIN_LEVEL||e.level>binding.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<binding.Z_MIN_MEMLEVEL||e.memLevel>binding.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=binding.Z_FILTERED&&e.strategy!=binding.Z_HUFFMAN_ONLY&&e.strategy!=binding.Z_RLE&&e.strategy!=binding.Z_FIXED&&e.strategy!=binding.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!Buffer.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new binding.Zlib(t);var n=this;this._hadError=!1,this._binding.onerror=function(s,l){n._binding=null,n._hadError=!0;var o=new Error(s);o.errno=l,o.code=binding.codes[l],n.emit("error",o)};var r=binding.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(r=e.level);var i=binding.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(i=e.strategy),this._binding.init(e.windowBits||binding.Z_DEFAULT_WINDOWBITS,r,e.memLevel||binding.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new Buffer(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=i,this.once("end",this.close)}inherits$1(Zlib,Transform),Zlib.prototype.params=function(e,t,n){if(e<binding.Z_MIN_LEVEL||e>binding.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=binding.Z_FILTERED&&t!=binding.Z_HUFFMAN_ONLY&&t!=binding.Z_RLE&&t!=binding.Z_FIXED&&t!=binding.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var r=this;this.flush(binding.Z_SYNC_FLUSH,function(){r._binding.params(e,t),r._hadError||(r._level=e,r._strategy=t,n&&n())})}else browser$1$1.nextTick(n)},Zlib.prototype.reset=function(){return this._binding.reset()},Zlib.prototype._flush=function(e){this._transform(new Buffer(0),"",e)},Zlib.prototype.flush=function(e,t){var n=this._writableState;if((typeof e=="function"||e===void 0&&!t)&&(t=e,e=binding.Z_FULL_FLUSH),n.ended)t&&browser$1$1.nextTick(t);else if(n.ending)t&&this.once("end",t);else if(n.needDrain){var r=this;this.once("drain",function(){r.flush(t)})}else this._flushFlag=e,this.write(new Buffer(0),"",t)},Zlib.prototype.close=function(e){if(e&&browser$1$1.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;browser$1$1.nextTick(function(){t.emit("close")})}},Zlib.prototype._transform=function(e,t,n){var r,i=this._writableState,s=i.ending||i.ended,l=s&&(!e||i.length===e.length);if(!e===null&&!Buffer.isBuffer(e))return n(new Error("invalid input"));l?r=binding.Z_FINISH:(r=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||binding.Z_NO_FLUSH)),this._processChunk(e,r,n)},Zlib.prototype._processChunk=function(e,t,n){var r=e&&e.length,i=this._chunkSize-this._offset,s=0,l=this,o=typeof n=="function";if(!o){var c=[],u=0,f;this.on("error",function(b){f=b});do var E=this._binding.writeSync(t,e,s,r,this._buffer,this._offset,i);while(!this._hadError&&g(E[0],E[1]));if(this._hadError)throw f;var w=Buffer.concat(c,u);return this.close(),w}var h=this._binding.write(t,e,s,r,this._buffer,this._offset,i);h.buffer=e,h.callback=g;function g(b,R){if(!l._hadError){var j=i-R;if(assert(j>=0,"have should not go down"),j>0){var F=l._buffer.slice(l._offset,l._offset+j);l._offset+=j,o?l.push(F):(c.push(F),u+=F.length)}if((R===0||l._offset>=l._chunkSize)&&(i=l._chunkSize,l._offset=0,l._buffer=new Buffer(l._chunkSize)),R===0){if(s+=r-b,r=b,!o)return!0;var M=l._binding.write(t,e,s,r,l._buffer,l._offset,l._chunkSize);M.callback=g,M.buffer=e;return}if(!o)return!1;n()}}},inherits$1(Deflate,Zlib),inherits$1(Inflate,Zlib),inherits$1(Gzip,Zlib),inherits$1(Gunzip,Zlib),inherits$1(DeflateRaw,Zlib),inherits$1(InflateRaw,Zlib),inherits$1(Unzip,Zlib);function serializeHash(e){return deflateSync(Buffer.from(JSON.stringify(e),"utf8")).toString("base64")}function deserializeHash(e){return JSON.parse(inflateSync(Buffer.from(e,"base64")).toString("utf8"))}function stringToArrayBuffer(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function browser(){const{userAgent:e}=navigator;return e.includes("Firefox/")?"Firefox":e.includes("Edg/")?"Edge":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":e.includes("MSIE/")||e.includes("Trident/")?"IE":"Other"}const rtcAudioChunkStreamType="audio-chunk";class AudioPlayer{constructor(t,n){Ae(this,"muted",!1);Ae(this,"hasReceivedData",!1);Ae(this,"audioContext");Ae(this,"chunks",[]);Ae(this,"isPlaying",!1);Ae(this,"startTime",0);Ae(this,"lastChunkOffset",0);Ae(this,"bufferSize",3);Ae(this,"receive",async t=>{var l;const n=(l=t.payload.audioChunk)==null?void 0:l.chunk_data;if(!n)return;this.hasReceivedData||(this.hasReceivedData=!0);const{audioContext:r,muted:i}=this;if(!r||t.header.stream.streamType!==rtcAudioChunkStreamType||i!==!1)return;const s=stringToArrayBuffer(n);try{await r.decodeAudioData(s.buffer,this.scheduleChunk)}catch(o){console.warn("Error decoding audio buffer, changing audioWireFormat on agent",{error:o}),this.changeAudioWireFormat("wav")}});Ae(this,"scheduleChunk",t=>{const{audioContext:n}=this;if(!n)return;(this.chunks.length>this.bufferSize||this.isPlaying===!1)&&(this.chunks.forEach(i=>{i.stop()}),this.isPlaying=!1,this.chunks=[]);const r=this.createChunk(t);r&&r.buffer&&(this.isPlaying===!1&&(this.startTime=n.currentTime,this.lastChunkOffset=0,this.isPlaying=!0),r.start(this.startTime+this.lastChunkOffset,0,t.duration),this.lastChunkOffset+=r.buffer.duration,this.chunks.push(r))});this.device=t,this.stream=n,this.device.startListeningToRealtimeDataStream(n),this.device.addRealtimeListener((i,s)=>{this.receive(s)}),browser()==="Safari"||browser()==="IE"?this.changeAudioWireFormat("wav"):this.changeAudioWireFormat("opus");const r=window.AudioContext||window.webkitAudioContext;this.audioContext=new r}async play(){var t,n;((t=this.audioContext)==null?void 0:t.state)==="suspended"&&await((n=this.audioContext)==null?void 0:n.resume()),this.muted=!1}async pause(){await this.audioContext.suspend(),this.muted=!0}destroy(){this.device.stopListeningToRealtimeDataStream(this.stream)}createChunk(t){const{audioContext:n}=this;if(!n)return;const r=n.createBufferSource();return r.buffer=t,r.connect(n.destination),r.loop=!1,r.onended=i=>{this.chunks.splice(this.chunks.indexOf(r),1),this.chunks.length===0&&(this.isPlaying=!1)},r}changeAudioWireFormat(t){const{stream:n}=this;(async()=>await this.device.changeStreamAudioType(n.name,t))()}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"];window.Buffer=Buffer;let urlParams=new URLSearchParams("");typeof window<"u"&&(urlParams=new URLSearchParams(window.location.search));const urlDevice=urlParams.get("device");urlDevice&&Fleet.setDefaultDevice(urlDevice);const urlAuth=urlParams.get("auth");urlAuth&&Authentication.loginWithToken(urlAuth);const moduleName=urlParams.get("module");moduleName&&Authentication.listenForRefresh(),exports.App=App,exports.AudioPlayer=AudioPlayer,exports.Authentication=Authentication,exports.BinaryRequestDataChannel=BinaryRequestDataChannel,exports.CaptureStream=CaptureStream,exports.DataChannel=DataChannel,exports.Device=Device,exports.Fleet=Fleet,exports.IRtcSendConfiguration=distExports.IRtcSendConfiguration,exports.IRtcStreamMessage=distExports.IRtcStreamMessage,exports.IRtcStreamPayload=distExports.IRtcStreamPayload,exports.KeyValue=KeyValue,exports.Manipulator=Manipulator,exports.PeerDevice=PeerDevice,exports.SessionType=SessionType,exports.TextRequestDataChannel=TextRequestDataChannel,exports.accessLevels=accessLevels,exports.administrator=administrator,exports.aggregateByDateFunctions=aggregateByDateFunctions,exports.aggregateFunctionMap=aggregateFunctionMap,exports.aggregateFunctions=aggregateFunctions,exports.aggregateLevels=aggregateLevels,exports.annotationTypes=annotationTypes,exports.combineNumericAggregates=combineNumericAggregates,exports.combineNumericSetAggregates=combineNumericSetAggregates,exports.deserializeHash=deserializeHash,exports.eventTypes=eventTypes,exports.formatTimeFrameText=formatTimeFrameText,exports.getAverage=getAverage,exports.getCount=getCount,exports.getMax=getMax,exports.getMin=getMin,exports.getStandardDeviation=getStandardDeviation,exports.getSum=getSum,exports.getVariance=getVariance,exports.getZeroINumericSet=getZeroINumericSet,exports.healthStatuses=healthStatuses,exports.interventionTypes=interventionTypes,exports.operator=operator,exports.reduceNumericSetStreamAggregates=reduceNumericSetStreamAggregates,exports.reduceNumericStreamAggregates=reduceNumericStreamAggregates,exports.serializeHash=serializeHash,exports.severities=severities,exports.timeout=timeout,exports.vailableAggregationIntervals=vailableAggregationIntervals,exports.videoMimeTypes=videoMimeTypes,exports.viewer=viewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
58
|
+
`)+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return typeof e=="boolean"}function isNull(e){return e===null}function isNumber(e){return typeof e=="number"}function isString(e){return typeof e=="string"}function isUndefined(e){return e===void 0}function isRegExp(e){return isObject(e)&&objectToString(e)==="[object RegExp]"}function isObject(e){return typeof e=="object"&&e!==null}function isDate(e){return isObject(e)&&objectToString(e)==="[object Date]"}function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}function isFunction(e){return typeof e=="function"}function objectToString(e){return Object.prototype.toString.call(e)}function _extend(e,t){if(!t||!isObject(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BufferList(){this.head=null,this.tail=null,this.length=0}BufferList.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},BufferList.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},BufferList.prototype.concat=function(e){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;for(var t=Buffer.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var isBufferEncoding=Buffer.isEncoding||function(e){switch(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 assertEncoding(e){if(e&&!isBufferEncoding(e))throw new Error("Unknown encoding: "+e)}function StringDecoder(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0}StringDecoder.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,t="";continue}if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived),t+=e.toString(this.encoding,0,r);var r=t.length-1,i=t.charCodeAt(r);if(i>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,r)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Readable.ReadableState=ReadableState;var debug=debuglog("stream");inherits$1(Readable,EventEmitter);function prependListener(e,t,n){if(typeof e.prependListener=="function")return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function listenerCount(e,t){return e.listeners(t).length}function ReadableState(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Duplex&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,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.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new StringDecoder(e.encoding),this.encoding=e.encoding)}function Readable(e){if(!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),EventEmitter.call(this)}Readable.prototype.push=function(e,t){var n=this._readableState;return!n.objectMode&&typeof e=="string"&&(t=t||n.defaultEncoding,t!==n.encoding&&(e=Buffer.from(e,t),t="")),readableAddChunk(this,n,e,t,!1)},Readable.prototype.unshift=function(e){var t=this._readableState;return readableAddChunk(this,t,e,"",!0)},Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};function readableAddChunk(e,t,n,r,i){var s=chunkInvalid(t,n);if(s)e.emit("error",s);else if(n===null)t.reading=!1,onEofChunk(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var l=new Error("stream.push() after EOF");e.emit("error",l)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else{var c;t.decoder&&!i&&!r&&(n=t.decoder.write(n),c=!t.objectMode&&n.length===0),i||(t.reading=!1),c||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&emitReadable(e))),maybeReadMore(e,t)}else i||(t.reading=!1);return needMoreData(t)}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Readable.prototype.setEncoding=function(e){return this._readableState.decoder=new StringDecoder(e),this._readableState.encoding=e,this};var MAX_HWM=8388608;function computeNewHighWaterMark(e){return e>=MAX_HWM?e=MAX_HWM:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Readable.prototype.read=function(e){debug("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return debug("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?endReadable(this):emitReadable(this),null;if(e=howMuchToRead(e,t),e===0&&t.ended)return t.length===0&&endReadable(this),null;var r=t.needReadable;debug("need readable",r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,debug("length less than watermark",r)),t.ended||t.reading?(r=!1,debug("reading or ended",r)):r&&(debug("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(n,t)));var i;return e>0?i=fromList(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&endReadable(this)),i!==null&&this.emit("data",i),i};function chunkInvalid(e,t){var n=null;return!Buffer.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==void 0&&!e.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(debug("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){debug("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(debug("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}Readable.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e);break}r.pipesCount+=1,debug("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||t.end!==!1,s=i?o:f;r.endEmitted?nextTick(s):n.once("end",s),e.on("unpipe",l);function l(j){debug("onunpipe"),j===n&&f()}function o(){debug("onend"),e.end()}var c=pipeOnDrain(n);e.on("drain",c);var u=!1;function f(){debug("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",l),n.removeListener("end",o),n.removeListener("end",f),n.removeListener("data",w),u=!0,r.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}var E=!1;n.on("data",w);function w(j){debug("ondata"),E=!1;var F=e.write(j);F===!1&&!E&&((r.pipesCount===1&&r.pipes===e||r.pipesCount>1&&indexOf(r.pipes,e)!==-1)&&!u&&(debug("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,E=!0),n.pause())}function h(j){debug("onerror",j),R(),e.removeListener("error",h),listenerCount(e,"error")===0&&e.emit("error",j)}prependListener(e,"error",h);function g(){e.removeListener("finish",b),R()}e.once("close",g);function b(){debug("onfinish"),e.removeListener("close",g),R()}e.once("finish",b);function R(){debug("unpipe"),n.unpipe(e)}return e.emit("pipe",n),r.flowing||(debug("pipe resume"),n.resume()),e};function pipeOnDrain(e){return function(){var t=e._readableState;debug("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&e.listeners("data").length&&(t.flowing=!0,flow(e))}}Readable.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var s=indexOf(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},Readable.prototype.on=function(e,t){var n=EventEmitter.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var r=this._readableState;!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&emitReadable(this):nextTick(nReadingNextTick,this))}return n},Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(e){debug("readable nexttick read 0"),e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(debug("resume"),e.flowing=!0,resume(this,e)),this};function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,nextTick(resume_,e,t))}function resume_(e,t){t.reading||(debug("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(e){var t=e._readableState;for(debug("flow",t.flowing);t.flowing&&e.read()!==null;);}Readable.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(debug("wrapped end"),t.decoder&&!t.ended){var l=t.decoder.end();l&&l.length&&r.push(l)}r.push(null)}),e.on("data",function(l){if(debug("wrapped data"),t.decoder&&(l=t.decoder.write(l)),!(t.objectMode&&l==null)&&!(!t.objectMode&&(!l||!l.length))){var o=r.push(l);o||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(l){return function(){return e[l].apply(e,arguments)}}(i));var s=["error","close","destroy","pause","resume"];return forEach(s,function(l){e.on(l,r.emit.bind(r,l))}),r._read=function(l){debug("wrapped _read",l),n&&(n=!1,e.resume())},r},Readable._fromList=fromList;function fromList(e,t){if(t.length===0)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(t.decoder?n=t.buffer.join(""):t.buffer.length===1?n=t.buffer.head.data:n=t.buffer.concat(t.length),t.buffer.clear()):n=fromListPartial(e,t.buffer,t.decoder),n}function fromListPartial(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?r=t.shift():r=n?copyFromBufferString(e,t):copyFromBuffer(e,t),r}function copyFromBufferString(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var s=n.data,l=e>s.length?s.length:e;if(l===s.length?i+=s:i+=s.slice(0,e),e-=l,e===0){l===s.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(l));break}++r}return t.length-=r,i}function copyFromBuffer(e,t){var n=Buffer.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var s=r.data,l=e>s.length?s.length:e;if(s.copy(n,n.length-e,0,l),e-=l,e===0){l===s.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(l));break}++i}return t.length-=i,n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,nextTick(endReadableNT,t,e))}function endReadableNT(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function forEach(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function indexOf(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Writable.WritableState=WritableState,inherits$1(Writable,EventEmitter);function nop(){}function WriteReq(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function WritableState(e,t){Object.defineProperty(this,"buffer",{get:deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Duplex&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){onwrite(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function e(){for(var t=this.bufferedRequest,n=[];t;)n.push(t),t=t.next;return n};function Writable(e){if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev)),EventEmitter.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(e,t){var n=new Error("write after end");e.emit("error",n),nextTick(t,n)}function validChunk(e,t,n,r){var i=!0,s=!1;return n===null?s=new TypeError("May not write null values to stream"):!Buffer.isBuffer(n)&&typeof n!="string"&&n!==void 0&&!t.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),nextTick(r,s),i=!1),i}Writable.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),typeof n!="function"&&(n=nop),r.ended?writeAfterEnd(this,n):validChunk(this,r,e,n)&&(r.pendingcb++,i=writeOrBuffer(this,r,e,t,n)),i},Writable.prototype.cork=function(){var e=this._writableState;e.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function e(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function decodeChunk(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Buffer.from(t,n)),t}function writeOrBuffer(e,t,n,r,i){n=decodeChunk(t,n,r),Buffer.isBuffer(n)&&(r="buffer");var s=t.objectMode?1:n.length;t.length+=s;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var o=t.lastBufferedRequest;t.lastBufferedRequest=new WriteReq(n,r,i),o?o.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,s,n,r,i);return l}function doWrite(e,t,n,r,i,s,l){t.writelen=r,t.writecb=l,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function onwriteError(e,t,n,r,i){--t.pendingcb,n?nextTick(i,r):i(r),e._writableState.errorEmitted=!0,e.emit("error",r)}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(onwriteStateUpdate(n),t)onwriteError(e,n,r,t,i);else{var s=needFinish(n);!s&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&clearBuffer(e,n),r?nextTick(afterWrite,e,n,s,i):afterWrite(e,n,s,i)}}function afterWrite(e,t,n,r){n||onwriteDrain(e,t),t.pendingcb--,r(),finishMaybe(e,t)}function onwriteDrain(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),s=t.corkedRequestsFree;s.entry=n;for(var l=0;n;)i[l]=n,n=n.next,l+=1;doWrite(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 CorkedRequest(t)}else{for(;n;){var o=n.chunk,c=n.encoding,u=n.callback,f=t.objectMode?1:o.length;if(doWrite(e,t,!1,f,o,c,u),n=n.next,t.writing)break}n===null&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}Writable.prototype._write=function(e,t,n){n(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,n){var r=this._writableState;typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),!r.ending&&!r.finished&&endWritable(this,r,n)};function needFinish(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function prefinish(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function finishMaybe(e,t){var n=needFinish(t);return n&&(t.pendingcb===0?(prefinish(e,t),t.finished=!0,e.emit("finish")):prefinish(e,t)),n}function endWritable(e,t,n){t.ending=!0,finishMaybe(e,t),n&&(t.finished?nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}inherits$1(Duplex,Readable);for(var keys=Object.keys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);Readable.call(this,e),Writable.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||nextTick(onEndNT,this)}function onEndNT(e){e.end()}inherits$1(Transform,Duplex);function TransformState(e){this.afterTransform=function(t,n){return afterTransform(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function afterTransform(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,n!=null&&e.push(n),i(t);var s=e._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&e._read(s.highWaterMark)}function Transform(e){if(!(this instanceof Transform))return new Transform(e);Duplex.call(this,e),this._transformState=new TransformState(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(n){done(t,n)}):done(t)})}Transform.prototype.push=function(e,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,e,t)},Transform.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Transform.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Transform.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};function done(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}inherits$1(PassThrough,Transform);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);Transform.call(this,e)}PassThrough.prototype._transform=function(e,t,n){n(null,e)},inherits$1(Stream,EventEmitter),Stream.Readable=Readable,Stream.Writable=Writable,Stream.Duplex=Duplex,Stream.Transform=Transform,Stream.PassThrough=PassThrough,Stream.Stream=Stream;function Stream(){EventEmitter.call(this)}Stream.prototype.pipe=function(e,t){var n=this;function r(f){e.writable&&e.write(f)===!1&&n.pause&&n.pause()}n.on("data",r);function i(){n.readable&&n.resume&&n.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(n.on("end",l),n.on("close",o));var s=!1;function l(){s||(s=!0,e.end())}function o(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}function c(f){if(u(),EventEmitter.listenerCount(this,"error")===0)throw f}n.on("error",c),e.on("error",c);function u(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",o),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e};const msg={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function arraySet(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var s=0;s<r;s++)e[i+s]=t[n+s]}var Buf8=Uint8Array,Buf16=Uint16Array,Buf32=Int32Array,Z_FIXED$2=4,Z_BINARY$1=0,Z_TEXT$1=1,Z_UNKNOWN$2=2;function zero$1(e){for(var t=e.length;--t>=0;)e[t]=0}var STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);var static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);var _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);var base_length=new Array(LENGTH_CODES$1);zero$1(base_length);var base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function d_code(e){return e<256?_dist_code[e]:_dist_code[256+(e>>>7)]}function put_short(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function send_bits(e,t,n){e.bi_valid>Buf_size-n?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>Buf_size-e.bi_valid,e.bi_valid+=n-Buf_size):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function send_code(e,t,n){send_bits(e,n[t*2],n[t*2+1])}function bi_reverse(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function bi_flush(e){e.bi_valid===16?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function gen_bitlen(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length,u,f,E,w,h,g,b=0;for(w=0;w<=MAX_BITS$1;w++)e.bl_count[w]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<HEAP_SIZE$1;u++)f=e.heap[u],w=n[n[f*2+1]*2+1]+1,w>c&&(w=c,b++),n[f*2+1]=w,!(f>r)&&(e.bl_count[w]++,h=0,f>=o&&(h=l[f-o]),g=n[f*2],e.opt_len+=g*(w+h),s&&(e.static_len+=g*(i[f*2+1]+h)));if(b!==0){do{for(w=c-1;e.bl_count[w]===0;)w--;e.bl_count[w]--,e.bl_count[w+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(w=c;w!==0;w--)for(f=e.bl_count[w];f!==0;)E=e.heap[--u],!(E>r)&&(n[E*2+1]!==w&&(e.opt_len+=(w-n[E*2+1])*n[E*2],n[E*2+1]=w),f--)}}function gen_codes(e,t,n){var r=new Array(MAX_BITS$1+1),i=0,s,l;for(s=1;s<=MAX_BITS$1;s++)r[s]=i=i+n[s-1]<<1;for(l=0;l<=t;l++){var o=e[l*2+1];o!==0&&(e[l*2]=bi_reverse(r[o]++,o))}}function tr_static_init(){var e,t,n,r,i,s=new Array(MAX_BITS$1+1);for(n=0,r=0;r<LENGTH_CODES$1-1;r++)for(base_length[r]=n,e=0;e<1<<extra_lbits[r];e++)_length_code[n++]=r;for(_length_code[n-1]=r,i=0,r=0;r<16;r++)for(base_dist[r]=i,e=0;e<1<<extra_dbits[r];e++)_dist_code[i++]=r;for(i>>=7;r<D_CODES$1;r++)for(base_dist[r]=i<<7,e=0;e<1<<extra_dbits[r]-7;e++)_dist_code[256+i++]=r;for(t=0;t<=MAX_BITS$1;t++)s[t]=0;for(e=0;e<=143;)static_ltree[e*2+1]=8,e++,s[8]++;for(;e<=255;)static_ltree[e*2+1]=9,e++,s[9]++;for(;e<=279;)static_ltree[e*2+1]=7,e++,s[7]++;for(;e<=287;)static_ltree[e*2+1]=8,e++,s[8]++;for(gen_codes(static_ltree,L_CODES$1+1,s),e=0;e<D_CODES$1;e++)static_dtree[e*2+1]=5,static_dtree[e*2]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)}function init_block(e){var t;for(t=0;t<L_CODES$1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<D_CODES$1;t++)e.dyn_dtree[t*2]=0;for(t=0;t<BL_CODES$1;t++)e.bl_tree[t*2]=0;e.dyn_ltree[END_BLOCK*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function bi_windup(e){e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function copy_block(e,t,n,r){bi_windup(e),r&&(put_short(e,n),put_short(e,~n)),arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function smaller(e,t,n,r){var i=t*2,s=n*2;return e[i]<e[s]||e[i]===e[s]&&r[t]<=r[n]}function pqdownheap(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&smaller(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!smaller(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function compress_block(e,t,n){var r,i,s=0,l,o;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+s*2]<<8|e.pending_buf[e.d_buf+s*2+1],i=e.pending_buf[e.l_buf+s],s++,r===0?send_code(e,i,t):(l=_length_code[i],send_code(e,l+LITERALS$1+1,t),o=extra_lbits[l],o!==0&&(i-=base_length[l],send_bits(e,i,o)),r--,l=d_code(r),send_code(e,l,n),o=extra_dbits[l],o!==0&&(r-=base_dist[l],send_bits(e,r,o)));while(s<e.last_lit);send_code(e,END_BLOCK,t)}function build_tree(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems,l,o,c=-1,u;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,l=0;l<s;l++)n[l*2]!==0?(e.heap[++e.heap_len]=c=l,e.depth[l]=0):n[l*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=c,l=e.heap_len>>1;l>=1;l--)pqdownheap(e,n,l);u=s;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=o,n[u*2]=n[l*2]+n[o*2],e.depth[u]=(e.depth[l]>=e.depth[o]?e.depth[l]:e.depth[o])+1,n[l*2+1]=n[o*2+1]=u,e.heap[1]=u++,pqdownheap(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,t),gen_codes(n,c,e.bl_count)}function scan_tree(e,t,n){var r,i=-1,s,l=t[0*2+1],o=0,c=7,u=4;for(l===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)s=l,l=t[(r+1)*2+1],!(++o<c&&s===l)&&(o<u?e.bl_tree[s*2]+=o:s!==0?(s!==i&&e.bl_tree[s*2]++,e.bl_tree[REP_3_6*2]++):o<=10?e.bl_tree[REPZ_3_10*2]++:e.bl_tree[REPZ_11_138*2]++,o=0,i=s,l===0?(c=138,u=3):s===l?(c=6,u=3):(c=7,u=4))}function send_tree(e,t,n){var r,i=-1,s,l=t[0*2+1],o=0,c=7,u=4;for(l===0&&(c=138,u=3),r=0;r<=n;r++)if(s=l,l=t[(r+1)*2+1],!(++o<c&&s===l)){if(o<u)do send_code(e,s,e.bl_tree);while(--o!==0);else s!==0?(s!==i&&(send_code(e,s,e.bl_tree),o--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,o-3,2)):o<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,o-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,o-11,7));o=0,i=s,l===0?(c=138,u=3):s===l?(c=6,u=3):(c=7,u=4)}}function build_bl_tree(e){var t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=BL_CODES$1-1;t>=3&&e.bl_tree[bl_order[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function send_all_trees(e,t,n,r){var i;for(send_bits(e,t-257,5),send_bits(e,n-1,5),send_bits(e,r-4,4),i=0;i<r;i++)send_bits(e,e.bl_tree[bl_order[i]*2+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,n-1)}function detect_data_type(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Z_BINARY$1;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Z_TEXT$1;for(n=32;n<LITERALS$1;n++)if(e.dyn_ltree[n*2]!==0)return Z_TEXT$1;return Z_BINARY$1}var static_init_done=!1;function _tr_init(e){static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)}function _tr_stored_block(e,t,n,r){send_bits(e,(STORED_BLOCK<<1)+(r?1:0),3),copy_block(e,t,n,!0)}function _tr_align(e){send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)}function _tr_flush_block(e,t,n,r){var i,s,l=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$2&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),l=build_bl_tree(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&t!==-1?_tr_stored_block(e,t,n,r):e.strategy===Z_FIXED$2||s===i?(send_bits(e,(STATIC_TREES<<1)+(r?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(r?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),r&&bi_windup(e)}function _tr_tally(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(_length_code[n]+LITERALS$1+1)*2]++,e.dyn_dtree[d_code(t)*2]++),e.last_lit===e.lit_bufsize-1}function adler32(e,t,n,r){for(var i=e&65535|0,s=e>>>16&65535|0,l=0;n!==0;){l=n>2e3?2e3:n,n-=l;do i=i+t[r++]|0,s=s+i|0;while(--l);i%=65521,s%=65521}return i|s<<16|0}function makeTable(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var crcTable=makeTable();function crc32(e,t,n,r){var i=crcTable,s=r+n;e^=-1;for(var l=r;l<s;l++)e=e>>>8^i[(e^t[l])&255];return e^-1}var Z_NO_FLUSH$1=0,Z_PARTIAL_FLUSH$1=1,Z_FULL_FLUSH$1=3,Z_FINISH$2=4,Z_BLOCK$2=5,Z_OK$2=0,Z_STREAM_END$2=1,Z_STREAM_ERROR$2=-2,Z_DATA_ERROR$2=-3,Z_BUF_ERROR$2=-5,Z_DEFAULT_COMPRESSION$1=-1,Z_FILTERED$1=1,Z_HUFFMAN_ONLY$1=2,Z_RLE$1=3,Z_FIXED$1=4,Z_UNKNOWN$1=2,Z_DEFLATED$2=8,MAX_MEM_LEVEL=9,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3;function err(e,t){return e.msg=msg[t],t}function rank(e){return(e<<1)-(e>4?9:0)}function zero(e){for(var t=e.length;--t>=0;)e[t]=0}function flush_pending(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function flush_block_only(e,t){_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)}function put_byte(e,t){e.pending_buf[e.pending++]=t}function putShortMSB(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function read_buf(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,arraySet(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=adler32(e.adler,t,i,n):e.state.wrap===2&&(e.adler=crc32(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function longest_match(e,t){var n=e.max_chain_length,r=e.strstart,i,s,l=e.prev_length,o=e.nice_match,c=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,u=e.window,f=e.w_mask,E=e.prev,w=e.strstart+MAX_MATCH,h=u[r+l-1],g=u[r+l];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(u[i+l]!==g||u[i+l-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<w);if(s=MAX_MATCH-(w-r),r=w-MAX_MATCH,s>l){if(e.match_start=t,l=s,s>=o)break;h=u[r+l-1],g=u[r+l]}}while((t=E[t&f])>c&&--n!==0);return l<=e.lookahead?l:e.lookahead}function fill_window(e){var t=e.w_size,n,r,i,s,l;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-MIN_LOOKAHEAD)){arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);s+=t}if(e.strm.avail_in===0)break;if(r=read_buf(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=r,e.lookahead+e.insert>=MIN_MATCH)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+MIN_MATCH-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&e.strm.avail_in!==0)}function deflate_stored(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fill_window(e),e.lookahead===0&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,flush_block_only(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-MIN_LOOKAHEAD&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):(e.strstart>e.block_start&&(flush_block_only(e,!1),e.strm.avail_out===0),BS_NEED_MORE)}function deflate_fast(e,t){for(var n,r;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n)),e.match_length>=MIN_MATCH)if(r=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_slow(e,t){for(var n,r,i;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n),e.match_length<=5&&(e.strategy===Z_FILTERED$1||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-MIN_MATCH,r=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+MIN_MATCH-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}else if(e.match_available){if(r=_tr_tally(e,0,e.window[e.strstart-1]),r&&flush_block_only(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_rle(e,t){for(var n,r,i,s,l=e.window;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&t===Z_NO_FLUSH$1)return BS_NEED_MORE;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(i=e.strstart-1,r=l[i],r===l[++i]&&r===l[++i]&&r===l[++i])){s=e.strstart+MAX_MATCH;do;while(r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&i<s);e.match_length=MAX_MATCH-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(n=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_huff(e,t){for(var n;;){if(e.lookahead===0&&(fill_window(e),e.lookahead===0)){if(t===Z_NO_FLUSH$1)return BS_NEED_MORE;break}if(e.match_length=0,n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$2?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var configuration_table;configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(e){e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0}function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Buf16(HEAP_SIZE*2),this.dyn_dtree=new Buf16((2*D_CODES+1)*2),this.bl_tree=new Buf16((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Buf16(MAX_BITS+1),this.heap=new Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function deflateResetKeep(e){var t;return!e||!e.state?err(e,Z_STREAM_ERROR$2):(e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN$1,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?INIT_STATE:BUSY_STATE,e.adler=t.wrap===2?0:1,t.last_flush=Z_NO_FLUSH$1,_tr_init(t),Z_OK$2)}function deflateReset(e){var t=deflateResetKeep(e);return t===Z_OK$2&&lm_init(e.state),t}function deflateInit2(e,t,n,r,i,s){if(!e)return Z_STREAM_ERROR$2;var l=1;if(t===Z_DEFAULT_COMPRESSION$1&&(t=6),r<0?(l=0,r=-r):r>15&&(l=2,r-=16),i<1||i>MAX_MEM_LEVEL||n!==Z_DEFLATED$2||r<8||r>15||t<0||t>9||s<0||s>Z_FIXED$1)return err(e,Z_STREAM_ERROR$2);r===8&&(r=9);var o=new DeflateState;return e.state=o,o.strm=e,o.wrap=l,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+MIN_MATCH-1)/MIN_MATCH),o.window=new Buf8(o.w_size*2),o.head=new Buf16(o.hash_size),o.prev=new Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=(1+2)*o.lit_bufsize,o.level=t,o.strategy=s,o.method=n,deflateReset(e)}function deflate(e,t){var n,r,i,s;if(!e||!e.state||t>Z_BLOCK$2||t<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===FINISH_STATE&&t!==Z_FINISH$2)return err(e,e.avail_out===0?Z_BUF_ERROR$2:Z_STREAM_ERROR$2);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===INIT_STATE)if(r.wrap===2)e.adler=0,put_byte(r,31),put_byte(r,139),put_byte(r,8),r.gzhead?(put_byte(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),put_byte(r,r.gzhead.time&255),put_byte(r,r.gzhead.time>>8&255),put_byte(r,r.gzhead.time>>16&255),put_byte(r,r.gzhead.time>>24&255),put_byte(r,r.level===9?2:r.strategy>=Z_HUFFMAN_ONLY$1||r.level<2?4:0),put_byte(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(put_byte(r,r.gzhead.extra.length&255),put_byte(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=crc32(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=EXTRA_STATE):(put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,r.level===9?2:r.strategy>=Z_HUFFMAN_ONLY$1||r.level<2?4:0),put_byte(r,OS_CODE),r.status=BUSY_STATE);else{var l=Z_DEFLATED$2+(r.w_bits-8<<4)<<8,o=-1;r.strategy>=Z_HUFFMAN_ONLY$1||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,l|=o<<6,r.strstart!==0&&(l|=PRESET_DICT),l+=31-l%31,r.status=BUSY_STATE,putShortMSB(r,l),r.strstart!==0&&(putShortMSB(r,e.adler>>>16),putShortMSB(r,e.adler&65535)),e.adler=1}if(r.status===EXTRA_STATE)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),flush_pending(e),i=r.pending,r.pending===r.pending_buf_size));)put_byte(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=NAME_STATE)}else r.status=NAME_STATE;if(r.status===NAME_STATE)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),flush_pending(e),i=r.pending,r.pending===r.pending_buf_size)){s=1;break}r.gzindex<r.gzhead.name.length?s=r.gzhead.name.charCodeAt(r.gzindex++)&255:s=0,put_byte(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),s===0&&(r.gzindex=0,r.status=COMMENT_STATE)}else r.status=COMMENT_STATE;if(r.status===COMMENT_STATE)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),flush_pending(e),i=r.pending,r.pending===r.pending_buf_size)){s=1;break}r.gzindex<r.gzhead.comment.length?s=r.gzhead.comment.charCodeAt(r.gzindex++)&255:s=0,put_byte(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=crc32(e.adler,r.pending_buf,r.pending-i,i)),s===0&&(r.status=HCRC_STATE)}else r.status=HCRC_STATE;if(r.status===HCRC_STATE&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&flush_pending(e),r.pending+2<=r.pending_buf_size&&(put_byte(r,e.adler&255),put_byte(r,e.adler>>8&255),e.adler=0,r.status=BUSY_STATE)):r.status=BUSY_STATE),r.pending!==0){if(flush_pending(e),e.avail_out===0)return r.last_flush=-1,Z_OK$2}else if(e.avail_in===0&&rank(t)<=rank(n)&&t!==Z_FINISH$2)return err(e,Z_BUF_ERROR$2);if(r.status===FINISH_STATE&&e.avail_in!==0)return err(e,Z_BUF_ERROR$2);if(e.avail_in!==0||r.lookahead!==0||t!==Z_NO_FLUSH$1&&r.status!==FINISH_STATE){var c=r.strategy===Z_HUFFMAN_ONLY$1?deflate_huff(r,t):r.strategy===Z_RLE$1?deflate_rle(r,t):configuration_table[r.level].func(r,t);if((c===BS_FINISH_STARTED||c===BS_FINISH_DONE)&&(r.status=FINISH_STATE),c===BS_NEED_MORE||c===BS_FINISH_STARTED)return e.avail_out===0&&(r.last_flush=-1),Z_OK$2;if(c===BS_BLOCK_DONE&&(t===Z_PARTIAL_FLUSH$1?_tr_align(r):t!==Z_BLOCK$2&&(_tr_stored_block(r,0,0,!1),t===Z_FULL_FLUSH$1&&(zero(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),flush_pending(e),e.avail_out===0))return r.last_flush=-1,Z_OK$2}return t!==Z_FINISH$2?Z_OK$2:r.wrap<=0?Z_STREAM_END$2:(r.wrap===2?(put_byte(r,e.adler&255),put_byte(r,e.adler>>8&255),put_byte(r,e.adler>>16&255),put_byte(r,e.adler>>24&255),put_byte(r,e.total_in&255),put_byte(r,e.total_in>>8&255),put_byte(r,e.total_in>>16&255),put_byte(r,e.total_in>>24&255)):(putShortMSB(r,e.adler>>>16),putShortMSB(r,e.adler&65535)),flush_pending(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Z_OK$2:Z_STREAM_END$2)}function deflateEnd(e){var t;return!e||!e.state?Z_STREAM_ERROR$2:(t=e.state.status,t!==INIT_STATE&&t!==EXTRA_STATE&&t!==NAME_STATE&&t!==COMMENT_STATE&&t!==HCRC_STATE&&t!==BUSY_STATE&&t!==FINISH_STATE?err(e,Z_STREAM_ERROR$2):(e.state=null,t===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$2))}var BAD$1=30,TYPE$1=12;function inflate_fast(e,t){var n,r,i,s,l,o,c,u,f,E,w,h,g,b,R,j,F,M,A,d,C,$,q,y,m;n=e.state,r=e.next_in,y=e.input,i=r+(e.avail_in-5),s=e.next_out,m=e.output,l=s-(t-e.avail_out),o=s+(e.avail_out-257),c=n.dmax,u=n.wsize,f=n.whave,E=n.wnext,w=n.window,h=n.hold,g=n.bits,b=n.lencode,R=n.distcode,j=(1<<n.lenbits)-1,F=(1<<n.distbits)-1;e:do{g<15&&(h+=y[r++]<<g,g+=8,h+=y[r++]<<g,g+=8),M=b[h&j];t:for(;;){if(A=M>>>24,h>>>=A,g-=A,A=M>>>16&255,A===0)m[s++]=M&65535;else if(A&16){d=M&65535,A&=15,A&&(g<A&&(h+=y[r++]<<g,g+=8),d+=h&(1<<A)-1,h>>>=A,g-=A),g<15&&(h+=y[r++]<<g,g+=8,h+=y[r++]<<g,g+=8),M=R[h&F];n:for(;;){if(A=M>>>24,h>>>=A,g-=A,A=M>>>16&255,A&16){if(C=M&65535,A&=15,g<A&&(h+=y[r++]<<g,g+=8,g<A&&(h+=y[r++]<<g,g+=8)),C+=h&(1<<A)-1,C>c){e.msg="invalid distance too far back",n.mode=BAD$1;break e}if(h>>>=A,g-=A,A=s-l,C>A){if(A=C-A,A>f&&n.sane){e.msg="invalid distance too far back",n.mode=BAD$1;break e}if($=0,q=w,E===0){if($+=u-A,A<d){d-=A;do m[s++]=w[$++];while(--A);$=s-C,q=m}}else if(E<A){if($+=u+E-A,A-=E,A<d){d-=A;do m[s++]=w[$++];while(--A);if($=0,E<d){A=E,d-=A;do m[s++]=w[$++];while(--A);$=s-C,q=m}}}else if($+=E-A,A<d){d-=A;do m[s++]=w[$++];while(--A);$=s-C,q=m}for(;d>2;)m[s++]=q[$++],m[s++]=q[$++],m[s++]=q[$++],d-=3;d&&(m[s++]=q[$++],d>1&&(m[s++]=q[$++]))}else{$=s-C;do m[s++]=m[$++],m[s++]=m[$++],m[s++]=m[$++],d-=3;while(d>2);d&&(m[s++]=m[$++],d>1&&(m[s++]=m[$++]))}}else if(A&64){e.msg="invalid distance code",n.mode=BAD$1;break e}else{M=R[(M&65535)+(h&(1<<A)-1)];continue n}break}}else if(A&64)if(A&32){n.mode=TYPE$1;break e}else{e.msg="invalid literal/length code",n.mode=BAD$1;break e}else{M=b[(M&65535)+(h&(1<<A)-1)];continue t}break}}while(r<i&&s<o);d=g>>3,r-=d,g-=d<<3,h&=(1<<g)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=s<o?257+(o-s):257-(s-o),n.hold=h,n.bits=g}var MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function inflate_table(e,t,n,r,i,s,l,o){var c=o.bits,u=0,f=0,E=0,w=0,h=0,g=0,b=0,R=0,j=0,F=0,M,A,d,C,$,q=null,y=0,m,I=new Buf16(MAXBITS+1),_=new Buf16(MAXBITS+1),L=null,W=0,B,N,D;for(u=0;u<=MAXBITS;u++)I[u]=0;for(f=0;f<r;f++)I[t[n+f]]++;for(h=c,w=MAXBITS;w>=1&&I[w]===0;w--);if(h>w&&(h=w),w===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(E=1;E<w&&I[E]===0;E++);for(h<E&&(h=E),R=1,u=1;u<=MAXBITS;u++)if(R<<=1,R-=I[u],R<0)return-1;if(R>0&&(e===CODES$1||w!==1))return-1;for(_[1]=0,u=1;u<MAXBITS;u++)_[u+1]=_[u]+I[u];for(f=0;f<r;f++)t[n+f]!==0&&(l[_[t[n+f]]++]=f);if(e===CODES$1?(q=L=l,m=19):e===LENS$1?(q=lbase,y-=257,L=lext,W-=257,m=256):(q=dbase,L=dext,m=-1),F=0,f=0,u=E,$=s,g=h,b=0,d=-1,j=1<<h,C=j-1,e===LENS$1&&j>ENOUGH_LENS$1||e===DISTS$1&&j>ENOUGH_DISTS$1)return 1;for(;;){B=u-b,l[f]<m?(N=0,D=l[f]):l[f]>m?(N=L[W+l[f]],D=q[y+l[f]]):(N=32+64,D=0),M=1<<u-b,A=1<<g,E=A;do A-=M,i[$+(F>>b)+A]=B<<24|N<<16|D|0;while(A!==0);for(M=1<<u-1;F&M;)M>>=1;if(M!==0?(F&=M-1,F+=M):F=0,f++,--I[u]===0){if(u===w)break;u=t[n+l[f]]}if(u>h&&(F&C)!==d){for(b===0&&(b=h),$+=E,g=u-b,R=1<<g;g+b<w&&(R-=I[g+b],!(R<=0));)g++,R<<=1;if(j+=1<<g,e===LENS$1&&j>ENOUGH_LENS$1||e===DISTS$1&&j>ENOUGH_DISTS$1)return 1;d=F&C,i[d]=h<<24|g<<16|$-s|0}}return F!==0&&(i[$+F]=u-b<<24|64<<16|0),o.bits=h,0}var CODES=0,LENS=1,DISTS=2,Z_FINISH$1=4,Z_BLOCK$1=5,Z_TREES$1=6,Z_OK$1=0,Z_STREAM_END$1=1,Z_NEED_DICT$1=2,Z_STREAM_ERROR$1=-2,Z_DATA_ERROR$1=-3,Z_MEM_ERROR=-4,Z_BUF_ERROR$1=-5,Z_DEFLATED$1=8,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,SYNC=32,ENOUGH_LENS=852,ENOUGH_DISTS=592;function zswap32(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Buf16(320),this.work=new Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function inflateResetKeep(e){var t;return!e||!e.state?Z_STREAM_ERROR$1:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=HEAD,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Buf32(ENOUGH_LENS),t.distcode=t.distdyn=new Buf32(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1)}function inflateReset(e){var t;return!e||!e.state?Z_STREAM_ERROR$1:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e))}function inflateReset2(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Z_STREAM_ERROR$1:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))}function inflateInit2(e,t){var n,r;return e?(r=new InflateState,e.state=r,r.window=null,n=inflateReset2(e,t),n!==Z_OK$1&&(e.state=null),n):Z_STREAM_ERROR$1}var virgin=!0,lenfix,distfix;function fixedtables(e){if(virgin){var t;for(lenfix=new Buf32(512),distfix=new Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inflate_table(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inflate_table(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5}function updatewindow(e,t,n,r){var i,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Buf8(s.wsize)),r>=s.wsize?(arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),arraySet(s.window,t,n-r,i,s.wnext),r-=i,r?(arraySet(s.window,t,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}function inflate(e,t){var n,r,i,s,l,o,c,u,f,E,w,h,g,b,R=0,j,F,M,A,d,C,$,q,y=new Buf8(4),m,I,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),l=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,f=n.bits,E=o,w=c,q=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(n.wrap===0){n.mode=TYPEDO;break}for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(n.wrap&2&&u===35615){n.check=0,y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0),u=0,f=0,n.mode=FLAGS;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((u&15)!==Z_DEFLATED$1){e.msg="unknown compression method",n.mode=BAD;break}if(u>>>=4,f-=4,$=(u&15)+8,n.wbits===0)n.wbits=$;else if($>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<$,e.adler=n.check=1,n.mode=u&512?DICTID:TYPE,u=0,f=0;break;case FLAGS:for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(n.flags=u,(n.flags&255)!==Z_DEFLATED$1){e.msg="unknown compression method",n.mode=BAD;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0)),u=0,f=0,n.mode=TIME;case TIME:for(;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.head&&(n.head.time=u),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,y[2]=u>>>16&255,y[3]=u>>>24&255,n.check=crc32(n.check,y,4,0)),u=0,f=0,n.mode=OS;case OS:for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0)),u=0,f=0,n.mode=EXLEN;case EXLEN:if(n.flags&1024){for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&(y[0]=u&255,y[1]=u>>>8&255,n.check=crc32(n.check,y,2,0)),u=0,f=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(n.flags&1024&&(h=n.length,h>o&&(h=o),h&&(n.head&&($=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),arraySet(n.head.extra,r,s,h,$)),n.flags&512&&(n.check=crc32(n.check,r,h,s)),o-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(n.flags&2048){if(o===0)break e;h=0;do $=r[s+h++],n.head&&$&&n.length<65536&&(n.head.name+=String.fromCharCode($));while($&&h<o);if(n.flags&512&&(n.check=crc32(n.check,r,h,s)),o-=h,s+=h,$)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(n.flags&4096){if(o===0)break e;h=0;do $=r[s+h++],n.head&&$&&n.length<65536&&(n.head.comment+=String.fromCharCode($));while($&&h<o);if(n.flags&512&&(n.check=crc32(n.check,r,h,s)),o-=h,s+=h,$)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(n.flags&512){for(;f<16;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=BAD;break}u=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}e.adler=n.check=zswap32(u),u=0,f=0,n.mode=DICT;case DICT:if(n.havedict===0)return e.next_out=l,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=f,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK$1||t===Z_TREES$1)break e;case TYPEDO:if(n.last){u>>>=f&7,f-=f&7,n.mode=CHECK;break}for(;f<3;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}switch(n.last=u&1,u>>>=1,f-=1,u&3){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES$1){u>>>=2,f-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}u>>>=2,f-=2;break;case STORED:for(u>>>=f&7,f-=f&7;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=u&65535,u=0,f=0,n.mode=COPY_,t===Z_TREES$1)break e;case COPY_:n.mode=COPY;case COPY:if(h=n.length,h){if(h>o&&(h=o),h>c&&(h=c),h===0)break e;arraySet(i,r,s,h,l),o-=h,s+=h,c-=h,l+=h,n.length-=h;break}n.mode=TYPE;break;case TABLE:for(;f<14;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(n.nlen=(u&31)+257,u>>>=5,f-=5,n.ndist=(u&31)+1,u>>>=5,f-=5,n.ncode=(u&15)+4,u>>>=4,f-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;f<3;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.lens[_[n.have++]]=u&7,u>>>=3,f-=3}for(;n.have<19;)n.lens[_[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,m={bits:n.lenbits},q=inflate_table(CODES,n.lens,0,19,n.lencode,0,n.work,m),n.lenbits=m.bits,q){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;R=n.lencode[u&(1<<n.lenbits)-1],j=R>>>24,F=R>>>16&255,M=R&65535,!(j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(M<16)u>>>=j,f-=j,n.lens[n.have++]=M;else{if(M===16){for(I=j+2;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(u>>>=j,f-=j,n.have===0){e.msg="invalid bit length repeat",n.mode=BAD;break}$=n.lens[n.have-1],h=3+(u&3),u>>>=2,f-=2}else if(M===17){for(I=j+3;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=j,f-=j,$=0,h=3+(u&7),u>>>=3,f-=3}else{for(I=j+7;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=j,f-=j,$=0,h=11+(u&127),u>>>=7,f-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;h--;)n.lens[n.have++]=$}}if(n.mode===BAD)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,m={bits:n.lenbits},q=inflate_table(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,m),n.lenbits=m.bits,q){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,m={bits:n.distbits},q=inflate_table(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,m),n.distbits=m.bits,q){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES$1)break e;case LEN_:n.mode=LEN;case LEN:if(o>=6&&c>=258){e.next_out=l,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=f,inflate_fast(e,w),l=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,f=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;R=n.lencode[u&(1<<n.lenbits)-1],j=R>>>24,F=R>>>16&255,M=R&65535,!(j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(F&&!(F&240)){for(A=j,d=F,C=M;R=n.lencode[C+((u&(1<<A+d)-1)>>A)],j=R>>>24,F=R>>>16&255,M=R&65535,!(A+j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=A,f-=A,n.back+=A}if(u>>>=j,f-=j,n.back+=j,n.length=M,F===0){n.mode=LIT;break}if(F&32){n.back=-1,n.mode=TYPE;break}if(F&64){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=F&15,n.mode=LENEXT;case LENEXT:if(n.extra){for(I=n.extra;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;R=n.distcode[u&(1<<n.distbits)-1],j=R>>>24,F=R>>>16&255,M=R&65535,!(j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(!(F&240)){for(A=j,d=F,C=M;R=n.distcode[C+((u&(1<<A+d)-1)>>A)],j=R>>>24,F=R>>>16&255,M=R&65535,!(A+j<=f);){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}u>>>=A,f-=A,n.back+=A}if(u>>>=j,f-=j,n.back+=j,F&64){e.msg="invalid distance code",n.mode=BAD;break}n.offset=M,n.extra=F&15,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(I=n.extra;f<I;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(c===0)break e;if(h=w-c,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}h>n.wnext?(h-=n.wnext,g=n.wsize-h):g=n.wnext-h,h>n.length&&(h=n.length),b=n.window}else b=i,g=l-n.offset,h=n.length;h>c&&(h=c),c-=h,n.length-=h;do i[l++]=b[g++];while(--h);n.length===0&&(n.mode=LEN);break;case LIT:if(c===0)break e;i[l++]=n.length,c--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;f<32;){if(o===0)break e;o--,u|=r[s++]<<f,f+=8}if(w-=c,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?crc32(n.check,i,w,l-w):adler32(n.check,i,w,l-w)),w=c,(n.flags?u:zswap32(u))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}u=0,f=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;f<32;){if(o===0)break e;o--,u+=r[s++]<<f,f+=8}if(u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=BAD;break}u=0,f=0}n.mode=DONE;case DONE:q=Z_STREAM_END$1;break e;case BAD:q=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR;case SYNC:default:return Z_STREAM_ERROR$1}return e.next_out=l,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=f,(n.wsize||w!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,w-e.avail_out),E-=e.avail_in,w-=e.avail_out,e.total_in+=E,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?crc32(n.check,i,w,e.next_out-w):adler32(n.check,i,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(E===0&&w===0||t===Z_FINISH$1)&&q===Z_OK$1&&(q=Z_BUF_ERROR$1),q}function inflateEnd(e){if(!e||!e.state)return Z_STREAM_ERROR$1;var t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1}var NONE=0,DEFLATE=1,INFLATE=2,GZIP=3,GUNZIP=4,DEFLATERAW=5,INFLATERAW=6,UNZIP=7,Z_NO_FLUSH=0,Z_PARTIAL_FLUSH=1,Z_SYNC_FLUSH=2,Z_FULL_FLUSH=3,Z_FINISH=4,Z_BLOCK=5,Z_TREES=6,Z_OK=0,Z_STREAM_END=1,Z_NEED_DICT=2,Z_ERRNO=-1,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_BUF_ERROR=-5,Z_NO_COMPRESSION=0,Z_BEST_SPEED=1,Z_BEST_COMPRESSION=9,Z_DEFAULT_COMPRESSION=-1,Z_FILTERED=1,Z_HUFFMAN_ONLY=2,Z_RLE=3,Z_FIXED=4,Z_DEFAULT_STRATEGY=0,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN=2,Z_DEFLATED=8;function Zlib$1(e){if(e<DEFLATE||e>UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}Zlib$1.prototype.init=function(e,t,n,r,i){this.windowBits=e,this.level=t,this.memLevel=n,this.strategy=r,(this.mode===GZIP||this.mode===GUNZIP)&&(this.windowBits+=16),this.mode===UNZIP&&(this.windowBits+=32),(this.mode===DEFLATERAW||this.mode===INFLATERAW)&&(this.windowBits=-this.windowBits),this.strm=new ZStream;var s;switch(this.mode){case DEFLATE:case GZIP:case DEFLATERAW:s=deflateInit2(this.strm,this.level,Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case INFLATE:case GUNZIP:case INFLATERAW:case UNZIP:s=inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(s!==Z_OK){this._error(s);return}this.write_in_progress=!1,this.init_done=!0},Zlib$1.prototype.params=function(){throw new Error("deflateParams Not supported")},Zlib$1.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===NONE)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},Zlib$1.prototype.write=function(e,t,n,r,i,s,l){this._writeCheck(),this.write_in_progress=!0;var o=this;return browser$1$1.nextTick(function(){o.write_in_progress=!1;var c=o._write(e,t,n,r,i,s,l);o.callback(c[0],c[1]),o.pending_close&&o.close()}),this};function bufferSet(e,t){for(var n=0;n<e.length;n++)this[t+n]=e[n]}Zlib$1.prototype.writeSync=function(e,t,n,r,i,s,l){return this._writeCheck(),this._write(e,t,n,r,i,s,l)},Zlib$1.prototype._write=function(e,t,n,r,i,s,l){if(this.write_in_progress=!0,e!==Z_NO_FLUSH&&e!==Z_PARTIAL_FLUSH&&e!==Z_SYNC_FLUSH&&e!==Z_FULL_FLUSH&&e!==Z_FINISH&&e!==Z_BLOCK)throw new Error("Invalid flush value");t==null&&(t=new Buffer(0),r=0,n=0),i._set?i.set=i._set:i.set=bufferSet;var o=this.strm;o.avail_in=r,o.input=t,o.next_in=n,o.avail_out=l,o.output=i,o.next_out=s;var c;switch(this.mode){case DEFLATE:case GZIP:case DEFLATERAW:c=deflate(o,e);break;case UNZIP:case INFLATE:case GUNZIP:case INFLATERAW:c=inflate(o,e);break;default:throw new Error("Unknown mode "+this.mode)}return c!==Z_STREAM_END&&c!==Z_OK&&this._error(c),this.write_in_progress=!1,[o.avail_in,o.avail_out]},Zlib$1.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,this.mode===DEFLATE||this.mode===GZIP||this.mode===DEFLATERAW?deflateEnd(this.strm):inflateEnd(this.strm),this.mode=NONE};var status;Zlib$1.prototype.reset=function(){switch(this.mode){case DEFLATE:case DEFLATERAW:status=deflateReset(this.strm);break;case INFLATE:case INFLATERAW:status=inflateReset(this.strm);break}status!==Z_OK&&this._error(status)},Zlib$1.prototype._error=function(e){this.onerror(msg[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()};const _binding=Object.freeze(Object.defineProperty({__proto__:null,DEFLATE,DEFLATERAW,GUNZIP,GZIP,INFLATE,INFLATERAW,NONE,UNZIP,Z_BEST_COMPRESSION,Z_BEST_SPEED,Z_BINARY,Z_BLOCK,Z_BUF_ERROR,Z_DATA_ERROR,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED,Z_ERRNO,Z_FILTERED,Z_FINISH,Z_FIXED,Z_FULL_FLUSH,Z_HUFFMAN_ONLY,Z_NEED_DICT,Z_NO_COMPRESSION,Z_NO_FLUSH,Z_OK,Z_PARTIAL_FLUSH,Z_RLE,Z_STREAM_END,Z_STREAM_ERROR,Z_SYNC_FLUSH,Z_TEXT,Z_TREES,Z_UNKNOWN,Zlib:Zlib$1},Symbol.toStringTag,{value:"Module"}));function assert(e,t){if(!e)throw new Error(t)}var binding={};Object.keys(_binding).forEach(function(e){binding[e]=_binding[e]}),binding.Z_MIN_WINDOWBITS=8,binding.Z_MAX_WINDOWBITS=15,binding.Z_DEFAULT_WINDOWBITS=15,binding.Z_MIN_CHUNK=64,binding.Z_MAX_CHUNK=1/0,binding.Z_DEFAULT_CHUNK=16*1024,binding.Z_MIN_MEMLEVEL=1,binding.Z_MAX_MEMLEVEL=9,binding.Z_DEFAULT_MEMLEVEL=8,binding.Z_MIN_LEVEL=-1,binding.Z_MAX_LEVEL=9,binding.Z_DEFAULT_LEVEL=binding.Z_DEFAULT_COMPRESSION;var codes={Z_OK:binding.Z_OK,Z_STREAM_END:binding.Z_STREAM_END,Z_NEED_DICT:binding.Z_NEED_DICT,Z_ERRNO:binding.Z_ERRNO,Z_STREAM_ERROR:binding.Z_STREAM_ERROR,Z_DATA_ERROR:binding.Z_DATA_ERROR,Z_MEM_ERROR:binding.Z_MEM_ERROR,Z_BUF_ERROR:binding.Z_BUF_ERROR,Z_VERSION_ERROR:binding.Z_VERSION_ERROR};Object.keys(codes).forEach(function(e){codes[codes[e]]=e});function deflateSync(e,t){return zlibBufferSync(new Deflate(t),e)}function inflateSync(e,t){return zlibBufferSync(new Inflate(t),e)}function zlibBufferSync(e,t){if(typeof t=="string"&&(t=new Buffer(t)),!Buffer.isBuffer(t))throw new TypeError("Not a string or buffer");var n=binding.Z_FINISH;return e._processChunk(t,n)}function Deflate(e){if(!(this instanceof Deflate))return new Deflate(e);Zlib.call(this,e,binding.DEFLATE)}function Inflate(e){if(!(this instanceof Inflate))return new Inflate(e);Zlib.call(this,e,binding.INFLATE)}function Gzip(e){if(!(this instanceof Gzip))return new Gzip(e);Zlib.call(this,e,binding.GZIP)}function Gunzip(e){if(!(this instanceof Gunzip))return new Gunzip(e);Zlib.call(this,e,binding.GUNZIP)}function DeflateRaw(e){if(!(this instanceof DeflateRaw))return new DeflateRaw(e);Zlib.call(this,e,binding.DEFLATERAW)}function InflateRaw(e){if(!(this instanceof InflateRaw))return new InflateRaw(e);Zlib.call(this,e,binding.INFLATERAW)}function Unzip(e){if(!(this instanceof Unzip))return new Unzip(e);Zlib.call(this,e,binding.UNZIP)}function Zlib(e,t){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||binding.Z_DEFAULT_CHUNK,Transform.call(this,e),e.flush&&e.flush!==binding.Z_NO_FLUSH&&e.flush!==binding.Z_PARTIAL_FLUSH&&e.flush!==binding.Z_SYNC_FLUSH&&e.flush!==binding.Z_FULL_FLUSH&&e.flush!==binding.Z_FINISH&&e.flush!==binding.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||binding.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<binding.Z_MIN_CHUNK||e.chunkSize>binding.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<binding.Z_MIN_WINDOWBITS||e.windowBits>binding.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<binding.Z_MIN_LEVEL||e.level>binding.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<binding.Z_MIN_MEMLEVEL||e.memLevel>binding.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=binding.Z_FILTERED&&e.strategy!=binding.Z_HUFFMAN_ONLY&&e.strategy!=binding.Z_RLE&&e.strategy!=binding.Z_FIXED&&e.strategy!=binding.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!Buffer.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new binding.Zlib(t);var n=this;this._hadError=!1,this._binding.onerror=function(s,l){n._binding=null,n._hadError=!0;var o=new Error(s);o.errno=l,o.code=binding.codes[l],n.emit("error",o)};var r=binding.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(r=e.level);var i=binding.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(i=e.strategy),this._binding.init(e.windowBits||binding.Z_DEFAULT_WINDOWBITS,r,e.memLevel||binding.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new Buffer(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=i,this.once("end",this.close)}inherits$1(Zlib,Transform),Zlib.prototype.params=function(e,t,n){if(e<binding.Z_MIN_LEVEL||e>binding.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=binding.Z_FILTERED&&t!=binding.Z_HUFFMAN_ONLY&&t!=binding.Z_RLE&&t!=binding.Z_FIXED&&t!=binding.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var r=this;this.flush(binding.Z_SYNC_FLUSH,function(){r._binding.params(e,t),r._hadError||(r._level=e,r._strategy=t,n&&n())})}else browser$1$1.nextTick(n)},Zlib.prototype.reset=function(){return this._binding.reset()},Zlib.prototype._flush=function(e){this._transform(new Buffer(0),"",e)},Zlib.prototype.flush=function(e,t){var n=this._writableState;if((typeof e=="function"||e===void 0&&!t)&&(t=e,e=binding.Z_FULL_FLUSH),n.ended)t&&browser$1$1.nextTick(t);else if(n.ending)t&&this.once("end",t);else if(n.needDrain){var r=this;this.once("drain",function(){r.flush(t)})}else this._flushFlag=e,this.write(new Buffer(0),"",t)},Zlib.prototype.close=function(e){if(e&&browser$1$1.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;browser$1$1.nextTick(function(){t.emit("close")})}},Zlib.prototype._transform=function(e,t,n){var r,i=this._writableState,s=i.ending||i.ended,l=s&&(!e||i.length===e.length);if(!e===null&&!Buffer.isBuffer(e))return n(new Error("invalid input"));l?r=binding.Z_FINISH:(r=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||binding.Z_NO_FLUSH)),this._processChunk(e,r,n)},Zlib.prototype._processChunk=function(e,t,n){var r=e&&e.length,i=this._chunkSize-this._offset,s=0,l=this,o=typeof n=="function";if(!o){var c=[],u=0,f;this.on("error",function(b){f=b});do var E=this._binding.writeSync(t,e,s,r,this._buffer,this._offset,i);while(!this._hadError&&g(E[0],E[1]));if(this._hadError)throw f;var w=Buffer.concat(c,u);return this.close(),w}var h=this._binding.write(t,e,s,r,this._buffer,this._offset,i);h.buffer=e,h.callback=g;function g(b,R){if(!l._hadError){var j=i-R;if(assert(j>=0,"have should not go down"),j>0){var F=l._buffer.slice(l._offset,l._offset+j);l._offset+=j,o?l.push(F):(c.push(F),u+=F.length)}if((R===0||l._offset>=l._chunkSize)&&(i=l._chunkSize,l._offset=0,l._buffer=new Buffer(l._chunkSize)),R===0){if(s+=r-b,r=b,!o)return!0;var M=l._binding.write(t,e,s,r,l._buffer,l._offset,l._chunkSize);M.callback=g,M.buffer=e;return}if(!o)return!1;n()}}},inherits$1(Deflate,Zlib),inherits$1(Inflate,Zlib),inherits$1(Gzip,Zlib),inherits$1(Gunzip,Zlib),inherits$1(DeflateRaw,Zlib),inherits$1(InflateRaw,Zlib),inherits$1(Unzip,Zlib);function serializeHash(e){return deflateSync(Buffer.from(JSON.stringify(e),"utf8")).toString("base64")}function deserializeHash(e){return JSON.parse(inflateSync(Buffer.from(e,"base64")).toString("utf8"))}function stringToArrayBuffer(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function browser(){const{userAgent:e}=navigator;return e.includes("Firefox/")?"Firefox":e.includes("Edg/")?"Edge":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":e.includes("MSIE/")||e.includes("Trident/")?"IE":"Other"}const rtcAudioChunkStreamType="audio-chunk";class AudioPlayer{constructor(t,n){Re(this,"muted",!1);Re(this,"hasReceivedData",!1);Re(this,"audioContext");Re(this,"chunks",[]);Re(this,"isPlaying",!1);Re(this,"startTime",0);Re(this,"lastChunkOffset",0);Re(this,"bufferSize",3);Re(this,"receive",async t=>{var l;const n=(l=t.payload.audioChunk)==null?void 0:l.chunk_data;if(!n)return;this.hasReceivedData||(this.hasReceivedData=!0);const{audioContext:r,muted:i}=this;if(!r||t.header.stream.streamType!==rtcAudioChunkStreamType||i!==!1)return;const s=stringToArrayBuffer(n);try{await r.decodeAudioData(s.buffer,this.scheduleChunk)}catch(o){console.warn("Error decoding audio buffer, changing audioWireFormat on agent",{error:o}),this.changeAudioWireFormat("wav")}});Re(this,"scheduleChunk",t=>{const{audioContext:n}=this;if(!n)return;(this.chunks.length>this.bufferSize||this.isPlaying===!1)&&(this.chunks.forEach(i=>{i.stop()}),this.isPlaying=!1,this.chunks=[]);const r=this.createChunk(t);r&&r.buffer&&(this.isPlaying===!1&&(this.startTime=n.currentTime,this.lastChunkOffset=0,this.isPlaying=!0),r.start(this.startTime+this.lastChunkOffset,0,t.duration),this.lastChunkOffset+=r.buffer.duration,this.chunks.push(r))});this.device=t,this.stream=n,this.device.startListeningToRealtimeDataStream(n),this.device.addRealtimeListener((i,s)=>{this.receive(s)}),browser()==="Safari"||browser()==="IE"?this.changeAudioWireFormat("wav"):this.changeAudioWireFormat("opus");const r=window.AudioContext||window.webkitAudioContext;this.audioContext=new r}async play(){var t,n;((t=this.audioContext)==null?void 0:t.state)==="suspended"&&await((n=this.audioContext)==null?void 0:n.resume()),this.muted=!1}async pause(){await this.audioContext.suspend(),this.muted=!0}destroy(){this.device.stopListeningToRealtimeDataStream(this.stream)}createChunk(t){const{audioContext:n}=this;if(!n)return;const r=n.createBufferSource();return r.buffer=t,r.connect(n.destination),r.loop=!1,r.onended=i=>{this.chunks.splice(this.chunks.indexOf(r),1),this.chunks.length===0&&(this.isPlaying=!1)},r}changeAudioWireFormat(t){const{stream:n}=this;(async()=>await this.device.changeStreamAudioType(n.name,t))()}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"];window.Buffer=Buffer;let urlParams=new URLSearchParams("");typeof window<"u"&&(urlParams=new URLSearchParams(window.location.search));const urlDevice=urlParams.get("device");urlDevice&&Fleet.setDefaultDevice(urlDevice);const urlAuth=urlParams.get("auth");urlAuth&&Authentication.loginWithToken(urlAuth);const moduleName=urlParams.get("module");moduleName&&Authentication.listenForRefresh(),exports.App=App,exports.AudioPlayer=AudioPlayer,exports.Authentication=Authentication,exports.BinaryRequestDataChannel=BinaryRequestDataChannel,exports.CaptureStream=CaptureStream,exports.DataChannel=DataChannel,exports.Device=Device,exports.Fleet=Fleet,exports.IRtcSendConfiguration=distExports.IRtcSendConfiguration,exports.IRtcStreamMessage=distExports.IRtcStreamMessage,exports.IRtcStreamPayload=distExports.IRtcStreamPayload,exports.KeyValue=KeyValue,exports.Manipulator=Manipulator,exports.PeerDevice=PeerDevice,exports.SessionType=SessionType,exports.TextRequestDataChannel=TextRequestDataChannel,exports.accessLevels=accessLevels,exports.administrator=administrator,exports.aggregateByDateFunctions=aggregateByDateFunctions,exports.aggregateFunctionMap=aggregateFunctionMap,exports.aggregateFunctions=aggregateFunctions,exports.aggregateLevels=aggregateLevels,exports.annotationTypes=annotationTypes,exports.combineNumericAggregates=combineNumericAggregates,exports.combineNumericSetAggregates=combineNumericSetAggregates,exports.deserializeHash=deserializeHash,exports.eventTypes=eventTypes,exports.formatTimeFrameText=formatTimeFrameText,exports.getAverage=getAverage,exports.getCount=getCount,exports.getMax=getMax,exports.getMin=getMin,exports.getStandardDeviation=getStandardDeviation,exports.getSum=getSum,exports.getVariance=getVariance,exports.getZeroINumericSet=getZeroINumericSet,exports.healthStatuses=healthStatuses,exports.interventionTypes=interventionTypes,exports.operator=operator,exports.reduceNumericSetStreamAggregates=reduceNumericSetStreamAggregates,exports.reduceNumericStreamAggregates=reduceNumericStreamAggregates,exports.serializeHash=serializeHash,exports.severities=severities,exports.timeout=timeout,exports.vailableAggregationIntervals=vailableAggregationIntervals,exports.videoMimeTypes=videoMimeTypes,exports.viewer=viewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|