@neurosity/sdk 6.5.8 → 6.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -542,65 +542,107 @@ var r=Array.isArray;function n(n){if(r(n))return t(n);var e=null,u="string"==typ
542
542
  },{}],"xIH5":[function(require,module,exports) {
543
543
  "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var r={};if(null!=i)for(var n in i)"default"!==n&&Object.prototype.hasOwnProperty.call(i,n)&&e(r,i,n);return t(r,i),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.validateOAuthScopeForFunctionName=exports.validateOAuthScopeForAction=void 0;var r=i(require("../utils/errors")),n={"marker/add":"write:brainwave-markers","brainwaves/record":"write:brainwaves","haptics/queue":"write:haptics","training/record":"write:kinesis","training/stop":"write:kinesis","training/stopAll":"write:kinesis","wifi/reset":"write:wifi-settings"},a={accelerometer:"read:accelerometer",brainwaves:"read:brainwaves",calm:"read:calm",focus:"read:focus",kinesis:"read:kinesis",predictions:"read:kinesis",signalQuality:"read:signal-quality",getInfo:"read:devices-info",getSelectedDevice:"read:devices-info",selectDevice:"read:devices-info",onDeviceChange:"read:devices-info",onUserDevicesChange:"read:devices-info",osVersion:"read:devices-info",settings:"read:devices-settings",changeSettings:"write:devices-settings",status:"read:devices-status",addDevice:"write:devices-add",removeDevice:"write:devices-remove",transferDevice:"write:devices-remove"};function s(e,t){var i=null!=e?e:{},r=i.oauth,a=i.scopes;if(!r)return[!1,null];var s=a.split(","),o=t.command,u=t.action,d=n["".concat(o,"/").concat(u)];return s.includes(d)?[!1,null]:[!0,c(d)]}function o(e,t){var i=null!=e?e:{},r=i.oauth,n=i.scopes;if(!r)return[!1,null];var s=n.split(","),o=a[t];return s.includes(o)?[!1,null]:[!0,c(o)]}function c(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new Error("".concat(r.prefix,"You are trying to access data with an OAuth token without access to the following scopes: ").concat(t.join(", "),"."))}exports.validateOAuthScopeForAction=s,exports.validateOAuthScopeForFunctionName=o;
544
544
  },{"../utils/errors":"WDyG"}],"EDTP":[function(require,module,exports) {
545
- "use strict";module.exports=function(r,n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];return r.apply(n,t)}};
545
+ "use strict";function e(e,t){return function(){return e.apply(t,arguments)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
546
546
  },{}],"S1cf":[function(require,module,exports) {
547
- "use strict";var r=require("./helpers/bind"),t=Object.prototype.toString;function n(r){return Array.isArray(r)}function e(r){return void 0===r}function o(r){return null!==r&&!e(r)&&null!==r.constructor&&!e(r.constructor)&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)}function i(r){return"[object ArrayBuffer]"===t.call(r)}function u(r){return"[object FormData]"===t.call(r)}function c(r){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer&&i(r.buffer)}function f(r){return"string"==typeof r}function a(r){return"number"==typeof r}function l(r){return null!==r&&"object"==typeof r}function s(r){if("[object Object]"!==t.call(r))return!1;var n=Object.getPrototypeOf(r);return null===n||n===Object.prototype}function p(r){return"[object Date]"===t.call(r)}function b(r){return"[object File]"===t.call(r)}function y(r){return"[object Blob]"===t.call(r)}function d(r){return"[object Function]"===t.call(r)}function j(r){return l(r)&&d(r.pipe)}function v(r){return"[object URLSearchParams]"===t.call(r)}function m(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function B(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function g(r,t){if(null!=r)if("object"!=typeof r&&(r=[r]),n(r))for(var e=0,o=r.length;e<o;e++)t.call(null,r[e],e,r);else for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.call(null,r[i],i,r)}function A(){var r={};function t(t,e){s(r[e])&&s(t)?r[e]=A(r[e],t):s(t)?r[e]=A({},t):n(t)?r[e]=t.slice():r[e]=t}for(var e=0,o=arguments.length;e<o;e++)g(arguments[e],t);return r}function O(t,n,e){return g(n,function(n,o){t[o]=e&&"function"==typeof n?r(n,e):n}),t}function h(r){return 65279===r.charCodeAt(0)&&(r=r.slice(1)),r}module.exports={isArray:n,isArrayBuffer:i,isBuffer:o,isFormData:u,isArrayBufferView:c,isString:f,isNumber:a,isObject:l,isPlainObject:s,isUndefined:e,isDate:p,isFile:b,isBlob:y,isFunction:d,isStream:j,isURLSearchParams:v,isStandardBrowserEnv:B,forEach:g,merge:A,extend:O,trim:m,stripBOM:h};
548
- },{"./helpers/bind":"EDTP"}],"H6Qo":[function(require,module,exports) {
549
- "use strict";var e=require("./../utils");function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}module.exports=function(i,n,t){if(!n)return i;var a;if(t)a=t(n);else if(e.isURLSearchParams(n))a=n.toString();else{var c=[];e.forEach(n,function(i,n){null!=i&&(e.isArray(i)?n+="[]":i=[i],e.forEach(i,function(i){e.isDate(i)?i=i.toISOString():e.isObject(i)&&(i=JSON.stringify(i)),c.push(r(n)+"="+r(i))}))}),a=c.join("&")}if(a){var o=i.indexOf("#");-1!==o&&(i=i.slice(0,o)),i+=(-1===i.indexOf("?")?"?":"&")+a}return i};
550
- },{"./../utils":"S1cf"}],"rj2i":[function(require,module,exports) {
551
- "use strict";var n=require("./../utils");function e(){this.handlers=[]}e.prototype.use=function(n,e,t){return this.handlers.push({fulfilled:n,rejected:e,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1},e.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},e.prototype.forEach=function(e){n.forEach(this.handlers,function(n){null!==n&&e(n)})},module.exports=e;
552
- },{"./../utils":"S1cf"}],"M8l6":[function(require,module,exports) {
553
- "use strict";var e=require("../utils");module.exports=function(t,r){e.forEach(t,function(e,o){o!==r&&o.toUpperCase()===r.toUpperCase()&&(t[r]=e,delete t[o])})};
554
- },{"../utils":"S1cf"}],"YdsM":[function(require,module,exports) {
555
- "use strict";module.exports=function(s,e,t,i,n){return s.config=e,t&&(s.code=t),s.request=i,s.response=n,s.isAxiosError=!0,s.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},s};
556
- },{}],"bIiH":[function(require,module,exports) {
557
- "use strict";var r=require("./enhanceError");module.exports=function(e,n,o,t,u){var a=new Error(e);return r(a,n,o,t,u)};
558
- },{"./enhanceError":"YdsM"}],"aS8y":[function(require,module,exports) {
559
- "use strict";var t=require("./createError");module.exports=function(e,s,u){var a=u.config.validateStatus;u.status&&a&&!a(u.status)?s(t("Request failed with status code "+u.status,u.config,null,u.request,u)):e(u)};
560
- },{"./createError":"bIiH"}],"dn2M":[function(require,module,exports) {
561
- "use strict";var e=require("./../utils");module.exports=e.isStandardBrowserEnv()?{write:function(n,t,o,r,i,u){var s=[];s.push(n+"="+encodeURIComponent(t)),e.isNumber(o)&&s.push("expires="+new Date(o).toGMTString()),e.isString(r)&&s.push("path="+r),e.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};
562
- },{"./../utils":"S1cf"}],"YZjV":[function(require,module,exports) {
563
- "use strict";module.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};
547
+ var global = arguments[3];
548
+ var define;
549
+ var e,t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=n(require("./helpers/bind.js"));function n(e){return e&&e.__esModule?e:{default:e}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(e=>t=>{const r=o.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),l=e=>(e=e.toLowerCase(),t=>s(t)===e),a=e=>t=>typeof t===e,{isArray:c}=Array,u=a("undefined");function f(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const p=l("ArrayBuffer");function y(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer)}const d=a("string"),b=a("function"),O=a("number"),g=e=>null!==e&&"object"==typeof e,h=e=>!0===e||!1===e,m=e=>{if("object"!==s(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},w=l("Date"),j=l("File"),A=l("Blob"),F=l("FileList"),S=e=>g(e)&&b(e.pipe),P=e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=s(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},x=l("URLSearchParams"),L=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function B(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),c(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(n=0;n<i;n++)s=o[n],t.call(null,e[s],s,e)}}function C(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}const D=(()=>"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t)(),T=e=>!u(e)&&e!==D;function E(){const{caseless:e}=T(this)&&this||{},t={},r=(r,n)=>{const o=e&&C(t,n)||n;m(t[o])&&m(r)?t[o]=E(t[o],r):m(r)?t[o]=E({},r):c(r)?t[o]=r.slice():t[o]=r};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&B(arguments[n],r);return t}const v=(e,t,n,{allOwnKeys:o}={})=>(B(t,(t,o)=>{n&&b(t)?e[o]=(0,r.default)(t,n):e[o]=t},{allOwnKeys:o}),e),M=e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),N=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},U=(e,t,r,n)=>{let o,s,l;const a={};if(t=t||{},null==e)return t;do{for(s=(o=Object.getOwnPropertyNames(e)).length;s-- >0;)l=o[s],n&&!n(l,e,t)||a[l]||(t[l]=e[l],a[l]=!0);e=!1!==r&&i(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_=(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},H=e=>{if(!e)return null;if(c(e))return e;let t=e.length;if(!O(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},I=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&i(Uint8Array)),k=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},K=(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},R=l("HTMLFormElement"),z=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),G=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),V=l("RegExp"),q=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};B(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)},J=e=>{q(e,(t,r)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=(()=>{throw Error("Can not rewrite read-only method '"+r+"'")})))})},W=(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return c(e)?n(e):n(String(e).split(t)),r},$=()=>{},Q=(e,t)=>(e=+e,Number.isFinite(e)?e:t),X="abcdefghijklmnopqrstuvwxyz",Y="0123456789",Z={DIGIT:Y,ALPHA:X,ALPHA_DIGIT:X+X.toUpperCase()+Y},ee=(e=16,t=Z.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function te(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])}const re=e=>{const t=new Array(10),r=(e,n)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=c(e)?[]:{};return B(e,(e,t)=>{const i=r(e,n+1);!u(i)&&(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},ne=l("AsyncFunction"),oe=e=>e&&(g(e)||b(e))&&b(e.then)&&b(e.catch);var ie={isArray:c,isArrayBuffer:p,isBuffer:f,isFormData:P,isArrayBufferView:y,isString:d,isNumber:O,isBoolean:h,isObject:g,isPlainObject:m,isUndefined:u,isDate:w,isFile:j,isBlob:A,isRegExp:V,isFunction:b,isStream:S,isURLSearchParams:x,isTypedArray:I,isFileList:F,forEach:B,merge:E,extend:v,trim:L,stripBOM:M,inherits:N,toFlatObject:U,kindOf:s,kindOfTest:l,endsWith:_,toArray:H,forEachEntry:k,matchAll:K,isHTMLForm:R,hasOwnProperty:G,hasOwnProp:G,reduceDescriptors:q,freezeMethods:J,toObjectSet:W,toCamelCase:z,noop:$,toFiniteNumber:Q,findKey:C,global:D,isContextDefined:T,ALPHABET:Z,generateString:ee,isSpecCompliantForm:te,toJSONObject:re,isAsyncFn:ne,isThenable:oe};exports.default=ie;
550
+ },{"./helpers/bind.js":"EDTP"}],"rRKx":[function(require,module,exports) {
551
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../utils.js"));function t(e){return e&&e.__esModule?e:{default:e}}function r(e,t,r,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),s&&(this.request=s),i&&(this.response=i)}e.default.inherits(r,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:e.default.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const s=r.prototype,i={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{i[e]={value:e}}),Object.defineProperties(r,i),Object.defineProperty(s,"isAxiosError",{value:!0}),r.from=((t,i,o,a,n,c)=>{const u=Object.create(s);return e.default.toFlatObject(t,u,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),r.call(u,t.message,i,o,a,n),u.cause=t,u.name=t.name,c&&Object.assign(u,c),u});var o=r;exports.default=o;
552
+ },{"../utils.js":"S1cf"}],"jiNE":[function(require,module,exports) {
553
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=null;exports.default=e;
554
+ },{}],"yh9p":[function(require,module,exports) {
555
+ "use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
556
+ },{}],"JgNJ":[function(require,module,exports) {
557
+ exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
558
+ },{}],"wvRa":[function(require,module,exports) {
559
+ var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
560
+ },{}],"peL6":[function(require,module,exports) {
561
+
562
+ var global = arguments[3];
563
+ var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
564
+ },{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"wvRa","buffer":"peL6"}],"BFle":[function(require,module,exports) {
565
+ var Buffer = require("buffer").Buffer;
566
+ var e=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("../utils.js")),r=i(require("../core/AxiosError.js")),n=i(require("../platform/node/classes/FormData.js"));function i(e){return e&&e.__esModule?e:{default:e}}function u(e){return t.default.isPlainObject(e)||t.default.isArray(e)}function f(e){return t.default.endsWith(e,"[]")?e.slice(0,-2):e}function o(e,t,r){return e?e.concat(t).map(function(e,t){return e=f(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}function a(e){return t.default.isArray(e)&&!e.some(u)}const l=t.default.toFlatObject(t.default,{},null,function(e){return/^is[A-Z]/.test(e)});function s(i,s,d){if(!t.default.isObject(i))throw new TypeError("target must be an object");s=s||new(n.default||FormData);const c=(d=t.default.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,r){return!t.default.isUndefined(r[e])})).metaTokens,p=d.visitor||h,b=d.dots,j=d.indexes,y=(d.Blob||"undefined"!=typeof Blob&&Blob)&&t.default.isSpecCompliantForm(s);if(!t.default.isFunction(p))throw new TypeError("visitor must be a function");function m(n){if(null===n)return"";if(t.default.isDate(n))return n.toISOString();if(!y&&t.default.isBlob(n))throw new r.default("Blob is not supported. Use a Buffer instead.");return t.default.isArrayBuffer(n)||t.default.isTypedArray(n)?y&&"function"==typeof Blob?new Blob([n]):e.from(n):n}function h(e,r,n){let i=e;if(e&&!n&&"object"==typeof e)if(t.default.endsWith(r,"{}"))r=c?r:r.slice(0,-2),e=JSON.stringify(e);else if(t.default.isArray(e)&&a(e)||(t.default.isFileList(e)||t.default.endsWith(r,"[]"))&&(i=t.default.toArray(e)))return r=f(r),i.forEach(function(e,n){!t.default.isUndefined(e)&&null!==e&&s.append(!0===j?o([r],n,b):null===j?r:r+"[]",m(e))}),!1;return!!u(e)||(s.append(o(n,r,b),m(e)),!1)}const w=[],B=Object.assign(l,{defaultVisitor:h,convertValue:m,isVisitable:u});if(!t.default.isObject(i))throw new TypeError("data must be an object");return function e(r,n){if(!t.default.isUndefined(r)){if(-1!==w.indexOf(r))throw Error("Circular reference detected in "+n.join("."));w.push(r),t.default.forEach(r,function(r,i){!0===(!(t.default.isUndefined(r)||null===r)&&p.call(s,r,t.default.isString(i)?i.trim():i,n,B))&&e(r,n?n.concat(i):[i])}),w.pop()}}(i),s}var d=s;exports.default=d;
567
+ },{"../utils.js":"S1cf","../core/AxiosError.js":"rRKx","../platform/node/classes/FormData.js":"jiNE","buffer":"peL6"}],"lSwM":[function(require,module,exports) {
568
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./toFormData.js"));function e(t){return t&&t.__esModule?t:{default:t}}function n(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function r(e,n){this._pairs=[],e&&(0,t.default)(e,this,n)}const o=r.prototype;o.append=function(t,e){this._pairs.push([t,e])},o.toString=function(t){const e=t?function(e){return t.call(this,e,n)}:n;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};var u=r;exports.default=u;
569
+ },{"./toFormData.js":"BFle"}],"H6Qo":[function(require,module,exports) {
570
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=t(require("../utils.js")),r=t(require("../helpers/AxiosURLSearchParams.js"));function t(e){return e&&e.__esModule?e:{default:e}}function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function n(t,n,a){if(!n)return t;const c=a&&a.encode||i,l=a&&a.serialize;let s;if(s=l?l(n,a):e.default.isURLSearchParams(n)?n.toString():new r.default(n,a).toString(c)){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}
571
+ },{"../utils.js":"S1cf","../helpers/AxiosURLSearchParams.js":"lSwM"}],"rj2i":[function(require,module,exports) {
572
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("./../utils.js"));function s(e){return e&&e.__esModule?e:{default:e}}class r{constructor(){this.handlers=[]}use(e,s,r){return this.handlers.push({fulfilled:e,rejected:s,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){e.default.forEach(this.handlers,function(e){null!==e&&s(e)})}}var t=r;exports.default=t;
573
+ },{"./../utils.js":"S1cf"}],"LrSb":[function(require,module,exports) {
574
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};exports.default=e;
575
+ },{}],"gNhC":[function(require,module,exports) {
576
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("../../../helpers/AxiosURLSearchParams.js"));function r(e){return e&&e.__esModule?e:{default:e}}var a="undefined"!=typeof URLSearchParams?URLSearchParams:e.default;exports.default=a;
577
+ },{"../../../helpers/AxiosURLSearchParams.js":"lSwM"}],"BCMH":[function(require,module,exports) {
578
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e="undefined"!=typeof FormData?FormData:null;exports.default=e;
579
+ },{}],"jSAH":[function(require,module,exports) {
580
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e="undefined"!=typeof Blob?Blob:null;exports.default=e;
581
+ },{}],"KFqX":[function(require,module,exports) {
582
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./classes/URLSearchParams.js")),s=a(require("./classes/FormData.js")),r=a(require("./classes/Blob.js"));function a(e){return e&&e.__esModule?e:{default:e}}var t={isBrowser:!0,classes:{URLSearchParams:e.default,FormData:s.default,Blob:r.default},protocols:["http","https","file","blob","url","data"]};exports.default=t;
583
+ },{"./classes/URLSearchParams.js":"gNhC","./classes/FormData.js":"BCMH","./classes/Blob.js":"jSAH"}],"umJP":[function(require,module,exports) {
584
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasStandardBrowserWebWorkerEnv=exports.hasStandardBrowserEnv=exports.hasBrowserEnv=void 0;const e="undefined"!=typeof window&&"undefined"!=typeof document;exports.hasBrowserEnv=e;const o=(o=>e&&["ReactNative","NativeScript","NS"].indexOf(o)<0)("undefined"!=typeof navigator&&navigator.product);exports.hasStandardBrowserEnv=o;const r=(()=>"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts)();exports.hasStandardBrowserWebWorkerEnv=r;
585
+ },{}],"dN6h":[function(require,module,exports) {
586
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./node/index.js")),t=n(require("./common/utils.js"));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}function n(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var u={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&Object.prototype.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(u,f,a):u[f]=e[f]}return u.default=e,n&&n.set(e,u),u}function u(e){return e&&e.__esModule?e:{default:e}}var o={...t,...e.default};exports.default=o;
587
+ },{"./node/index.js":"KFqX","./common/utils.js":"umJP"}],"R27V":[function(require,module,exports) {
588
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=s(require("../utils.js")),t=s(require("./toFormData.js")),r=s(require("../platform/index.js"));function s(e){return e&&e.__esModule?e:{default:e}}function u(s,u){return(0,t.default)(s,new r.default.classes.URLSearchParams,Object.assign({visitor:function(t,s,u,a){return r.default.isNode&&e.default.isBuffer(t)?(this.append(s,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},u))}
589
+ },{"../utils.js":"S1cf","./toFormData.js":"BFle","../platform/index.js":"dN6h"}],"zEQI":[function(require,module,exports) {
590
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("../utils.js"));function e(t){return t&&t.__esModule?t:{default:t}}function r(e){return t.default.matchAll(/\w+|\[(\w*)]/g,e).map(t=>"[]"===t[0]?"":t[1]||t[0])}function n(t){const e={},r=Object.keys(t);let n;const u=r.length;let l;for(n=0;n<u;n++)e[l=r[n]]=t[l];return e}function u(e){if(t.default.isFormData(e)&&t.default.isFunction(e.entries)){const u={};return t.default.forEachEntry(e,(e,l)=>{!function e(r,u,l,a){let s=r[a++];const i=Number.isFinite(+s),o=a>=r.length;return s=!s&&t.default.isArray(l)?l.length:s,o?(t.default.hasOwnProp(l,s)?l[s]=[l[s],u]:l[s]=u,!i):(l[s]&&t.default.isObject(l[s])||(l[s]=[]),e(r,u,l[s],a)&&t.default.isArray(l[s])&&(l[s]=n(l[s])),!i)}(r(e),l,u,0)}),u}return null}var l=u;exports.default=l;
591
+ },{"../utils.js":"S1cf"}],"VQpg":[function(require,module,exports) {
592
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("../utils.js")),t=o(require("../core/AxiosError.js")),r=o(require("./transitional.js")),a=o(require("../helpers/toFormData.js")),i=o(require("../helpers/toURLEncodedForm.js")),n=o(require("../platform/index.js")),s=o(require("../helpers/formDataToJSON.js"));function o(e){return e&&e.__esModule?e:{default:e}}function f(t,r,a){if(e.default.isString(t))try{return(r||JSON.parse)(t),e.default.trim(t)}catch(i){if("SyntaxError"!==i.name)throw i}return(a||JSON.stringify)(t)}const u={transitional:r.default,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,u=e.default.isObject(t);if(u&&e.default.isHTMLForm(t)&&(t=new FormData(t)),e.default.isFormData(t))return o&&o?JSON.stringify((0,s.default)(t)):t;if(e.default.isArrayBuffer(t)||e.default.isBuffer(t)||e.default.isStream(t)||e.default.isFile(t)||e.default.isBlob(t))return t;if(e.default.isArrayBufferView(t))return t.buffer;if(e.default.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(u){if(n.indexOf("application/x-www-form-urlencoded")>-1)return(0,i.default)(t,this.formSerializer).toString();if((l=e.default.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return(0,a.default)(l?{"files[]":t}:t,e&&new e,this.formSerializer)}}return u||o?(r.setContentType("application/json",!1),f(t)):t}],transformResponse:[function(r){const a=this.transitional||u.transitional,i=a&&a.forcedJSONParsing,n="json"===this.responseType;if(r&&e.default.isString(r)&&(i&&!this.responseType||n)){const e=!(a&&a.silentJSONParsing)&&n;try{return JSON.parse(r)}catch(s){if(e){if("SyntaxError"===s.name)throw t.default.from(s,t.default.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:n.default.classes.FormData,Blob:n.default.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};e.default.forEach(["delete","get","head","post","put","patch"],e=>{u.headers[e]={}});var l=u;exports.default=l;
593
+ },{"../utils.js":"S1cf","../core/AxiosError.js":"rRKx","./transitional.js":"LrSb","../helpers/toFormData.js":"BFle","../helpers/toURLEncodedForm.js":"R27V","../platform/index.js":"dN6h","../helpers/formDataToJSON.js":"zEQI"}],"ZeD7":[function(require,module,exports) {
594
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./../utils.js"));function t(e){return e&&e.__esModule?e:{default:e}}const r=e.default.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var o=e=>{const t={};let o,i,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),o=e.substring(0,s).trim().toLowerCase(),i=e.substring(s+1).trim(),!o||t[o]&&r[o]||("set-cookie"===o?t[o]?t[o].push(i):t[o]=[i]:t[o]=t[o]?t[o]+", "+i:i)}),t};exports.default=o;
595
+ },{"./../utils.js":"S1cf"}],"aueS":[function(require,module,exports) {
596
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("../utils.js")),e=r(require("../helpers/parseHeaders.js"));function r(t){return t&&t.__esModule?t:{default:t}}const n=Symbol("internals");function s(t){return t&&String(t).trim().toLowerCase()}function i(e){return!1===e||null==e?e:t.default.isArray(e)?e.map(i):String(e)}function o(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const c=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function a(e,r,n,s,i){return t.default.isFunction(s)?s.call(this,r,n):(i&&(r=n),t.default.isString(r)?t.default.isString(s)?-1!==r.indexOf(s):t.default.isRegExp(s)?s.test(r):void 0:void 0)}function u(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}function l(e,r){const n=t.default.toCamelCase(" "+r);["get","set","has"].forEach(t=>{Object.defineProperty(e,t+n,{value:function(e,n,s){return this[t].call(this,r,e,n,s)},configurable:!0})})}class f{constructor(t){t&&this.set(t)}set(r,n,o){const a=this;function u(e,r,n){const o=s(r);if(!o)throw new Error("header name must be a non-empty string");const c=t.default.findKey(a,o);(!c||void 0===a[c]||!0===n||void 0===n&&!1!==a[c])&&(a[c||r]=i(e))}const l=(e,r)=>t.default.forEach(e,(t,e)=>u(t,e,r));return t.default.isPlainObject(r)||r instanceof this.constructor?l(r,n):t.default.isString(r)&&(r=r.trim())&&!c(r)?l((0,e.default)(r),n):null!=r&&u(n,r,o),this}get(e,r){if(e=s(e)){const n=t.default.findKey(this,e);if(n){const e=this[n];if(!r)return e;if(!0===r)return o(e);if(t.default.isFunction(r))return r.call(this,e,n);if(t.default.isRegExp(r))return r.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=s(e)){const n=t.default.findKey(this,e);return!(!n||void 0===this[n]||r&&!a(this,this[n],n,r))}return!1}delete(e,r){const n=this;let i=!1;function o(e){if(e=s(e)){const s=t.default.findKey(n,e);!s||r&&!a(n,n[s],s,r)||(delete n[s],i=!0)}}return t.default.isArray(e)?e.forEach(o):o(e),i}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const s=e[r];t&&!a(this,this[s],s,t,!0)||(delete this[s],n=!0)}return n}normalize(e){const r=this,n={};return t.default.forEach(this,(s,o)=>{const c=t.default.findKey(n,o);if(c)return r[c]=i(s),void delete r[o];const a=e?u(o):String(o).trim();a!==o&&delete r[o],r[a]=i(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(e){const r=Object.create(null);return t.default.forEach(this,(n,s)=>{null!=n&&!1!==n&&(r[s]=e&&t.default.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(e){const r=(this[n]=this[n]={accessors:{}}).accessors,i=this.prototype;function o(t){const e=s(t);r[e]||(l(i,t),r[e]=!0)}return t.default.isArray(e)?e.forEach(o):o(e),this}}f.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),t.default.reduceDescriptors(f.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),t.default.freezeMethods(f);var d=f;exports.default=d;
597
+ },{"../utils.js":"S1cf","../helpers/parseHeaders.js":"ZeD7"}],"woEt":[function(require,module,exports) {
598
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=s;var e=u(require("./../utils.js")),t=u(require("../defaults/index.js")),r=u(require("../core/AxiosHeaders.js"));function u(e){return e&&e.__esModule?e:{default:e}}function s(u,s){const a=this||t.default,o=s||a,i=r.default.from(o.headers);let l=o.data;return e.default.forEach(u,function(e){l=e.call(a,l,i.normalize(),s?s.status:void 0)}),i.normalize(),l}
599
+ },{"./../utils.js":"S1cf","../defaults/index.js":"VQpg","../core/AxiosHeaders.js":"aueS"}],"V30M":[function(require,module,exports) {
600
+ "use strict";function e(e){return!(!e||!e.__CANCEL__)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
601
+ },{}],"E1lI":[function(require,module,exports) {
602
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../core/AxiosError.js")),r=t(require("../utils.js"));function t(e){return e&&e.__esModule?e:{default:e}}function u(r,t,u){e.default.call(this,null==r?"canceled":r,e.default.ERR_CANCELED,t,u),this.name="CanceledError"}r.default.inherits(u,e.default,{__CANCEL__:!0});var l=u;exports.default=l;
603
+ },{"../core/AxiosError.js":"rRKx","../utils.js":"S1cf"}],"aS8y":[function(require,module,exports) {
604
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=s;var t=e(require("./AxiosError.js"));function e(t){return t&&t.__esModule?t:{default:t}}function s(e,s,u){const a=u.config.validateStatus;u.status&&a&&!a(u.status)?s(new t.default("Request failed with status code "+u.status,[t.default.ERR_BAD_REQUEST,t.default.ERR_BAD_RESPONSE][Math.floor(u.status/100)-4],u.config,u.request,u)):e(u)}
605
+ },{"./AxiosError.js":"rRKx"}],"dn2M":[function(require,module,exports) {
606
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./../utils.js")),t=r(require("../platform/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}var o=t.default.hasStandardBrowserEnv?{write(t,r,o,n,u,s){const i=[t+"="+encodeURIComponent(r)];e.default.isNumber(o)&&i.push("expires="+new Date(o).toGMTString()),e.default.isString(n)&&i.push("path="+n),e.default.isString(u)&&i.push("domain="+u),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};exports.default=o;
607
+ },{"./../utils.js":"S1cf","../platform/index.js":"dN6h"}],"YZjV":[function(require,module,exports) {
608
+ "use strict";function e(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
564
609
  },{}],"a2Uu":[function(require,module,exports) {
565
- "use strict";module.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e};
610
+ "use strict";function e(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
566
611
  },{}],"KxkP":[function(require,module,exports) {
567
- "use strict";var e=require("../helpers/isAbsoluteURL"),r=require("../helpers/combineURLs");module.exports=function(s,u){return s&&!e(u)?r(s,u):u};
568
- },{"../helpers/isAbsoluteURL":"YZjV","../helpers/combineURLs":"a2Uu"}],"ZeD7":[function(require,module,exports) {
569
- "use strict";var e=require("./../utils"),t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];module.exports=function(r){var i,o,n,s={};return r?(e.forEach(r.split("\n"),function(r){if(n=r.indexOf(":"),i=e.trim(r.substr(0,n)).toLowerCase(),o=e.trim(r.substr(n+1)),i){if(s[i]&&t.indexOf(i)>=0)return;s[i]="set-cookie"===i?(s[i]?s[i]:[]).concat([o]):s[i]?s[i]+", "+o:o}}),s):s};
570
- },{"./../utils":"S1cf"}],"w7LF":[function(require,module,exports) {
571
- "use strict";var t=require("./../utils");module.exports=t.isStandardBrowserEnv()?function(){var r,e=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");function a(t){var r=t;return e&&(o.setAttribute("href",r),r=o.href),o.setAttribute("href",r),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}return r=a(window.location.href),function(e){var o=t.isString(e)?a(e):e;return o.protocol===r.protocol&&o.host===r.host}}():function(){return!0};
572
- },{"./../utils":"S1cf"}],"mIKj":[function(require,module,exports) {
573
- "use strict";function t(t){this.message=t}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,module.exports=t;
612
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=t(require("../helpers/isAbsoluteURL.js")),r=t(require("../helpers/combineURLs.js"));function t(e){return e&&e.__esModule?e:{default:e}}function u(t,u){return t&&!(0,e.default)(u)?(0,r.default)(t,u):u}
613
+ },{"../helpers/isAbsoluteURL.js":"YZjV","../helpers/combineURLs.js":"a2Uu"}],"w7LF":[function(require,module,exports) {
614
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./../utils.js")),t=r(require("../platform/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}var o=t.default.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let o;function a(e){let o=e;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return o=a(window.location.href),function(t){const r=e.default.isString(t)?a(t):t;return r.protocol===o.protocol&&r.host===o.host}}():function(){return!0};exports.default=o;
615
+ },{"./../utils.js":"S1cf","../platform/index.js":"dN6h"}],"NS8l":[function(require,module,exports) {
616
+ "use strict";function e(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
617
+ },{}],"keMf":[function(require,module,exports) {
618
+ "use strict";function e(e,t){e=e||10;const r=new Array(e),o=new Array(e);let n,u=0,s=0;return t=void 0!==t?t:1e3,function(a){const d=Date.now(),i=o[s];n||(n=d),r[u]=a,o[u]=d;let c=s,f=0;for(;c!==u;)f+=r[c++],c%=e;if((u=(u+1)%e)===s&&(s=(s+1)%e),d-n<t)return;const l=i&&d-i;return l?Math.round(1e3*f/l):void 0}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e;exports.default=t;
574
619
  },{}],"KRuG":[function(require,module,exports) {
575
- "use strict";var e=require("./../utils"),r=require("./../core/settle"),t=require("./../helpers/cookies"),n=require("./../helpers/buildURL"),o=require("../core/buildFullPath"),s=require("./../helpers/parseHeaders"),a=require("./../helpers/isURLSameOrigin"),i=require("../core/createError"),u=require("../defaults"),l=require("../cancel/Cancel");module.exports=function(d){return new Promise(function(c,p){var f,m=d.data,g=d.headers,h=d.responseType;function T(){d.cancelToken&&d.cancelToken.unsubscribe(f),d.signal&&d.signal.removeEventListener("abort",f)}e.isFormData(m)&&delete g["Content-Type"];var E=new XMLHttpRequest;if(d.auth){var v=d.auth.username||"",q=d.auth.password?unescape(encodeURIComponent(d.auth.password)):"";g.Authorization="Basic "+btoa(v+":"+q)}var b=o(d.baseURL,d.url);function w(){if(E){var e="getAllResponseHeaders"in E?s(E.getAllResponseHeaders()):null,t={data:h&&"text"!==h&&"json"!==h?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:e,config:d,request:E};r(function(e){c(e),T()},function(e){p(e),T()},t),E=null}}if(E.open(d.method.toUpperCase(),n(b,d.params,d.paramsSerializer),!0),E.timeout=d.timeout,"onloadend"in E?E.onloadend=w:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(w)},E.onabort=function(){E&&(p(i("Request aborted",d,"ECONNABORTED",E)),E=null)},E.onerror=function(){p(i("Network Error",d,null,E)),E=null},E.ontimeout=function(){var e=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",r=d.transitional||u.transitional;d.timeoutErrorMessage&&(e=d.timeoutErrorMessage),p(i(e,d,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",E)),E=null},e.isStandardBrowserEnv()){var R=(d.withCredentials||a(b))&&d.xsrfCookieName?t.read(d.xsrfCookieName):void 0;R&&(g[d.xsrfHeaderName]=R)}"setRequestHeader"in E&&e.forEach(g,function(e,r){void 0===m&&"content-type"===r.toLowerCase()?delete g[r]:E.setRequestHeader(r,e)}),e.isUndefined(d.withCredentials)||(E.withCredentials=!!d.withCredentials),h&&"json"!==h&&(E.responseType=d.responseType),"function"==typeof d.onDownloadProgress&&E.addEventListener("progress",d.onDownloadProgress),"function"==typeof d.onUploadProgress&&E.upload&&E.upload.addEventListener("progress",d.onUploadProgress),(d.cancelToken||d.signal)&&(f=function(e){E&&(p(!e||e&&e.type?new l("canceled"):e),E.abort(),E=null)},d.cancelToken&&d.cancelToken.subscribe(f),d.signal&&(d.signal.aborted?f():d.signal.addEventListener("abort",f))),m||(m=null),E.send(m)})};
576
- },{"./../utils":"S1cf","./../core/settle":"aS8y","./../helpers/cookies":"dn2M","./../helpers/buildURL":"H6Qo","../core/buildFullPath":"KxkP","./../helpers/parseHeaders":"ZeD7","./../helpers/isURLSameOrigin":"w7LF","../core/createError":"bIiH","../defaults":"BXyq","../cancel/Cancel":"mIKj"}],"BXyq":[function(require,module,exports) {
577
- var process = require("process");
578
- var e=require("process"),r=require("./utils"),t=require("./helpers/normalizeHeaderName"),n=require("./core/enhanceError"),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var r;return"undefined"!=typeof XMLHttpRequest?r=require("./adapters/xhr"):void 0!==e&&"[object process]"===Object.prototype.toString.call(e)&&(r=require("./adapters/http")),r}function s(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(e)}var c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:o(),transformRequest:[function(e,n){return t(n,"Accept"),t(n,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(n,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||n&&"application/json"===n["Content-Type"]?(a(n,"application/json"),s(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,i=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,o=!i&&"json"===this.responseType;if(o||a&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o){if("SyntaxError"===s.name)throw n(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){c.headers[e]={}}),r.forEach(["post","put","patch"],function(e){c.headers[e]=r.merge(i)}),module.exports=c;
579
- },{"./utils":"S1cf","./helpers/normalizeHeaderName":"M8l6","./core/enhanceError":"YdsM","./adapters/xhr":"KRuG","./adapters/http":"KRuG","process":"pBGv"}],"woEt":[function(require,module,exports) {
580
- "use strict";var r=require("./../utils"),e=require("./../defaults");module.exports=function(t,u,i){var s=this||e;return r.forEach(i,function(r){t=r.call(s,t,u)}),t};
581
- },{"./../utils":"S1cf","./../defaults":"BXyq"}],"V30M":[function(require,module,exports) {
582
- "use strict";module.exports=function(t){return!(!t||!t.__CANCEL__)};
583
- },{}],"uz6X":[function(require,module,exports) {
584
- "use strict";var e=require("./../utils"),a=require("./transformData"),r=require("../cancel/isCancel"),t=require("../defaults"),n=require("../cancel/Cancel");function s(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new n("canceled")}module.exports=function(n){return s(n),n.headers=n.headers||{},n.data=a.call(n,n.data,n.headers,n.transformRequest),n.headers=e.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),e.forEach(["delete","get","head","post","put","patch","common"],function(e){delete n.headers[e]}),(n.adapter||t.adapter)(n).then(function(e){return s(n),e.data=a.call(n,e.data,e.headers,n.transformResponse),e},function(e){return r(e)||(s(n),e&&e.response&&(e.response.data=a.call(n,e.response.data,e.response.headers,n.transformResponse))),Promise.reject(e)})};
585
- },{"./../utils":"S1cf","./transformData":"woEt","../cancel/isCancel":"V30M","../defaults":"BXyq","../cancel/Cancel":"mIKj"}],"OHvn":[function(require,module,exports) {
586
- "use strict";var e=require("../utils");module.exports=function(n,t){t=t||{};var i={};function r(n,t){return e.isPlainObject(n)&&e.isPlainObject(t)?e.merge(n,t):e.isPlainObject(t)?e.merge({},t):e.isArray(t)?t.slice():t}function o(i){return e.isUndefined(t[i])?e.isUndefined(n[i])?void 0:r(void 0,n[i]):r(n[i],t[i])}function s(n){if(!e.isUndefined(t[n]))return r(void 0,t[n])}function a(i){return e.isUndefined(t[i])?e.isUndefined(n[i])?void 0:r(void 0,n[i]):r(void 0,t[i])}function d(e){return e in t?r(n[e],t[e]):e in n?r(void 0,n[e]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:d};return e.forEach(Object.keys(n).concat(Object.keys(t)),function(n){var t=c[n]||o,r=t(n);e.isUndefined(r)&&t!==d||(i[n]=r)}),i};
587
- },{"../utils":"S1cf"}],"xNqU":[function(require,module,exports) {
588
- module.exports={version:"0.25.0"};
620
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=p(require("./../utils.js")),t=p(require("./../core/settle.js")),o=p(require("./../helpers/cookies.js")),r=p(require("./../helpers/buildURL.js")),n=p(require("../core/buildFullPath.js")),s=p(require("./../helpers/isURLSameOrigin.js")),a=p(require("../defaults/transitional.js")),u=p(require("../core/AxiosError.js")),l=p(require("../cancel/CanceledError.js")),i=p(require("../helpers/parseProtocol.js")),d=p(require("../platform/index.js")),f=p(require("../core/AxiosHeaders.js")),c=p(require("../helpers/speedometer.js"));function p(e){return e&&e.__esModule?e:{default:e}}function m(e,t){let o=0;const r=(0,c.default)(50,250);return n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,u=s-o,l=r(u);o=s;const i={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&s<=a?(a-s)/l:void 0,event:n};i[t?"download":"upload"]=!0,e(i)}}const E="undefined"!=typeof XMLHttpRequest;var h=E&&function(c){return new Promise(function(p,E){let h=c.data;const T=f.default.from(c.headers).normalize();let g,R,{responseType:w,withXSRFToken:q}=c;function b(){c.cancelToken&&c.cancelToken.unsubscribe(g),c.signal&&c.signal.removeEventListener("abort",g)}if(e.default.isFormData(h))if(d.default.hasStandardBrowserEnv||d.default.hasStandardBrowserWebWorkerEnv)T.setContentType(!1);else if(!1!==(R=T.getContentType())){const[e,...t]=R?R.split(";").map(e=>e.trim()).filter(Boolean):[];T.setContentType([e||"multipart/form-data",...t].join("; "))}let v=new XMLHttpRequest;if(c.auth){const e=c.auth.username||"",t=c.auth.password?unescape(encodeURIComponent(c.auth.password)):"";T.set("Authorization","Basic "+btoa(e+":"+t))}const x=(0,n.default)(c.baseURL,c.url);function j(){if(!v)return;const e=f.default.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),o={data:w&&"text"!==w&&"json"!==w?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:e,config:c,request:v};(0,t.default)(function(e){p(e),b()},function(e){E(e),b()},o),v=null}if(v.open(c.method.toUpperCase(),(0,r.default)(x,c.params,c.paramsSerializer),!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=j:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(j)},v.onabort=function(){v&&(E(new u.default("Request aborted",u.default.ECONNABORTED,c,v)),v=null)},v.onerror=function(){E(new u.default("Network Error",u.default.ERR_NETWORK,c,v)),v=null},v.ontimeout=function(){let e=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const t=c.transitional||a.default;c.timeoutErrorMessage&&(e=c.timeoutErrorMessage),E(new u.default(e,t.clarifyTimeoutError?u.default.ETIMEDOUT:u.default.ECONNABORTED,c,v)),v=null},d.default.hasStandardBrowserEnv&&(q&&e.default.isFunction(q)&&(q=q(c)),q||!1!==q&&(0,s.default)(x))){const e=c.xsrfHeaderName&&c.xsrfCookieName&&o.default.read(c.xsrfCookieName);e&&T.set(c.xsrfHeaderName,e)}void 0===h&&T.setContentType(null),"setRequestHeader"in v&&e.default.forEach(T.toJSON(),function(e,t){v.setRequestHeader(t,e)}),e.default.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),w&&"json"!==w&&(v.responseType=c.responseType),"function"==typeof c.onDownloadProgress&&v.addEventListener("progress",m(c.onDownloadProgress,!0)),"function"==typeof c.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",m(c.onUploadProgress)),(c.cancelToken||c.signal)&&(g=(e=>{v&&(E(!e||e.type?new l.default(null,c,v):e),v.abort(),v=null)}),c.cancelToken&&c.cancelToken.subscribe(g),c.signal&&(c.signal.aborted?g():c.signal.addEventListener("abort",g)));const y=(0,i.default)(x);y&&-1===d.default.protocols.indexOf(y)?E(new u.default("Unsupported protocol "+y+":",u.default.ERR_BAD_REQUEST,c)):v.send(h||null)})};exports.default=h;
621
+ },{"./../utils.js":"S1cf","./../core/settle.js":"aS8y","./../helpers/cookies.js":"dn2M","./../helpers/buildURL.js":"H6Qo","../core/buildFullPath.js":"KxkP","./../helpers/isURLSameOrigin.js":"w7LF","../defaults/transitional.js":"LrSb","../core/AxiosError.js":"rRKx","../cancel/CanceledError.js":"E1lI","../helpers/parseProtocol.js":"NS8l","../platform/index.js":"dN6h","../core/AxiosHeaders.js":"aueS","../helpers/speedometer.js":"keMf"}],"MSoV":[function(require,module,exports) {
622
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("../utils.js")),t=n(require("./http.js")),r=n(require("./xhr.js")),a=n(require("../core/AxiosError.js"));function n(e){return e&&e.__esModule?e:{default:e}}const i={http:t.default,xhr:r.default};e.default.forEach(i,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});const o=e=>`- ${e}`,s=t=>e.default.isFunction(t)||null===t||!1===t;var u={getAdapter:t=>{t=e.default.isArray(t)?t:[t];const{length:r}=t;let n,u;const d={};for(let e=0;e<r;e++){let r;if(u=n=t[e],!s(n)&&void 0===(u=i[(r=String(n)).toLowerCase()]))throw new a.default(`Unknown adapter '${r}'`);if(u)break;d[r||"#"+e]=u}if(!u){const e=Object.entries(d).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(o).join("\n"):" "+o(e[0]):"as no adapter specified";throw new a.default("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return u},adapters:i};exports.default=u;
623
+ },{"../utils.js":"S1cf","./http.js":"jiNE","./xhr.js":"KRuG","../core/AxiosError.js":"rRKx"}],"uz6X":[function(require,module,exports) {
624
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=d(require("./transformData.js")),r=d(require("../cancel/isCancel.js")),a=d(require("../defaults/index.js")),t=d(require("../cancel/CanceledError.js")),s=d(require("../core/AxiosHeaders.js")),n=d(require("../adapters/adapters.js"));function d(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new t.default(null,e)}function u(t){return o(t),t.headers=s.default.from(t.headers),t.data=e.default.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),n.default.getAdapter(t.adapter||a.default.adapter)(t).then(function(r){return o(t),r.data=e.default.call(t,t.transformResponse,r),r.headers=s.default.from(r.headers),r},function(a){return(0,r.default)(a)||(o(t),a&&a.response&&(a.response.data=e.default.call(t,t.transformResponse,a.response),a.response.headers=s.default.from(a.response.headers))),Promise.reject(a)})}
625
+ },{"./transformData.js":"woEt","../cancel/isCancel.js":"V30M","../defaults/index.js":"VQpg","../cancel/CanceledError.js":"E1lI","../core/AxiosHeaders.js":"aueS","../adapters/adapters.js":"MSoV"}],"OHvn":[function(require,module,exports) {
626
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e=n(require("../utils.js")),t=n(require("./AxiosHeaders.js"));function n(e){return e&&e.__esModule?e:{default:e}}const s=e=>e instanceof t.default?e.toJSON():e;function i(t,n){n=n||{};const i={};function o(t,n,s){return e.default.isPlainObject(t)&&e.default.isPlainObject(n)?e.default.merge.call({caseless:s},t,n):e.default.isPlainObject(n)?e.default.merge({},n):e.default.isArray(n)?n.slice():n}function r(t,n,s){return e.default.isUndefined(n)?e.default.isUndefined(t)?void 0:o(void 0,t,s):o(t,n,s)}function a(t,n){if(!e.default.isUndefined(n))return o(void 0,n)}function d(t,n){return e.default.isUndefined(n)?e.default.isUndefined(t)?void 0:o(void 0,t):o(void 0,n)}function u(e,s,i){return i in n?o(e,s):i in t?o(void 0,e):void 0}const f={url:a,method:a,data:a,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:u,headers:(e,t)=>r(s(e),s(t),!0)};return e.default.forEach(Object.keys(Object.assign({},t,n)),function(s){const o=f[s]||r,a=o(t[s],n[s],s);e.default.isUndefined(a)&&o!==u||(i[s]=a)}),i}
627
+ },{"../utils.js":"S1cf","./AxiosHeaders.js":"aueS"}],"xNqU":[function(require,module,exports) {
628
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VERSION=void 0;const e="1.6.2";exports.VERSION="1.6.2";
589
629
  },{}],"lsvU":[function(require,module,exports) {
590
- "use strict";var n=require("../env/data").version,e={};["object","boolean","number","function","string","symbol"].forEach(function(n,r){e[n]=function(e){return typeof e===n||"a"+(r<1?"n ":" ")+n}});var r={};function o(n,e,r){if("object"!=typeof n)throw new TypeError("options must be an object");for(var o=Object.keys(n),t=o.length;t-- >0;){var i=o[t],a=e[i];if(a){var s=n[i],u=void 0===s||a(s,i,n);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}}e.transitional=function(e,o,t){function i(e,r){return"[Axios v"+n+"] Transitional option '"+e+"'"+r+(t?". "+t:"")}return function(n,t,a){if(!1===e)throw new Error(i(t," has been removed"+(o?" in "+o:"")));return o&&!r[t]&&(r[t]=!0,console.warn(i(t," has been deprecated since v"+o+" and will be removed in the near future"))),!e||e(n,t,a)}},module.exports={assertOptions:o,validators:e};
591
- },{"../env/data":"xNqU"}],"OvAf":[function(require,module,exports) {
592
- "use strict";var t=require("./../utils"),e=require("../helpers/buildURL"),r=require("./InterceptorManager"),o=require("./dispatchRequest"),i=require("./mergeConfig"),n=require("../helpers/validator"),s=n.validators;function a(t){this.defaults=t,this.interceptors={request:new r,response:new r}}a.prototype.request=function(t,e){if("string"==typeof t?(e=e||{}).url=t:e=t||{},!e.url)throw new Error("Provided config url is not valid");(e=i(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&n.assertOptions(r,{silentJSONParsing:s.transitional(s.boolean),forcedJSONParsing:s.transitional(s.boolean),clarifyTimeoutError:s.transitional(s.boolean)},!1);var a=[],u=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,a.unshift(t.fulfilled,t.rejected))});var h,l=[];if(this.interceptors.response.forEach(function(t){l.push(t.fulfilled,t.rejected)}),!u){var f=[o,void 0];for(Array.prototype.unshift.apply(f,a),f=f.concat(l),h=Promise.resolve(e);f.length;)h=h.then(f.shift(),f.shift());return h}for(var d=e;a.length;){var c=a.shift(),p=a.shift();try{d=c(d)}catch(m){p(m);break}}try{h=o(d)}catch(m){return Promise.reject(m)}for(;l.length;)h=h.then(l.shift(),l.shift());return h},a.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=i(this.defaults,t),e(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],function(t){a.prototype[t]=function(e,r){return this.request(i(r||{},{method:t,url:e,data:(r||{}).data}))}}),t.forEach(["post","put","patch"],function(t){a.prototype[t]=function(e,r,o){return this.request(i(o||{},{method:t,url:e,data:r}))}}),module.exports=a;
593
- },{"./../utils":"S1cf","../helpers/buildURL":"H6Qo","./InterceptorManager":"rj2i","./dispatchRequest":"uz6X","./mergeConfig":"OHvn","../helpers/validator":"lsvU"}],"tsWd":[function(require,module,exports) {
594
- "use strict";var e=require("./Cancel");function n(n){if("function"!=typeof n)throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(e){s=e});var t=this;this.promise.then(function(e){if(t._listeners){var n,s=t._listeners.length;for(n=0;n<s;n++)t._listeners[n](e);t._listeners=null}}),this.promise.then=function(e){var n,s=new Promise(function(e){t.subscribe(e),n=e}).then(e);return s.cancel=function(){t.unsubscribe(n)},s},n(function(n){t.reason||(t.reason=new e(n),s(t.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},n.prototype.unsubscribe=function(e){if(this._listeners){var n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}},n.source=function(){var e;return{token:new n(function(n){e=n}),cancel:e}},module.exports=n;
595
- },{"./Cancel":"mIKj"}],"X8jb":[function(require,module,exports) {
596
- "use strict";module.exports=function(n){return function(t){return n.apply(null,t)}};
630
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../env/data.js"),t=n(require("../core/AxiosError.js"));function n(e){return e&&e.__esModule?e:{default:e}}const o={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const r={};function i(e,n,o){if("object"!=typeof e)throw new t.default("options must be an object",t.default.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],s=n[a];if(s){const n=e[a],o=void 0===n||s(n,a,e);if(!0!==o)throw new t.default("option "+a+" must be "+o,t.default.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new t.default("Unknown option "+a,t.default.ERR_BAD_OPTION)}}o.transitional=function(n,o,i){function a(t,n){return"[Axios v"+e.VERSION+"] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(e,i,s)=>{if(!1===n)throw new t.default(a(i," has been removed"+(o?" in "+o:"")),t.default.ERR_DEPRECATED);return o&&!r[i]&&(r[i]=!0,console.warn(a(i," has been deprecated since v"+o+" and will be removed in the near future"))),!n||n(e,i,s)}};var a={assertOptions:i,validators:o};exports.default=a;
631
+ },{"../env/data.js":"xNqU","../core/AxiosError.js":"rRKx"}],"OvAf":[function(require,module,exports) {
632
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("./../utils.js")),t=i(require("../helpers/buildURL.js")),r=i(require("./InterceptorManager.js")),a=i(require("./dispatchRequest.js")),s=i(require("./mergeConfig.js")),o=i(require("./buildFullPath.js")),n=i(require("../helpers/validator.js")),u=i(require("./AxiosHeaders.js"));function i(e){return e&&e.__esModule?e:{default:e}}const l=n.default.validators;class d{constructor(e){this.defaults=e,this.interceptors={request:new r.default,response:new r.default}}request(t,r){"string"==typeof t?(r=r||{}).url=t:r=t||{},r=(0,s.default)(this.defaults,r);const{transitional:o,paramsSerializer:i,headers:d}=r;void 0!==o&&n.default.assertOptions(o,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1),null!=i&&(e.default.isFunction(i)?r.paramsSerializer={serialize:i}:n.default.assertOptions(i,{encode:l.function,serialize:l.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=d&&e.default.merge(d.common,d[r.method]);d&&e.default.forEach(["delete","get","head","post","put","patch","common"],e=>{delete d[e]}),r.headers=u.default.concat(f,d);const c=[];let h=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(r)||(h=h&&e.synchronous,c.unshift(e.fulfilled,e.rejected))});const p=[];let m;this.interceptors.response.forEach(function(e){p.push(e.fulfilled,e.rejected)});let g,q=0;if(!h){const e=[a.default.bind(this),void 0];for(e.unshift.apply(e,c),e.push.apply(e,p),g=e.length,m=Promise.resolve(r);q<g;)m=m.then(e[q++],e[q++]);return m}g=c.length;let y=r;for(q=0;q<g;){const e=c[q++],t=c[q++];try{y=e(y)}catch(j){t.call(this,j);break}}try{m=a.default.call(this,y)}catch(j){return Promise.reject(j)}for(q=0,g=p.length;q<g;)m=m.then(p[q++],p[q++]);return m}getUri(e){e=(0,s.default)(this.defaults,e);const r=(0,o.default)(e.baseURL,e.url);return(0,t.default)(r,e.params,e.paramsSerializer)}}e.default.forEach(["delete","get","head","options"],function(e){d.prototype[e]=function(t,r){return this.request((0,s.default)(r||{},{method:e,url:t,data:(r||{}).data}))}}),e.default.forEach(["post","put","patch"],function(e){function t(t){return function(r,a,o){return this.request((0,s.default)(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}d.prototype[e]=t(),d.prototype[e+"Form"]=t(!0)});var f=d;exports.default=f;
633
+ },{"./../utils.js":"S1cf","../helpers/buildURL.js":"H6Qo","./InterceptorManager.js":"rj2i","./dispatchRequest.js":"uz6X","./mergeConfig.js":"OHvn","./buildFullPath.js":"KxkP","../helpers/validator.js":"lsvU","./AxiosHeaders.js":"aueS"}],"tsWd":[function(require,module,exports) {
634
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("./CanceledError.js"));function s(e){return e&&e.__esModule?e:{default:e}}class t{constructor(s){if("function"!=typeof s)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](e);r._listeners=null}),this.promise.then=(e=>{let s;const t=new Promise(e=>{r.subscribe(e),s=e}).then(e);return t.cancel=function(){r.unsubscribe(s)},t}),s(function(s,n,i){r.reason||(r.reason=new e.default(s,n,i),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);-1!==s&&this._listeners.splice(s,1)}static source(){let e;return{token:new t(function(s){e=s}),cancel:e}}}var r=t;exports.default=r;
635
+ },{"./CanceledError.js":"E1lI"}],"X8jb":[function(require,module,exports) {
636
+ "use strict";function e(e){return function(t){return e.apply(null,t)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
597
637
  },{}],"wICU":[function(require,module,exports) {
598
- "use strict";var r=require("./../utils");module.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError};
599
- },{"./../utils":"S1cf"}],"nUiQ":[function(require,module,exports) {
600
- "use strict";var e=require("./utils"),r=require("./helpers/bind"),i=require("./core/Axios"),n=require("./core/mergeConfig"),o=require("./defaults");function u(o){var s=new i(o),t=r(i.prototype.request,s);return e.extend(t,i.prototype,s),e.extend(t,s),t.create=function(e){return u(n(o,e))},t}var s=u(o);s.Axios=i,s.Cancel=require("./cancel/Cancel"),s.CancelToken=require("./cancel/CancelToken"),s.isCancel=require("./cancel/isCancel"),s.VERSION=require("./env/data").version,s.all=function(e){return Promise.all(e)},s.spread=require("./helpers/spread"),s.isAxiosError=require("./helpers/isAxiosError"),module.exports=s,module.exports.default=s;
601
- },{"./utils":"S1cf","./helpers/bind":"EDTP","./core/Axios":"OvAf","./core/mergeConfig":"OHvn","./defaults":"BXyq","./cancel/Cancel":"mIKj","./cancel/CancelToken":"tsWd","./cancel/isCancel":"V30M","./env/data":"xNqU","./helpers/spread":"X8jb","./helpers/isAxiosError":"wICU"}],"dZBD":[function(require,module,exports) {
602
- module.exports=require("./lib/axios");
603
- },{"./lib/axios":"nUiQ"}],"kRnD":[function(require,module,exports) {
638
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e=r(require("./../utils.js"));function r(e){return e&&e.__esModule?e:{default:e}}function t(r){return e.default.isObject(r)&&!0===r.isAxiosError}
639
+ },{"./../utils.js":"S1cf"}],"Ijhc":[function(require,module,exports) {
640
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const e={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(e).forEach(([t,o])=>{e[o]=t});var t=e;exports.default=t;
641
+ },{}],"nUiQ":[function(require,module,exports) {
642
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=C(require("./utils.js")),r=C(require("./helpers/bind.js")),t=C(require("./core/Axios.js")),a=C(require("./core/mergeConfig.js")),u=C(require("./defaults/index.js")),s=C(require("./helpers/formDataToJSON.js")),l=C(require("./cancel/CanceledError.js")),o=C(require("./cancel/CancelToken.js")),d=C(require("./cancel/isCancel.js")),i=require("./env/data.js"),n=C(require("./helpers/toFormData.js")),f=C(require("./core/AxiosError.js")),c=C(require("./helpers/spread.js")),p=C(require("./helpers/isAxiosError.js")),j=C(require("./core/AxiosHeaders.js")),q=C(require("./adapters/adapters.js")),x=C(require("./helpers/HttpStatusCode.js"));function C(e){return e&&e.__esModule?e:{default:e}}function A(u){const s=new t.default(u),l=(0,r.default)(t.default.prototype.request,s);return e.default.extend(l,t.default.prototype,s,{allOwnKeys:!0}),e.default.extend(l,s,null,{allOwnKeys:!0}),l.create=function(e){return A((0,a.default)(u,e))},l}const m=A(u.default);m.Axios=t.default,m.CanceledError=l.default,m.CancelToken=o.default,m.isCancel=d.default,m.VERSION=i.VERSION,m.toFormData=n.default,m.AxiosError=f.default,m.Cancel=m.CanceledError,m.all=function(e){return Promise.all(e)},m.spread=c.default,m.isAxiosError=p.default,m.mergeConfig=a.default,m.AxiosHeaders=j.default,m.formToJSON=(r=>(0,s.default)(e.default.isHTMLForm(r)?new FormData(r):r)),m.getAdapter=q.default.getAdapter,m.HttpStatusCode=x.default,m.default=m;var E=m;exports.default=E;
643
+ },{"./utils.js":"S1cf","./helpers/bind.js":"EDTP","./core/Axios.js":"OvAf","./core/mergeConfig.js":"OHvn","./defaults/index.js":"VQpg","./helpers/formDataToJSON.js":"zEQI","./cancel/CanceledError.js":"E1lI","./cancel/CancelToken.js":"tsWd","./cancel/isCancel.js":"V30M","./env/data.js":"xNqU","./helpers/toFormData.js":"BFle","./core/AxiosError.js":"rRKx","./helpers/spread.js":"X8jb","./helpers/isAxiosError.js":"wICU","./core/AxiosHeaders.js":"aueS","./adapters/adapters.js":"MSoV","./helpers/HttpStatusCode.js":"Ijhc"}],"dZBD":[function(require,module,exports) {
644
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.all=exports.VERSION=exports.HttpStatusCode=exports.CanceledError=exports.CancelToken=exports.Cancel=exports.AxiosHeaders=exports.AxiosError=exports.Axios=void 0,Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}}),exports.toFormData=exports.spread=exports.mergeConfig=exports.isCancel=exports.isAxiosError=exports.getAdapter=exports.formToJSON=void 0;var e=r(require("./lib/axios.js"));function r(e){return e&&e.__esModule?e:{default:e}}const{Axios:o,AxiosError:t,CanceledError:s,isCancel:x,CancelToken:p,VERSION:a,all:i,Cancel:n,isAxiosError:l,spread:d,toFormData:c,AxiosHeaders:C,HttpStatusCode:u,formToJSON:A,getAdapter:f,mergeConfig:E}=e.default;exports.mergeConfig=E,exports.getAdapter=f,exports.formToJSON=A,exports.HttpStatusCode=u,exports.AxiosHeaders=C,exports.toFormData=c,exports.spread=d,exports.isAxiosError=l,exports.Cancel=n,exports.all=i,exports.VERSION=a,exports.CancelToken=p,exports.isCancel=x,exports.CanceledError=s,exports.AxiosError=t,exports.Axios=o;
645
+ },{"./lib/axios.js":"nUiQ"}],"kRnD":[function(require,module,exports) {
604
646
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.prodFunctionsBaseUrl=void 0,exports.prodFunctionsBaseUrl="https://us-central1-neurosity-device.cloudfunctions.net";
605
647
  },{}],"RIhy":[function(require,module,exports) {
606
648
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFunctionsBaseURL=void 0;var e=require("./config");function t(t){if(!t.emulator)return e.prodFunctionsBaseUrl;var r=t.emulatorHost,o=t.emulatorFunctionsPort;return"http://".concat(r,":").concat(o,"/neurosity-device/us-central1")}exports.getFunctionsBaseURL=t;
@@ -619,17 +661,7 @@ var e=require("process");function o(){return void 0!==e&&null!=e.versions&&null!
619
661
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isWebBluetoothSupported=void 0;var e=require("./isMaybeWebWorkerContext");function o(){var o;return"undefined"!=typeof window&&(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.bluetooth)&&!(0,e.isMaybeWebWorkerContext)()}exports.isWebBluetoothSupported=o;
620
662
  },{"./isMaybeWebWorkerContext":"VusC"}],"UDAB":[function(require,module,exports) {
621
663
  "use strict";function e(){return Math.floor(1e5+9e5*Math.random())}Object.defineProperty(exports,"__esModule",{value:!0}),exports.create6DigitPin=void 0,exports.create6DigitPin=e;
622
- },{}],"yh9p":[function(require,module,exports) {
623
- "use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
624
- },{}],"JgNJ":[function(require,module,exports) {
625
- exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
626
- },{}],"wvRa":[function(require,module,exports) {
627
- var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
628
- },{}],"peL6":[function(require,module,exports) {
629
-
630
- var global = arguments[3];
631
- var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
632
- },{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"wvRa","buffer":"peL6"}],"dskh":[function(require,module,exports) {
664
+ },{}],"dskh":[function(require,module,exports) {
633
665
 
634
666
  "use strict";const t=require("base64-js"),e=require("ieee754"),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50;const n=2147483647;function i(){try{const e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),42===e.foo()}catch(t){return!1}}function o(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return a(t,e);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(nt(t,ArrayBuffer)||t&&nt(t.buffer,ArrayBuffer))return g(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(nt(t,SharedArrayBuffer)||t&&nt(t.buffer,SharedArrayBuffer)))return g(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);const i=y(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t,e,r){return u(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}function c(t){return u(t),o(t<0?0:0|w(t))}function a(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let n=o(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function p(t){const e=t.length<0?0:0|w(t.length),r=o(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t){if(nt(t,Uint8Array)){const e=new Uint8Array(t);return g(e.buffer,e.byteOffset,e.byteLength)}return p(t)}function g(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function y(t){if(f.isBuffer(t)){const e=0|w(t.length),r=o(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}return void 0!==t.length?"number"!=typeof t.length||it(t.length)?o(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}function w(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||nt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return et(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function B(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return L(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return $(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function E(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),it(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:I(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):I(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function I(t,e,r,n,i){let o,f=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;f=2,s/=2,u/=2,r/=2}function h(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(i){let n=-1;for(o=r;o<s;o++)if(h(t,o)===h(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*f}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(h(t,o+n)!==h(e,n)){r=!1;break}if(r)return o}return-1}function U(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let f;for(n>o/2&&(n=o/2),f=0;f<n;++f){const n=parseInt(e.substr(2*f,2),16);if(it(n))return f;t[r+f]=n}return f}function A(t,e,r,n){return rt(K(e,t.length-r),t,r,n)}function v(t,e,r,n){return rt(Q(e),t,r,n)}function R(t,e,r,n){return rt(et(e),t,r,n)}function T(t,e,r,n){return rt(tt(e,t.length-r),t,r,n)}function O(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function L(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,f=e>239?4:e>223?3:e>191?2:1;if(i+f<=r){let r,n,s,u;switch(f){case 1:e<128&&(o=e);break;case 2:128==(192&(r=t[i+1]))&&(u=(31&e)<<6|63&r)>127&&(o=u);break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=f}return _(n)}exports.kMaxLength=n,f.TYPED_ARRAY_SUPPORT=i(),f.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(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return h(t,e,r)},f.allocUnsafe=function(t){return c(t)},f.allocUnsafeSlow=function(t){return c(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(nt(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),nt(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=f.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(nt(e,Uint8Array))i+e.length>n.length?(f.isBuffer(e)||(e=f.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!f.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)E(this,e,e+1);return this},f.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)E(this,e,e+3),E(this,e+1,e+2);return this},f.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)E(this,e,e+7),E(this,e+1,e+6),E(this,e+2,e+5),E(this,e+3,e+4);return this},f.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?L(this,0,t):B.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){let t="";const e=exports.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},r&&(f.prototype[r]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(nt(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const u=Math.min(o,s),h=this.slice(n,i),c=t.slice(e,r);for(let f=0;f<u;++f)if(h[f]!==c[f]){o=h[f],s=c[f];break}return o<s?-1:s<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return U(this,t,e,r);case"utf8":case"utf-8":return A(this,t,e,r);case"ascii":case"latin1":case"binary":return v(this,t,e,r);case"base64":return R(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function _(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=S));return r}function x(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function $(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=ot[t[o]];return i}function C(t,e,r){const n=t.slice(e,r);let i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){W(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function M(t,e,r,n,i){W(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,r,n,i,o){return r=+r,n>>>=0,o||j(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function z(t,r,n,i,o){return r=+r,n>>>=0,o||j(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=ft(function(t){X(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),f.prototype.readBigUInt64BE=ft(function(t){X(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=ft(function(t){X(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),f.prototype.readBigInt64BE=ft(function(t){X(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),f.prototype.readFloatLE=function(t,r){return t>>>=0,r||k(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return t>>>=0,r||k(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return t>>>=0,r||k(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return t>>>=0,r||k(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigUInt64LE=ft(function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=ft(function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=0,o=1,f=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===f&&0!==this[e+i-1]&&(f=1),this[e+i]=(t/o>>0)-f&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=r-1,o=1,f=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/o>>0)-f&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigInt64LE=ft(function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=ft(function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=f.isBuffer(t)?t:f.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const Y={};function G(t,e,r){Y[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function q(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r){X(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||J(e,t.length-(r+1))}function W(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** `+`${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new Y.ERR_OUT_OF_RANGE("value",i,t)}V(n,i,o)}function X(t,e){if("number"!=typeof t)throw new Y.ERR_INVALID_ARG_TYPE(e,"number",t)}function J(t,e,r){if(Math.floor(t)!==t)throw X(t,r),new Y.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),G("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${e}. Received ${i}`},RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function H(t){if((t=(t=t.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let f=0;f<n;++f){if((r=t.charCodeAt(f))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function tt(t,e){let r,n,i;const o=[];for(let f=0;f<t.length&&!((e-=2)<0);++f)n=(r=t.charCodeAt(f))>>8,i=r%256,o.push(i),o.push(n);return o}function et(e){return t.toByteArray(H(e))}function rt(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function nt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function it(t){return t!=t}const ot=function(){const t=new Array(256);for(let e=0;e<16;++e){const r=16*e;for(let n=0;n<16;++n)t[r+n]="0123456789abcdef"[e]+"0123456789abcdef"[n]}return t}();function ft(t){return"undefined"==typeof BigInt?st:t}function st(){throw new Error("BigInt not supported")}
635
667
  },{"base64-js":"yh9p","ieee754":"JgNJ","buffer":"peL6"}],"iwtf":[function(require,module,exports) {
@@ -675,8 +707,8 @@ var r=require("./compare"),e=function(e,o,u){return r(e,o,u)>=0};module.exports=
675
707
  "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__exportStar||function(t,r){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(r,o)||e(r,t,o)};Object.defineProperty(exports,"__esModule",{value:!0}),t(require("./BluetoothClient"),exports),t(require("./web/WebBluetoothTransport"),exports),t(require("./react-native/ReactNativeTransport"),exports),t(require("./utils/osHasBluetoothSupport"),exports),t(require("./types/index"),exports);
676
708
  },{"./BluetoothClient":"fihV","./web/WebBluetoothTransport":"ouKb","./react-native/ReactNativeTransport":"FtS5","./utils/osHasBluetoothSupport":"rH2Y","./types/index":"iwtf"}],"BZP9":[function(require,module,exports) {
677
709
  var define;
678
- var e;function t(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function n(e){var t=u();return function(){var r,n=c(e);if(t){var o=c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return i(this,r)}}function i(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e){return(a="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 s(e,t){return p(e)||d(e,t)||h(e,t)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function f(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 d(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,u,c=[],a=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw i}}return c}}function p(e){if(Array.isArray(e))return e}function v(){"use strict";v=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(A){s=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var o=t&&t.prototype instanceof d?t:d,u=Object.create(o.prototype),c=new _(i||[]);return n(u,"_invoke",{value:S(e,r,c)}),u}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=l;var f={};function d(){}function p(){}function m(){}var y={};s(y,o,function(){return this});var b=Object.getPrototypeOf,g=b&&b(b(M([])));g&&g!==t&&r.call(g,o)&&(y=g);var w=m.prototype=d.prototype=Object.create(y);function C(e){["next","throw","return"].forEach(function(t){s(e,t,function(e){return this._invoke(t,e)})})}function O(e,t){var i;n(this,"_invoke",{value:function(n,o){function u(){return new t(function(i,u){!function n(i,o,u,c){var s=h(e[i],e,o);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==a(f)&&r.call(f,"__await")?t.resolve(f.__await).then(function(e){n("next",e,u,c)},function(e){n("throw",e,u,c)}):t.resolve(f).then(function(e){l.value=e,u(l)},function(e){return n("throw",e,u,c)})}c(s.arg)}(n,o,i,u)})}return i=i?i.then(u,u):u()}})}function S(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return T()}for(r.method=i,r.arg=o;;){var u=r.delegate;if(u){var c=x(u,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var a=h(e,t,r);if("normal"===a.type){if(n=r.done?"completed":"suspendedYield",a.arg===f)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n="completed",r.method="throw",r.arg=a.arg)}}}function x(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=h(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function M(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=m,n(w,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},C(O.prototype),s(O.prototype,u,function(){return this}),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var u=new O(l(t,r,n,i),o);return e.isGeneratorFunction(r)?u:u.next().then(function(e){return e.done?e.value:u.next()})},C(w),s(w,c,"Generator"),s(w,o,function(){return this}),s(w,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=M,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return u.type="throw",u.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],u=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),a=r.call(o,"finallyLoc");if(c&&a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var 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,g(n.key),n)}}function b(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e){var t=w(e,"string");return"symbol"===a(t)?t:String(t)}function w(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var C=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),O=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&C(t,e,r);return O(t,e),t},x=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function u(e){try{a(n.next(e))}catch(t){o(t)}}function c(e){try{a(n.throw(e))}catch(t){o(t)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,c)}a((n=n.apply(e,t||[])).next())})},k=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Notion=exports.Neurosity=void 0;var E=require("rxjs"),_=require("rxjs"),M=require("rxjs/operators"),T=require("rxjs/operators"),A=k(require("fast-deep-equal")),D=require("./api/index"),N=require("./api/index"),I=require("./types/streaming"),j=require("./utils/subscription"),P=require("./types/status"),F=S(require("./utils/errors")),L=S(require("./utils/platform")),R=S(require("./utils/hapticEffects")),B=require("./utils/oauth"),U=require("./utils/oauth"),G=require("./api/https/createOAuthURL"),q=require("./api/https/getOAuthToken"),H=require("./utils/is-node"),W=require("./utils/metrics"),Y=require("./api/bluetooth"),V=require("./api/bluetooth/types"),$={timesync:!1,autoSelectDevice:!0,streamingMode:I.STREAMING_MODE.WIFI_ONLY,emulator:!1,emulatorHost:"localhost",emulatorAuthPort:9099,emulatorDatabasePort:9e3,emulatorFunctionsPort:5001,emulatorFirestorePort:8080,emulatorOptions:{}},K=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.streamingMode$=new _.ReplaySubject(1);var r=t.streamingMode,n=t.bluetoothTransport;this.options=Object.freeze(Object.assign(Object.assign({},$),t)),this.cloudClient=new D.CloudClient(this.options),n&&(this.bluetoothClient=new Y.BluetoothClient({selectedDevice$:this.onDeviceChange(),osHasBluetoothSupport$:this._osHasBluetoothSupport(),createBluetoothToken:this.createBluetoothToken.bind(this),transport:n})),this._initStreamingMode(r,!!n)}return b(e,[{key:"_initStreamingMode",value:function(e,t){var r=[I.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK,I.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK].includes(e),n=!Object.values(I.STREAMING_MODE).includes(e),i=r&&!t;this.isMissingBluetoothTransport=i,!e||n||i?this.streamingMode$.next(I.STREAMING_MODE.WIFI_ONLY):this.streamingMode$.next(e)}},{key:"_osHasBluetoothSupport",value:function(){return(0,E.combineLatest)({selectedDevice:this.onDeviceChange(),osVersion:this.osVersion().pipe((0,M.startWith)(null))}).pipe((0,M.map)(function(e){var t=e.selectedDevice,r=e.osVersion;return(0,Y.osHasBluetoothSupport)(t,r)}))}},{key:"streamingState",value:function(){var e=this,t=function(e){return[P.STATUS.ONLINE,P.STATUS.UPDATING].includes(e)};return this.streamingMode$.pipe((0,M.switchMap)(function(r){return(0,E.combineLatest)({selectedDevice:e.onDeviceChange(),osHasBluetoothSupport:e._osHasBluetoothSupport()}).pipe((0,M.switchMap)(function(n){var i=n.selectedDevice,o=n.osHasBluetoothSupport;return i?e.isMissingBluetoothTransport||!o?e.cloudClient.status().pipe((0,M.map)(function(e){var n=e.state;return{connected:t(n),streamingMode:r,activeMode:I.STREAMING_TYPE.WIFI}})):(0,E.combineLatest)({wifiStatus:e.cloudClient.status(),bluetoothConnection:(null==e?void 0:e.bluetoothClient)?e.bluetoothClient.connection():(0,E.of)(V.BLUETOOTH_CONNECTION.DISCONNECTED)}).pipe((0,M.map)(function(e){var n=e.wifiStatus,i=e.bluetoothConnection===V.BLUETOOTH_CONNECTION.CONNECTED;switch(r){default:case I.STREAMING_MODE.WIFI_ONLY:return{connected:t(n.state),streamingMode:r,activeMode:I.STREAMING_TYPE.WIFI};case I.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK:return{connected:t(n.state)||!i?t(n.state):i,streamingMode:r,activeMode:t(n.state)||!i?I.STREAMING_TYPE.WIFI:I.STREAMING_TYPE.BLUETOOTH};case I.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK:return{connected:!!i||t(n.state),streamingMode:r,activeMode:i?I.STREAMING_TYPE.BLUETOOTH:I.STREAMING_TYPE.WIFI}}}),(0,T.distinctUntilChanged)(function(e,t){return(0,A.default)(e,t)})):(0,E.of)({connected:!1,streamingMode:r,activeMode:I.STREAMING_TYPE.WIFI})}))}))}},{key:"_withStreamingModeObservable",value:function(e){var t=e.wifi,r=e.bluetooth;return this.streamingState().pipe((0,M.switchMap)(function(e){switch(e.activeMode){case I.STREAMING_TYPE.WIFI:return t();case I.STREAMING_TYPE.BLUETOOTH:return r();default:return t()}}))}},{key:"_withStreamingModePromise",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.wifi,n=e.bluetooth,t.next=3,(0,_.firstValueFrom)(this.streamingState());case 3:i=t.sent,o=i.activeMode,t.t0=o,t.next=t.t0===I.STREAMING_TYPE.WIFI?8:t.t0===I.STREAMING_TYPE.BLUETOOTH?11:14;break;case 8:return t.next=10,r();case 10:return t.abrupt("return",t.sent);case 11:return t.next=13,n();case 13:return t.abrupt("return",t.sent);case 14:return t.next=16,r();case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}},t,this)}))}},{key:"bluetooth",get:function(){return null==this?void 0:this.bluetoothClient}},{key:"_getCloudMetricDependencies",value:function(){return{options:this.options,cloudClient:this.cloudClient,onDeviceChange:this.onDeviceChange.bind(this),status:this.status.bind(this)}}},{key:"login",value:function(e){return x(this,void 0,void 0,v().mark(function t(){return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.login(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"logout",value:function(){return x(this,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.logout();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"__getApp",value:function(){return this.cloudClient.__getApp()}},{key:"onAuthStateChanged",value:function(){return this.cloudClient.onAuthStateChanged()}},{key:"addDevice",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"addDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.addDevice(e)}},{key:"removeDevice",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"removeDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.removeDevice(e)}},{key:"transferDevice",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"transferDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.transferDevice(e)}},{key:"onUserDevicesChange",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onUserDevicesChange"),2),t=e[0],r=e[1];return t?(0,E.throwError)(function(){return r}):this.cloudClient.onUserDevicesChange()}},{key:"onUserClaimsChange",value:function(){return this.cloudClient.onUserClaimsChange()}},{key:"getDevices",value:function(){return x(this,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.getDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"selectDevice",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"selectDevice"),n=s(r,2),i=n[0],o=n[1],!i){t.next=3;break}return t.abrupt("return",Promise.reject(o));case 3:return t.next=5,this.cloudClient.selectDevice(e);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getSelectedDevice",value:function(){return x(this,void 0,void 0,v().mark(function e(){var t,r,n,i;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getSelectedDevice"),r=s(t,2),n=r[0],i=r[1],!n){e.next=3;break}return e.abrupt("return",Promise.reject(i));case 3:return e.next=5,this.cloudClient.getSelectedDevice();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}},e,this)}))}},{key:"getInfo",value:function(){return x(this,void 0,void 0,v().mark(function e(){var t,r,n,i,o=this;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",Promise.reject(F.mustSelectDevice));case 4:if(t=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getInfo"),r=s(t,2),n=r[0],i=r[1],!n){e.next=7;break}return e.abrupt("return",Promise.reject(i));case 7:return e.next=9,this._withStreamingModePromise({wifi:function(){return o.cloudClient.getInfo()},bluetooth:function(){return o.bluetoothClient.getInfo()}});case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e,this)}))}},{key:"onDeviceChange",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onDeviceChange"),2),t=e[0],r=e[1];return t?(0,E.throwError)(function(){return r}):this.cloudClient.onDeviceChange()}},{key:"disconnect",value:function(){return x(this,void 0,void 0,v().mark(function e(){var t=this;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withStreamingModePromise({wifi:function(){return t.cloudClient.disconnect()},bluetooth:function(){return t.bluetoothClient.disconnect()}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"dispatchAction",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o,u=this;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(F.mustSelectDevice));case 4:if(r=(0,U.validateOAuthScopeForAction)(this.cloudClient.userClaims,e),n=s(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this._withStreamingModePromise({wifi:function(){return u.cloudClient.dispatchAction(e)},bluetooth:function(){return u.bluetoothClient.dispatchAction(e)}});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}))}},{key:"addMarker",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r=this;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}throw F.mustSelectDevice;case 4:if(e){t.next=6;break}throw new Error("".concat(F.prefix,"A label is required for addMarker"));case 6:return t.next=8,this._withStreamingModePromise({wifi:function(){return r.cloudClient.dispatchAction({command:"marker",action:"add",message:{label:e,timestamp:r.cloudClient.timestamp}})},bluetooth:function(){return r.bluetoothClient.addMarker(e)}});case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}},t,this)}))}},{key:"haptics",value:function(e){var t;return x(this,void 0,void 0,v().mark(function r(){var n,i,o,u,c,a,s=this;return v().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n="haptics",r.next=3,this.cloudClient.didSelectDevice();case 3:if(r.sent){r.next=5;break}return r.abrupt("return",Promise.reject(F.mustSelectDevice));case 5:return r.next=7,this.getSelectedDevice();case 7:if(r.t1=t=r.sent,r.t0=null===r.t1,r.t0){r.next=11;break}r.t0=void 0===t;case 11:if(!r.t0){r.next=15;break}r.t2=void 0,r.next=16;break;case 15:r.t2=t.modelVersion;case 16:if(i=r.t2,L.supportsHaptics(i)){r.next=20;break}return r.abrupt("return",Promise.reject(F.metricNotSupportedByModel(n,i)));case 20:o=L.getPlatformHapticMotors(i),r.t3=v().keys(e);case 22:if((r.t4=r.t3()).done){r.next=33;break}if(u=r.t4.value,Object.keys(o).includes(u)){r.next=26;break}return r.abrupt("return",Promise.reject(F.locationNotFound(u,i)));case 26:if(c=e[u],7,!(c.length>7)){r.next=30;break}return r.abrupt("return",Promise.reject(F.exceededMaxItems(7)));case 30:o[u]=c,r.next=22;break;case 33:return a={command:n,action:"queue",responseRequired:!0,responseTimeout:1e3,message:{effects:o}},r.next=36,this._withStreamingModePromise({wifi:function(){return s.cloudClient.dispatchAction(a)},bluetooth:function(){return s.bluetoothClient.dispatchAction(a)}});case 36:return r.abrupt("return",r.sent);case 37:case"end":return r.stop()}},r,this)}))}},{key:"getHapticEffects",value:function(){return R}},{key:"accelerometer",value:function(){var e=this,t="accelerometer",r=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,E.throwError)(function(){return i}):this.onDeviceChange().pipe((0,M.switchMap)(function(r){var n=(null==r?void 0:r.modelVersion)||L.MODEL_VERSION_1;return L.supportsAccel(n)?e._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,j.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.accelerometer()}}):(0,E.throwError)(function(){return F.metricNotSupportedByModel(t,n)})}))}},{key:"brainwaves",value:function(e){var t=this,r=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"brainwaves"),2),n=r[0],i=r[1];return n?(0,E.throwError)(function(){return i}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(t._getCloudMetricDependencies(),{metric:"brainwaves",labels:e?[e]:[],atomic:!1})},bluetooth:function(){return t.bluetoothClient.brainwaves(e)}})}},{key:"calm",value:function(){var e=this,t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"calm"),2),r=t[0],n=t[1];return r?(0,E.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["calm"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.calm()}})}},{key:"signalQuality",value:function(){var e=this,t="signalQuality",r=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,E.throwError)(function(){return i}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,j.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.signalQuality()}})}},{key:"settings",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"settings"),2),t=e[0],r=e[1];return t?(0,E.throwError)(function(){return r}):this.cloudClient.observeNamespace("settings")}},{key:"osVersion",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"osVersion"),2),t=e[0],r=e[1];return t?(0,E.throwError)(function(){return r}):this.cloudClient.osVersion()}},{key:"focus",value:function(){var e=this,t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"focus"),2),r=t[0],n=t[1];return r?(0,E.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["focus"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.focus()}})}},{key:"kinesis",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"kinesis"),2),r=t[0],n=t[1];return r?(0,E.throwError)(function(){return n}):(0,W.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"kinesis",labels:e?[e]:[],atomic:!1})}},{key:"predictions",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"predictions"),2),r=t[0],n=t[1];return r?(0,E.throwError)(function(){return n}):(0,W.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"predictions",labels:e?[e]:[],atomic:!1})}},{key:"status",value:function(){var e=this,t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"status"),2),r=t[0],n=t[1];return r?(0,E.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return e.cloudClient.status()},bluetooth:function(){return e.bluetoothClient.status()}})}},{key:"changeSettings",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(F.mustSelectDevice));case 4:if(r=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"changeSettings"),n=s(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this.cloudClient.changeSettings(e);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}))}},{key:"training",get:function(){var e=this;return{record:function(t){return x(e,void 0,void 0,v().mark(function e(){var r,n;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw F.mustSelectDevice;case 4:return r=this.cloudClient.user&&"uid"in this.cloudClient.user?this.cloudClient.user.uid:null,n=Object.assign(Object.assign({fit:!1,baseline:!1,timestamp:this.cloudClient.timestamp},t),{userId:r}),e.next=8,this.cloudClient.actions.dispatch({command:"training",action:"record",message:n});case 8:case"end":return e.stop()}},e,this)}))},stop:function(t){return x(e,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw F.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stop",message:Object.assign({},t)});case 6:case"end":return e.stop()}},e,this)}))},stopAll:function(){return x(e,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw F.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stopAll",message:{}});case 6:case"end":return e.stop()}},e,this)}))}}}},{key:"goOffline",value:function(){this.cloudClient.goOffline()}},{key:"goOnline",value:function(){this.cloudClient.goOnline()}},{key:"createAccount",value:function(e){return this.cloudClient.createAccount(e)}},{key:"deleteAccount",value:function(){return this.cloudClient.deleteAccount()}},{key:"createBluetoothToken",value:function(){return this.cloudClient.createBluetoothToken()}},{key:"createCustomToken",value:function(){return this.cloudClient.createCustomToken()}},{key:"getTimesyncOffset",value:function(){return this.options.timesync||console.warn("getTimesyncOffset() requires options.timesync to be true."),this.options.timesync?this.cloudClient.getTimesyncOffset():0}},{key:"createOAuthURL",value:function(e){return H.isNode?(0,G.createOAuthURL)(e,this.options):Promise.reject(new Error("".concat(F.prefix,"the createOAuthURL method must be used on the server side (node.js) for security reasons.")))}},{key:"getOAuthToken",value:function(e){return H.isNode?(0,q.getOAuthToken)(e,this.options):Promise.reject(new Error("".concat(F.prefix,"the getOAuthToken method must be used on the server side (node.js) for security reasons.")))}},{key:"removeOAuthAccess",value:function(){return this.cloudClient.removeOAuthAccess()}},{key:"onUserExperiments",value:function(){return this.cloudClient.onUserExperiments()}},{key:"deleteUserExperiment",value:function(e){return this.cloudClient.deleteUserExperiment(e)}}]),e}();exports.Neurosity=K,K.credentialWithLink=N.credentialWithLink,K.createUser=D.createUser,K.SERVER_TIMESTAMP=N.SERVER_TIMESTAMP;var Q=function(e){t(i,K);var r=n(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,i),e=r.call(this,t),console.log("The Notion class is deprecated and will be removed in the next version of the SDK. Please use the Neurosity class instead. e.g. new Notion() => new Neurosity()"),e}return b(i)}();exports.Notion=Q;
679
- },{"rxjs":"Zr8e","rxjs/operators":"v3iE","fast-deep-equal":"jIGR","./api/index":"LXvB","./types/streaming":"rekm","./utils/subscription":"yLLB","./types/status":"Ttuy","./utils/errors":"WDyG","./utils/platform":"wAkn","./utils/hapticEffects":"lLai","./utils/oauth":"xIH5","./api/https/createOAuthURL":"MDrB","./api/https/getOAuthToken":"nfg4","./utils/is-node":"vsps","./utils/metrics":"DCuD","./api/bluetooth":"TICO","./api/bluetooth/types":"iwtf"}],"QCba":[function(require,module,exports) {
710
+ var e;function t(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function n(e){var t=u();return function(){var r,n=c(e);if(t){var o=c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return i(this,r)}}function i(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e){return(a="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 s(e,t){return p(e)||d(e,t)||h(e,t)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function f(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 d(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,u,c=[],a=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw i}}return c}}function p(e){if(Array.isArray(e))return e}function v(){"use strict";v=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(A){s=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var o=t&&t.prototype instanceof d?t:d,u=Object.create(o.prototype),c=new E(i||[]);return n(u,"_invoke",{value:S(e,r,c)}),u}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=l;var f={};function d(){}function p(){}function m(){}var y={};s(y,o,function(){return this});var b=Object.getPrototypeOf,g=b&&b(b(M([])));g&&g!==t&&r.call(g,o)&&(y=g);var w=m.prototype=d.prototype=Object.create(y);function C(e){["next","throw","return"].forEach(function(t){s(e,t,function(e){return this._invoke(t,e)})})}function O(e,t){var i;n(this,"_invoke",{value:function(n,o){function u(){return new t(function(i,u){!function n(i,o,u,c){var s=h(e[i],e,o);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==a(f)&&r.call(f,"__await")?t.resolve(f.__await).then(function(e){n("next",e,u,c)},function(e){n("throw",e,u,c)}):t.resolve(f).then(function(e){l.value=e,u(l)},function(e){return n("throw",e,u,c)})}c(s.arg)}(n,o,i,u)})}return i=i?i.then(u,u):u()}})}function S(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return T()}for(r.method=i,r.arg=o;;){var u=r.delegate;if(u){var c=x(u,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var a=h(e,t,r);if("normal"===a.type){if(n=r.done?"completed":"suspendedYield",a.arg===f)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n="completed",r.method="throw",r.arg=a.arg)}}}function x(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=h(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function M(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=m,n(w,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},C(O.prototype),s(O.prototype,u,function(){return this}),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var u=new O(l(t,r,n,i),o);return e.isGeneratorFunction(r)?u:u.next().then(function(e){return e.done?e.value:u.next()})},C(w),s(w,c,"Generator"),s(w,o,function(){return this}),s(w,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=M,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return u.type="throw",u.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],u=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),a=r.call(o,"finallyLoc");if(c&&a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var 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,g(n.key),n)}}function b(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e){var t=w(e,"string");return"symbol"===a(t)?t:String(t)}function w(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var C=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),O=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&C(t,e,r);return O(t,e),t},x=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function u(e){try{a(n.next(e))}catch(t){o(t)}}function c(e){try{a(n.throw(e))}catch(t){o(t)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,c)}a((n=n.apply(e,t||[])).next())})},k=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.__firebase=exports.Notion=exports.Neurosity=void 0;var _=require("rxjs"),E=require("rxjs"),M=require("rxjs/operators"),T=require("rxjs/operators"),A=k(require("fast-deep-equal")),D=require("./api/index"),N=require("./api/index"),j=require("./types/streaming"),I=require("./utils/subscription"),P=require("./types/status"),F=S(require("./utils/errors")),L=S(require("./utils/platform")),R=S(require("./utils/hapticEffects")),B=require("./utils/oauth"),U=require("./utils/oauth"),G=require("./api/https/createOAuthURL"),q=require("./api/https/getOAuthToken"),H=require("./utils/is-node"),W=require("./utils/metrics"),Y=require("./api/bluetooth"),V=require("./api/bluetooth/types"),$={timesync:!1,autoSelectDevice:!0,streamingMode:j.STREAMING_MODE.WIFI_ONLY,emulator:!1,emulatorHost:"localhost",emulatorAuthPort:9099,emulatorDatabasePort:9e3,emulatorFunctionsPort:5001,emulatorFirestorePort:8080,emulatorOptions:{}},K=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.streamingMode$=new E.ReplaySubject(1);var r=t.streamingMode,n=t.bluetoothTransport;this.options=Object.freeze(Object.assign(Object.assign({},$),t)),this.cloudClient=new D.CloudClient(this.options),n&&(this.bluetoothClient=new Y.BluetoothClient({selectedDevice$:this.onDeviceChange(),osHasBluetoothSupport$:this._osHasBluetoothSupport(),createBluetoothToken:this.createBluetoothToken.bind(this),transport:n})),this._initStreamingMode(r,!!n)}return b(e,[{key:"_initStreamingMode",value:function(e,t){var r=[j.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK,j.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK].includes(e),n=!Object.values(j.STREAMING_MODE).includes(e),i=r&&!t;this.isMissingBluetoothTransport=i,!e||n||i?this.streamingMode$.next(j.STREAMING_MODE.WIFI_ONLY):this.streamingMode$.next(e)}},{key:"_osHasBluetoothSupport",value:function(){return(0,_.combineLatest)({selectedDevice:this.onDeviceChange(),osVersion:this.osVersion().pipe((0,M.startWith)(null))}).pipe((0,M.map)(function(e){var t=e.selectedDevice,r=e.osVersion;return(0,Y.osHasBluetoothSupport)(t,r)}))}},{key:"streamingState",value:function(){var e=this,t=function(e){return[P.STATUS.ONLINE,P.STATUS.UPDATING].includes(e)};return this.streamingMode$.pipe((0,M.switchMap)(function(r){return(0,_.combineLatest)({selectedDevice:e.onDeviceChange(),osHasBluetoothSupport:e._osHasBluetoothSupport()}).pipe((0,M.switchMap)(function(n){var i=n.selectedDevice,o=n.osHasBluetoothSupport;return i?e.isMissingBluetoothTransport||!o?e.cloudClient.status().pipe((0,M.map)(function(e){var n=e.state;return{connected:t(n),streamingMode:r,activeMode:j.STREAMING_TYPE.WIFI}})):(0,_.combineLatest)({wifiStatus:e.cloudClient.status(),bluetoothConnection:(null==e?void 0:e.bluetoothClient)?e.bluetoothClient.connection():(0,_.of)(V.BLUETOOTH_CONNECTION.DISCONNECTED)}).pipe((0,M.map)(function(e){var n=e.wifiStatus,i=e.bluetoothConnection===V.BLUETOOTH_CONNECTION.CONNECTED;switch(r){default:case j.STREAMING_MODE.WIFI_ONLY:return{connected:t(n.state),streamingMode:r,activeMode:j.STREAMING_TYPE.WIFI};case j.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK:return{connected:t(n.state)||!i?t(n.state):i,streamingMode:r,activeMode:t(n.state)||!i?j.STREAMING_TYPE.WIFI:j.STREAMING_TYPE.BLUETOOTH};case j.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK:return{connected:!!i||t(n.state),streamingMode:r,activeMode:i?j.STREAMING_TYPE.BLUETOOTH:j.STREAMING_TYPE.WIFI}}}),(0,T.distinctUntilChanged)(function(e,t){return(0,A.default)(e,t)})):(0,_.of)({connected:!1,streamingMode:r,activeMode:j.STREAMING_TYPE.WIFI})}))}))}},{key:"_withStreamingModeObservable",value:function(e){var t=e.wifi,r=e.bluetooth;return this.streamingState().pipe((0,M.switchMap)(function(e){switch(e.activeMode){case j.STREAMING_TYPE.WIFI:return t();case j.STREAMING_TYPE.BLUETOOTH:return r();default:return t()}}))}},{key:"_withStreamingModePromise",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.wifi,n=e.bluetooth,t.next=3,(0,E.firstValueFrom)(this.streamingState());case 3:i=t.sent,o=i.activeMode,t.t0=o,t.next=t.t0===j.STREAMING_TYPE.WIFI?8:t.t0===j.STREAMING_TYPE.BLUETOOTH?11:14;break;case 8:return t.next=10,r();case 10:return t.abrupt("return",t.sent);case 11:return t.next=13,n();case 13:return t.abrupt("return",t.sent);case 14:return t.next=16,r();case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}},t,this)}))}},{key:"bluetooth",get:function(){return null==this?void 0:this.bluetoothClient}},{key:"_getCloudMetricDependencies",value:function(){return{options:this.options,cloudClient:this.cloudClient,onDeviceChange:this.onDeviceChange.bind(this),status:this.status.bind(this)}}},{key:"login",value:function(e){return x(this,void 0,void 0,v().mark(function t(){return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.login(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"logout",value:function(){return x(this,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.logout();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"__getApp",value:function(){return this.cloudClient.__getApp()}},{key:"onAuthStateChanged",value:function(){return this.cloudClient.onAuthStateChanged()}},{key:"addDevice",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"addDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.addDevice(e)}},{key:"removeDevice",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"removeDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.removeDevice(e)}},{key:"transferDevice",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"transferDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.transferDevice(e)}},{key:"onUserDevicesChange",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onUserDevicesChange"),2),t=e[0],r=e[1];return t?(0,_.throwError)(function(){return r}):this.cloudClient.onUserDevicesChange()}},{key:"onUserClaimsChange",value:function(){return this.cloudClient.onUserClaimsChange()}},{key:"getDevices",value:function(){return x(this,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.getDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"selectDevice",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"selectDevice"),n=s(r,2),i=n[0],o=n[1],!i){t.next=3;break}return t.abrupt("return",Promise.reject(o));case 3:return t.next=5,this.cloudClient.selectDevice(e);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getSelectedDevice",value:function(){return x(this,void 0,void 0,v().mark(function e(){var t,r,n,i;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getSelectedDevice"),r=s(t,2),n=r[0],i=r[1],!n){e.next=3;break}return e.abrupt("return",Promise.reject(i));case 3:return e.next=5,this.cloudClient.getSelectedDevice();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}},e,this)}))}},{key:"getInfo",value:function(){return x(this,void 0,void 0,v().mark(function e(){var t,r,n,i,o=this;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",Promise.reject(F.mustSelectDevice));case 4:if(t=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getInfo"),r=s(t,2),n=r[0],i=r[1],!n){e.next=7;break}return e.abrupt("return",Promise.reject(i));case 7:return e.next=9,this._withStreamingModePromise({wifi:function(){return o.cloudClient.getInfo()},bluetooth:function(){return o.bluetoothClient.getInfo()}});case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e,this)}))}},{key:"onDeviceChange",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onDeviceChange"),2),t=e[0],r=e[1];return t?(0,_.throwError)(function(){return r}):this.cloudClient.onDeviceChange()}},{key:"disconnect",value:function(){return x(this,void 0,void 0,v().mark(function e(){var t=this;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withStreamingModePromise({wifi:function(){return t.cloudClient.disconnect()},bluetooth:function(){return t.bluetoothClient.disconnect()}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"dispatchAction",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o,u=this;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(F.mustSelectDevice));case 4:if(r=(0,U.validateOAuthScopeForAction)(this.cloudClient.userClaims,e),n=s(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this._withStreamingModePromise({wifi:function(){return u.cloudClient.dispatchAction(e)},bluetooth:function(){return u.bluetoothClient.dispatchAction(e)}});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}))}},{key:"addMarker",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r=this;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}throw F.mustSelectDevice;case 4:if(e){t.next=6;break}throw new Error("".concat(F.prefix,"A label is required for addMarker"));case 6:return t.next=8,this._withStreamingModePromise({wifi:function(){return r.cloudClient.dispatchAction({command:"marker",action:"add",message:{label:e,timestamp:r.cloudClient.timestamp}})},bluetooth:function(){return r.bluetoothClient.addMarker(e)}});case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}},t,this)}))}},{key:"haptics",value:function(e){var t;return x(this,void 0,void 0,v().mark(function r(){var n,i,o,u,c,a,s=this;return v().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n="haptics",r.next=3,this.cloudClient.didSelectDevice();case 3:if(r.sent){r.next=5;break}return r.abrupt("return",Promise.reject(F.mustSelectDevice));case 5:return r.next=7,this.getSelectedDevice();case 7:if(r.t1=t=r.sent,r.t0=null===r.t1,r.t0){r.next=11;break}r.t0=void 0===t;case 11:if(!r.t0){r.next=15;break}r.t2=void 0,r.next=16;break;case 15:r.t2=t.modelVersion;case 16:if(i=r.t2,L.supportsHaptics(i)){r.next=20;break}return r.abrupt("return",Promise.reject(F.metricNotSupportedByModel(n,i)));case 20:o=L.getPlatformHapticMotors(i),r.t3=v().keys(e);case 22:if((r.t4=r.t3()).done){r.next=33;break}if(u=r.t4.value,Object.keys(o).includes(u)){r.next=26;break}return r.abrupt("return",Promise.reject(F.locationNotFound(u,i)));case 26:if(c=e[u],7,!(c.length>7)){r.next=30;break}return r.abrupt("return",Promise.reject(F.exceededMaxItems(7)));case 30:o[u]=c,r.next=22;break;case 33:return a={command:n,action:"queue",responseRequired:!0,responseTimeout:1e3,message:{effects:o}},r.next=36,this._withStreamingModePromise({wifi:function(){return s.cloudClient.dispatchAction(a)},bluetooth:function(){return s.bluetoothClient.dispatchAction(a)}});case 36:return r.abrupt("return",r.sent);case 37:case"end":return r.stop()}},r,this)}))}},{key:"getHapticEffects",value:function(){return R}},{key:"accelerometer",value:function(){var e=this,t="accelerometer",r=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,_.throwError)(function(){return i}):this.onDeviceChange().pipe((0,M.switchMap)(function(r){var n=(null==r?void 0:r.modelVersion)||L.MODEL_VERSION_1;return L.supportsAccel(n)?e._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,I.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.accelerometer()}}):(0,_.throwError)(function(){return F.metricNotSupportedByModel(t,n)})}))}},{key:"brainwaves",value:function(e){var t=this,r=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"brainwaves"),2),n=r[0],i=r[1];return n?(0,_.throwError)(function(){return i}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(t._getCloudMetricDependencies(),{metric:"brainwaves",labels:e?[e]:[],atomic:!1})},bluetooth:function(){return t.bluetoothClient.brainwaves(e)}})}},{key:"calm",value:function(){var e=this,t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"calm"),2),r=t[0],n=t[1];return r?(0,_.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["calm"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.calm()}})}},{key:"signalQuality",value:function(){var e=this,t="signalQuality",r=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,_.throwError)(function(){return i}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,I.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.signalQuality()}})}},{key:"settings",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"settings"),2),t=e[0],r=e[1];return t?(0,_.throwError)(function(){return r}):this.cloudClient.observeNamespace("settings")}},{key:"osVersion",value:function(){var e=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"osVersion"),2),t=e[0],r=e[1];return t?(0,_.throwError)(function(){return r}):this.cloudClient.osVersion()}},{key:"focus",value:function(){var e=this,t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"focus"),2),r=t[0],n=t[1];return r?(0,_.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return(0,W.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["focus"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.focus()}})}},{key:"kinesis",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"kinesis"),2),r=t[0],n=t[1];return r?(0,_.throwError)(function(){return n}):(0,W.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"kinesis",labels:e?[e]:[],atomic:!1})}},{key:"predictions",value:function(e){var t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"predictions"),2),r=t[0],n=t[1];return r?(0,_.throwError)(function(){return n}):(0,W.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"predictions",labels:e?[e]:[],atomic:!1})}},{key:"status",value:function(){var e=this,t=s((0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"status"),2),r=t[0],n=t[1];return r?(0,_.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return e.cloudClient.status()},bluetooth:function(){return e.bluetoothClient.status()}})}},{key:"changeSettings",value:function(e){return x(this,void 0,void 0,v().mark(function t(){var r,n,i,o;return v().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(F.mustSelectDevice));case 4:if(r=(0,B.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"changeSettings"),n=s(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this.cloudClient.changeSettings(e);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}))}},{key:"training",get:function(){var e=this;return{record:function(t){return x(e,void 0,void 0,v().mark(function e(){var r,n;return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw F.mustSelectDevice;case 4:return r=this.cloudClient.user&&"uid"in this.cloudClient.user?this.cloudClient.user.uid:null,n=Object.assign(Object.assign({fit:!1,baseline:!1,timestamp:this.cloudClient.timestamp},t),{userId:r}),e.next=8,this.cloudClient.actions.dispatch({command:"training",action:"record",message:n});case 8:case"end":return e.stop()}},e,this)}))},stop:function(t){return x(e,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw F.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stop",message:Object.assign({},t)});case 6:case"end":return e.stop()}},e,this)}))},stopAll:function(){return x(e,void 0,void 0,v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw F.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stopAll",message:{}});case 6:case"end":return e.stop()}},e,this)}))}}}},{key:"goOffline",value:function(){this.cloudClient.goOffline()}},{key:"goOnline",value:function(){this.cloudClient.goOnline()}},{key:"createAccount",value:function(e){return this.cloudClient.createAccount(e)}},{key:"deleteAccount",value:function(){return this.cloudClient.deleteAccount()}},{key:"createBluetoothToken",value:function(){return this.cloudClient.createBluetoothToken()}},{key:"createCustomToken",value:function(){return this.cloudClient.createCustomToken()}},{key:"getTimesyncOffset",value:function(){return this.options.timesync||console.warn("getTimesyncOffset() requires options.timesync to be true."),this.options.timesync?this.cloudClient.getTimesyncOffset():0}},{key:"createOAuthURL",value:function(e){return H.isNode?(0,G.createOAuthURL)(e,this.options):Promise.reject(new Error("".concat(F.prefix,"the createOAuthURL method must be used on the server side (node.js) for security reasons.")))}},{key:"getOAuthToken",value:function(e){return H.isNode?(0,q.getOAuthToken)(e,this.options):Promise.reject(new Error("".concat(F.prefix,"the getOAuthToken method must be used on the server side (node.js) for security reasons.")))}},{key:"removeOAuthAccess",value:function(){return this.cloudClient.removeOAuthAccess()}},{key:"onUserExperiments",value:function(){return this.cloudClient.onUserExperiments()}},{key:"deleteUserExperiment",value:function(e){return this.cloudClient.deleteUserExperiment(e)}}]),e}();exports.Neurosity=K,K.credentialWithLink=N.credentialWithLink,K.createUser=D.createUser,K.SERVER_TIMESTAMP=N.SERVER_TIMESTAMP;var Q=function(e){t(i,K);var r=n(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m(this,i),e=r.call(this,t),console.log("The Notion class is deprecated and will be removed in the next version of the SDK. Please use the Neurosity class instead. e.g. new Notion() => new Neurosity()"),e}return b(i)}();exports.Notion=Q;var z=require("./api/firebase");Object.defineProperty(exports,"__firebase",{enumerable:!0,get:function(){return z.__firebase}});
711
+ },{"rxjs":"Zr8e","rxjs/operators":"v3iE","fast-deep-equal":"jIGR","./api/index":"LXvB","./types/streaming":"rekm","./utils/subscription":"yLLB","./types/status":"Ttuy","./utils/errors":"WDyG","./utils/platform":"wAkn","./utils/hapticEffects":"lLai","./utils/oauth":"xIH5","./api/https/createOAuthURL":"MDrB","./api/https/getOAuthToken":"nfg4","./utils/is-node":"vsps","./utils/metrics":"DCuD","./api/bluetooth":"TICO","./api/bluetooth/types":"iwtf","./api/firebase":"kM30"}],"QCba":[function(require,module,exports) {
680
712
  "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),t=this&&this.__exportStar||function(t,r){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||e(r,t,i)};Object.defineProperty(exports,"__esModule",{value:!0}),t(require("./Neurosity"),exports),t(require("./api/bluetooth"),exports),t(require("./types/streaming"),exports);
681
713
  },{"./Neurosity":"BZP9","./api/bluetooth":"TICO","./types/streaming":"rekm"}]},{},["QCba"], null)
682
714
  //# sourceMappingURL=/neurosity.js.map