UNPKG

232 kBJavaScriptView Raw
1/*! For license information please see kuzzle.js.LICENSE.txt */
2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.KuzzleSDK=t():e.KuzzleSDK=t()}(self,(function(){return(()=>{var e={1045:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(6371),t),o(r(1076),t),o(r(147),t),o(r(4898),t),o(r(2140),t),o(r(3026),t),o(r(7885),t),o(r(896),t),o(r(1183),t),o(r(4545),t),o(r(3044),t),o(r(9235),t),o(r(5914),t),o(r(8285),t),o(r(7146),t),o(r(8779),t),o(r(8429),t)},6717:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=a(e),s=i[0],u=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),c=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,u=0,a=n-o;u<a;u+=s)i.push(l(e,u,u+s>a?a:u+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=i.length;s<u;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var o,i,s=[],u=t;u<n;u+=3)o=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5851:(e,t,r)=>{"use strict";const n=r(6717),o=r(9350),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=u(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);const o=function(e){if(a.isBuffer(e)){const t=0|p(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||V(e.length)?u(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),u(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=u(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,a.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function b(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,o){let i,s=1,u=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,u/=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<u;i++)if(l(e,i)===l(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===a)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){let r=!0;for(let n=0;n<a;n++)if(l(e,i+n)!==l(t,n)){r=!1;break}if(r)return i}return-1}function _(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(V(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return $(W(t,e.length-r),e,r,n)}function E(e,t,r,n){return $(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function O(e,t,r,n){return $(K(t),e,r,n)}function S(e,t,r,n){return $(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,u,a;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(a=(31&t)<<6|63&r,a>127&&(i=a));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(a=(15&t)<<12|(63&r)<<6|63&n,a>2047&&(a<55296||a>57343)&&(i=a));break;case 4:r=e[o+1],n=e[o+2],u=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&u)&&(a=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&u,a>65535&&a<1114112&&(i=a))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},a.allocUnsafe=function(e){return f(e)},a.allocUnsafeSlow=function(e){return f(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(J(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=a.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))o+t.length>n.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},a.byteLength=y,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):b.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,o){if(J(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const u=Math.min(i,s),l=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<u;++e)if(l[e]!==c[e]){i=l[e],s=c[e];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function x(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function j(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function q(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function z(e,t,r,n,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function A(e,t,r,n,o){N(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function L(e,t,r,n,o){N(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function M(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}a.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=X((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),a.prototype.readBigUInt64BE=X((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=X((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),a.prototype.readBigInt64BE=X((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||z(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||z(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=X((function(e,t=0){return A(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);z(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);z(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=X((function(e,t=0){return A(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=a.isBuffer(e)?e:a.from(e,n),s=i.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%s]}return this};const B={};function D(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function G(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Q(t,e.length-(r+1))}(n,o,i)}function F(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function Q(e,t,r){if(Math.floor(e)!==e)throw F(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=G(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=G(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},1403:e=>{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"}},1590:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(){void 0!==i&&e.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==t&&(i=function(r){e.removeListener(t,o),n(r)},e.once("error",i)),e.once(t,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,s,l;if(u(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=a(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=c.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)n(a,this,t);else{var l=a.length,c=p(a,l);for(r=0;r<l;++r)n(c[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9804:(e,t,r)=>{var n=r(5262),o=r(3149),i=e.exports;for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);function u(e){if("string"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}i.request=function(e,t){return e=u(e),n.request.call(this,e,t)},i.get=function(e,t){return e=u(e),n.get.call(this,e,t)}},9350:(e,t)=>{t.read=function(e,t,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,l=a>>1,c=-7,f=r?o-1:0,h=r?-1:1,d=e[t+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=u;c>0;i=256*i+e[t+f],f+=h,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+e[t+f],f+=h,c-=8);if(0===i)i=1-l;else{if(i===a)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),i-=l}return(d?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,u,a,l=8*i-o-1,c=(1<<l)-1,f=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),(t+=s+f>=1?h/a:h*Math.pow(2,1-f))*a>=2&&(s++,a/=2),s+f>=c?(u=0,s=c):s+f>=1?(u=(t*a-1)*Math.pow(2,o),s+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+d]=255&u,d+=p,u/=256,o-=8);for(s=s<<o|u,l+=o;l>0;e[r+d]=255&s,d+=p,s/=256,l-=8);e[r+d-p]|=128*y}},5153:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},2223:(e,t,r)=>{const n=r(5262),o=r(9804),i=r(3149);e.exports.request=(e,t,r={})=>new Promise(((s,u)=>{const a=i.parse(e),l=(e=>/^https/.test(e)?o:n)(e).request(Object.assign({},r,{method:t,hostname:a.hostname,port:a.port,path:a.path}),(e=>{let t=new Buffer.alloc(0);e.on("data",(e=>{t=Buffer.concat([t,e])})),e.on("end",(()=>{if(r.responseEncoding||!e.headers["content-type"]||/^(text|application\/json)/.test(e.headers["content-type"])){let n="utf-8";if(r.responseEncoding)n=r.responseEncoding;else if(e.headers["content-type"]){const t=/;\s*charset=(.*)/.exec(e.headers["content-type"]);t&&(n=t[1])}n=n.toLowerCase().replace(/^iso-?8859(-1)?$/,"latin1"),["ascii","base64","binary","hex","ucs2","ucs-2","utf16le","utf-16le","utf8","utf-8","latin1"].indexOf(n)<0&&(n="utf-8"),e.body=t.toString(n)}else e.body=t;s(e)})),e.on("error",u),e.on("timeout",(()=>u(l)))}));l.on("error",u),l.write(r.body||""),l.end()}));for(const t of["get","post","delete","put","head"])e.exports[t]=(r,n)=>e.exports.request(r,t,n)},4806:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,o){r=r||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var s=/\+/g;e=e.split(r);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var a=e.length;u>0&&a>u&&(a=u);for(var l=0;l<a;++l){var c,f,h,d,p=e[l].replace(s,"%20"),y=p.indexOf(n);y>=0?(c=p.substr(0,y),f=p.substr(y+1)):(c=p,f=""),h=decodeURIComponent(c),d=decodeURIComponent(f),t(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i}},5491:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,o){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var i=encodeURIComponent(t(o))+n;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(t(e))})).join(r):i+encodeURIComponent(t(e[o]))})).join(r):o?encodeURIComponent(t(o))+n+encodeURIComponent(t(e)):""}},4126:(e,t,r)=>{"use strict";t.decode=t.parse=r(4806),t.encode=t.stringify=r(5491)},352:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var o,i,s,u,a;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var l=("number"!=typeof a&&(a=0),a+".".length>(u=e).length||-1===u.indexOf(".",a)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(o," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},3653:(e,t,r)=>{"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(8817),i=r(2248);r(5153)(l,o);for(var s=n(i.prototype),u=0;u<s.length;u++){var a=s[u];l.prototype[a]||(l.prototype[a]=i.prototype[a])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},8210:(e,t,r)=>{"use strict";e.exports=o;var n=r(5500);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(5153)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},8817:(e,t,r)=>{"use strict";var n;e.exports=S,S.ReadableState=O,r(1590).EventEmitter;var o,i=function(e,t){return e.listeners(t).length},s=r(1773),u=r(5851).Buffer,a=global.Uint8Array||function(){},l=r(1758);o=l&&l.debuglog?l.debuglog("stream"):function(){};var c,f,h,d=r(2923),p=r(1735),y=r(9604).getHighWaterMark,b=r(352).q,v=b.ERR_INVALID_ARG_TYPE,m=b.ERR_STREAM_PUSH_AFTER_EOF,g=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5153)(S,s);var w=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function O(e,t,o){n=n||r(3653),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",o),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=r(1907).s),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(3653),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new O(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function T(e,t,r,n,i){o("readableAddChunk",t);var s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}}(e,l);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}(l,t)),s)w(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)l.endEmitted?w(e,new _):R(e,l,t,!0);else if(l.ended)w(e,new m);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!r?(t=l.decoder.write(t),l.objectMode||0!==t.length?R(e,l,t,!1):q(e,l)):R(e,l,t,!1)}else n||(l.reading=!1,q(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function R(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),q(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),T(this,e,t,!1,r)},S.prototype.unshift=function(e){return T(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){c||(c=r(1907).s);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var k=1073741824;function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(j,e))}function j(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function q(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function z(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function A(e){o("readable nexttick read 0"),e.read(0)}function L(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function D(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}S.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):x(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?I(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){w(this,new g("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===process.stdout||e===process.stderr?p:u;function u(){o("onend"),e.end()}n.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",p),r.removeListener("data",c),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||a())}));var a=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",a);var l=!1;function c(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==D(n.pipes,e))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){o("onerror",t),p(),e.removeListener("error",f),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",d),p()}function d(){o("onfinish"),e.removeListener("close",h),p()}function p(){o("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on(t,r)}(e,"error",f),e.once("close",h),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=D(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},S.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?x(this):n.reading||process.nextTick(A,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(z,this),r},S.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(z,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(L,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(4258)),f(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=I,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===h&&(h=r(7766)),h(S,e,t)})},5500:(e,t,r)=>{"use strict";e.exports=c;var n=r(352).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=n.ERR_TRANSFORM_WITH_LENGTH_0,a=r(3653);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new u;if(e._transformState.transforming)throw new s;return e.push(null)}r(5153)(c,a),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new o("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){a.prototype._destroy.call(this,e,(function(e){t(e)}))}},2248:(e,t,r)=>{"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=S,S.WritableState=O;var i,s={deprecate:r(6276)},u=r(1773),a=r(5851).Buffer,l=global.Uint8Array||function(){},c=r(1735),f=r(9604).getHighWaterMark,h=r(352).q,d=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_MULTIPLE_CALLBACK,b=h.ERR_STREAM_CANNOT_PIPE,v=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,g=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,w=c.errorOrDestroy;function E(){}function O(e,t,i){o=o||r(3653),e=e||{},"boolean"!=typeof i&&(i=t instanceof o),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(j,e,t),e._writableState.errorEmitted=!0,w(e,n)):(o(n),e._writableState.errorEmitted=!0,w(e,n),j(e,t))}(e,r,n,t,o);else{var i=P(r)||e.destroyed;i||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),n?process.nextTick(R,e,r,i,o):R(e,r,i,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function S(e){var t=this instanceof(o=o||r(3653));if(!t&&!i.call(S,this))return new S(e);this._writableState=new O(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function T(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function R(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),j(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var o=t.bufferedRequestCount,i=new Array(o),s=t.corkedRequestsFree;s.entry=r;for(var u=0,a=!0;r;)i[u]=r,r.isBuf||(a=!1),r=r.next,u+=1;i.allBuffers=a,T(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 n(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(T(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),j(e,t)}))}function j(e,t){var r=P(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5153)(S,u),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===S&&e&&e._writableState instanceof O}})):i=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new b)},S.prototype.write=function(e,t,r){var n,o=this._writableState,i=!1,s=!o.objectMode&&(n=e,a.isBuffer(n)||n instanceof l);return s&&!a.isBuffer(e)&&(e=function(e){return a.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new g;w(e,r),process.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(w(e,o),process.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,i=function(e,t,r,n,o,i){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r)),t}(t,n,o);n!==s&&(r=!0,o="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,u,n,o,i);return l}(this,o,s,e,t,r)),i},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,j(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=c.destroy,S.prototype._undestroy=c.undestroy,S.prototype._destroy=function(e,t){t(e)}},4258:(e,t,r)=>{"use strict";var n;function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=r(6591),s=Symbol("lastResolve"),u=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var r=e[h].read();null!==r&&(e[c]=null,e[s]=null,e[u]=null,t(d(r,!1)))}}function y(e){process.nextTick(p,e)}var b=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((o(n={get stream(){return this[h]},next:function(){var e=this,t=this[a];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[a]?r(e[a]):t(d(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(d(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[f])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),b);e.exports=function(e){var t,r=Object.create(v,(o(t={},h,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[h].read();n?(r[c]=null,r[s]=null,r[u]=null,e(d(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[c]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[c]=null,r[s]=null,r[u]=null,t(e)),void(r[a]=e)}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(d(void 0,!0))),r[l]=!0})),e.on("readable",y.bind(null,r)),r}},2923:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(5851).Buffer,u=r(1758).inspect,a=u&&u.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,o=s.allocUnsafe(e>>>0),i=this.head,u=0;i;)t=i.data,r=o,n=u,s.prototype.copy.call(t,r,n),u+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:a,value:function(e,t){return u(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&i(t.prototype,r),e}()},1735:e=>{"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var i=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?i._writableState?i._writableState.errorEmitted?process.nextTick(r,i):(i._writableState.errorEmitted=!0,process.nextTick(t,i,e)):process.nextTick(t,i,e):o?(process.nextTick(r,i),o(e)):process.nextTick(r,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},6591:(e,t,r)=>{"use strict";var n=r(352).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var s=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,a=function(){t.writable||c()},l=t._writableState&&t._writableState.finished,c=function(){u=!1,l=!0,s||i.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,u||i.call(t)},d=function(e){i.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):u&&!l?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},y=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",p),t.req?y():t.on("request",y)):u&&!t._writableState&&(t.on("end",a),t.on("close",a)),t.on("end",h),t.on("finish",c),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",a),t.removeListener("close",a),t.removeListener("finish",c),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},7766:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},5879:(e,t,r)=>{"use strict";var n,o=r(352).q,i=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function u(e){if(e)throw e}function a(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var u=!1;e.on("close",(function(){u=!0})),void 0===n&&(n=r(6591)),n(e,{readable:t,writable:o},(function(e){if(e)return i(e);u=!0,i()}));var a=!1;return function(t){if(!u&&!a)return a=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new s("pipe"))}}function l(e){e()}function c(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?u:e.pop():u}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,o=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var s=t.map((function(e,r){var i=r<t.length-1;return a(e,i,r>0,(function(e){n||(n=e),e&&s.forEach(l),i||(s.forEach(l),o(n))}))}));return t.reduce(c)}},9604:(e,t,r)=>{"use strict";var n=r(352).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},1773:(e,t,r)=>{e.exports=r(1590).EventEmitter},9970:(e,t,r)=>{(t=e.exports=r(8817)).Stream=t,t.Readable=t,t.Writable=r(2248),t.Duplex=r(3653),t.Transform=r(5500),t.PassThrough=r(8210),t.finished=r(6591),t.pipeline=r(5879)},5262:(e,t,r)=>{var n=r(69),o=r(4089),i=r(2786),s=r(1403),u=r(3149),a=t;a.request=function(e,t){e="string"==typeof e?u.parse(e):i(e);var r=-1===global.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||r,s=e.hostname||e.host,a=e.port,l=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?o+"//"+s:"")+(a?":"+a:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new n(e);return t&&c.on("response",t),c},a.get=function(e,t){var r=a.request(e,t);return r.end(),r},a.ClientRequest=n,a.IncomingMessage=o.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=s,a.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"]},5757:(e,t)=>{var r;function n(){if(void 0!==r)return r;if(global.XMLHttpRequest){r=new global.XMLHttpRequest;try{r.open("GET",global.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function o(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function i(e){return"function"==typeof e}t.fetch=i(global.fetch)&&i(global.ReadableStream),t.writableStream=i(global.WritableStream),t.abortController=i(global.AbortController),t.arraybuffer=t.fetch||o("arraybuffer"),t.msstream=!t.fetch&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!n()&&i(n().overrideMimeType),r=null},69:(e,t,r)=>{var n=r(5757),o=r(8008),i=r(4089),s=r(9970),u=i.IncomingMessage,a=i.readyStates,l=e.exports=function(e){var t,r=this;s.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+Buffer.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!n.abortController)o=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!n.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return n.fetch&&t?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&e?"arraybuffer":"text"}(t,o),r._fetchTimer=null,r.on("finish",(function(){r._onFinish()}))};o(l,s.Writable),l.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===c.indexOf(r)&&(this._headers[r]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,r=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(r["content-type"]||{}).value||""}));var i=[];if(Object.keys(r).forEach((function(e){var t=r[e].name,n=r[e].value;Array.isArray(n)?n.forEach((function(e){i.push([t,e])})):i.push([t,n])})),"fetch"===e._mode){var s=null;if(n.abortController){var u=new AbortController;s=u.signal,e._fetchAbortController=u,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=global.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}global.fetch(e._opts.url,{method:e._opts.method,headers:i,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:s}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){global.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var l=e._xhr=new global.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void process.nextTick((function(){e.emit("error",t)}))}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),i.forEach((function(e){l.setRequestHeader(e[0],e[1])})),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case a.LOADING:case a.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{l.send(o)}catch(t){return void process.nextTick((function(){e.emit("error",t)}))}}}},l.prototype._onXHRProgress=function(){var e=this;(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},l.prototype._write=function(e,t,r){this._body.push(e),r()},l.prototype.abort=l.prototype.destroy=function(){var e=this;e._destroyed=!0,global.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},l.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),s.Writable.prototype.end.call(this,e,t,r)},l.prototype.flushHeaders=function(){},l.prototype.setTimeout=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var c=["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"]},4089:(e,t,r)=>{var n=r(5757),o=r(8008),i=r(9970),s=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=t.IncomingMessage=function(e,t,r,o){var s=this;if(i.Readable.call(s),s._mode=r,s.headers={},s.rawHeaders=[],s.trailers={},s.rawTrailers=[],s.on("end",(function(){process.nextTick((function(){s.emit("close")}))})),"fetch"===r){if(s._fetchResponse=t,s.url=t.url,s.statusCode=t.status,s.statusMessage=t.statusText,t.headers.forEach((function(e,t){s.headers[t.toLowerCase()]=e,s.rawHeaders.push(t,e)})),n.writableStream){var u=new WritableStream({write:function(e){return new Promise((function(t,r){s._destroyed?r():s.push(Buffer.from(e))?t():s._resumeFetch=t}))},close:function(){global.clearTimeout(o),s._destroyed||s.push(null)},abort:function(e){s._destroyed||s.emit("error",e)}});try{return void t.body.pipeTo(u).catch((function(e){global.clearTimeout(o),s._destroyed||s.emit("error",e)}))}catch(e){}}var a=t.body.getReader();!function e(){a.read().then((function(t){if(!s._destroyed){if(t.done)return global.clearTimeout(o),void s.push(null);s.push(Buffer.from(t.value)),e()}})).catch((function(e){global.clearTimeout(o),s._destroyed||s.emit("error",e)}))}()}else if(s._xhr=e,s._pos=0,s.url=e.responseURL,s.statusCode=e.status,s.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===s.headers[r]&&(s.headers[r]=[]),s.headers[r].push(t[2])):void 0!==s.headers[r]?s.headers[r]+=", "+t[2]:s.headers[r]=t[2],s.rawHeaders.push(t[1],t[2])}})),s._charset="x-user-defined",!n.overrideMimeType){var l=s.rawHeaders["mime-type"];if(l){var c=l.match(/;\s*charset=([^;])(;|$)/);c&&(s._charset=c[1].toLowerCase())}s._charset||(s._charset="utf-8")}};o(u,i.Readable),u.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},u.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text":if((r=t.responseText).length>e._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var o=Buffer.alloc(n.length),i=0;i<n.length;i++)o[i]=255&n.charCodeAt(i);e.push(o)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==s.DONE||!t.response)break;r=t.response,e.push(Buffer.from(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==s.LOADING||!r)break;e.push(Buffer.from(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==s.LOADING)break;var u=new global.MSStreamReader;u.onprogress=function(){u.result.byteLength>e._pos&&(e.push(Buffer.from(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===s.DONE&&"ms-stream"!==e._mode&&e.push(null)}},8008:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},1907:(e,t,r)=>{"use strict";var n=r(3094).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=a,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function a(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3094:(e,t,r)=>{var n=r(5851),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},1749:function(e,t,r){var n;e=r.nmd(e),function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof global&&global;i.global!==i&&i.window!==i&&i.self;var s,u=2147483647,a=36,l=/^xn--/,c=/[^\x20-\x7E]/,f=/[\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"},d=Math.floor,p=String.fromCharCode;function y(e){throw RangeError(h[e])}function b(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function v(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+b((e=e.replace(f,".")).split("."),t).join(".")}function m(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function g(e){return b(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=a)e=d(e/35);return d(n+36*e/(e+38))}function E(e){var t,r,n,o,i,s,l,c,f,h,p,b=[],v=e.length,m=0,_=128,E=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&y("not-basic"),b.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<v;){for(i=m,s=1,l=a;o>=v&&y("invalid-input"),((c=(p=e.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:a)>=a||c>d((u-m)/s))&&y("overflow"),m+=c*s,!(c<(f=l<=E?1:l>=E+26?26:l-E));l+=a)s>d(u/(h=a-f))&&y("overflow"),s*=h;E=w(m-i,t=b.length+1,0==i),d(m/t)>u-_&&y("overflow"),_+=d(m/t),m%=t,b.splice(m++,0,_)}return g(b)}function O(e){var t,r,n,o,i,s,l,c,f,h,b,v,g,E,O,S=[];for(v=(e=m(e)).length,t=128,r=0,i=72,s=0;s<v;++s)(b=e[s])<128&&S.push(p(b));for(n=o=S.length,o&&S.push("-");n<v;){for(l=u,s=0;s<v;++s)(b=e[s])>=t&&b<l&&(l=b);for(l-t>d((u-r)/(g=n+1))&&y("overflow"),r+=(l-t)*g,t=l,s=0;s<v;++s)if((b=e[s])<t&&++r>u&&y("overflow"),b==t){for(c=r,f=a;!(c<(h=f<=i?1:f>=i+26?26:f-i));f+=a)O=c-h,E=a-h,S.push(p(_(h+O%E,0))),c=d(O/E);S.push(p(_(c,0))),i=w(r,g,n==o),r=0,++n}++r,++t}return S.join("")}s={version:"1.3.2",ucs2:{decode:m,encode:g},decode:E,encode:O,toASCII:function(e){return v(e,(function(e){return c.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return v(e,(function(e){return l.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},3149:(e,t,r)=>{"use strict";var n=r(1749),o=r(4249);function i(){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=g,t.resolve=function(e,t){return g(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?g(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=g(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var s=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),f=["%","/","?",";","#"].concat(c),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(4126);function g(e,t,r){if(e&&o.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),u=-1!==i&&i<e.indexOf("#")?"?":"#",l=e.split(u);l[0]=l[0].replace(/\\/g,"/");var g=e=l.join(u);if(g=g.trim(),!r&&1===e.split("#").length){var _=a.exec(g);if(_)return this.path=g,this.href=g,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=s.exec(g);if(w){var E=(w=w[0]).toLowerCase();this.protocol=E,g=g.substr(w.length)}if(r||w||g.match(/^\/\/[^@\/]+@[^@\/]+/)){var O="//"===g.substr(0,2);!O||w&&b[w]||(g=g.substr(2),this.slashes=!0)}if(!b[w]&&(O||w&&!v[w])){for(var S,T,R=-1,k=0;k<h.length;k++)-1!==(P=g.indexOf(h[k]))&&(-1===R||P<R)&&(R=P);for(-1!==(T=-1===R?g.lastIndexOf("@"):g.lastIndexOf("@",R))&&(S=g.slice(0,T),g=g.slice(T+1),this.auth=decodeURIComponent(S)),R=-1,k=0;k<f.length;k++){var P;-1!==(P=g.indexOf(f[k]))&&(-1===R||P<R)&&(R=P)}-1===R&&(R=g.length),this.host=g.slice(0,R),g=g.slice(R),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var j=this.hostname.split(/\./),q=(k=0,j.length);k<q;k++){var C=j[k];if(C&&!C.match(d)){for(var z="",A=0,L=C.length;A<L;A++)C.charCodeAt(A)>127?z+="x":z+=C[A];if(!z.match(d)){var M=j.slice(0,k),I=j.slice(k+1),U=C.match(p);U&&(M.push(U[1]),I.unshift(U[2])),I.length&&(g="/"+I.join(".")+g),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+B,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!y[E])for(k=0,q=c.length;k<q;k++){var G=c[k];if(-1!==g.indexOf(G)){var N=encodeURIComponent(G);N===G&&(N=escape(G)),g=g.split(G).join(N)}}var F=g.indexOf("#");-1!==F&&(this.hash=g.substr(F),g=g.slice(0,F));var Q=g.indexOf("?");if(-1!==Q?(this.search=g.substr(Q),this.query=g.substr(Q+1),t&&(this.query=m.parse(this.query)),g=g.slice(0,Q)):t&&(this.search="",this.query={}),g&&(this.pathname=g),v[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var H=this.search||"";this.path=B+H}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(s=m.stringify(this.query));var u=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),u&&"?"!==u.charAt(0)&&(u="?"+u),t+i+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(u=u.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),s=0;s<n.length;s++){var u=n[s];r[u]=this[u]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(r[c]=e[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var d=f[h];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||b[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",m=r.search||"";r.path=y+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||g||r.host&&e.pathname,E=w,O=r.pathname&&r.pathname.split("/")||[],S=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(S&&(r.hostname="",r.port=null,r.host&&(""===O[0]?O[0]=r.host:O.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),w=w&&(""===p[0]||""===O[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,O=p;else if(p.length)O||(O=[]),O.pop(),O=O.concat(p),r.search=e.search,r.query=e.query;else if(!o.isNullOrUndefined(e.search))return S&&(r.hostname=r.host=O.shift(),(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift())),r.search=e.search,r.query=e.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!O.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=O.slice(-1)[0],R=(r.host||e.host||O.length>1)&&("."===T||".."===T)||""===T,k=0,P=O.length;P>=0;P--)"."===(T=O[P])?O.splice(P,1):".."===T?(O.splice(P,1),k++):k&&(O.splice(P,1),k--);if(!w&&!E)for(;k--;k)O.unshift("..");!w||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),R&&"/"!==O.join("/").substr(-1)&&O.push("");var x,j=""===O[0]||O[0]&&"/"===O[0].charAt(0);return S&&(r.hostname=r.host=j?"":O.length?O.shift():"",(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift())),(w=w||r.host&&O.length)&&!j&&O.unshift(""),O.length?r.pathname=O.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},4249:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},6276:e=>{function t(e){try{if(!global.localStorage)return!1}catch(e){return!1}var t=global.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,r){if(t("noDeprecation"))return e;var n=!1;return function(){if(!n){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return e.apply(this,arguments)}}},3301:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},2786:e=>{e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var o in n)t.call(n,o)&&(e[o]=n[o])}return e};var t=Object.prototype.hasOwnProperty},6371:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?l(e):t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Kuzzle=void 0;var f=r(4898),h=r(9235),d=r(4134),p=r(8285),y=r(7146),b=r(8779),v=r(8429),m=r(1994),g=r(7127),_=r(3318),w=r(4957),E=r(8964),O=["connected","discarded","disconnected","loginAttempt","networkError","offlineQueuePush","offlineQueuePop","queryError","reconnected","tokenExpired"],S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(R,e);var t,r,f,S,T=(f=R,S=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(f);if(S){var r=c(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function R(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o(this,R),t=T.call(this),null==e)throw new Error('"protocol" argument missing');for(var i=0,s=["addListener","isReady","query"];i<s.length;i++){var u=s[i];if("function"!=typeof e[u])throw new Error('Protocol instance must implement a "'.concat(u,'" method'))}return t.protocol=e,t._protectedEvents={connected:{},error:{},disconnected:{},reconnected:{},tokenExpired:{},loginAttempt:{}},t.autoResubscribe="boolean"!=typeof r.autoResubscribe||r.autoResubscribe,t.eventTimeout="number"==typeof r.eventTimeout?r.eventTimeout:200,t.sdkVersion="7.4.4",t.sdkName="js@".concat(t.sdkVersion),t.volatile="object"===n(r.volatile)?r.volatile:{},t.useController(h.AuthController,"auth"),t.useController(d.BulkController,"bulk"),t.useController(p.CollectionController,"collection"),t.useController(y.DocumentController,"document"),t.useController(b.IndexController,"index"),t.useController(_.MemoryStorageController,"ms"),t.useController(v.RealtimeController,"realtime"),t.useController(g.SecurityController,"security"),t.useController(m.ServerController,"server"),t._offlineQueue=[],t._autoQueue="boolean"==typeof r.autoQueue&&r.autoQueue,t._autoReplay="boolean"==typeof r.autoReplay&&r.autoReplay,t._offlineQueueLoader="function"==typeof r.offlineQueueLoader?r.offlineQueueLoader:null,t._queueFilter="function"==typeof r.queueFilter?r.queueFilter:null,t._queueMaxSize="number"==typeof r.queueMaxSize?r.queueMaxSize:500,t._queueTTL="number"==typeof r.queueTTL?r.queueTTL:12e4,t._replayInterval="number"==typeof r.replayInterval?r.replayInterval:10,t._tokenExpiredInterval="number"==typeof r.tokenExpiredInterval?r.tokenExpiredInterval:1e3,"auto"===r.offlineMode&&(t._autoQueue=!0,t._autoReplay=!0),t._queuing=!1,t._lastTokenExpired=null,a(t,E.proxify(l(t),{seal:!0,name:"kuzzle",exposeApi:!0}))}return t=R,(r=[{key:"emit",value:function(e){var t=Date.now(),r=this._protectedEvents[e];if(r){if(r.lastEmitted&&r.lastEmitted>t-this.eventTimeout)return!1;r.lastEmitted=t}for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return this._superEmit.apply(this,[e].concat(o))}},{key:"_superEmit",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=s(c(R.prototype),"emit",this)).call.apply(t,[this,e].concat(n))}},{key:"connect",value:function(){var e=this;return this.protocol.isReady()?Promise.resolve():(this.autoQueue&&this.startQueuing(),this.protocol.addListener("queryError",(function(t,r){return e.emit("queryError",t,r)})),this.protocol.addListener("tokenExpired",(function(){return e.tokenExpired()})),this.protocol.addListener("connect",(function(){e.autoQueue&&e.stopQueuing(),e.autoReplay&&e.playQueue(),e.emit("connected")})),this.protocol.addListener("networkError",(function(t){e.autoQueue&&e.startQueuing(),e.emit("networkError",t)})),this.protocol.addListener("disconnect",(function(){e.emit("disconnected")})),this.protocol.addListener("reconnect",(function(){if(e.autoQueue&&e.stopQueuing(),e.autoReplay&&e.playQueue(),e.auth.authenticationToken)return e.auth.checkToken().then((function(t){t.valid||(e.auth.authenticationToken=null)})).catch((function(){e.auth.authenticationToken=null})).then((function(){return e.emit("reconnected")}));e.emit("reconnected")})),this.protocol.addListener("discarded",(function(t){return e.emit("discarded",t)})),this.protocol.connect())}},{key:"addListener",value:function(e,t){if(-1===O.indexOf(e))throw new Error("[".concat(e,"] is not a known event. Known events: ").concat(O.toString()));return this._superAddListener(e,t)}},{key:"_superAddListener",value:function(e,t){return s(c(R.prototype),"addListener",this).call(this,e,t)}},{key:"flushQueue",value:function(){return this._offlineQueue=[],this}},{key:"disconnect",value:function(){this.protocol.close()}},{key:"query",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==n(t)||Array.isArray(t))throw new Error("Kuzzle.query: Invalid request: ".concat(JSON.stringify(t)));if("object"!==n(r)||Array.isArray(r))throw new Error('Kuzzle.query: Invalid "options" argument: '.concat(JSON.stringify(r)));if(t.requestId||(t.requestId=w.uuidv4()),void 0===t.refresh&&void 0!==r.refresh&&(t.refresh=r.refresh),t.volatile){if("object"!==n(t.volatile)||Array.isArray(t.volatile))throw new Error("Kuzzle.query: Invalid volatile argument received: ".concat(JSON.stringify(t.volatile)))}else t.volatile=this.volatile;for(var o=0,i=Object.keys(this.volatile);o<i.length;o++){var s=i[o];void 0===t.volatile[s]&&(t.volatile[s]=this.volatile[s])}t.volatile.sdkInstanceId=t.volatile.sdkInstanceId||this.protocol.id,t.volatile.sdkName=t.volatile.sdkName||this.sdkName,this.auth.authenticateRequest(t);var u=!0;return r&&!1===r.queuable&&(u=!1),this.queueFilter&&(u=u&&this.queueFilter(t)),this._queuing?u?(this._cleanQueue(),this.emit("offlineQueuePush",{request:t}),new Promise((function(r,n){e.offlineQueue.push({resolve:r,reject:n,request:t,ts:Date.now()})}))):(this.emit("discarded",{request:t}),Promise.reject(new Error("Unable to execute request: not connected to a Kuzzle server.\nDiscarded request: ".concat(JSON.stringify(t))))):this.protocol.query(t,r)}},{key:"startQueuing",value:function(){return this._queuing=!0,this}},{key:"stopQueuing",value:function(){return this._queuing=!1,this}},{key:"playQueue",value:function(){return this.protocol.isReady()&&(this._cleanQueue(),this._dequeue()),this}},{key:"tokenExpired",value:function(){var e=Date.now();e-this._lastTokenExpired<this.tokenExpiredInterval||(this._lastTokenExpired=e,this.emit("tokenExpired"))}},{key:"useController",value:function(e,t){if(!(t&&t.length>0))throw new Error("You must provide a valid accessor.");if(this.__proxy__?this.__proxy__.hasProp(t):this[t])throw new Error("There is already a controller with the accessor '".concat(t,"'. Please use another one."));var r=new e(this);if(!(r.name&&r.name.length>0))throw new Error("Controllers must have a name.");if(r.kuzzle!==this)throw new Error("You must pass the Kuzzle SDK instance to the parent constructor.");return this.__proxy__&&this.__proxy__.registerProp(t),this[t]=r,this}},{key:"_checkPropertyType",value:function(e,t,r){if("array"===t?!Array.isArray(r):n(r)!==t)throw new Error("Expected ".concat(e," to be a ").concat(t,", ").concat(n(r)," received"))}},{key:"_cleanQueue",value:function(){var e=this,t=Date.now(),r=-1;this.queueTTL>0&&(this.offlineQueue.forEach((function(n,o){n.ts<t-e.queueTTL&&(r=o)})),-1!==r&&this.offlineQueue.splice(0,r+1).forEach((function(t){e.emit("offlineQueuePop",t.query)}))),this.queueMaxSize>0&&this.offlineQueue.length>this.queueMaxSize&&this.offlineQueue.splice(0,this.offlineQueue.length-this.queueMaxSize).forEach((function(t){e.emit("offlineQueuePop",t.query)}))}},{key:"_dequeue",value:function(){var e=this,t={},r=function t(){e.offlineQueue.length>0&&(e.protocol.query(e.offlineQueue[0].request).then(e.offlineQueue[0].resolve).catch(e.offlineQueue[0].reject),e.emit("offlineQueuePop",e.offlineQueue.shift()),setTimeout((function(){t()}),Math.max(0,e.replayInterval)))};if(this.offlineQueueLoader){if("function"!=typeof this.offlineQueueLoader)throw new Error("Invalid value for offlineQueueLoader property. Expected: function. Got: "+n(this.offlineQueueLoader));return Promise.resolve().then((function(){return e.offlineQueueLoader()})).then((function(o){if(!Array.isArray(o))throw new Error("Invalid value returned by the offlineQueueLoader function. Expected: array. Got: "+n(o));e._offlineQueue=o.concat(e.offlineQueue).filter((function(e){if(!e.request||void 0===e.request.requestId||!e.request.action||!e.request.controller)throw new Error("Invalid offline queue request. One or more missing properties: requestId, action, controller.");return!Object.prototype.hasOwnProperty.call(t,e.request.requestId)&&(t[e.request.requestId]=!0)})),r()}))}r()}},{key:"authenticated",get:function(){return this.auth.authenticationToken&&!this.auth.authenticationToken.expired}},{key:"autoQueue",get:function(){return this._autoQueue},set:function(e){this._checkPropertyType("_autoQueue","boolean",e),this._autoQueue=e}},{key:"autoReconnect",get:function(){return this.protocol.autoReconnect},set:function(e){this._checkPropertyType("autoReconnect","boolean",e),this.protocol.autoReconnect=e}},{key:"autoReplay",get:function(){return this._autoReplay},set:function(e){this._checkPropertyType("_autoReplay","boolean",e),this._autoReplay=e}},{key:"connected",get:function(){return this.protocol.connected}},{key:"host",get:function(){return this.protocol.host}},{key:"jwt",get:function(){return this.auth.authenticationToken?this.auth.authenticationToken.encodedJwt:null},set:function(e){this.auth.authenticationToken=e}},{key:"offlineQueue",get:function(){return this._offlineQueue}},{key:"offlineQueueLoader",get:function(){return this._offlineQueueLoader},set:function(e){this._checkPropertyType("_offlineQueueLoader","function",e),this._offlineQueueLoader=e}},{key:"port",get:function(){return this.protocol.port}},{key:"queueFilter",get:function(){return this._queueFilter},set:function(e){this._checkPropertyType("_queueFilter","function",e),this._queueFilter=e}},{key:"queueMaxSize",get:function(){return this._queueMaxSize},set:function(e){this._checkPropertyType("_queueMaxSize","number",e),this._queueMaxSize=e}},{key:"queueTTL",get:function(){return this._queueTTL},set:function(e){this._checkPropertyType("_queueTTL","number",e),this._queueTTL=e}},{key:"reconnectionDelay",get:function(){return this.protocol.reconnectionDelay}},{key:"replayInterval",get:function(){return this._replayInterval},set:function(e){this._checkPropertyType("_replayInterval","number",e),this._replayInterval=e}},{key:"sslConnection",get:function(){return this.protocol.sslConnection}},{key:"tokenExpiredInterval",get:function(){return this._tokenExpiredInterval},set:function(e){this._checkPropertyType("_tokenExpiredInterval","number",e),this._tokenExpiredInterval=e}}])&&i(t.prototype,r),R}(f.KuzzleEventEmitter);t.Kuzzle=S},4528:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,e)})(e)}function u(e,t,r){return(u=a()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&l(o,r.prototype),o}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.KuzzleError=void 0;var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,e);var t,r,s=(t=u,r=a(),function(){var e,n=c(t);if(r){var i=c(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return o(this,e)});function u(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n(this,u),(t=s.call(this,e.message)).status=e.status,e.stack&&Reflect.defineProperty(i(t),"kuzzleStack",{value:e.stack}),r&&(t.stack=r),t.id=e.id,t.code=e.code,206===t.status&&(t.errors=e.errors,t.count=e.count),t}return u}(s(Error));t.KuzzleError=f},9235:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.AuthController=void 0;var a=r(9665),l=r(5914),c=r(3987),f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(h,e);var t,r,n,l,f=(n=h,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(l){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function h(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),(t=f.call(this,e,"auth"))._authenticationToken=null,t.kuzzle.on("tokenExpired",(function(){t._authenticationToken=null})),t}return t=h,(r=[{key:"authenticateRequest",value:function(e){this.authenticationToken&&("auth"!==e.controller||"checkToken"!==e.action&&"login"!==e.action)&&(e.jwt=this.authenticationToken.encodedJwt)}},{key:"createApiKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"createApiKey",_id:t._id,expiresIn:t.expiresIn,refresh:t.refresh,body:{description:e}};return this.query(r).then((function(e){return e.result}))}},{key:"deleteApiKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"deleteApiKey",_id:e,refresh:t.refresh};return this.query(r).then((function(){return null}))}},{key:"searchApiKeys",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"searchApiKeys",from:t.from,size:t.size,body:e};return this.query(r).then((function(e){return e.result}))}},{key:"checkToken",value:function(e){return void 0===e&&this.authenticationToken&&(e=this.authenticationToken.encodedJwt),this.query({action:"checkToken",body:{token:e}},{queuable:!1}).then((function(e){return e.result}))}},{key:"createMyCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({strategy:e,action:"createMyCredentials",body:t},r).then((function(e){return e.result}))}},{key:"credentialsExist",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({strategy:e,action:"credentialsExist"},t).then((function(e){return e.result}))}},{key:"deleteMyCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({strategy:e,action:"deleteMyCredentials"},t).then((function(e){return e.result.acknowledged}))}},{key:"getCurrentUser",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getCurrentUser"},t).then((function(t){return new c.User(e.kuzzle,t.result._id,t.result._source)}))}},{key:"getMyCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({strategy:e,action:"getMyCredentials"},t).then((function(e){return e.result}))}},{key:"getMyRights",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getMyRights"},e).then((function(e){return e.result.hits}))}},{key:"getStrategies",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getStrategies"},e).then((function(e){return e.result}))}},{key:"login",value:function(e,t,r){var n=this,o={strategy:e,expiresIn:r,body:t,action:"login"};return this.query(o,{queuable:!1,verb:"POST"}).then((function(e){return n._authenticationToken=new a.Jwt(e.result.jwt),n.kuzzle.emit("loginAttempt",{success:!0}),e.result.jwt})).catch((function(e){throw n.kuzzle.emit("loginAttempt",{success:!1,error:e.message}),e}))}},{key:"logout",value:function(){var e=this;return this.query({action:"logout"},{queuable:!1}).then((function(){e._authenticationToken=null}))}},{key:"updateMyCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({strategy:e,body:t,action:"updateMyCredentials"},r).then((function(e){return e.result}))}},{key:"updateSelf",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({body:e,action:"updateSelf"},r).then((function(e){return new c.User(t.kuzzle,e.result._id,e.result._source)}))}},{key:"validateMyCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({strategy:e,body:t,action:"validateMyCredentials"},r).then((function(e){return e.result}))}},{key:"refreshToken",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={action:"refreshToken",expiresIn:t.expiresIn};return this.query(r,t).then((function(t){return e._authenticationToken=new a.Jwt(t.result.jwt),t.result}))}},{key:"authenticationToken",get:function(){return this._authenticationToken},set:function(e){if(null==e)this._authenticationToken=null;else{if("string"!=typeof e)throw new Error("Invalid token argument: ".concat(e));this._authenticationToken=new a.Jwt(e)}}}])&&o(t.prototype,r),h}(l.BaseController);t.AuthController=f},5914:(e,t)=>{"use strict";function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.BaseController=void 0;var n=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Reflect.defineProperty(this,"_kuzzle",{value:t}),this._name=r}var t,n;return t=e,(n=[{key:"query",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.controller=e.controller||this.name,this._kuzzle.query(e,t)}},{key:"kuzzle",get:function(){return this._kuzzle}},{key:"name",get:function(){return this._name}}])&&r(t.prototype,n),e}();t.BaseController=n},4134:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(c,e);var t,r,n,a,l=(n=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(a){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),l.call(this,e,"bulk")}return t=c,(r=[{key:"deleteByQuery",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:r,action:"deleteByQuery"};return this.query(o,n).then((function(e){return e.result.deleted}))}},{key:"import",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,action:"import",body:{bulkData:r}},n).then((function(e){return e.result}))}},{key:"write",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.query({index:e,collection:t,_id:n,action:"write",body:r},o).then((function(e){return e.result}))}},{key:"mWrite",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,action:"mWrite",body:{documents:r}},n).then((function(e){return e.result}))}}])&&o(t.prototype,r),c}(r(5914).BaseController);e.exports={BulkController:a}},8285:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionController=void 0;var a=r(5914),l=r(1183),c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(f,e);var t,r,n,a,c=(n=f,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(a){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),c.call(this,e,"collection")}return t=f,(r=[{key:"create",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:r,action:"create"};return this.query(o,n).then((function(){}))}},{key:"deleteSpecifications",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={index:e,collection:t,action:"deleteSpecifications"};return this.query(n,r).then((function(){}))}},{key:"exists",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({index:e,collection:t,action:"exists"},r).then((function(e){return e.result}))}},{key:"refresh",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({index:e,collection:t,action:"refresh"},r).then((function(){}))}},{key:"getMapping",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={index:e,collection:t,action:"getMapping",includeKuzzleMeta:r.includeKuzzleMeta||!1};return this.query(n,r).then((function(e){return e.result}))}},{key:"getSpecifications",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({index:e,collection:t,action:"getSpecifications"},r).then((function(e){return e.result}))}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={index:e,action:"list",size:t.size||0,from:t.from};return this.query(r,t).then((function(e){return e.result}))}},{key:"searchSpecifications",value:function(){for(var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={body:t,action:"searchSpecifications"},o=0,i=["from","size","scroll"];o<i.length;o++){var s=i[o];n[s]=r[s]}return this.query(n,r).then((function(t){return new l.SpecificationsSearchResult(e.kuzzle,n,r,t.result)}))}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={index:e,collection:t,action:"truncate"};return this.query(n,r).then((function(){}))}},{key:"update",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,body:r,action:"update"},n).then((function(){}))}},{key:"updateMapping",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,body:r,action:"updateMapping"},n).then((function(e){return e.result}))}},{key:"updateSpecifications",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,body:r,action:"updateSpecifications"},n).then((function(e){return e.result}))}},{key:"validateSpecifications",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,body:r,action:"validateSpecifications"},n).then((function(e){return e.result}))}},{key:"delete",value:function(e,t){var r={index:e,collection:t,action:"delete"};return this.query(r).then((function(){}))}}])&&o(t.prototype,r),f}(a.BaseController);t.CollectionController=c},7146:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentController=void 0;var f=r(5914),h=r(3026),d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(f,e);var t,r,n,o,s=(n=f,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(n);if(o){var r=c(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return l(this,e)});function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),s.call(this,e,"document")}return t=f,(r=[{key:"count",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:r,action:"count"};return this.query(o,n).then((function(e){return e.result.count}))}},{key:"create",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={index:e,collection:t,_id:n,body:r,action:"create"};return this.query(i,o).then((function(e){return e.result}))}},{key:"createOrReplace",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={index:e,collection:t,_id:r,body:n,action:"createOrReplace"};return this.query(i,o).then((function(e){return e.result}))}},{key:"delete",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,_id:r,action:"delete"};return this.query(o,n).then((function(e){return e.result._id}))}},{key:"deleteByQuery",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:r,action:"deleteByQuery"};return this.query(o,n).then((function(e){return e.result.ids}))}},{key:"exists",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,_id:r,action:"exists"};return this.query(o,n).then((function(e){return e.result}))}},{key:"get",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,_id:r,action:"get"};return this.query(o,n).then((function(e){return e.result}))}},{key:"mCreate",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:{documents:r},action:"mCreate"};return this.query(o,n).then((function(e){return e.result}))}},{key:"mCreateOrReplace",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:{documents:r},action:"mCreateOrReplace"};return this.query(o,n).then((function(e){return e.result}))}},{key:"mDelete",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:{ids:r},action:"mDelete"};return this.query(o,n).then((function(e){return e.result}))}},{key:"mGet",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,action:"mGet",body:{ids:r}};return this.query(o,n).then((function(e){return e.result}))}},{key:"mReplace",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:{documents:r},action:"mReplace"};return this.query(o,n).then((function(e){return e.result}))}},{key:"mUpdate",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:{documents:r},action:"mUpdate"};return this.query(o,n).then((function(e){return e.result}))}},{key:"replace",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={index:e,collection:t,_id:r,body:n,action:"replace"};return this.query(i,o).then((function(e){return e.result}))}},{key:"search",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this._search(e,t,n,o).then((function(e){var t=e.response,n=e.request,o=e.opts;return new h.DocumentSearchResult(r.kuzzle,n,o,t.result)}))}},{key:"_search",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:null,action:"search"};"http"===this.kuzzle.protocol.name&&n.verb&&"get"===n.verb.toLowerCase()?o.searchBody=r:o.body=r;for(var s=0,u=["from","size","scroll"];s<u.length;s++){var a=u[s];o[a]=n[a]}var l=i({verb:n.verb||"POST"},n);return this.query(o,l).then((function(e){return{response:e,request:o,opts:l}}))}},{key:"update",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={index:e,collection:t,_id:r,body:n,action:"update",retryOnConflict:o.retryOnConflict,source:o.source};return this.query(i,o).then((function(e){return e.result}))}},{key:"updateByQuery",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={index:e,collection:t,body:{query:r,changes:n},action:"updateByQuery",source:o.source};return this.query(i,o).then((function(e){return e.result}))}},{key:"validate",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({index:e,collection:t,body:r,action:"validate"},n).then((function(e){return e.result}))}}])&&u(t.prototype,r),f}(f.BaseController);t.DocumentController=d},8779:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.IndexController=void 0;var a=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(c,e);var t,r,n,a,l=(n=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(a){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),l.call(this,e,"index")}return t=c,(r=[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={index:e,action:"create"};return this.query(r,t).then((function(){}))}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={index:e,action:"delete"};return this.query(r,t).then((function(){}))}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({index:e,action:"exists"},t).then((function(e){return e.result}))}},{key:"list",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"list"},e).then((function(e){return e.result.indexes}))}},{key:"mDelete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"mDelete",body:{indexes:e}};return this.query(r,t).then((function(e){return e.result.deleted}))}}])&&o(t.prototype,r),c}(r(5914).BaseController);t.IndexController=a},3318:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}for(var u=r(5914).BaseController,a={getter:!0,required:["_id"]},l={getter:!0,required:["_id","field"]},c={getter:!0,required:["keys"]},f={getter:!0,required:["_id","member"]},h={getter:!0,required:["_id","cursor"],opts:["match","count"],mapResults:x},d={getter:!0,required:["_id","start","stop"],opts:S,mapResults:P},p={getter:!0,required:["_id","min","max"],opts:S,mapResults:P},y={required:["_id"]},b={required:["_id","value"]},v={append:b,bitcount:{getter:!0,required:["_id"],opts:["start","end"]},bitop:{required:["_id","operation","keys"]},bitpos:{getter:!0,required:["_id","bit"],opts:["start","end"]},dbsize:{getter:!0},decr:y,decrby:b,del:{required:["keys"]},exists:c,expire:{required:["_id","seconds"],mapResults:Boolean},expireat:{required:["_id","timestamp"],mapResults:Boolean},flushdb:{mapResults:k},geoadd:{required:["_id","points"]},geodist:{getter:!0,required:["_id","member1","member2"],opts:["unit"],mapResults:parseFloat},geohash:{getter:!0,required:["_id","members"]},geopos:{getter:!0,required:["_id","members"],mapResults:function(e){return e.map((function(e){return e.map(parseFloat)}))}},georadius:{getter:!0,required:["_id","lon","lat","distance","unit"],opts:O,mapResults:T},georadiusbymember:{getter:!0,required:["_id","member","distance","unit"],opts:O,mapResults:T},get:a,getbit:{getter:!0,required:["_id","offset"]},getrange:{getter:!0,required:["_id","start","end"]},getset:b,hdel:{required:["_id","fields"]},hexists:{getter:!0,required:["_id","field"],mapResults:Boolean},hget:l,hgetall:{getter:!0,required:["_id"]},hincrby:{required:["_id","field","value"]},hincrbyfloat:{required:["_id","field","value"],mapResults:parseFloat},hkeys:a,hlen:a,hmget:{getter:!0,required:["_id","fields"]},hmset:{required:["_id","entries"],mapResults:k},hscan:h,hset:{required:["_id","field","value"],mapResults:Boolean},hsetnx:{required:["_id","field","value"],mapResults:Boolean},hstrlen:l,hvals:a,incr:y,incrby:b,incrbyfloat:{required:["_id","value"],mapResults:parseFloat},keys:{getter:!0,required:["pattern"]},lindex:{getter:!0,required:["_id","idx"]},linsert:{required:["_id","position","pivot","value"]},llen:a,lpop:y,lpush:{required:["_id","values"]},lpushx:b,lrange:{getter:!0,required:["_id","start","stop"]},lrem:{required:["_id","count","value"]},lset:{required:["_id","index","value"],mapResults:k},ltrim:{required:["_id","start","stop"],mapResults:k},mexecute:{required:["actions"]},mget:c,mset:{required:["entries"],mapResults:k},msetnx:{required:["entries"],mapResults:Boolean},object:{getter:!0,required:["_id","subcommand"]},persist:{required:["_id"],mapResults:Boolean},pexpire:{required:["_id","milliseconds"],mapResults:Boolean},pexpireat:{required:["_id","timestamp"],mapResults:Boolean},pfadd:{required:["_id","elements"],mapResults:Boolean},pfcount:c,pfmerge:{required:["_id","sources"],mapResults:k},ping:{getter:!0},psetex:{required:["_id","value","milliseconds"],mapResults:k},pttl:a,randomkey:{getter:!0},rename:{required:["_id","newkey"],mapResults:k},renamenx:{required:["_id","newkey"],mapResults:Boolean},rpop:y,rpoplpush:{required:["source","destination"]},rpush:{required:["_id","values"]},rpushx:b,sadd:{required:["_id","members"]},scan:{getter:!0,required:["cursor"],opts:["match","count"],mapResults:x},scard:a,sdiff:{getter:!0,required:["_id","keys"]},sdiffstore:{required:["_id","keys","destination"]},set:{required:["_id","value"],opts:["ex","px","nx","xx"],mapResults:k},setex:{required:["_id","value","seconds"],mapResults:k},setnx:{required:["_id","value"],mapResults:Boolean},sinter:c,sinterstore:{required:["destination","keys"]},sismember:{getter:!0,required:["_id","member"],mapResults:Boolean},smembers:a,smove:{required:["_id","destination","member"],mapResults:Boolean},sort:{required:["_id"],opts:["alpha","by","direction","get","limit"]},spop:{required:["_id"],opts:["count"],mapResults:R},srandmember:{getter:!0,required:["_id"],opts:["count"],mapResults:R},srem:{required:["_id","members"]},sscan:h,strlen:a,sunion:c,sunionstore:{required:["destination","keys"]},time:{getter:!0,mapResults:function(e){return e.map((function(e){return parseInt(e)}))}},touch:{required:["keys"]},ttl:a,type:a,zadd:{required:["_id","elements"],opts:["nx","xx","ch","incr"]},zcard:a,zcount:{getter:!0,required:["_id","min","max"]},zincrby:{required:["_id","member","value"]},zinterstore:{required:["_id","keys"],opts:["weights","aggregate"]},zlexcount:{getter:!0,required:["_id","min","max"]},zrange:d,zrangebylex:{getter:!0,required:["_id","min","max"],opts:["limit"]},zrevrangebylex:{getter:!0,required:["_id","min","max"],opts:["limit"]},zrangebyscore:p,zrank:f,zrem:{required:["_id","members"]},zremrangebylex:{required:["_id","min","max"]},zremrangebyrank:{required:["_id","start","stop"]},zremrangebyscore:{required:["_id","min","max"]},zrevrange:d,zrevrangebyscore:p,zrevrank:f,zscan:h,zscore:{getter:!0,required:["_id","member"],mapResults:parseFloat},zunionstore:{required:["_id","keys"],opts:["weights","aggregate"]}},m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var o=s(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return i(this,e)});function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),n.call(this,e,"ms")}return u}(u),g=function(e,t){var r=t[e];m.prototype[r]=function(){var e=v[r],t={action:r},o={};e.getter||(t.body={});for(var i=arguments.length,s=new Array(i),u=0;u<i;u++)s[u]=arguments[u];for(var a=0,l=e.required||[];a<l.length;a++){var c=l[a],f=s.shift();if(void 0===f)throw new Error("ms.".concat(r,": missing parameter ").concat(c));E(t,e.getter,c,f)}if(s.length>1)throw new Error("ms.".concat(r,": too many parameters provided"));if(s.length){if("object"!==n(s[0])||Array.isArray(s[0]))throw new Error("ms.".concat(r,": invalid optional paramater (expected an object"));if(Object.assign(o,s[0]),Array.isArray(e.opts))for(var h=0,d=e.opts;h<d.length;h++){var p=d[h];null!==o[p]&&void 0!==o[p]&&E(t,e.getter,p,o[p])}}return"function"==typeof e.opts&&e.opts(t,o),this.query(t,o).then((function(t){return e.mapResults?e.mapResults(t.result):t.result}))}},_=0,w=Object.keys(v);_<w.length;_++)g(_,w);function E(e,t,r,n){t||"_id"===r?e[r]=n:e.body[r]=n}function O(e,t){var r=[];Object.keys(t).filter((function(e){return t[e]&&-1!==["withcoord","withdist","count","sort"].indexOf(e)})).forEach((function(e){"withcoord"===e||"withdist"===e?r.push(e):"count"!==e&&"sort"!==e||("count"===e&&r.push("count"),r.push(t[e]))})),r.length>0&&(e.options=r)}function S(e,t){e.options=["withscores"],t.limit&&(e.limit=t.limit)}function T(e){return Array.isArray(e[0])?e.map((function(e){for(var t={name:e.shift()},r=0;r<e.length;r++){var n=e[r];Array.isArray(n)?t.coordinates=n.map(parseFloat):t.distance=parseFloat(n)}return t})):e.map((function(e){return{name:e}}))}function R(e){return Array.isArray(e)?e:[e]}function k(){}function P(e){for(var t=[],r=0;r<e.length;r+=2)t.push({member:e[r],score:parseFloat(e[r+1])});return t}function x(e){return{cursor:e[0],values:e[1]}}e.exports={MemoryStorageController:m}},8429:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeController=t.UserOption=t.ScopeOption=void 0;var l,c,f=r(5914),h=a(r(8100));(c=t.ScopeOption||(t.ScopeOption={})).all="all",c.in="in",c.out="out",c.none="none",(l=t.UserOption||(t.UserOption={})).all="all",l.in="in",l.out="out",l.none="none";var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(c,e);var t,r,n,a,l=(n=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(a){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=l.call(this,e,"realtime"))._subscriptions=new Map,t._subscriptionsOff=new Map,t.kuzzle.on("tokenExpired",(function(){return t.removeSubscriptions()})),t.kuzzle.on("disconnected",(function(){return t.saveSubscriptions()})),t.kuzzle.on("networkError",(function(){return t.saveSubscriptions()})),t.kuzzle.on("reconnected",(function(){return t.resubscribe()})),t}return t=c,(r=[{key:"count",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({action:"count",body:{roomId:e}},t).then((function(e){return e.result.count}))}},{key:"publish",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={index:e,collection:t,body:r,action:"publish",_id:n._id};return this.query(o,n).then((function(e){return e.result.published}))}},{key:"subscribe",value:function(e,t,r,n){var o=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=new h.default(this,e,t,r,n,i);return s.subscribe().then((function(){return o._subscriptions.has(s.id)||o._subscriptions.set(s.id,[]),o._subscriptions.get(s.id).push(s),s.id}))}},{key:"unsubscribe",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={action:"unsubscribe",body:{roomId:e}};return this.query(n,r).then((function(){var r=t._subscriptions.get(e);if(r){for(var n=0;n<r.length;n++)r[n].removeListeners();t._subscriptions.delete(e)}}))}},{key:"saveSubscriptions",value:function(){for(var e=0,t=this._subscriptions.keys();e<t.length;e++){for(var r=t[e],n=0,o=this._subscriptions.get(r);n<o.length;n++){var i=o[n];i.removeListeners(),i.autoResubscribe&&(this._subscriptionsOff.has(r)||this._subscriptionsOff.set(r,[]),this._subscriptionsOff.get(r).push(i))}this._subscriptions.delete(r)}}},{key:"resubscribe",value:function(){for(var e=this,t=0,r=this._subscriptionsOff.keys();t<r.length;t++){for(var n=r[t],o=function(t,r){var o=r[t];e._subscriptions.has(n)||e._subscriptions.set(n,[]),e._subscriptions.get(n).push(o),o.subscribe().catch((function(){return e.kuzzle.emit("discarded",{request:o.request})}))},i=0,s=this._subscriptionsOff.get(n);i<s.length;i++)o(i,s);this._subscriptionsOff.delete(n)}}},{key:"removeSubscriptions",value:function(){for(var e=0,t=this._subscriptions.keys();e<t.length;e++)for(var r=t[e],n=0,o=this._subscriptions.get(r);n<o.length;n++)o[n].removeListeners();this._subscriptions=new Map,this._subscriptionsOff=new Map}}])&&o(t.prototype,r),c}(f.BaseController);t.RealtimeController=d},7127:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a=r(5914).BaseController,l=r(3955).Role,c=r(896).RoleSearchResult,f=r(4103).Profile,h=r(7885).ProfileSearchResult,d=r(3987).User,p=r(4545).UserSearchResult,y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(b,e);var t,r,n,a,y=(n=b,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(a){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function b(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),y.call(this,e,"security")}return t=b,(r=[{key:"createApiKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={userId:e,action:"createApiKey",_id:r._id,expiresIn:r.expiresIn,refresh:r.refresh,body:{description:t}};return this.query(n).then((function(e){return e.result}))}},{key:"deleteApiKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={userId:e,action:"deleteApiKey",_id:t,refresh:r.refresh};return this.query(n).then((function(){}))}},{key:"searchApiKeys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={userId:e,action:"searchApiKeys",from:r.from,size:r.size,body:t};return this.query(n).then((function(e){return e.result}))}},{key:"createCredentials",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({_id:t,strategy:e,body:r,action:"createCredentials"},n).then((function(e){return e.result}))}},{key:"createFirstAdmin",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"createFirstAdmin",reset:n.reset};return this.query(o,n).then((function(e){return new d(r.kuzzle,e.result._id,e.result._source)}))}},{key:"createOrReplaceProfile",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"createOrReplaceProfile"};return this.query(o,n).then((function(e){return new f(r.kuzzle,e.result._id,e.result._source)}))}},{key:"createOrReplaceRole",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"createOrReplaceRole",force:!!n.force||null};return this.query(o,n).then((function(e){return new l(r.kuzzle,e.result._id,e.result._source.controllers)}))}},{key:"createProfile",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"createProfile"};return this.query(o,n).then((function(e){return new f(r.kuzzle,e.result._id,e.result._source)}))}},{key:"createRestrictedUser",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.content||(e.content={});var o={_id:r,body:e,action:"createRestrictedUser"};return this.query(o,n).then((function(e){return new d(t.kuzzle,e.result._id,e.result._source)}))}},{key:"createRole",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"createRole",force:!!n.force||null};return this.query(o,n).then((function(e){return new l(r.kuzzle,e.result._id,e.result._source.controllers)}))}},{key:"createUser",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"createUser"};return this.query(o,n).then((function(e){return new d(r.kuzzle,e.result._id,e.result._source)}))}},{key:"deleteCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={strategy:e,_id:t,action:"deleteCredentials"};return this.query(n,r).then((function(e){return e.result}))}},{key:"deleteProfile",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={_id:e,action:"deleteProfile"};return this.query(r,t).then((function(e){return e.result}))}},{key:"deleteRole",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={_id:e,action:"deleteRole"};return this.query(r,t).then((function(e){return e.result}))}},{key:"deleteUser",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={_id:e,action:"deleteUser"};return this.query(r,t).then((function(e){return e.result}))}},{key:"getAllCredentialFields",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getAllCredentialFields"},e).then((function(e){return e.result}))}},{key:"getCredentialFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({strategy:e,action:"getCredentialFields"},t).then((function(e){return e.result}))}},{key:"getCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({strategy:e,_id:t,action:"getCredentials"},r).then((function(e){return e.result}))}},{key:"getCredentialsById",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({strategy:e,_id:t,action:"getCredentialsById"},r).then((function(e){return e.result}))}},{key:"getProfile",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({_id:e,action:"getProfile"},r).then((function(e){return new f(t.kuzzle,e.result._id,e.result._source)}))}},{key:"getProfileMapping",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getProfileMapping"},e).then((function(e){return e.result}))}},{key:"getProfileRights",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({_id:e,action:"getProfileRights"},t).then((function(e){return e.result.hits}))}},{key:"getRole",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({_id:e,action:"getRole"},r).then((function(e){return new l(t.kuzzle,e.result._id,e.result._source.controllers)}))}},{key:"getRoleMapping",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getRoleMapping"},e).then((function(e){return e.result}))}},{key:"getUser",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({_id:e,action:"getUser"},r).then((function(e){return new d(t.kuzzle,e.result._id,e.result._source)}))}},{key:"getUserMapping",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.query({action:"getUserMapping"},e).then((function(e){return e.result}))}},{key:"getUserRights",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({_id:e,action:"getUserRights"},t).then((function(e){return e.result.hits}))}},{key:"hasCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.query({strategy:e,_id:t,action:"hasCredentials"},r).then((function(e){return e.result}))}},{key:"mDeleteProfiles",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"mDeleteProfiles",body:{ids:e}};return this.query(r,t).then((function(e){return e.result}))}},{key:"mDeleteRoles",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"mDeleteRoles",body:{ids:e}};return this.query(r,t).then((function(e){return e.result}))}},{key:"mDeleteUsers",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={action:"mDeleteUsers",body:{ids:e}};return this.query(r,t).then((function(e){return e.result}))}},{key:"mGetProfiles",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({action:"mGetProfiles",body:{ids:e}},r).then((function(e){return e.result.hits.map((function(e){return new f(t.kuzzle,e._id,e._source)}))}))}},{key:"mGetUsers",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={action:"mGetUsers",body:{ids:e}};return this.query(n,r).then((function(e){return e.result.hits.map((function(e){return new d(t.kuzzle,e._id,e._source)}))}))}},{key:"mGetRoles",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({action:"mGetRoles",body:{ids:e}},r).then((function(e){return e.result.hits.map((function(e){return new l(t.kuzzle,e._id,e._source.controllers)}))}))}},{key:"refresh",value:function(e){return this.query({collection:e,action:"refresh"})}},{key:"replaceUser",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"replaceUser"};return this.query(o,n).then((function(e){return new d(r.kuzzle,e.result._id,e.result._source)}))}},{key:"searchProfiles",value:function(e){for(var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={body:e,action:"searchProfiles"},o=0,i=["from","size","scroll"];o<i.length;o++){var s=i[o];n[s]=r[s]}return this.query(n,r).then((function(e){return new h(t.kuzzle,n,r,e.result)}))}},{key:"searchRoles",value:function(e){for(var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={body:e,action:"searchRoles"},o=0,i=["from","size"];o<i.length;o++){var s=i[o];n[s]=r[s]}return this.query(n,r).then((function(e){return new c(t.kuzzle,n,r,e.result)}))}},{key:"searchUsers",value:function(e){for(var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={body:e,action:"searchUsers"},o=0,i=["from","size","scroll"];o<i.length;o++){var s=i[o];n[s]=r[s]}return this.query(n,r).then((function(e){return new p(t.kuzzle,n,r,e.result)}))}},{key:"updateCredentials",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({strategy:e,_id:t,body:r,action:"updateCredentials"},n).then((function(e){return e.result}))}},{key:"updateProfile",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"updateProfile"};return this.query(o,n).then((function(e){return new f(r.kuzzle,e.result._id,e.result._source)}))}},{key:"updateProfileMapping",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({body:e,action:"updateProfileMapping"},t).then((function(e){return e.result}))}},{key:"updateRole",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"updateRole",force:!!n.force||null};return this.query(o,n).then((function(e){return new l(r.kuzzle,e.result._id,e.result._source.controllers)}))}},{key:"updateRoleMapping",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({body:e,action:"updateRoleMapping"},t).then((function(e){return e.result}))}},{key:"updateUser",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={_id:e,body:t,action:"updateUser"};return this.query(o,n).then((function(e){return new d(r.kuzzle,e.result._id,e.result._source)}))}},{key:"updateUserMapping",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.query({body:e,action:"updateUserMapping"},t).then((function(e){return e.result}))}},{key:"validateCredentials",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.query({_id:t,strategy:e,body:r,action:"validateCredentials"},n).then((function(e){return e.result}))}}])&&o(t.prototype,r),b}(a);e.exports={SecurityController:y}},1994:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(c,e);var t,r,n,a,l=(n=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(n);if(a){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return s(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),l.call(this,e,"server")}return t=c,(r=[{key:"adminExists",value:function(e){return this.query({action:"adminExists"},e).then((function(e){return e.result.exists}))}},{key:"getAllStats",value:function(e){return this.query({action:"getAllStats"},e).then((function(e){return e.result}))}},{key:"getConfig",value:function(e){return this.query({action:"getConfig"},e).then((function(e){return e.result}))}},{key:"getLastStats",value:function(e){return this.query({action:"getLastStats"},e).then((function(e){return e.result}))}},{key:"getStats",value:function(e,t,r){return this.query({action:"getStats",startTime:e,stopTime:t},r).then((function(e){return e.result}))}},{key:"info",value:function(e){return this.query({action:"info"},e).then((function(e){return e.result}))}},{key:"now",value:function(e){return this.query({action:"now"},e).then((function(e){return e.result.now}))}}])&&o(t.prototype,r),c}(r(5914).BaseController);e.exports={ServerController:a}},9665:e=>{"use strict";function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._encodedJwt=t,this._userId=null,this._expiresAt=null,this._decode()}var r,n;return r=e,(n=[{key:"_decode",value:function(){var e,t=this._encodedJwt.split(".")[1];if(!t)throw new Error("Invalid JWT format");try{e=JSON.parse(function(e){var t=e.replace(/=+$/,""),r="";if(t.length%4==1)throw new Error("Malformed base64 string.");for(var n,o=0,i=0,s=0;n=t.charAt(s++);~n&&(i=o%4?64*i+n:n,o++%4)?r+=String.fromCharCode(255&i>>(-2*o&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return r}(t))}catch(e){throw new Error("Invalid JSON payload for JWT")}this._userId=e._id,this._expiresAt=e.exp}},{key:"encodedJwt",get:function(){return this._encodedJwt}},{key:"userId",get:function(){return this._userId}},{key:"expiresAt",get:function(){return this._expiresAt}},{key:"expired",get:function(){return Date.now()>this.expiresAt}}])&&t(r.prototype,n),e}();e.exports={Jwt:r}},4898:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.KuzzleEventEmitter=void 0;var i=function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o(this,e),this.fn=t,this.once=r},s=function(){function e(){o(this,e),this._events=new Map}var t,s;return t=e,(s=[{key:"_exists",value:function(e,t){return Boolean(e.find((function(e){return e.fn===t})))}},{key:"listeners",value:function(e){return this._events.has(e)?this._events.get(e).map((function(e){return e.fn})):[]}},{key:"addListener",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||!t)return this;var o=r(t);if("function"!==o)throw new Error("Invalid listener type: expected a function, got a ".concat(o));return this._events.has(e)||this._events.set(e,[]),this._exists(this._events.get(e),t)||this._events.get(e).push(new i(t,n)),this}},{key:"on",value:function(e,t){return this.addListener(e,t)}},{key:"prependListener",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||!t)return this;if(this._events.has(e)||this._events.set(e,[]),!this._exists(this._events.get(e),t)){var n=[new i(t,r)].concat(this._events.get(e));this._events.set(e,n)}return this}},{key:"addOnceListener",value:function(e,t){return this.addListener(e,t,!0)}},{key:"once",value:function(e,t){return this.addOnceListener(e,t)}},{key:"prependOnceListener",value:function(e,t){return this.prependListener(e,t,!0)}},{key:"removeListener",value:function(e,t){var r=this._events.get(e);if(!r||!r.length)return this;var n=r.findIndex((function(e){return e.fn===t}));return-1!==n&&r.splice(n,1),0===r.length&&this._events.delete(e),this}},{key:"removeAllListeners",value:function(e){return e?this._events.delete(e):this._events=new Map,this}},{key:"emit",value:function(e){var t=this._events.get(e);if(void 0===t)return!1;for(var r=[],n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];for(var s=0;s<t.length;s++){var u=t[s];u.fn.apply(u,o),u.once&&r.push(u.fn)}for(var a=0;a<r.length;a++){var l=r[a];this.removeListener(e,l)}return!0}},{key:"eventNames",value:function(){return Array.from(this._events.keys())}},{key:"listenerCount",value:function(e){return this._events.has(e)&&this._events.get(e).length||0}}])&&n(t.prototype,s),e}();t.KuzzleEventEmitter=s,e.exports={KuzzleEventEmitter:s}},8100:e=>{"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var n=function(){function e(r,n,o,i,s){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};t(this,e),Reflect.defineProperty(this,"_kuzzle",{value:r.kuzzle}),this.controller=r,this.index=n,this.collection=o,this.callback=s,this.options=u,this.id=null,this.channel=null,this.request={index:n,collection:o,body:i,controller:"realtime",action:"subscribe",state:this.options.state,scope:this.options.scope,users:this.options.users,volatile:this.options.volatile},this.autoResubscribe="boolean"==typeof u.autoResubscribe?u.autoResubscribe:this.kuzzle.autoResubscribe,this.subscribeToSelf="boolean"!=typeof u.subscribeToSelf||u.subscribeToSelf,this._channelListener=this._channelListener.bind(this)}var n,o;return n=e,(o=[{key:"subscribe",value:function(){var e=this;return this.kuzzle.query(this.request,this.options).then((function(t){return e.id=t.result.roomId,e.channel=t.result.channel,e.kuzzle.protocol.on(e.channel,e._channelListener),t}))}},{key:"removeListeners",value:function(){this.channel&&this.kuzzle.protocol.removeListener(this.channel,this._channelListener)}},{key:"_channelListener",value:function(e){if("TokenExpired"===e.type)return this.kuzzle.tokenExpired();var t=e.volatile&&e.volatile.sdkInstanceId===this.kuzzle.protocol.id;!this.subscribeToSelf&&t||this.callback(e)}},{key:"kuzzle",get:function(){return this._kuzzle}}])&&r(n.prototype,o),e}();e.exports=n},3026:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentSearchResult=void 0;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var o=s(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return i(this,e)});function u(e,t,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(i=n.call(this,e,t,r,o))._searchAction="search",i._scrollAction="scroll",i}return u}(r(2140).SearchResultBase);t.DocumentSearchResult=u,e.exports={DocumentSearchResult:u}},7885:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileSearchResult=void 0;var l=r(4103),c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(h,e);var t,r,n,c,f=(n=h,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=a(n);if(c){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return u(this,e)});function h(e,t,r,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),(o=f.call(this,e,t,r,n))._searchAction="searchProfiles",o._scrollAction="scrollProfiles",o.hits=n.hits.map((function(e){return new l.Profile(o._kuzzle,e._id,e._source)})),o}return t=h,(r=[{key:"next",value:function(){return i(a(h.prototype),"next",this).call(this).then((function(e){return e?(e.hits=e._response.hits.map((function(t){return new l.Profile(e._kuzzle,t._id,t._source)})),e):null}))}}])&&o(t.prototype,r),h}(r(2140).SearchResultBase);t.ProfileSearchResult=c},896:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.RoleSearchResult=void 0;var l=r(3955),c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(h,e);var t,r,n,c,f=(n=h,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=a(n);if(c){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return u(this,e)});function h(e,t,r,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),(o=f.call(this,e,t,r,n))._searchAction="searchRoles",o._scrollAction=null,o.hits=o._response.hits.map((function(e){return new l.Role(o._kuzzle,e._id,e._source.controllers)})),o}return t=h,(r=[{key:"next",value:function(){return this._request.scroll||this._request.sort?Promise.reject(new Error("only from/size params are allowed for role search")):i(a(h.prototype),"next",this).call(this).then((function(e){return e?(e.hits=e._response.hits.map((function(t){return new l.Role(e._kuzzle,t._id,t._source.controllers)})),e):null}))}}])&&o(t.prototype,r),h}(r(2140).SearchResultBase);t.RoleSearchResult=c},2140:(e,t)=>{"use strict";function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.SearchResultBase=void 0;var u=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i(this,e),Reflect.defineProperty(this,"_kuzzle",{value:t}),Reflect.defineProperty(this,"_request",{value:r}),Reflect.defineProperty(this,"_options",{value:n}),Reflect.defineProperty(this,"_response",{value:o}),Reflect.defineProperty(this,"_controller",{value:r.controller,writable:!0}),Reflect.defineProperty(this,"_searchAction",{value:"search",writable:!0}),Reflect.defineProperty(this,"_scrollAction",{value:"scroll",writable:!0}),this.aggregations=o.aggregations,this.hits=o.hits||[],this.fetched=this.hits.length,this.total=o.total||0}var t,r;return t=e,(r=[{key:"next",value:function(){var e=this;if(this.fetched>=this.total)return Promise.resolve(null);if(this._request.scroll)return this._kuzzle.query({controller:this._request.controller,action:this._scrollAction,scroll:this._request.scroll,scrollId:this._response.scrollId},this._options).then((function(t){return e._buildNextSearchResult(t)}));if(this._request.size&&this._request.body.sort){var t,r=n(n({},this._request),{},{action:this._searchAction}),o=this._response.hits[this._response.hits.length-1];if(!o)return Promise.reject(new Error('Unable to retrieve all results from search: the sort combination must identify one item only. Add document "_id" to the sort.'));if(r.body.search_after=[],0===(t="string"==typeof this._request.body.sort?[this._request.body.sort]:Array.isArray(this._request.body.sort)?this._request.body.sort:Object.keys(this._request.body.sort)).length)return Promise.reject(new Error("Unable to retrieve next results from search: sort param is empty"));for(var i=0,s=t;i<s.length;i++){var u=s[i],a="string"==typeof u?u:Object.keys(u)[0],l="_id"===a?o._id:this._get(o._source,a.split("."));r.body.search_after.push(l)}return this._kuzzle.query(r,this._options).then((function(t){return e._buildNextSearchResult(t)}))}return this._request.size?this._request.from>=this._response.total?Promise.resolve(null):this._kuzzle.query(n(n({},this._request),{},{action:this._searchAction,from:this.fetched}),this._options).then((function(t){return e._buildNextSearchResult(t)})):Promise.reject(new Error("Unable to retrieve next results from search: missing scrollId, from/sort, or from/size params"))}},{key:"_get",value:function(e,t){if(!e)return e;if(1===t.length)return e[t[0]];var r=t.shift();return this._get(e[r],t)}},{key:"_buildNextSearchResult",value:function(e){var t=new(0,this.constructor)(this._kuzzle,this._request,this._options,e.result);return t.fetched+=this.fetched,t}}])&&s(t.prototype,r),e}();t.SearchResultBase=u},1183:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.SpecificationsSearchResult=void 0;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=s(t);if(r){var o=s(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return i(this,e)});function u(e,t,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(i=n.call(this,e,t,r,o))._controller="collection",i._searchAction="searchSpecifications",i._scrollAction="scrollSpecifications",i}return u}(r(2140).SearchResultBase);t.SpecificationsSearchResult=u},4545:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.UserSearchResult=void 0;var l=r(2140),c=r(3987),f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(h,e);var t,r,n,l,f=(n=h,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=a(n);if(l){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return u(this,e)});function h(e,t,r,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),(o=f.call(this,e,t,r,n))._searchAction="searchUsers",o._scrollAction="scrollUsers",o.hits=o._response.hits.map((function(e){return new c.User(o._kuzzle,e._id,e._source)})),o}return t=h,(r=[{key:"next",value:function(){return i(a(h.prototype),"next",this).call(this).then((function(e){return e?(e.hits=e._response.hits.map((function(t){return new c.User(e._kuzzle,t._id,t._source)})),e):null}))}}])&&o(t.prototype,r),h}(l.SearchResultBase);t.UserSearchResult=f},4103:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Profile=void 0;var o=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,e),Reflect.defineProperty(this,"_kuzzle",{value:t}),this._id=n,this.rateLimit=o&&o.rateLimit?o.rateLimit:0,this.policies=o&&o.policies?o.policies:[]}var t,o;return t=e,(o=[{key:"getRoles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.policies&&0!==this.policies.length?this.kuzzle.security.mGetRoles(this.policies.map((function(e){return e.roleId})),e):Promise.resolve([])}},{key:"kuzzle",get:function(){return this._kuzzle}}])&&n(t.prototype,o),e}();t.Profile=o},3955:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Role=void 0;var o=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),Reflect.defineProperty(this,"_kuzzle",{value:t}),this._id=n,this.controllers=o}var t,o;return t=e,(o=[{key:"kuzzle",get:function(){return this._kuzzle}}])&&n(t.prototype,o),e}();t.Role=o,e.exports={Role:o}},3987:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;var o=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),Reflect.defineProperty(this,"_kuzzle",{value:t}),this._id=n,this.content=o}var t,o;return t=e,(o=[{key:"getProfiles",value:function(){return this.profileIds&&0!==this.profileIds.length?this.kuzzle.security.mGetProfiles(this.profileIds):Promise.resolve([])}},{key:"kuzzle",get:function(){return this._kuzzle}},{key:"profileIds",get:function(){return this.content.profileIds||[]}}])&&n(t.prototype,o),e}();t.User=o,e.exports={User:o}},6900:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var f=c(r(4880)),h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(v,e);var t,c,h,y,b=(h=v,y=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(h);if(y){var r=l(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function v(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,v),t=b.call(this,e,r,"http"),"string"!=typeof e||""===e)throw new Error("host is required");t._routes={},t._timeout=r.timeout||0,t._customRoutes=r.customRoutes||{};for(var n=0,o=Object.keys(t._customRoutes);n<o.length;n++)for(var s=o[n],u=t._customRoutes[s],a=0,l=Object.keys(u);a<l.length;a++){var c=l[a],f=u[c];if(!("string"==typeof f.url&&f.url.length>0))throw new Error("Incorrect URL for custom route ".concat(s,":").concat(c,"."));if(!("string"==typeof f.verb&&f.verb.length>0))throw new Error("Incorrect VERB for custom route ".concat(s,":").concat(c,"."))}return t}return t=v,(c=[{key:"connect",value:function(){var e=this;return"ready"===this.state?Promise.resolve():this._sendHttpRequest("GET","/_publicApi").then((function(t){var r=t.result,n=t.error;if(n){if(401===n.status||403===n.status)return e._warn('"server:publicApi" route is restricted for anonymous user.'),e._warn("This route is used by the HTTP protocol to build API URLs."),e._warn("Fallback to static routes, some API routes may be unavailable as well as plugin custom routes"),void(e._routes=f.default);if(404===n.status)return e._sendHttpRequest("GET","/").then((function(t){var r=t.result,n=t.error;if(n){if(401!==n.status&&403!==n.status)throw n;e._warn('"server:info" route is restricted for anonymous user.'),e._warn("This route is used by the HTTP protocol to build API URLs."),e._warn('If you want to expose your API routes without disclosing server information you can use "server:publicApi" (available in Kuzzle 1.9.0).'),e._warn("Fallback to static routes, some API routes may be unavailable as well as plugin custom routes"),e._routes=f.default}else e._routes=e._constructRoutes(r.serverInfo.kuzzle.api.routes)}));throw n}e._routes=e._constructRoutes(r)})).then((function(){e._routes=Object.assign(e._routes,e._customRoutes),e.clientConnected()})).catch((function(t){var r=new Error("Unable to connect to kuzzle server at ".concat(e.host,":").concat(e.port));throw r.internal=t,e.emit("networkError",r),t}))}},{key:"send",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.routes[e.controller]&&this.routes[e.controller][e.action];if(n){for(var i=r.verb||n.verb,s={action:void 0,body:void 0,collection:void 0,controller:void 0,headers:{"Content-Type":"application/json"},index:void 0,meta:void 0,requestId:void 0},u={},a=0,l=Object.keys(e);a<l.length;a++){var c=l[a],f=e[c];"body"===c?"GET"===i?Object.assign(u,f):s.body=JSON.stringify(f):"jwt"===c?s.headers.authorization="Bearer "+f:"volatile"===c?s.headers["x-kuzzle-volatile"]=JSON.stringify(f):Object.prototype.hasOwnProperty.call(s,c)?s[c]=f:null!=f&&(u[c]=f)}for(var h=/\/:([^/]*)/,d=n.url,p=h.exec(d);p;){var y=e[p[1]];if(!y){var b=new Error('Missing URL param "'.concat(p[1],'" in "').concat(p.input,'"'));return void this.emit(s.requestId,{status:400,error:b})}d=d.replace(h,"/".concat(encodeURIComponent(e[p[1]]))),delete u[p[1]],p=h.exec(d)}for(var v=[],m=0,g=Object.keys(u);m<g.length;m++){var _=g[m],w=u[_],E=encodeURIComponent(_);Array.isArray(w)?v.push("".concat(E,"=").concat(encodeURIComponent(w.join()))):"boolean"==typeof w?!0===w&&v.push(E):(w="object"===o(w)?JSON.stringify(w):w,v.push("".concat(E,"=").concat(encodeURIComponent(w))))}v.length>0&&(d+="?"+v.join("&")),this._sendHttpRequest(i,d,s).then((function(e){return t.emit(s.requestId,e)})).catch((function(e){return t.emit(s.requestId,{error:e})}))}else{var O=new Error('No URL found for "'.concat(e.controller,":").concat(e.action,'".'));this.emit(e.requestId,{status:400,error:O})}}},{key:"_sendHttpRequest",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("undefined"==typeof XMLHttpRequest){var i=r(2223);"/"!==t[0]&&(t="/".concat(t));var s="".concat(this.protocol,"://").concat(this.host,":").concat(this.port).concat(t),u=o.headers||{};return u["Content-Length"]=Buffer.byteLength(o.body||""),i.request(s,e,{headers:u,body:o.body,timeout:this._timeout}).then((function(e){return JSON.parse(e.body)}))}return new Promise((function(r,i){var s=new XMLHttpRequest,u="".concat(n.protocol,"://").concat(n.host,":").concat(n.port).concat(t);s.timeout=n._timeout,s.onreadystatechange=function(){4===s.readyState&&0===s.status&&i(new Error("Cannot connect to host. Is the host online?"))},s.open(e,u);for(var a=0,l=Object.keys(o.headers||{});a<l.length;a++){var c=l[a];s.setRequestHeader(c,o.headers[c])}s.onload=function(){try{var e=JSON.parse(s.responseText);r(e)}catch(e){i(e)}},s.send(o.body)}))}},{key:"_constructRoutes",value:function(e){for(var t=Object.keys(e).map((function(t){return[t,e[t]]})).reduce((function(e,t){var r,o,i=(o=2,function(e){if(Array.isArray(e))return e}(r=t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var s,u=e[Symbol.iterator]();!(n=(s=u.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(r,o)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],u=i[1];e[s]={};for(var a=0,l=Object.keys(u);a<l.length;a++){var c=l[a],f=u[c].http;f&&1===f.length?e[s][c]=f[0]:f&&f.length>1&&(e[s][c]="document"===s&&"search"===c?d(f):p(f))}return e}),{}),r=0,o=Object.keys(this._customRoutes);r<o.length;r++){var i=o[r];t[i]=this._customRoutes[i]}return t}},{key:"_warn",value:function(e){console.warn(e)}},{key:"http",get:function(){return this.routes}},{key:"routes",get:function(){return this._routes}},{key:"protocol",get:function(){return this.ssl?"https":"http"}},{key:"connected",get:function(){return!0}},{key:"timeout",get:function(){return this._timeout},set:function(e){this._timeout=e}}])&&s(t.prototype,c),v}(r(147).KuzzleAbstractProtocol);function d(e){return"POST"===e[0].verb?e[0]:e[1]}function p(e){for(var t,r=e[0],n=e[0].url.length,o=!0,i=0;i<e.length;i++){var s=e[i];s.url.length!==n&&(o=!1),s.url.length<n&&(r=s,n=s.url.length),"GET"===s.verb&&(t=s)}return o?t:r}t.default=h},7380:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0});var c=r(4528),f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(y,e);var t,f,h,d,p=(h=y,d=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(h);if(d){var r=l(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function y(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o(this,y),t=p.call(this,e,i,"ws"),"string"!=typeof e||""===e)throw new Error("host is required");if("undefined"!=typeof WebSocket)t.WebSocketClient=WebSocket,t.options=null;else if(t.WebSocketClient=r(3301),t.options={perMessageDeflate:!1,headers:i.headers||null},null!==t.options.headers&&(Array.isArray(t.options.headers)||"object"!==n(t.options.headers)))throw new Error('Invalid "headers" option: expected an object');return t.client=null,t.lasturl=null,t}return t=y,(f=[{key:"connect",value:function(){var e=this;return new Promise((function(t,r){var n="".concat(e.ssl?"wss":"ws","://").concat(e.host,":").concat(e.port);s(l(y.prototype),"connect",e).call(e),n!==e.lasturl&&(e.wasConnected=!1,e.lasturl=n),e.client=new e.WebSocketClient(n,e.options),e.client.onopen=function(){return e.clientConnected(),t()},e.client.onclose=function(t,r){var n,o=r;if("number"==typeof t?n=t:(n=t.code,t.reason&&(o=t.reason)),1e3===n)e.clientDisconnected();else if(e.wasConnected){var i=new Error(o);i.status=n,e.clientNetworkError(i)}},e.client.onerror=function(t){var n=t;if(t instanceof Error||(n=!t||"undefined"!=typeof Event&&t instanceof Event?new Error("Connection error"):new Error(t.message||t)),e.clientNetworkError(n),[e.client.CLOSING,e.client.CLOSED].indexOf(e.client.readyState)>-1)return r(n)},e.client.onmessage=function(t){var r=JSON.parse(t.data||t);if(r.room)e.emit(r.room,r);else{e.emit("discarded",r);var n=new c.KuzzleError(r.error);e.emit("queryError",n,r)}}}))}},{key:"send",value:function(e){this.client&&this.client.readyState===this.client.OPEN&&this.client.send(JSON.stringify(e))}},{key:"close",value:function(){this.state="offline",this.removeAllListeners(),this.wasConnected=!1,this.client&&this.client.close(),this.client=null,this.stopRetryingToConnect=!0,s(l(y.prototype),"close",this).call(this)}}])&&i(t.prototype,f),y}(r(3189).BaseProtocolRealtime);t.default=f},147:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.KuzzleAbstractProtocol=void 0;var c=r(4528),f=r(4957),h=r(4898),d=r(3041),p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(y,e);var t,r,n,h,p=(n=y,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(n);if(h){var r=l(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return u(this,e)});function y(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o(this,y),(t=p.call(this))._pendingRequests=new Map,t._host=e,t._name=n;var i=parseInt(r.port,10);if(t._port=isNaN(i)?7512:i,void 0!==r.ssl&&void 0!==r.sslConnection)throw new Error('Both "ssl" and "sslConnection" options are set. Use only "ssl".');return"boolean"==typeof r.ssl?t._ssl=r.ssl:"boolean"==typeof r.sslConnection?t._ssl=r.sslConnection:t._ssl=443===i||7443===i,t.id=f.uuidv4(),t.state="offline",Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(a(t),e)&&Object.getOwnPropertyDescriptor(a(t),e).writable&&(t[e]=r[e])})),t}return t=y,(r=[{key:"clientConnected",value:function(e,t){this.state=e||"ready",this.emit(t?"reconnect":"connect")}},{key:"close",value:function(){this.state="offline",this.clear()}},{key:"query",value:function(e,t){var r=this;if(!this.isReady())return this.emit("discarded",e),Promise.reject(new Error("Unable to execute request: not connected to a Kuzzle server.\nDiscarded request: ".concat(JSON.stringify(e))));var n=Error().stack,o=new d.PendingRequest(e);return this._pendingRequests.set(e.requestId,o),this.once(e.requestId,(function(t){if(r._pendingRequests.delete(e.requestId),t.error){var i=new c.KuzzleError(t.error,n);return r.emit("queryError",i,e),"logout"!==e.action&&"security.token.invalid"===i.id&&r.emit("tokenExpired"),o.reject(i)}o.resolve(t)})),this.send(e,t),o.promise}},{key:"isReady",value:function(){return"ready"===this.state}},{key:"clear",value:function(){for(var e=new Error("Network error: request was sent but no response has been received"),t=0,r=this._pendingRequests.values();t<r.length;t++){var n=r[t];n.reject(e),this.removeAllListeners(n.request.requestId),this.emit("discarded",n.request)}this._pendingRequests.clear()}},{key:"host",get:function(){return this._host}},{key:"name",get:function(){return this._name}},{key:"port",get:function(){return this._port}},{key:"ssl",get:function(){return this._ssl}},{key:"connected",get:function(){return"connected"===this.state}},{key:"pendingRequests",get:function(){return this._pendingRequests}}])&&i(t.prototype,r),y}(h.KuzzleEventEmitter);t.KuzzleAbstractProtocol=p},3041:e=>{"use strict";function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._resolve=null,this._reject=null,this.request=t,this.promise=new Promise((function(e,t){r._resolve=e,r._reject=t}))}var r,n;return r=e,(n=[{key:"resolve",value:function(){this._resolve.apply(this,arguments)}},{key:"reject",value:function(e){this._reject(e)}}])&&t(r.prototype,n),e}();e.exports={PendingRequest:r}},3189:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.BaseProtocolRealtime=void 0;var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(d,e);var t,r,c,f,h=(c=d,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(c);if(f){var r=l(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function d(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return o(this,d),(t=h.call(this,e,r,n))._autoReconnect="boolean"!=typeof r.autoReconnect||r.autoReconnect,t._reconnectionDelay="number"==typeof r.reconnectionDelay?r.reconnectionDelay:1e3,t.wasConnected=!1,t.stopRetryingToConnect=!1,t.retrying=!1,t}return t=d,(r=[{key:"connect",value:function(){return this.state="connecting",Promise.resolve()}},{key:"clientConnected",value:function(){s(l(d.prototype),"clientConnected",this).call(this,"connected",this.wasConnected),this.state="connected",this.wasConnected=!0,this.stopRetryingToConnect=!1}},{key:"clientDisconnected",value:function(){this.clear(),this.emit("disconnect")}},{key:"clientNetworkError",value:function(e){var t=this;this.state="offline",this.clear();var r=new Error("Unable to connect to kuzzle server at ".concat(this.host,":").concat(this.port,": ").concat(e.message," (ws status=").concat(e.status,")"));if(this.emit("networkError",r),!this.autoReconnect||this.retrying||this.stopRetryingToConnect)this.emit("disconnect");else{if(this.retrying=!0,"object"===("undefined"==typeof window?"undefined":n(window))&&"object"===n(window.navigator)&&!1===window.navigator.onLine)return void window.addEventListener("online",(function(){t.retrying=!1,t.connect().catch((function(e){return t.clientNetworkError(e)}))}),{once:!0});setTimeout((function(){t.retrying=!1,t.connect().catch((function(e){return t.clientNetworkError(e)}))}),this.reconnectionDelay)}}},{key:"isReady",value:function(){return"connected"===this.state}},{key:"autoReconnect",get:function(){return this._autoReconnect}},{key:"reconnectionDelay",get:function(){return this._reconnectionDelay}}])&&i(t.prototype,r),d}(r(147).KuzzleAbstractProtocol);t.BaseProtocolRealtime=c},1076:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Http=t.WebSocket=void 0;var o=r(7380);Object.defineProperty(t,"WebSocket",{enumerable:!0,get:function(){return n(o).default}});var i=r(6900);Object.defineProperty(t,"Http",{enumerable:!0,get:function(){return n(i).default}})},3405:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8694:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Document=void 0,t.Document=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}},9468:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8811:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3209:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3044:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(3405),t),o(r(8694),t),o(r(9468),t),o(r(8811),t),o(r(6253),t),o(r(6687),t),o(r(3209),t),o(r(4296),t)},8964:e=>{function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o=function(e){return Object.assign({},{name:"object",seal:!0,sealGet:!1,deprecated:[],warnDeprecationOnce:!0,exposeApi:!1,apiNamespace:"__proxy__"},e)},i=function e(t){if(!t)return[];var n=Object.getOwnPropertyNames(t.prototype||t),o=Object.getPrototypeOf(t);return s([].concat(r(n),r(e(o))))},s=function(e){return r(new Set(e))};e.exports={proxify:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"object"!==t(e)&&"function"!=typeof e)throw Error("proxify only applies on non-null object");var s=o(n),u=new Set(["inspect"]),a=new Set(s.deprecated),l=new Set,c=function(e){var t="".concat(s.name,".").concat(e);s.warnDeprecationOnce&&l.has(t)||(l.add(t),console.warn("Warning: ".concat(t," is deprecated")))};s.exposeApi&&(e[s.apiNamespace]={registerProp:function(e){return u.add(e)},unregisterProp:function(e){return u.delete(e)},hasProp:function(e){return u.has(e)}}),[].concat(r(Object.getOwnPropertyNames(e)),r(i(e))).forEach((function(e){return u.add(e)}));var f={get:function(e,t){if(s.sealGet&&!u.has(t))throw new Error("".concat(s.name,".").concat(t," is not defined"));return a.has(t)&&c(t),e[t]},set:function(e,t,r){if(s.seal&&!u.has(t))throw new Error("Cannot set a value to the undefined '".concat(t,"' property in '").concat(s.name,"'"));return a.has(t)&&c(t),e[t]=r,!0}};return new Proxy(e,f)}}},4957:e=>{e.exports={uuidv4:function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}}},4880:e=>{"use strict";e.exports=JSON.parse('{"auth":{"login":{"verb":"POST","url":"/_login/:strategy"},"logout":{"url":"/_logout","verb":"POST"},"getCurrentUser":{"url":"/users/_me","verb":"GET"},"getMyRights":{"url":"/users/_me/_rights","verb":"GET"},"checkToken":{"url":"/_checkToken","verb":"POST"},"updateSelf":{"url":"/_updateSelf","verb":"PUT"},"getStrategies":{"url":"/strategies","verb":"GET"},"createMyCredentials":{"url":"/credentials/:strategy/_me/_create","verb":"POST"},"updateMyCredentials":{"url":"/credentials/:strategy/_me/_update","verb":"PUT"},"credentialsExist":{"url":"/credentials/:strategy/_me/_exists","verb":"GET"},"validateMyCredentials":{"url":"/credentials/:strategy/_me/_validate","verb":"POST"},"deleteMyCredentials":{"url":"/credentials/:strategy/_me","verb":"DELETE"},"getMyCredentials":{"url":"/credentials/:strategy/_me","verb":"GET"},"refreshToken":{"url":"/_refreshToken","verb":"POST"}},"bulk":{"deleteByQuery":{"url":"/:index/:collection/_bulk/_query","verb":"DELETE"},"import":{"verb":"POST","url":"/:index/:collection/_bulk"},"write":{"verb":"POST","url":"/:index/:collection/_write"},"mWrite":{"verb":"POST","url":"/:index/:collection/_mWrite"}},"document":{"create":{"verb":"POST","url":"/:index/:collection/_create"},"scroll":{"url":"/_scroll/:scrollId","verb":"GET"},"exists":{"url":"/:index/:collection/:_id/_exists","verb":"GET"},"get":{"url":"/:index/:collection/:_id","verb":"GET"},"mGet":{"url":"/:index/:collection/_mGet","verb":"POST"},"count":{"url":"/:index/:collection/_count","verb":"POST"},"mCreate":{"url":"/:index/:collection/_mCreate","verb":"POST"},"createOrReplace":{"url":"/:index/:collection/:_id","verb":"PUT"},"mCreateOrReplace":{"url":"/:index/:collection/_mCreateOrReplace","verb":"PUT"},"update":{"url":"/:index/:collection/:_id/_update","verb":"PUT"},"updateByQuery":{"url":"/:index/:collection/_query","verb":"PUT"},"mUpdate":{"url":"/:index/:collection/_mUpdate","verb":"PUT"},"replace":{"url":"/:index/:collection/:_id/_replace","verb":"PUT"},"mReplace":{"url":"/:index/:collection/_mReplace","verb":"PUT"},"delete":{"url":"/:index/:collection/:_id","verb":"DELETE"},"mDelete":{"url":"/:index/:collection/_mDelete","verb":"DELETE"},"deleteByQuery":{"url":"/:index/:collection/_query","verb":"DELETE"},"validate":{"url":"/:index/:collection/_validate","verb":"POST"},"search":{"url":"/:index/:collection/_search","verb":"GET"}},"security":{"createFirstAdmin":{"verb":"POST","url":"/_createFirstAdmin"},"createRestrictedUser":{"verb":"POST","url":"/users/_createRestricted"},"createUser":{"verb":"POST","url":"/users/_create"},"getRoleMapping":{"url":"/roles/_mapping","verb":"GET"},"updateRoleMapping":{"url":"/roles/_mapping","verb":"PUT"},"getProfileMapping":{"url":"/profiles/_mapping","verb":"GET"},"updateProfileMapping":{"url":"/profiles/_mapping","verb":"PUT"},"getUserMapping":{"url":"/users/_mapping","verb":"GET"},"updateUserMapping":{"url":"/users/_mapping","verb":"PUT"},"getRole":{"url":"/roles/:_id","verb":"GET"},"mGetRoles":{"url":"/roles/_mGet","verb":"POST"},"searchRoles":{"url":"/roles/_search","verb":"POST"},"createOrReplaceRole":{"url":"/roles/:_id","verb":"PUT"},"createRole":{"url":"/roles/:_id/_create","verb":"POST"},"deleteRole":{"url":"/roles/:_id","verb":"DELETE"},"getProfile":{"url":"/profiles/:_id","verb":"GET"},"mGetProfiles":{"url":"/profiles/_mGet","verb":"POST"},"createOrReplaceProfile":{"url":"/profiles/:_id","verb":"PUT"},"createProfile":{"url":"/profiles/:_id/_create","verb":"POST"},"deleteProfile":{"url":"/profiles/:_id","verb":"DELETE"},"searchProfiles":{"url":"/profiles/_search","verb":"POST"},"getUser":{"url":"/users/:_id","verb":"GET"},"getProfileRights":{"url":"/profiles/:_id/_rights","verb":"GET"},"getUserRights":{"url":"/users/:_id/_rights","verb":"GET"},"searchUsers":{"url":"/users/_search","verb":"POST"},"deleteUser":{"url":"/users/:_id","verb":"DELETE"},"updateUser":{"url":"/users/:_id/_update","verb":"PUT"},"replaceUser":{"url":"/users/:_id/_replace","verb":"PUT"},"updateProfile":{"url":"/profiles/:_id/_update","verb":"PUT"},"updateRole":{"url":"/roles/:_id/_update","verb":"PUT"},"mDeleteProfiles":{"url":"/profiles/_mDelete","verb":"POST"},"mDeleteRoles":{"url":"/roles/_mDelete","verb":"POST"},"mDeleteUsers":{"url":"/users/_mDelete","verb":"POST"},"scrollUsers":{"url":"/users/_scroll/:scrollId","verb":"GET"},"scrollProfiles":{"url":"/profiles/_scroll/:scrollId","verb":"GET"},"createCredentials":{"url":"/credentials/:strategy/:_id/_create","verb":"POST"},"updateCredentials":{"url":"/credentials/:strategy/:_id/_update","verb":"PUT"},"hasCredentials":{"url":"/credentials/:strategy/:_id/_exists","verb":"GET"},"validateCredentials":{"url":"/credentials/:strategy/:_id/_validate","verb":"POST"},"deleteCredentials":{"url":"/credentials/:strategy/:_id","verb":"DELETE"},"getCredentials":{"url":"/credentials/:strategy/:_id","verb":"GET"},"getCredentialsById":{"url":"/credentials/:strategy/:_id/_byId","verb":"GET"},"getCredentialFields":{"url":"/credentials/:strategy/_fields","verb":"GET"},"getAllCredentialFields":{"url":"/credentials/_fields","verb":"GET"}},"collection":{"update":{"url":"/:index/:collection/","verb":"POST"},"updateMapping":{"url":"/:index/:collection/_mapping","verb":"PUT"},"getMapping":{"url":"/:index/:collection/_mapping","verb":"GET"},"getSpecifications":{"url":"/:index/:collection/_specifications","verb":"GET"},"searchSpecifications":{"url":"/validations/_search","verb":"POST"},"scrollSpecifications":{"url":"/validations/_scroll/:scrollId","verb":"GET"},"updateSpecifications":{"url":"/:index/:collection/_specifications","verb":"PUT"},"deleteSpecifications":{"url":"/:index/:collection/_specifications","verb":"DELETE"},"validateSpecifications":{"url":"/:index/:collection/_validateSpecifications","verb":"POST"},"truncate":{"url":"/:index/:collection/_truncate","verb":"DELETE"},"list":{"url":"/:index/_list","verb":"GET"},"exists":{"url":"/:index/:collection/_exists","verb":"GET"},"create":{"url":"/:index/:collection","verb":"PUT"}},"index":{"mDelete":{"url":"/_mdelete","verb":"DELETE"},"create":{"url":"/:index/_create","verb":"POST"},"delete":{"url":"/:index","verb":"DELETE"},"refresh":{"url":"/:index/_refresh","verb":"POST"},"list":{"url":"/_list","verb":"GET"},"refreshInternal":{"url":"/_refreshInternal","verb":"POST"},"getAutoRefresh":{"url":"/:index/_autoRefresh","verb":"GET"},"setAutoRefresh":{"url":"/:index/_autoRefresh","verb":"POST"},"exists":{"url":"/:index/_exists","verb":"GET"}},"ms":{"append":{"url":"/ms/_append/:_id","verb":"POST"},"bitcount":{"url":"/ms/_bitcount/:_id","verb":"GET"},"bitop":{"url":"/ms/_bitop/:_id","verb":"POST"},"bitpos":{"url":"/ms/_bitpos/:_id","verb":"GET"},"dbsize":{"url":"/ms/_dbsize","verb":"GET"},"decrby":{"url":"/ms/_decrby/:_id","verb":"POST"},"del":{"url":"/ms","verb":"DELETE"},"expire":{"url":"/ms/_expire/:_id","verb":"POST"},"expireat":{"url":"/ms/_expireat/:_id","verb":"POST"},"flushdb":{"url":"/ms/_flushdb","verb":"POST"},"geoadd":{"url":"/ms/_geoadd/:_id","verb":"POST"},"geodist":{"url":"/ms/_geodist/:_id/:member1/:member2","verb":"GET"},"geohash":{"url":"/ms/_geohash/:_id","verb":"GET"},"georadius":{"url":"/ms/_georadius/:_id","verb":"GET"},"georadiusbymember":{"url":"/ms/_georadiusbymember/:_id","verb":"GET"},"getbit":{"url":"/ms/_getbit/:_id","verb":"GET"},"getrange":{"url":"/ms/_getrange/:_id","verb":"GET"},"hdel":{"url":"/ms/_hdel/:_id","verb":"DELETE"},"hmget":{"url":"/ms/_hmget/:_id","verb":"GET"},"hexists":{"url":"/ms/_hexists/:_id/:field","verb":"GET"},"hincrby":{"url":"/ms/_hincrby/:_id","verb":"POST"},"hmset":{"url":"/ms/_hmset/:_id","verb":"POST"},"hset":{"url":"/ms/_hset/:_id","verb":"POST"},"hstrlen":{"url":"/ms/_hstrlen/:_id/:field","verb":"GET"},"keys":{"url":"/ms/_keys/:pattern","verb":"GET"},"lindex":{"url":"/ms/_lindex/:_id/:idx","verb":"GET"},"linsert":{"url":"/ms/_linsert/:_id","verb":"POST"},"lpush":{"url":"/ms/_lpush/:_id","verb":"POST"},"lrange":{"url":"/ms/_lrange/:_id","verb":"GET"},"lrem":{"url":"/ms/_lrem/:_id","verb":"DELETE"},"lset":{"url":"/ms/_lset/:_id","verb":"POST"},"ltrim":{"url":"/ms/_ltrim/:_id","verb":"POST"},"mexecute":{"url":"/ms/_mexecute","verb":"POST"},"mget":{"url":"/ms/_mget","verb":"GET"},"mset":{"url":"/ms/_mset","verb":"POST"},"object":{"url":"/ms/_object/:_id","verb":"GET"},"pexpire":{"url":"/ms/_pexpire/:_id","verb":"POST"},"pexpireat":{"url":"/ms/_pexpireat/:_id","verb":"POST"},"pfadd":{"url":"/ms/_pfadd/:_id","verb":"POST"},"pfmerge":{"url":"/ms/_pfmerge/:_id","verb":"POST"},"ping":{"url":"/ms/_ping","verb":"GET"},"psetex":{"url":"/ms/_psetex/:_id","verb":"POST"},"randomkey":{"url":"/ms/_randomkey","verb":"GET"},"rename":{"url":"/ms/_rename/:_id","verb":"POST"},"renamenx":{"url":"/ms/_renamenx/:_id","verb":"POST"},"rpoplpush":{"url":"/ms/_rpoplpush","verb":"POST"},"sadd":{"url":"/ms/_sadd/:_id","verb":"POST"},"scan":{"url":"/ms/_scan","verb":"GET"},"sdiff":{"url":"/ms/_sdiff/:_id","verb":"GET"},"sdiffstore":{"url":"/ms/_sdiffstore/:_id","verb":"POST"},"set":{"url":"/ms/_set/:_id","verb":"POST"},"setex":{"url":"/ms/_setex/:_id","verb":"POST"},"setnx":{"url":"/ms/_setnx/:_id","verb":"POST"},"sinterstore":{"url":"/ms/_sinterstore","verb":"POST"},"sismember":{"url":"/ms/_sismember/:_id/:member","verb":"GET"},"smove":{"url":"/ms/_smove/:_id","verb":"POST"},"sort":{"url":"/ms/_sort/:_id","verb":"POST"},"spop":{"url":"/ms/_spop/:_id","verb":"POST"},"srandmember":{"url":"/ms/_srandmember/:_id","verb":"GET"},"srem":{"url":"/ms/_srem/:_id","verb":"DELETE"},"sscan":{"url":"/ms/_sscan/:_id","verb":"GET"},"sunion":{"url":"/ms/_sunion","verb":"GET"},"sunionstore":{"url":"/ms/_sunionstore","verb":"POST"},"time":{"url":"/ms/_time","verb":"GET"},"touch":{"url":"/ms/_touch","verb":"POST"},"zadd":{"url":"/ms/_zadd/:_id","verb":"POST"},"zcount":{"url":"/ms/_zcount/:_id","verb":"GET"},"zincrby":{"url":"/ms/_zincrby/:_id","verb":"POST"},"zinterstore":{"url":"/ms/_zinterstore/:_id","verb":"POST"},"zlexcount":{"url":"/ms/_zlexcount/:_id","verb":"GET"},"zrange":{"url":"/ms/_zrange/:_id","verb":"GET"},"zrangebylex":{"url":"/ms/_zrangebylex/:_id","verb":"GET"},"zrangebyscore":{"url":"/ms/_zrangebyscore/:_id","verb":"GET"},"zrem":{"url":"/ms/_zrem/:_id","verb":"DELETE"},"zremrangebylex":{"url":"/ms/_zremrangebylex/:_id","verb":"DELETE"},"zremrangebyrank":{"url":"/ms/_zremrangebyrank/:_id","verb":"DELETE"},"zremrangebyscore":{"url":"/ms/_zremrangebyscore/:_id","verb":"DELETE"},"zrevrangebylex":{"url":"/ms/_zrevrangebylex/:_id","verb":"GET"},"zrevrangebyscore":{"url":"/ms/_zrevrangebyscore/:_id","verb":"GET"},"zrevrank":{"url":"/ms/_zrevrank/:_id/:member","verb":"GET"},"zunionstore":{"url":"/ms/_zunionstore/:_id","verb":"POST"},"zcard":{"url":"/ms/_zcard/:_id","verb":"GET"},"type":{"url":"/ms/_type/:_id","verb":"GET"},"ttl":{"url":"/ms/_ttl/:_id","verb":"GET"},"strlen":{"url":"/ms/_strlen/:_id","verb":"GET"},"smembers":{"url":"/ms/_smembers/:_id","verb":"GET"},"scard":{"url":"/ms/_scard/:_id","verb":"GET"},"rpop":{"url":"/ms/_rpop/:_id","verb":"POST"},"pttl":{"url":"/ms/_pttl/:_id","verb":"GET"},"persist":{"url":"/ms/_persist/:_id","verb":"POST"},"lpop":{"url":"/ms/_lpop/:_id","verb":"POST"},"llen":{"url":"/ms/_llen/:_id","verb":"GET"},"incr":{"url":"/ms/_incr/:_id","verb":"POST"},"hvals":{"url":"/ms/_hvals/:_id","verb":"GET"},"hlen":{"url":"/ms/_hlen/:_id","verb":"GET"},"hkeys":{"url":"/ms/_hkeys/:_id","verb":"GET"},"hgetall":{"url":"/ms/_hgetall/:_id","verb":"GET"},"get":{"url":"/ms/:_id","verb":"GET"},"decr":{"url":"/ms/_decr/:_id","verb":"POST"},"rpushx":{"url":"/ms/_rpushx/:_id","verb":"POST"},"lpushx":{"url":"/ms/_lpushx/:_id","verb":"POST"},"getset":{"url":"/ms/_getset/:_id","verb":"POST"},"sinter":{"url":"/ms/_sinter","verb":"GET"},"pfcount":{"url":"/ms/_pfcount","verb":"GET"},"incrbyfloat":{"url":"/ms/_incrbyfloat/:_id","verb":"POST"},"incrby":{"url":"/ms/_incrby/:_id","verb":"POST"},"geopos":{"url":"/ms/_geopos/:_id","verb":"GET"},"hget":{"url":"/ms/_hget/:_id/:field","verb":"GET"},"hsetnx":{"url":"/ms/_hsetnx/:_id","verb":"POST"},"msetnx":{"url":"/ms/_msetnx","verb":"POST"},"rpush":{"url":"/ms/_rpush/:_id","verb":"POST"},"hincrbyfloat":{"url":"/ms/_hincrbyfloat/:_id","verb":"POST"},"zrevrange":{"url":"/ms/_zrevrange/:_id","verb":"GET"},"zrank":{"url":"/ms/_zrank/:_id/:member","verb":"GET"},"zscore":{"url":"/ms/_zscore/:_id/:member","verb":"GET"},"zscan":{"url":"/ms/_zscan/:_id","verb":"GET"},"hscan":{"url":"/ms/_hscan/:_id","verb":"GET"},"exists":{"url":"/ms/_exists","verb":"GET"}},"memoryStorage":{"append":{"url":"/ms/_append/:_id","verb":"POST"},"bitcount":{"url":"/ms/_bitcount/:_id","verb":"GET"},"bitop":{"url":"/ms/_bitop/:_id","verb":"POST"},"bitpos":{"url":"/ms/_bitpos/:_id","verb":"GET"},"dbsize":{"url":"/ms/_dbsize","verb":"GET"},"decrby":{"url":"/ms/_decrby/:_id","verb":"POST"},"del":{"url":"/ms","verb":"DELETE"},"expire":{"url":"/ms/_expire/:_id","verb":"POST"},"expireat":{"url":"/ms/_expireat/:_id","verb":"POST"},"flushdb":{"url":"/ms/_flushdb","verb":"POST"},"geoadd":{"url":"/ms/_geoadd/:_id","verb":"POST"},"geodist":{"url":"/ms/_geodist/:_id/:member1/:member2","verb":"GET"},"geohash":{"url":"/ms/_geohash/:_id","verb":"GET"},"georadius":{"url":"/ms/_georadius/:_id","verb":"GET"},"georadiusbymember":{"url":"/ms/_georadiusbymember/:_id","verb":"GET"},"getbit":{"url":"/ms/_getbit/:_id","verb":"GET"},"getrange":{"url":"/ms/_getrange/:_id","verb":"GET"},"hdel":{"url":"/ms/_hdel/:_id","verb":"DELETE"},"hmget":{"url":"/ms/_hmget/:_id","verb":"GET"},"hexists":{"url":"/ms/_hexists/:_id/:field","verb":"GET"},"hincrby":{"url":"/ms/_hincrby/:_id","verb":"POST"},"hmset":{"url":"/ms/_hmset/:_id","verb":"POST"},"hset":{"url":"/ms/_hset/:_id","verb":"POST"},"hstrlen":{"url":"/ms/_hstrlen/:_id/:field","verb":"GET"},"keys":{"url":"/ms/_keys/:pattern","verb":"GET"},"lindex":{"url":"/ms/_lindex/:_id/:idx","verb":"GET"},"linsert":{"url":"/ms/_linsert/:_id","verb":"POST"},"lpush":{"url":"/ms/_lpush/:_id","verb":"POST"},"lrange":{"url":"/ms/_lrange/:_id","verb":"GET"},"lrem":{"url":"/ms/_lrem/:_id","verb":"DELETE"},"lset":{"url":"/ms/_lset/:_id","verb":"POST"},"ltrim":{"url":"/ms/_ltrim/:_id","verb":"POST"},"mget":{"url":"/ms/_mget","verb":"GET"},"mset":{"url":"/ms/_mset","verb":"POST"},"object":{"url":"/ms/_object/:_id","verb":"GET"},"pexpire":{"url":"/ms/_pexpire/:_id","verb":"POST"},"pexpireat":{"url":"/ms/_pexpireat/:_id","verb":"POST"},"pfadd":{"url":"/ms/_pfadd/:_id","verb":"POST"},"pfmerge":{"url":"/ms/_pfmerge/:_id","verb":"POST"},"ping":{"url":"/ms/_ping","verb":"GET"},"psetex":{"url":"/ms/_psetex/:_id","verb":"POST"},"randomkey":{"url":"/ms/_randomkey","verb":"GET"},"rename":{"url":"/ms/_rename/:_id","verb":"POST"},"renamenx":{"url":"/ms/_renamenx/:_id","verb":"POST"},"rpoplpush":{"url":"/ms/_rpoplpush","verb":"POST"},"sadd":{"url":"/ms/_sadd/:_id","verb":"POST"},"scan":{"url":"/ms/_scan","verb":"GET"},"sdiff":{"url":"/ms/_sdiff/:_id","verb":"GET"},"sdiffstore":{"url":"/ms/_sdiffstore/:_id","verb":"POST"},"set":{"url":"/ms/_set/:_id","verb":"POST"},"setex":{"url":"/ms/_setex/:_id","verb":"POST"},"setnx":{"url":"/ms/_setnx/:_id","verb":"POST"},"sinterstore":{"url":"/ms/_sinterstore","verb":"POST"},"sismember":{"url":"/ms/_sismember/:_id/:member","verb":"GET"},"smove":{"url":"/ms/_smove/:_id","verb":"POST"},"sort":{"url":"/ms/_sort/:_id","verb":"POST"},"spop":{"url":"/ms/_spop/:_id","verb":"POST"},"srandmember":{"url":"/ms/_srandmember/:_id","verb":"GET"},"srem":{"url":"/ms/_srem/:_id","verb":"DELETE"},"sscan":{"url":"/ms/_sscan/:_id","verb":"GET"},"sunion":{"url":"/ms/_sunion","verb":"GET"},"sunionstore":{"url":"/ms/_sunionstore","verb":"POST"},"time":{"url":"/ms/_time","verb":"GET"},"touch":{"url":"/ms/_touch","verb":"POST"},"zadd":{"url":"/ms/_zadd/:_id","verb":"POST"},"zcount":{"url":"/ms/_zcount/:_id","verb":"GET"},"zincrby":{"url":"/ms/_zincrby/:_id","verb":"POST"},"zinterstore":{"url":"/ms/_zinterstore/:_id","verb":"POST"},"zlexcount":{"url":"/ms/_zlexcount/:_id","verb":"GET"},"zrange":{"url":"/ms/_zrange/:_id","verb":"GET"},"zrangebylex":{"url":"/ms/_zrangebylex/:_id","verb":"GET"},"zrangebyscore":{"url":"/ms/_zrangebyscore/:_id","verb":"GET"},"zrem":{"url":"/ms/_zrem/:_id","verb":"DELETE"},"zremrangebylex":{"url":"/ms/_zremrangebylex/:_id","verb":"DELETE"},"zremrangebyrank":{"url":"/ms/_zremrangebyrank/:_id","verb":"DELETE"},"zremrangebyscore":{"url":"/ms/_zremrangebyscore/:_id","verb":"DELETE"},"zrevrangebylex":{"url":"/ms/_zrevrangebylex/:_id","verb":"GET"},"zrevrangebyscore":{"url":"/ms/_zrevrangebyscore/:_id","verb":"GET"},"zrevrank":{"url":"/ms/_zrevrank/:_id/:member","verb":"GET"},"zunionstore":{"url":"/ms/_zunionstore/:_id","verb":"POST"},"zcard":{"url":"/ms/_zcard/:_id","verb":"GET"},"type":{"url":"/ms/_type/:_id","verb":"GET"},"ttl":{"url":"/ms/_ttl/:_id","verb":"GET"},"strlen":{"url":"/ms/_strlen/:_id","verb":"GET"},"smembers":{"url":"/ms/_smembers/:_id","verb":"GET"},"scard":{"url":"/ms/_scard/:_id","verb":"GET"},"rpop":{"url":"/ms/_rpop/:_id","verb":"POST"},"pttl":{"url":"/ms/_pttl/:_id","verb":"GET"},"persist":{"url":"/ms/_persist/:_id","verb":"POST"},"lpop":{"url":"/ms/_lpop/:_id","verb":"POST"},"llen":{"url":"/ms/_llen/:_id","verb":"GET"},"incr":{"url":"/ms/_incr/:_id","verb":"POST"},"hvals":{"url":"/ms/_hvals/:_id","verb":"GET"},"hlen":{"url":"/ms/_hlen/:_id","verb":"GET"},"hkeys":{"url":"/ms/_hkeys/:_id","verb":"GET"},"hgetall":{"url":"/ms/_hgetall/:_id","verb":"GET"},"get":{"url":"/ms/:_id","verb":"GET"},"decr":{"url":"/ms/_decr/:_id","verb":"POST"},"rpushx":{"url":"/ms/_rpushx/:_id","verb":"POST"},"lpushx":{"url":"/ms/_lpushx/:_id","verb":"POST"},"getset":{"url":"/ms/_getset/:_id","verb":"POST"},"sinter":{"url":"/ms/_sinter","verb":"GET"},"pfcount":{"url":"/ms/_pfcount","verb":"GET"},"incrbyfloat":{"url":"/ms/_incrbyfloat/:_id","verb":"POST"},"incrby":{"url":"/ms/_incrby/:_id","verb":"POST"},"geopos":{"url":"/ms/_geopos/:_id","verb":"GET"},"hget":{"url":"/ms/_hget/:_id/:field","verb":"GET"},"hsetnx":{"url":"/ms/_hsetnx/:_id","verb":"POST"},"msetnx":{"url":"/ms/_msetnx","verb":"POST"},"rpush":{"url":"/ms/_rpush/:_id","verb":"POST"},"hincrbyfloat":{"url":"/ms/_hincrbyfloat/:_id","verb":"POST"},"zrevrange":{"url":"/ms/_zrevrange/:_id","verb":"GET"},"zrank":{"url":"/ms/_zrank/:_id/:member","verb":"GET"},"zscore":{"url":"/ms/_zscore/:_id/:member","verb":"GET"},"zscan":{"url":"/ms/_zscan/:_id","verb":"GET"},"hscan":{"url":"/ms/_hscan/:_id","verb":"GET"},"exists":{"url":"/ms/_exists","verb":"GET"}},"realtime":{"list":{"url":"/_listSubscriptions","verb":"GET"},"publish":{"url":"/:index/:collection/_publish","verb":"POST"}},"server":{"getStats":{"url":"/_getStats","verb":"GET"},"getLastStats":{"url":"/_getLastStats","verb":"GET"},"getAllStats":{"url":"/_getAllStats","verb":"GET"},"getConfig":{"url":"/_getConfig","verb":"GET"},"adminExists":{"url":"/_adminExists","verb":"GET"},"now":{"url":"/_now","verb":"GET"},"healthCheck":{"url":"/_healthCheck","verb":"GET"},"info":{"url":"/","verb":"GET"}},"admin":{"resetKuzzleData":{"url":"/admin/_resetKuzzleData/","verb":"POST"},"resetCache":{"url":"/admin/_resetCache","verb":"POST"},"resetSecurity":{"url":"/admin/_resetSecurity/","verb":"POST"},"resetDatabase":{"url":"/admin/_resetDatabase/","verb":"POST"},"dump":{"url":"/admin/_dump","verb":"POST"},"shutdown":{"url":"/admin/_shutdown/","verb":"POST"},"loadFixtures":{"url":"/admin/_loadFixtures/","verb":"POST"},"loadMappings":{"url":"/admin/_loadMappings/","verb":"POST"},"loadSecurities":{"url":"/admin/_loadSecurities/","verb":"POST"}}}')},1758:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1045)})()}));
3//# sourceMappingURL=kuzzle.js.map
\No newline at end of file