@audius/sdk 2.0.3-beta.3 → 2.0.3-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs.js +249 -215
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.browser.esm.js +249 -215
- package/dist/index.browser.esm.js.map +1 -1
- package/dist/index.cjs.js +251 -217
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +251 -217
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.js +249 -215
- package/dist/index.native.js.map +1 -1
- package/dist/legacy.js +251 -217
- package/dist/legacy.js.map +1 -1
- package/dist/native-libs.js +2 -2
- package/dist/sdk/api/chats/ChatsApi.d.ts +1 -0
- package/dist/sdk.js +2 -2
- package/dist/sdk.js.map +1 -1
- package/package.json +2 -2
- package/src/sdk/api/chats/ChatsApi.ts +14 -0
package/dist/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
!function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t,r,n,a,i,s){try{var o=e[i](s),u=o.value}catch(e){return void r(e)}o.done?t(u):Promise.resolve(u).then(n,a)}function r(e){return function(){var r=this,n=arguments;return new Promise((function(a,i){var s=e.apply(r,n);function o(e){t(s,a,i,o,u,"next",e)}function u(e){t(s,a,i,o,u,"throw",e)}o(void 0)}))}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){return s="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},s(e)}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={exports:{}},l={exports:{}};!function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(l),function(e){var t=l.exports.default;function r(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
e.exports=r=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var n={},a=Object.prototype,i=a.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),s=new I(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return S()}for(r.method=a,r.arg=i;;){var s=r.delegate;if(s){var o=_(s,r);if(o){if(o===p)continue;return o}}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 u=f(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,s),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p={};function h(){}function v(){}function y(){}var m={};l(m,o,(function(){return this}));var w=Object.getPrototypeOf,g=w&&w(w(T([])));g&&g!==a&&i.call(g,o)&&(m=g);var k=y.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,r){function n(a,s,o,u){var c=f(e[a],e,s);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(e){n("next",e,o,u)}),(function(e){n("throw",e,o,u)})):r.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,u)}))}u(c.arg)}var a;this._invoke=function(e,t){function i(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(i,i):i()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function R(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 I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function T(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 r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=y,l(k,"constructor",y),l(y,"constructor",v),v.displayName=l(y,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,u,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,a,i){void 0===i&&(i=Promise);var s=new x(d(e,t,r,a),i);return n.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},b(k),l(k,c,"Generator"),l(k,o,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},n.values=T,I.prototype={constructor:I,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)&&i.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 r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(o&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(s)},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),p},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),p}},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 a=n.arg;E(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(c);var d=c.exports(),f=d;try{regeneratorRuntime=d}catch(e){"object"===("undefined"==typeof globalThis?"undefined":s(globalThis))?globalThis.regeneratorRuntime=d:Function("r","regeneratorRuntime = r")(d)}var p="https://audius.co/oauth/auth",h="audiusOauthState",v=function(){function e(t){if(n(this,e),this.config=t,"undefined"==typeof window)throw new Error("Audius OAuth SDK functions are only available in browser. Refer to our documentation to learn how to implement Audius OAuth manually.");this.activePopupWindow=null,this.loginSuccessCallback=null,this.loginErrorCallback=null,this.popupCheckInterval=null}var t,a;return i(e,[{key:"init",value:function(e,t){var r=this;this.loginSuccessCallback=e,this.loginErrorCallback=null!=t?t:null,window.addEventListener("message",(function(e){r._receiveMessage(e)}),!1)}},{key:"login",value:function(){var e=this;if(this.config.appName)if(this.loginSuccessCallback){var t,r=(t=new Uint8Array(20),(window.crypto||window.msCrypto).getRandomValues(t),Array.from(t,(function(e){return e.toString(16).padStart(2,"0")})).join(""));window.localStorage.setItem(h,r);var n=encodeURIComponent(window.location.origin),a=encodeURI(this.config.appName),i="".concat(p,"?scope=read&state=").concat(r,"&redirect_uri=postMessage&origin=").concat(n,"&app_name=").concat(a);this.activePopupWindow=window.open(i,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=375, height=720, top=100, left=100"),this._clearPopupCheckInterval(),this.popupCheckInterval=setInterval((function(){var t;null!==(t=e.activePopupWindow)&&void 0!==t&&t.closed&&(e._surfaceError("The login popup was closed prematurely."),e.popupCheckInterval&&clearInterval(e.popupCheckInterval))}),500)}else this._surfaceError("Login success callback not set (set with `init` method).");else this._surfaceError("App name not set (set with `init` method).")}},{key:"renderButton",value:function(e,t){var r,n,a=this;e||console.error("Target element for Audius OAuth button is empty.");var i=document.createElement("style");i.textContent="\n.audiusLoginButton {\n cursor: pointer;\n font-family: Helvetica, Arial, sans-serif;\n text-align: center;\n color: #FFFFFF;\n font-weight: 700;\n font-size: 14px;\n line-height: 100%;\n align-items: center;\n display: flex;\n border: 0;\n height: 28px;\n justify-content: center;\n padding: 0px 16px;\n background: #CC0FE0;\n border-radius: 4px;\n transition: all 0.07s ease-in-out;\n}\n\n.audiusLoginButton:hover {\n background: #D127E3;\n transform: perspective(1px) scale3d(1.04, 1.04, 1.04);\n}\n\n.audiusLoginButton.disableHoverGrow:hover {\n transform: none;\n}\n\n.audiusLoginButton:active {\n background: #A30CB3;\n}\n\n.audiusLoginButton.pill {\n border-radius: 99px;\n}\n\n.audiusLoginButton.fullWidth {\n width: 100%;\n}\n\n.audiusLoginButton.small {\n height: 20px;\n font-size: 11px;\n padding: 0px 32px;\n}\n\n.audiusLoginButton.large {\n height: 40px;\n font-size: 18px;\n padding: 0px 18px;\n}\n",document.head.appendChild(i);var s,o,u,c=document.createElement("button");c.id="audius-login-button",c.classList.add("audiusLoginButton"),"pill"===(null==t?void 0:t.corners)&&c.classList.add("pill"),"small"===(null==t?void 0:t.size)&&c.classList.add("small"),"large"===(null==t?void 0:t.size)&&c.classList.add("large"),null!=t&&t.fullWidth&&c.classList.add("fullWidth"),null!=t&&t.disableHoverGrow&&c.classList.add("disableHoverGrow"),c.innerHTML="".concat((s=null!==(r=null==t?void 0:t.size)&&void 0!==r?r:"medium","small"===s?(o=16,u=5):"medium"===s?(o=18,u=5):(o=24,u=10),'<svg width="'.concat(o,'px" height="').concat(o,'px" viewBox="0 0 56 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="padding-right: ').concat(u,'px;">\n<g id="Assets" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="assets" transform="translate(-1555.000000, -2588.000000)">\n <g id="audiusLogoGlyph" transform="translate(1555.000000, 2588.000000)">\n <path d="M55.8191698,46.0362519 L42.4551012,23.3458831 L36.1870263,12.7036635 L29.0910326,0.65551431 C28.5766233,-0.217848954 27.2890668,-0.218676884 26.7734944,0.654065432 L13.3787621,23.3270477 L7.90582764,32.5909699 C7.39025522,33.4637122 8.03324043,34.5553386 9.06332791,34.5560631 L19.4031138,34.56279 C19.881044,34.5631005 20.3230236,34.3136864 20.5623059,33.9087249 L25.9362708,24.8122516 L26.7580568,23.4212248 C26.790518,23.3662709 26.8260456,23.3149392 26.8641108,23.2669192 C27.4325516,22.5520012 28.5935412,22.6041608 29.0755951,23.4226737 L34.6514114,32.8894388 L35.682239,34.6396841 C35.7412402,34.7399672 35.7843808,34.8430445 35.813987,34.9470533 C36.0430129,35.7492145 35.4339691,36.6039494 34.5220954,36.6034319 L22.3586676,36.5954631 C21.8806317,36.5951526 21.4387578,36.8445667 21.1994756,37.2496317 L16.0236614,46.0105861 C15.5080889,46.8833284 16.1510741,47.9749548 17.1810559,47.9756793 L27.9002253,47.9827167 L41.2664086,47.9913065 L54.6590261,47.9999997 C55.6892193,48.0006207 56.3335791,46.9096152 55.8191698,46.0362519" id="Audius-Logo" fill="#ffffff" fill-rule="evenodd"></path>\n <rect id="bound" x="0" y="0" width="56" height="48"></rect>\n </g>\n </g>\n</g>\n</svg>'))," ").concat(null!==(n=null==t?void 0:t.customText)&&void 0!==n?n:"Continue With Audius"),c.onclick=function(){a.login()},e.replaceWith(c)}},{key:"verifyToken",value:(a=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.config.usersApi.verifyIDToken({token:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_surfaceError",value:function(e){this.loginErrorCallback?this.loginErrorCallback(e):console.error(e)}},{key:"_clearPopupCheckInterval",value:function(){this.popupCheckInterval&&clearInterval(this.popupCheckInterval)}},{key:"_receiveMessage",value:(t=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new URL(p).origin,t.origin===r&&t.source===this.activePopupWindow&&t.data.state&&t.data.token){e.next=3;break}return e.abrupt("return");case 3:return this._clearPopupCheckInterval(),this.activePopupWindow&&(this.activePopupWindow.closed||this.activePopupWindow.close(),this.activePopupWindow=null),window.localStorage.getItem(h)!==t.data.state&&this._surfaceError("State mismatch."),e.next=8,this.verifyToken(t.data.token);case 8:null!=(n=e.sent)&&n.data?this.loginSuccessCallback&&this.loginSuccessCallback(n.data):this._surfaceError("The token was invalid.");case 10:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function m(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&&y(e,t)}function w(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function k(){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 b(e,t,r){return b=k()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&y(a,r.prototype),a},b.apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return b(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)},x(e)}function _(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 R(e,t){if(e){if("string"==typeof e)return _(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)?_(e,t):void 0}}function E(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?T(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function P(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var A="/v1".replace(/\/+$/,""),O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.configuration=t}return i(e,[{key:"config",set:function(e){this.configuration=e}},{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:A}},{key:"fetchApi",get:function(){return this.configuration.fetchApi}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||M}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:r(f.mark((function t(){return f.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e);case 1:case"end":return t.stop()}}),t)})))}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}]),e}(),C=new O,U=function(){function e(){var t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C;n(this,e),this.configuration=a,this.fetchApi=function(){var e=r(f.mark((function e(r,n){var a,i,s,o,u,c,l,d,p,h,v;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={url:r,init:n},i=P(t.middleware),e.prev=2,i.s();case 4:if((s=i.n()).done){e.next=15;break}if(!(o=s.value).pre){e.next=13;break}return e.next=9,o.pre(S({fetch:t.fetchApi},a));case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0=a;case 12:a=e.t0;case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),i.e(e.t1);case 20:return e.prev=20,i.f(),e.finish(20);case 23:return u=void 0,e.prev=24,e.next=27,(t.configuration.fetchApi||fetch)(a.url,a.init);case 27:u=e.sent,e.next=60;break;case 30:e.prev=30,e.t2=e.catch(24),c=P(t.middleware),e.prev=33,c.s();case 35:if((l=c.n()).done){e.next=46;break}if(!(d=l.value).onError){e.next=44;break}return e.next=40,d.onError({fetch:t.fetchApi,url:a.url,init:a.init,error:e.t2,response:u?u.clone():void 0});case 40:if(e.t3=e.sent,e.t3){e.next=43;break}e.t3=u;case 43:u=e.t3;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t4=e.catch(33),c.e(e.t4);case 51:return e.prev=51,c.f(),e.finish(51);case 54:if(void 0!==u){e.next=60;break}if(!(e.t2 instanceof Error)){e.next=59;break}throw new D(e.t2,"The request failed and the interceptors did not return an alternative response");case 59:throw e.t2;case 60:p=P(t.middleware),e.prev=61,p.s();case 63:if((h=p.n()).done){e.next=74;break}if(!(v=h.value).post){e.next=72;break}return e.next=68,v.post({fetch:t.fetchApi,url:a.url,init:a.init,response:u.clone()});case 68:if(e.t5=e.sent,e.t5){e.next=71;break}e.t5=u;case 71:u=e.t5;case 72:e.next=63;break;case 74:e.next=79;break;case 76:e.prev=76,e.t6=e.catch(61),p.e(e.t6);case 79:return e.prev=79,p.f(),e.finish(79);case 82:return e.abrupt("return",u);case 83:case"end":return e.stop()}}),e,null,[[2,17,20,23],[24,30],[33,48,51,54],[61,76,79,82]])})));return function(t,r){return e.apply(this,arguments)}}(),this.middleware=a.middleware}var t,a;return i(e,[{key:"withMiddleware",value:function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,arguments),t}},{key:"withPreMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{pre:e}}));return this.withMiddleware.apply(this,E(n))}},{key:"withPostMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{post:e}}));return this.withMiddleware.apply(this,E(n))}},{key:"request",value:(a=r(f.mark((function e(t,r){var n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createFetchParams(t,r);case 2:return n=e.sent,a=n.url,i=n.init,e.next=7,this.fetchApi(a,i);case 7:if(!((s=e.sent)&&s.status>=200&&s.status<300)){e.next=10;break}return e.abrupt("return",s);case 10:throw new B(s,"Response returned an error code");case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createFetchParams",value:(t=r(f.mark((function e(t,n){var a,i,s,o,u,c;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.configuration.basePath+t.path,void 0!==t.query&&0!==Object.keys(t.query).length&&(a+="?"+this.configuration.queryParamsStringify(t.query)),i=Object.assign({},this.configuration.headers,t.headers),Object.keys(i).forEach((function(e){return void 0===i[e]?delete i[e]:{}})),s="function"==typeof n?n:r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}}),e)}))),o={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},e.t0=S,e.t1=S({},o),e.next=10,s({init:o,context:t});case 10:return e.t2=e.sent,u=(0,e.t0)(e.t1,e.t2),c=S(S({},u),{},{body:(l=u.body,"undefined"!=typeof FormData&&l instanceof FormData||u.body instanceof URLSearchParams||L(u.body)||N(u.body)?u.body:JSON.stringify(u.body))}),e.abrupt("return",{url:a,init:c});case 14:case"end":return e.stop()}var l}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"clone",value:function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}]),e}();function L(e){return"undefined"!=typeof Blob&&e instanceof Blob}function N(e){return"string"==typeof e}var B=function(e){m(r,e);var t=I(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).response=e,i.name="ResponseError",i}return i(r)}(x(Error)),D=function(e){m(r,e);var t=I(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).cause=e,i.name="FetchError",i}return i(r)}(x(Error)),j=function(e){m(r,e);var t=I(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).field=e,i.name="RequiredError",i}return i(r)}(x(Error)),F=",";function G(e,t){var r=e[t];return null!=r}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).sort().map((function(r){return H(r,e[r],t)})).filter((function(e){return e.length>0})).join("&")}function H(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r+(r.length?"[".concat(e,"]"):e);if(t instanceof Array){var a=t.map((function(e){return encodeURIComponent(String(e))})).join("&".concat(encodeURIComponent(n),"="));return"".concat(encodeURIComponent(n),"=").concat(a)}if(t instanceof Set){var i=Array.from(t);return H(e,i,r)}return t instanceof Date?"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.toISOString())):t instanceof Object?M(t,n):"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(t)))}function W(t,r){return Object.keys(t).reduce((function(n,a){return S(S({},n),{},e({},a,r(t[a])))}),{})}var V=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};n(this,e),this.raw=t,this.transformer=r}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,this.raw.json();case 3:return e.t1=e.sent,e.abrupt("return",e.t0.transformer.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),z=function(){function e(t){n(this,e),this.raw=t}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),e}();function X(e){return function(e,t){if(null==e)return e;return{timestamp:G(e,"timestamp")?e.timestamp:void 0,itemType:G(e,"item_type")?e.item_type:void 0,item:G(e,"item")?e.item:void 0}}(e)}function $(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,subscriberIds:G(e,"subscriber_ids")?e.subscriber_ids:void 0}}(e)}function Y(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map($):void 0}}(e)}function K(e){return function(e,t){if(null==e)return e;return{ercWallets:e.erc_wallets,splWallets:e.spl_wallets}}(e)}function J(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?K(e.data):void 0}}(e)}function Z(e){return function(e,t){if(null==e)return e;return{_640x:G(e,"640x")?e["640x"]:void 0,_2000x:G(e,"2000x")?e["2000x"]:void 0}}(e)}function Q(e){return function(e,t){if(null==e)return e;return{_150x150:G(e,"150x150")?e["150x150"]:void 0,_480x480:G(e,"480x480")?e["480x480"]:void 0,_1000x1000:G(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function ee(e){return function(e,t){if(null==e)return e;return{userId:e.userId,email:e.email,name:e.name,handle:e.handle,verified:e.verified,profilePicture:G(e,"profilePicture")?Q(e.profilePicture):void 0,sub:e.sub,iat:e.iat}}(e)}function te(e){return function(e,t){if(null==e)return e;return{userId:G(e,"user_id")?e.user_id:void 0}}(e)}function re(e){return function(e,t){if(null==e)return e;return{favoriteItemId:e.favorite_item_id,favoriteType:e.favorite_type,userId:e.user_id,createdAt:e.created_at}}(e)}function ne(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(re):void 0}}(e)}function ae(e){return function(e,t){if(null==e)return e;return{albumCount:e.album_count,artistPickTrackId:G(e,"artist_pick_track_id")?e.artist_pick_track_id:void 0,bio:G(e,"bio")?e.bio:void 0,coverPhoto:G(e,"cover_photo")?Z(e.cover_photo):void 0,followeeCount:e.followee_count,followerCount:e.follower_count,doesFollowCurrentUser:G(e,"does_follow_current_user")?e.does_follow_current_user:void 0,handle:e.handle,id:e.id,isVerified:e.is_verified,location:G(e,"location")?e.location:void 0,name:e.name,playlistCount:e.playlist_count,profilePicture:G(e,"profile_picture")?Q(e.profile_picture):void 0,repostCount:e.repost_count,trackCount:e.track_count,isDeactivated:e.is_deactivated,ercWallet:G(e,"erc_wallet")?e.erc_wallet:void 0,splWallet:e.spl_wallet,supporterCount:e.supporter_count,supportingCount:e.supporting_count}}(e)}function ie(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function se(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function oe(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,sender:ae(e.sender)}}(e)}function ue(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?oe(e.data):void 0}}(e)}function ce(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(oe):void 0}}(e)}function le(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,receiver:ae(e.receiver)}}(e)}function de(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(le):void 0}}(e)}function fe(e){return function(e,t){if(null==e)return e;return{amount:e.amount,sender:G(e,"sender")?ae(e.sender):void 0,receiver:G(e,"receiver")?ae(e.receiver):void 0,createdAt:e.created_at}}(e)}function pe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(fe):void 0}}(e)}function he(e){return function(e,t){if(null==e)return e;return{service:e.service,version:e.version}}(e)}function ve(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:he(e.version),data:G(e,"data")?e.data.map(X):void 0}}(e)}function ye(e){return function(e,t){if(null==e)return e;return{trackId:G(e,"trackId")?e.trackId:void 0,date:G(e,"date")?e.date:void 0,listens:G(e,"listens")?e.listens:void 0}}(e)}function me(e){return function(e,t){if(null==e)return e;return{totalListens:G(e,"totalListens")?e.totalListens:void 0,trackIds:G(e,"trackIds")?e.trackIds:void 0,listenCounts:G(e,"listenCounts")?e.listenCounts.map(ye):void 0}}(e)}function we(e){return function(e,t){if(null==e)return e;return{_150x150:G(e,"150x150")?e["150x150"]:void 0,_480x480:G(e,"480x480")?e["480x480"]:void 0,_1000x1000:G(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function ge(e){return function(e,t){if(null==e)return e;return{artwork:G(e,"artwork")?we(e.artwork):void 0,description:G(e,"description")?e.description:void 0,permalink:G(e,"permalink")?e.permalink:void 0,id:e.id,isAlbum:e.is_album,playlistName:e.playlist_name,repostCount:e.repost_count,favoriteCount:e.favorite_count,totalPlayCount:e.total_play_count,user:ae(e.user)}}(e)}function ke(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ge):void 0}}(e)}function be(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ge):void 0}}(e)}function xe(e){return function(e,t){if(null==e)return e;return{parentTrackId:e.parent_track_id}}(e)}function _e(e){return function(e,t){if(null==e)return e;return{tracks:G(e,"tracks")?e.tracks.map(xe):void 0}}(e)}function Re(e){return function(e,t){if(null==e)return e;return{_150x150:G(e,"150x150")?e["150x150"]:void 0,_480x480:G(e,"480x480")?e["480x480"]:void 0,_1000x1000:G(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function Ee(e){return function(e,t){if(null==e)return e;return{artwork:G(e,"artwork")?Re(e.artwork):void 0,description:G(e,"description")?e.description:void 0,genre:G(e,"genre")?e.genre:void 0,id:e.id,trackCid:G(e,"track_cid")?e.track_cid:void 0,mood:G(e,"mood")?e.mood:void 0,releaseDate:G(e,"release_date")?e.release_date:void 0,remixOf:G(e,"remix_of")?_e(e.remix_of):void 0,repostCount:e.repost_count,favoriteCount:e.favorite_count,tags:G(e,"tags")?e.tags:void 0,title:e.title,user:ae(e.user),duration:e.duration,downloadable:G(e,"downloadable")?e.downloadable:void 0,playCount:e.play_count,permalink:G(e,"permalink")?e.permalink:void 0,isStreamable:G(e,"is_streamable")?e.is_streamable:void 0}}(e)}function Ie(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(Ee):void 0}}(e)}function Te(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Se(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(X):void 0}}(e)}function Pe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function qe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data:void 0}}(e)}function Ae(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Oe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Ce(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?Ee(e.data):void 0}}(e)}function Ue(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(Ee):void 0}}(e)}function Le(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(Ee):void 0}}(e)}function Ne(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ge):void 0}}(e)}function Be(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?te(e.data):void 0}}(e)}function De(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,wallet:e.wallet,primary:G(e,"primary")?e.primary:void 0,secondary1:G(e,"secondary1")?e.secondary1:void 0,secondary2:G(e,"secondary2")?e.secondary2:void 0,primarySpID:G(e,"primarySpID")?e.primarySpID:void 0,secondary1SpID:G(e,"secondary1SpID")?e.secondary1SpID:void 0,secondary2SpID:G(e,"secondary2SpID")?e.secondary2SpID:void 0}}(e)}function je(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?ae(e.data):void 0}}(e)}function Fe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Ge(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?W(e.data,me):void 0}}(e)}function Me(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?De(e.data):void 0}}(e)}function He(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?ee(e.data):void 0}}(e)}function We(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ve=function(e){m(h,e);var t,a,s,o,u,c,l,d,p=We(h);function h(){return n(this,h),p.apply(this,arguments)}return i(h,[{key:"getPlaylistRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new j("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylist.");case 2:return n={},a={},e.next=6,this.request({path:"/playlists/{playlist_id}".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ke(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getPlaylist",value:(l=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getPlaylistTracksRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new j("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylistTracks.");case 2:return n={},a={},e.next=6,this.request({path:"/playlists/{playlist_id}/tracks".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ie(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getPlaylistTracks",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistTracksRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getTrendingPlaylistsRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.time&&(n.time=t.time),a={},e.next=5,this.request({path:"/playlists/trending",method:"GET",headers:a,query:n},r);case 5:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ne(e)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getTrendingPlaylists",value:(s=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingPlaylistsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"searchPlaylistsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new j("query","Required parameter requestParameters.query was null or undefined when calling searchPlaylists.");case 2:return n={},void 0!==t.query&&(n.query=t.query),a={},e.next=7,this.request({path:"/playlists/search",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return be(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"searchPlaylists",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchPlaylistsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),h}(U);function ze(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Xe=function(e){m(o,e);var t,a,s=ze(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"getTipsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.receiverMinFollowers&&(n.receiver_min_followers=t.receiverMinFollowers),void 0!==t.receiverIsVerified&&(n.receiver_is_verified=t.receiverIsVerified),void 0!==t.currentUserFollows&&(n.current_user_follows=t.currentUserFollows),void 0!==t.uniqueBy&&(n.unique_by=t.uniqueBy),a={},e.next=11,this.request({path:"/tips",method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new V(i,(function(e){return pe(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getTips",value:(t=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTipsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),o}(U);function $e(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ye=function(e){m(b,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k=$e(b);function b(){return n(this,b),k.apply(this,arguments)}return i(b,[{key:"getBulkTracksRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.permalink&&(n.permalink=t.permalink),t.id&&(n.id=t.id),a={},e.next=6,this.request({path:"/tracks",method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getBulkTracks",value:(w=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getBulkTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"getTrackRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new j("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrack.");case 2:return n={},a={},e.next=6,this.request({path:"/tracks/{track_id}".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ce(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getTrack",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getTrendingTracksRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),a={},e.next=6,this.request({path:"/tracks/trending",method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getTrendingTracks",value:(p=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getUndergroundTrendingTracksRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=6,this.request({path:"/tracks/trending/underground",method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUndergroundTrendingTracks",value:(l=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getUndergroundTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersionRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new j("version","Required parameter requestParameters.version was null or undefined when calling getUndergroundTrendingTracksWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=8,this.request({path:"/tracks/trending/underground/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersion",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUndergroundTrendingTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"searchTracksRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new j("query","Required parameter requestParameters.query was null or undefined when calling searchTracks.");case 2:return n={},void 0!==t.query&&(n.query=t.query),void 0!==t.onlyDownloadable&&(n.only_downloadable=t.onlyDownloadable),a={},e.next=8,this.request({path:"/tracks/search",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ue(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"searchTracks",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchTracksRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"streamTrackRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new j("trackId","Required parameter requestParameters.trackId was null or undefined when calling streamTrack.");case 2:return n={},void 0!==t.userSignature&&(n.user_signature=t.userSignature),void 0!==t.userData&&(n.user_data=t.userData),void 0!==t.premiumContentSignature&&(n.premium_content_signature=t.premiumContentSignature),a={},e.next=9,this.request({path:"/tracks/{track_id}/stream".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new z(i));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"streamTrack",value:(t=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamTrackRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),b}(U);function Ke(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Je=function(e){m(_e,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,E,I,T,S,P,q,A,O,C,U,L,N,B,D,G,M,H,W,z,X,$,K,Z,Q,ee,te,re,ae,oe,le,fe,pe,he,ye,me,we,ge,ke,be,xe=Ke(_e);function _e(){return n(this,_e),xe.apply(this,arguments)}return i(_e,[{key:"bulkGetSubscribersRaw",value:(be=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new j("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribers.");case 2:return n={},t.ids&&(n.ids=t.ids.join(F)),a={},e.next=7,this.request({path:"/users/subscribers",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Y(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return be.apply(this,arguments)})},{key:"bulkGetSubscribers",value:(ke=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ke.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequestRaw",value:(ge=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new j("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribersViaJSONRequest.");case 2:return n={},t.ids&&(n.ids=t.ids.join(F)),a={},e.next=7,this.request({path:"/users/subscribers",method:"POST",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Y(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return ge.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequest",value:(we=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersViaJSONRequestRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return we.apply(this,arguments)})},{key:"getConnectedWalletsRaw",value:(me=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getConnectedWallets.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/connected_wallets".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return J(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return me.apply(this,arguments)})},{key:"getConnectedWallets",value:(ye=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getConnectedWalletsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ye.apply(this,arguments)})},{key:"getFavoriteAlbumsRaw",value:(he=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFavoriteAlbums.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/favorites/albums".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ne(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return he.apply(this,arguments)})},{key:"getFavoriteAlbums",value:(pe=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoriteAlbumsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return pe.apply(this,arguments)})},{key:"getFavoritePlaylistsRaw",value:(fe=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFavoritePlaylists.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/favorites/playlists".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ne(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return fe.apply(this,arguments)})},{key:"getFavoritePlaylists",value:(le=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoritePlaylistsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return le.apply(this,arguments)})},{key:"getFavoritesRaw",value:(oe=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFavorites.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/favorites".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ne(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return oe.apply(this,arguments)})},{key:"getFavorites",value:(ae=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ae.apply(this,arguments)})},{key:"getFollowersRaw",value:(re=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFollowers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/followers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ie(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return re.apply(this,arguments)})},{key:"getFollowers",value:(te=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"getFollowingsRaw",value:(ee=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFollowings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/following".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return se(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return ee.apply(this,arguments)})},{key:"getFollowings",value:(Q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Q.apply(this,arguments)})},{key:"getRelatedUsersRaw",value:(Z=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getRelatedUsers.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=8,this.request({path:"/users/{id}/related".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Te(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return Z.apply(this,arguments)})},{key:"getRelatedUsers",value:(K=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRelatedUsersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"getRepostsRaw",value:($=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/reposts".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Se(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return $.apply(this,arguments)})},{key:"getReposts",value:(X=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return X.apply(this,arguments)})},{key:"getRepostsByHandleRaw",value:(z=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new j("handle","Required parameter requestParameters.handle was null or undefined when calling getRepostsByHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/handle/{handle}/reposts".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Se(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"getRepostsByHandle",value:(W=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"getSubscribersRaw",value:(H=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSubscribers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/subscribers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Pe(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getSubscribers",value:(M=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getSupporterRaw",value:(G=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupporter.");case 2:if(null!==t.supporterUserId&&void 0!==t.supporterUserId){e.next=4;break}throw new j("supporterUserId","Required parameter requestParameters.supporterUserId was null or undefined when calling getSupporter.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporters/{supporter_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supporter_user_id","}"),encodeURIComponent(String(t.supporterUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ue(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"getSupporter",value:(D=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupporterRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getSupportersRaw",value:(B=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupporters.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=8,this.request({path:"/users/{id}/supporters".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ce(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"getSupporters",value:(N=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"getSupportingRaw",value:(L=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupporting.");case 2:if(null!==t.supportedUserId&&void 0!==t.supportedUserId){e.next=4;break}throw new j("supportedUserId","Required parameter requestParameters.supportedUserId was null or undefined when calling getSupporting.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporting/{supported_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supported_user_id","}"),encodeURIComponent(String(t.supportedUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return de(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getSupporting",value:(U=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getSupportingsRaw",value:(C=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupportings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=8,this.request({path:"/users/{id}/supporting".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return de(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getSupportings",value:(O=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"getTopTrackTagsRaw",value:(A=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getTopTrackTags.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=8,this.request({path:"/users/{id}/tags".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return qe(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getTopTrackTags",value:(q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTopTrackTagsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getTopUsersRaw",value:(P=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Oe(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getTopUsers",value:(S=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"getTopUsersInGenreRaw",value:(T=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),t.genre&&(n.genre=t.genre),a={},e.next=7,this.request({path:"/users/genre/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ae(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getTopUsersInGenre",value:(I=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersInGenreRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"getTracksByUserRaw",value:(E=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getTracksByUser.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/{id}/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"getTracksByUser",value:(R=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"getTracksByUserHandleRaw",value:(_=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new j("handle","Required parameter requestParameters.handle was null or undefined when calling getTracksByUserHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/handle/{handle}/tracks".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"getTracksByUserHandle",value:(x=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"getUserRaw",value:(b=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUser.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return je(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getUser",value:(k=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getUserByHandleRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new j("handle","Required parameter requestParameters.handle was null or undefined when calling getUserByHandle.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/handle/{handle}".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return je(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getUserByHandle",value:(w=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getUserIDFromWalletRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.associatedWallet&&void 0!==t.associatedWallet){e.next=2;break}throw new j("associatedWallet","Required parameter requestParameters.associatedWallet was null or undefined when calling getUserIDFromWallet.");case 2:return n={},void 0!==t.associatedWallet&&(n.associated_wallet=t.associatedWallet),a={},e.next=7,this.request({path:"/users/id",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Be(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getUserIDFromWallet",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserIDFromWalletRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getUserMonthlyTrackListensRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUserMonthlyTrackListens.");case 2:if(null!==t.startTime&&void 0!==t.startTime){e.next=4;break}throw new j("startTime","Required parameter requestParameters.startTime was null or undefined when calling getUserMonthlyTrackListens.");case 4:if(null!==t.endTime&&void 0!==t.endTime){e.next=6;break}throw new j("endTime","Required parameter requestParameters.endTime was null or undefined when calling getUserMonthlyTrackListens.");case 6:return n={},void 0!==t.startTime&&(n.start_time=t.startTime),void 0!==t.endTime&&(n.end_time=t.endTime),a={},e.next=12,this.request({path:"/users/{id}/listen_counts_monthly".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ge(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getUserMonthlyTrackListens",value:(p=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserMonthlyTrackListensRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getUserReplicaSetRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUserReplicaSet.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/replica_set".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Me(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUserReplicaSet",value:(l=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserReplicaSetRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getUsersTrackHistoryRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUsersTrackHistory.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},e.next=12,this.request({path:"/users/{id}/history/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ve(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUsersTrackHistory",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersTrackHistoryRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"searchUsersRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new j("query","Required parameter requestParameters.query was null or undefined when calling searchUsers.");case 2:return n={},void 0!==t.query&&(n.query=t.query),a={},e.next=7,this.request({path:"/users/search",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Fe(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"searchUsers",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchUsersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"verifyIDTokenRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.token&&void 0!==t.token){e.next=2;break}throw new j("token","Required parameter requestParameters.token was null or undefined when calling verifyIDToken.");case 2:return n={},void 0!==t.token&&(n.token=t.token),a={},e.next=7,this.request({path:"/users/verify_token",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return He(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"verifyIDToken",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.verifyIDTokenRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),_e}(U);function Ze(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Qe=function(e){m(s,e);var t,a=Ze(s);function s(e,t){var r;return n(this,s),(r=a.call(this,e)).discoveryNodeSelectorService=t,r}return i(s,[{key:"streamTrack",value:(t=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new j("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrack.");case 2:return r="/tracks/{track_id}/stream".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),e.next=5,this.discoveryNodeSelectorService.getSelectedEndpoint();case 5:return n=e.sent,e.abrupt("return","".concat(n).concat(A).concat(r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),s}(Ye);function et(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var tt=function(e){m(o,e);var t,a,s=et(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"resolveRaw",value:(a=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.url&&void 0!==t.url){e.next=2;break}throw new j("url","Required parameter requestParameters.url was null or undefined when calling resolve.");case 2:return r={},void 0!==t.url&&(r.url=t.url),n={},e.next=7,this.request({path:"/resolve",method:"GET",headers:n,query:r});case 7:return a=e.sent,e.abrupt("return",new V(a,(function(e){return Ce(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"resolve",value:(t=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveRaw(t);case 2:return e.next=4,e.sent.value();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),o}(U);function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],s=!0,o=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){o=!0,a=e}finally{try{s||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||R(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nt=Object.freeze({__proto__:null,default:{}}),at={node:nt,web:"object"===("undefined"==typeof self?"undefined":s(self))&&"crypto"in self?self.crypto:void 0};function it(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+s(e));if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function st(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every((function(e){return e instanceof Uint8Array})))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),a=new Uint8Array(n),i=0,s=0;i<t.length;i++){var o=t[i];a.set(o,s),s+=o.length}return a}var ot="AES-GCM",ut={name:"AES-GCM",length:256};function ct(e,t){return lt.apply(this,arguments)}function lt(){return(lt=r(f.mark((function e(t,r){var n,a,i,s,o,u,c,l,d,p;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof r&&(r=pt.utf8ToBytes(r)),n=pt.randomBytes(12),!at.web){e.next=16;break}return e.next=5,at.web.subtle.importKey("raw",t,ut,!0,["encrypt"]);case 5:return a=e.sent,e.next=8,at.web.subtle.encrypt({name:ot,iv:n},a,r);case 8:return i=e.sent,s=new Uint8Array(i),(o=new Uint8Array(n.length+s.byteLength)).set(n,0),o.set(s,n.length),e.abrupt("return",o);case 16:return u=at.node.createCipheriv("aes-256-gcm",t,n),c=u.update(r,void 0,"hex"),c+=u.final("hex"),l=it(c),d=u.getAuthTag(),p=st(n,l,d),e.abrupt("return",p);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dt(e,t){return ft.apply(this,arguments)}function ft(){return(ft=r(f.mark((function e(t,r){var n,a,i,s,o,u,c,l,d,p;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof r&&(r=it(r)),n=r.slice(0,12),!at.web){e.next=13;break}return a=r.slice(12),e.next=6,at.web.subtle.importKey("raw",t,ut,!0,["decrypt"]);case 6:return i=e.sent,e.next=9,at.web.subtle.decrypt({name:ot,iv:n},i,a);case 9:return s=e.sent,e.abrupt("return",new Uint8Array(s));case 13:return o=r.slice(12,-16),u=r.slice(-16),(c=at.node.createDecipheriv("aes-256-gcm",t,n)).setAuthTag(u),l=c.update(o),d=Uint8Array.from(c.final()),p=st(l,d),e.abrupt("return",p);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pt={randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(at.web)return at.web.getRandomValues(new Uint8Array(e));if(at.node){var t=at.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},bytesToUtf8:function(e){return(new TextDecoder).decode(e)},utf8ToBytes:function(e){return(new TextEncoder).encode(e)},hexToBytes:it,concatBytes:st};function ht(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return vt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function vt(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}
|
|
4
|
-
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yt(e){if(!Number.isSafeInteger(e))throw new Error("Wrong integer: ".concat(e))}function mt(){for(var e=function(e,t){return function(r){return e(t(r))}},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=Array.from(r).reverse().reduce((function(t,r){return t?e(t,r.encode):r.encode}),void 0),i=r.reduce((function(t,r){return t?e(t,r.decode):r.decode}),void 0);return{encode:a,decode:i}}function wt(e){return{encode:function(t){if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((function(t){if(yt(t),t<0||t>=e.length)throw new Error("Digit index outside alphabet: ".concat(t," (alphabet: ").concat(e.length,")"));return e[t]}))},decode:function(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((function(t){if("string"!=typeof t)throw new Error("alphabet.decode: not string element=".concat(t));var r=e.indexOf(t);if(-1===r)throw new Error('Unknown letter: "'.concat(t,'". Allowed: ').concat(e));return r}))}}}function gt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"!=typeof e)throw new Error("join separator should be string");return{encode:function(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");var r,n=ht(t);try{for(n.s();!(r=n.n()).done;){var a=r.value;if("string"!=typeof a)throw new Error("join.encode: non-string input=".concat(a))}}catch(e){n.e(e)}finally{n.f()}return t.join(e)},decode:function(t){if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function kt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";if(yt(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode:function(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");var n,a=ht(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("string"!=typeof i)throw new Error("padding.encode: non-string input=".concat(i))}}catch(e){a.e(e)}finally{a.f()}for(;r.length*e%8;)r.push(t);return r},decode:function(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");var n,a=ht(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("string"!=typeof i)throw new Error("padding.decode: non-string input=".concat(i))}}catch(e){a.e(e)}finally{a.f()}var s=r.length;if(s*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;s>0&&r[s-1]===t;s--)if(!((s-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,s)}}}function bt(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:function(e){return e},decode:function(t){return e(t)}}}function xt(e,t,r){if(t<2)throw new Error("convertRadix: wrong from=".concat(t,", base cannot be less than 2"));if(r<2)throw new Error("convertRadix: wrong to=".concat(r,", base cannot be less than 2"));if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];var n=0,a=[],i=Array.from(e);for(i.forEach((function(e){if(yt(e),e<0||e>=t)throw new Error("Wrong integer: ".concat(e))}));;){for(var s=0,o=!0,u=n;u<i.length;u++){var c=i[u],l=t*s+c;if(!Number.isSafeInteger(l)||t*s/t!==s||l-c!=t*s)throw new Error("convertRadix: carry overflow");if(s=l%r,i[u]=Math.floor(l/r),!Number.isSafeInteger(i[u])||i[u]*r+s!==l)throw new Error("convertRadix: carry overflow");o&&(i[u]?o=!1:n=u)}if(a.push(s),o)break}for(var d=0;d<e.length-1&&0===e[d];d++)a.push(0);return a.reverse()}var _t=function e(t,r){return r?e(r,t%r):t},Rt=function(e,t){return e+(t-_t(e,t))};function Et(e,t,r,n){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error("convertRadix2: wrong from=".concat(t));if(r<=0||r>32)throw new Error("convertRadix2: wrong to=".concat(r));if(Rt(t,r)>32)throw new Error("convertRadix2: carry overflow from=".concat(t," to=").concat(r," carryBits=").concat(Rt(t,r)));var a,i=0,s=0,o=Math.pow(2,r)-1,u=[],c=ht(e);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(yt(l),l>=Math.pow(2,t))throw new Error("convertRadix2: invalid data word=".concat(l," from=").concat(t));if(i=i<<t|l,s+t>32)throw new Error("convertRadix2: carry overflow pos=".concat(s," from=").concat(t));for(s+=t;s>=r;s-=r)u.push((i>>s-r&o)>>>0);i&=Math.pow(2,s)-1}}catch(e){c.e(e)}finally{c.f()}if(i=i<<r-s&o,!n&&s>=t)throw new Error("Excess padding");if(!n&&i)throw new Error("Non-zero padding: ".concat(i));return n&&s>0&&u.push(i>>>0),u}function It(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(yt(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Rt(8,e)>32||Rt(e,8)>32)throw new Error("radix2: carry overflow");return{encode:function(r){if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Et(Array.from(r),8,e,!t)},decode:function(r){if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Et(r,e,8,t))}}}function Tt(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(null,r)}catch(e){}}}var St=mt(It(4),wt("0123456789ABCDEF"),gt("")),Pt=mt(It(5),wt("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),kt(5),gt(""));mt(It(5),wt("0123456789ABCDEFGHIJKLMNOPQRSTUV"),kt(5),gt("")),mt(It(5),wt("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),gt(""),bt((function(e){return e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")})));var qt=mt(It(6),wt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),kt(6),gt("")),At=mt(It(6),wt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),kt(6),gt("")),Ot=function(e){return mt((yt(t=58),{encode:function(e){if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return xt(Array.from(e),Math.pow(2,8),t)},decode:function(e){if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(xt(e,t,Math.pow(2,8)))}}),wt(e),gt(""));var t},Ct=Ot("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Ot("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Ot("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var Ut=[0,2,3,5,6,7,9,10,11],Lt={encode:function(e){for(var t="",r=0;r<e.length;r+=8){var n=e.subarray(r,r+8);t+=Ct.encode(n).padStart(Ut[n.length],"1")}return t},decode:function(e){for(var t=[],r=0;r<e.length;r+=11){for(var n=e.slice(r,r+11),a=Ut.indexOf(n.length),i=Ct.decode(n),s=0;s<i.length-a;s++)if(0!==i[s])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(i.slice(i.length-a)))}return Uint8Array.from(t)}},Nt=mt(wt("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),gt("")),Bt=[996825010,642813549,513874426,1027748829,705979059];function Dt(e){for(var t=e>>25,r=(33554431&e)<<5,n=0;n<Bt.length;n++)1==(t>>n&1)&&(r^=Bt[n]);return r}function jt(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=e.length,a=1,i=0;i<n;i++){var s=e.charCodeAt(i);if(s<33||s>126)throw new Error("Invalid prefix (".concat(e,")"));a=Dt(a)^s>>5}a=Dt(a);for(var o=0;o<n;o++)a=Dt(a)^31&e.charCodeAt(o);var u,c=ht(t);try{for(c.s();!(u=c.n()).done;){var l=u.value;a=Dt(a)^l}}catch(e){c.e(e)}finally{c.f()}for(var d=0;d<6;d++)a=Dt(a);return a^=r,Nt.encode(Et([a%Math.pow(2,30)],30,5,!1))}function Ft(e){var t="bech32"===e?1:734539939,r=It(5),n=r.decode,a=r.encode,i=Tt(n);function o(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:90;if("string"!=typeof e)throw new Error("bech32.decode input should be string, not ".concat(s(e)));if(e.length<8||!1!==r&&e.length>r)throw new TypeError("Wrong string length: ".concat(e.length," (").concat(e,"). Expected (8..").concat(r,")"));var n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");var a=(e=n).lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');var i=e.slice(0,a),o=e.slice(a+1);if(o.length<6)throw new Error("Data must be at least 6 characters long");var u=Nt.decode(o).slice(0,-6),c=jt(i,u,t);if(!o.endsWith(c))throw new Error("Invalid checksum in ".concat(e,': expected "').concat(c,'"'));return{prefix:i,words:u}}return{encode:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90;if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not ".concat(s(e)));if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not ".concat(s(r)));var a=e.length+7+r.length;if(!1!==n&&a>n)throw new TypeError("Length ".concat(a," exceeds limit ").concat(n));return e=e.toLowerCase(),"".concat(e,"1").concat(Nt.encode(r)).concat(jt(e,r,t))},decode:o,decodeToBytes:function(e){var t=o(e,!1),r=t.prefix,a=t.words;return{prefix:r,words:a,bytes:n(a)}},decodeUnsafe:Tt(o),fromWords:n,fromWordsUnsafe:i,toWords:a}}Ft("bech32"),Ft("bech32m");var Gt={utf8:{encode:function(e){return(new TextDecoder).decode(e)},decode:function(e){return(new TextEncoder).encode(e)}},hex:mt(It(4),wt("0123456789abcdef"),gt(""),bt((function(e){if("string"!=typeof e||e.length%2)throw new TypeError("hex.decode: expected string, got ".concat(s(e)," with length ").concat(e.length));return e.toLowerCase()}))),base16:St,base32:Pt,base64:qt,base64url:At,base58:Ct,base58xmr:Lt};function Mt(e){var t=new Error(e);return t.source="ulid",t}"Invalid encoding type. Available types: ".concat(Object.keys(Gt).join(", "));var Ht="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Wt=Ht.length,Vt=Math.pow(2,48)-1;function zt(e){var t=Math.floor(e()*Wt);return t===Wt&&(t=Wt-1),Ht.charAt(t)}var Xt,$t=(Xt||(Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];t||(t="undefined"!=typeof window?window:null);var r=t&&(t.crypto||t.msCrypto);if(r)return function(){var e=new Uint8Array(1);return r.getRandomValues(e),e[0]/255};try{var n=require("crypto");return function(){return n.randomBytes(1).readUInt8()/255}}catch(e){}if(e){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch(e){}return function(){return Math.random()}}throw Mt("secure crypto unusable, insecure Math.random not allowed")}()),function(e){return isNaN(e)&&(e=Date.now()),function(e,t){if(isNaN(e))throw new Error(e+" must be a number");if(e>Vt)throw Mt("cannot encode time greater than "+Vt);if(e<0)throw Mt("time must be positive");if(!1===Number.isInteger(e))throw Mt("time must be an integer");for(var r=void 0,n="";t>0;t--)n=Ht.charAt(r=e%Wt)+n,e=(e-r)/Wt;return n}(e,10)+function(e,t){for(var r="";e>0;e--)r=zt(t)+r;return r}(16,Xt)});function Yt(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Kt=BigInt(0),Jt=BigInt(1),Zt=BigInt(2),Qt=BigInt(3),er=BigInt(8),tr=Object.freeze({a:Kt,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:Jt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});function rr(e){var t=tr.a,r=tr.b,n=_r(e*e),a=_r(n*e);return _r(a+t*e+r)}var nr=tr.a===Kt,ar=function(e){m(r,e);var t=Yt(r);function r(e){return n(this,r),t.call(this,e)}return i(r)}(x(Error)),ir=function(){function e(t,r,a){n(this,e),this.x=t,this.y=r,this.z=a}return i(e,[{key:"equals",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint expected");var r=this.x,n=this.y,a=this.z,i=t.x,s=t.y,o=t.z,u=_r(a*a),c=_r(o*o),l=_r(r*c),d=_r(i*u),f=_r(_r(n*o)*c),p=_r(_r(s*a)*u);return l===d&&f===p}},{key:"negate",value:function(){return new e(this.x,_r(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,r=this.y,n=this.z,a=_r(t*t),i=_r(r*r),s=_r(i*i),o=t+i,u=_r(Zt*(_r(o*o)-a-s)),c=_r(Qt*a),l=_r(c*c),d=_r(l-Zt*u);return new e(d,_r(c*(u-d)-er*s),_r(Zt*r*n))}},{key:"add",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint expected");var r=this.x,n=this.y,a=this.z,i=t.x,s=t.y,o=t.z;if(i===Kt||s===Kt)return this;if(r===Kt||n===Kt)return t;var u=_r(a*a),c=_r(o*o),l=_r(r*c),d=_r(i*u),f=_r(_r(n*o)*c),p=_r(_r(s*a)*u),h=_r(d-l),v=_r(p-f);if(h===Kt)return v===Kt?this.double():e.ZERO;var y=_r(h*h),m=_r(h*y),w=_r(l*y),g=_r(v*v-m-Zt*w);return new e(g,_r(v*(w-g)-f*m),_r(a*o*h))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var r=e.ZERO;if("bigint"==typeof t&&t===Kt)return r;var n=xr(t);if(n===Jt)return this;if(!nr){for(var a=r,i=this;n>Kt;)n&Jt&&(a=a.add(i)),i=i.double(),n>>=Jt;return a}for(var s=qr(n),o=s.k1neg,u=s.k1,c=s.k2neg,l=s.k2,d=r,f=r,p=this;u>Kt||l>Kt;)u&Jt&&(d=d.add(p)),l&Jt&&(f=f.add(p)),p=p.double(),u>>=Jt,l>>=Jt;return o&&(d=d.negate()),c&&(f=f.negate()),f=new e(_r(f.x*tr.beta),f.y,f.z),d.add(f)}},{key:"precomputeWindow",value:function(e){for(var t=nr?128/e+1:256/e+1,r=[],n=this,a=n,i=0;i<t;i++){a=n,r.push(a);for(var s=1;s<Math.pow(2,e-1);s++)a=a.add(n),r.push(a);n=a.double()}return r}},{key:"wNAF",value:function(t,r){!r&&this.equals(e.BASE)&&(r=or.BASE);var n=r&&r._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");var a=r&&sr.get(r);a||(a=this.precomputeWindow(n),r&&1!==n&&(a=e.normalizeZ(a),sr.set(r,a)));for(var i=e.ZERO,s=e.ZERO,o=1+(nr?128/n:256/n),u=Math.pow(2,n-1),c=BigInt(Math.pow(2,n)-1),l=Math.pow(2,n),d=BigInt(n),f=0;f<o;f++){var p=f*u,h=Number(t&c);if(t>>=d,h>u&&(h-=l,t+=Jt),0===h){var v=a[p];f%2&&(v=v.negate()),s=s.add(v)}else{var y=a[p+Math.abs(h)-1];h<0&&(y=y.negate()),i=i.add(y)}}return{p:i,f:s}}},{key:"multiply",value:function(t,r){var n,a,i=xr(t);if(nr){var s=qr(i),o=s.k1neg,u=s.k1,c=s.k2neg,l=s.k2,d=this.wNAF(u,r),f=d.p,p=d.f,h=this.wNAF(l,r),v=h.p,y=h.f;o&&(f=f.negate()),c&&(v=v.negate()),v=new e(_r(v.x*tr.beta),v.y,v.z),n=f.add(v),a=p.add(y)}else{var m=this.wNAF(i,r);n=m.p,a=m.f}return e.normalizeZ([n,a])[0]}},{key:"toAffine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Er(this.z),t=this.x,r=this.y,n=this.z,a=e,i=_r(a*a),s=_r(i*a),o=_r(t*i),u=_r(r*s),c=_r(n*a);if(c!==Jt)throw new Error("invZ was invalid");return new or(o,u)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof or))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new e(t.x,t.y,Jt)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tr.P,r=new Array(e.length),n=Er(e.reduce((function(e,n,a){return n===Kt?e:(r[a]=e,_r(e*n,t))}),Jt),t);return e.reduceRight((function(e,n,a){return n===Kt?e:(r[a]=_r(e*r[a],t),_r(e*n,t))}),n),r}(e.map((function(e){return e.z})));return e.map((function(e,r){return e.toAffine(t[r])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();ir.BASE=new ir(tr.Gx,tr.Gy,Jt),ir.ZERO=new ir(Kt,Jt,Kt);var sr=new WeakMap,or=function(){function e(t,r){n(this,e),this.x=t,this.y=r}return i(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,sr.delete(this)}},{key:"hasEvenY",value:function(){return this.y%Zt===Kt}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return gr(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=vr(this.x);if(e){var r=this.hasEvenY()?"02":"03";return"".concat(r).concat(t)}return"04".concat(t).concat(vr(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,r=this.y;if(!Or(t)||!Or(r))throw new Error(e);var n=_r(r*r);if(_r(n-rr(t))!==Kt)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,_r(-this.y))}},{key:"double",value:function(){return ir.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ir.fromAffine(this).add(ir.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ir.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,r,n){var a=ir.fromAffine(this),i=r===Kt||r===Jt||this!==e.BASE?a.multiplyUnsafe(r):a.multiply(r),s=ir.fromAffine(t).multiplyUnsafe(n),o=i.add(s);return o.equals(ir.ZERO)?void 0:o.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var r=32===t.length,n=kr(r?t:t.subarray(1));if(!Or(n))throw new Error("Point is not on curve");var a=function(e){var t=tr.P,r=BigInt(6),n=BigInt(11),a=BigInt(22),i=BigInt(23),s=BigInt(44),o=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=Rr(c,Qt)*c%t,d=Rr(l,Qt)*c%t,f=Rr(d,Zt)*u%t,p=Rr(f,n)*f%t,h=Rr(p,a)*p%t,v=Rr(h,s)*h%t,y=Rr(v,o)*v%t,m=Rr(y,s)*h%t,w=Rr(m,Qt)*c%t,g=Rr(w,i)*p%t,k=Rr(g,r)*u%t;return Rr(k,Zt)}(rr(n)),i=(a&Jt)===Jt;r?i&&(a=_r(-a)):1==(1&t[0])!==i&&(a=_r(-a));var s=new e(n,a);return s.assertValidity(),s}},{key:"fromUncompressedHex",value:function(t){var r=new e(kr(t.subarray(1,33)),kr(t.subarray(33,65)));return r.assertValidity(),r}},{key:"fromHex",value:function(e){var t=br(e),r=t.length,n=t[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ".concat(r))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Cr(t))}},{key:"fromSignature",value:function(t,r,n){var a=function(e){var t=tr.n,r=8*e.length-256,n=kr(e);r>0&&(n>>=BigInt(r));n>=t&&(n-=t);return n}(t=br(t)),i=function(e){if(e instanceof lr)return e.assertValidity(),e;try{return lr.fromDER(e)}catch(t){return lr.fromCompact(e)}}(r),s=i.r,o=i.s;if(0!==n&&1!==n)throw new Error("Cannot recover signature: invalid recovery bit");var u=1&n?"03":"02",c=e.fromHex(u+vr(s)),l=tr.n,d=Er(s,l),f=_r(-a*d,l),p=_r(o*d,l),h=e.BASE.multiplyAndAddUnsafe(c,f,p);if(!h)throw new Error("Cannot recover signature: point at infinify");return h.assertValidity(),h}}]),e}();function ur(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function cr(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(pr(e)));var t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:kr(r),left:e.subarray(t+2)}}or.BASE=new or(tr.Gx,tr.Gy),or.ZERO=new or(Kt,Kt);var lr=function(){function e(t,r){n(this,e),this.r=t,this.s=r,this.assertValidity()}return i(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!Ar(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Ar(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=tr.n>>Jt;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,tr.n-this.s):this}},{key:"toDERRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return gr(this.toDERHex(e))}},{key:"toDERHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ur(mr(this.s));if(e)return t;var r=ur(mr(this.r)),n=mr(r.length/2),a=mr(t.length/2),i=mr(r.length/2+t.length/2+4);return"30".concat(i,"02").concat(n).concat(r,"02").concat(a).concat(t)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return gr(this.toCompactHex())}},{key:"toCompactHex",value:function(){return vr(this.r)+vr(this.s)}}],[{key:"fromCompact",value:function(t){var r=t instanceof Uint8Array,n="Signature.fromCompact";if("string"!=typeof t&&!r)throw new TypeError("".concat(n,": Expected string or Uint8Array"));var a=r?pr(t):t;if(128!==a.length)throw new Error("".concat(n,": Expected 64-byte hex"));return new e(wr(a.slice(0,64)),wr(a.slice(64,128)))}},{key:"fromDER",value:function(t){var r=t instanceof Uint8Array;if("string"!=typeof t&&!r)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var n=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(pr(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=cr(e.subarray(2)),r=t.data,n=cr(t.left),a=n.data,i=n.left;if(i.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(pr(i)));return{r:r,s:a}}(r?t:gr(t));return new e(n.r,n.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function dr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every((function(e){return e instanceof Uint8Array})))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),a=new Uint8Array(n),i=0,s=0;i<t.length;i++){var o=t[i];a.set(o,s),s+=o.length}return a}var fr=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function pr(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var t="",r=0;r<e.length;r++)t+=fr[e[r]];return t}var hr=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function vr(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(Kt<=e&&e<hr))throw new Error("Expected number < 2^256");return e.toString(16).padStart(64,"0")}function yr(e){var t=gr(vr(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function mr(e){var t=e.toString(16);return 1&t.length?"0".concat(t):t}function wr(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+s(e));return BigInt("0x".concat(e))}function gr(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+s(e));if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function kr(e){return wr(pr(e))}function br(e){return e instanceof Uint8Array?Uint8Array.from(e):gr(e)}function xr(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&Ar(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function _r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tr.P,r=e%t;return r>=Kt?r:t+r}function Rr(e,t){for(var r=tr.P,n=e;t-- >Kt;)n*=n,n%=r;return n}function Er(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tr.P;if(e===Kt||t<=Kt)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var r=_r(e,t),n=t,a=Kt,i=Jt;r!==Kt;){var s=n/r,o=n%r,u=a-i*s;n=r,r=o,a=i,i=u}var c=n;if(c!==Jt)throw new Error("invert: does not exist");return _r(a,t)}var Ir,Tr,Sr=function(e,t){return(e+t/Zt)/t},Pr={a1:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),b1:-Jt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a2:BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),b2:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),POW_2_128:BigInt("0x100000000000000000000000000000000")};function qr(e){var t=tr.n,r=Pr.a1,n=Pr.b1,a=Pr.a2,i=Pr.b2,s=Pr.POW_2_128,o=Sr(i*e,t),u=Sr(-n*e,t),c=_r(e-o*r-u*a,t),l=_r(-o*n-u*i,t),d=c>s,f=l>s;if(d&&(c=t-c),f&&(l=t-l),c>s||l>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:f,k2:l}}function Ar(e){return Kt<e&&e<tr.n}function Or(e){return Kt<e&&e<tr.P}function Cr(e){var t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=wr(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=kr(e)}if(!Ar(t))throw new Error("Expected private key: 0 < key < n");return t}or.BASE._setWindowSize(8);var Ur,Lr,Nr,Br={node:nt,web:"object"===("undefined"==typeof self?"undefined":s(self))&&"crypto"in self?self.crypto:void 0},Dr={},jr={bytesToHex:pr,hexToBytes:gr,concatBytes:dr,mod:_r,invert:Er,isValidPrivateKey:function(e){try{return Cr(e),!0}catch(e){return!1}},_bigintTo32Bytes:yr,_normalizePrivateKey:Cr,hashToPrivateKey:function(e){if((e=br(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return yr(_r(kr(e),tr.n-Jt)+Jt)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Br.web)return Br.web.getRandomValues(new Uint8Array(e));if(Br.node){var t=Br.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return jr.hashToPrivateKey(jr.randomBytes(40))},sha256:(Nr=r(f.mark((function e(){var t,r,n,a,i,s,o=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=o.length,r=new Array(t),n=0;n<t;n++)r[n]=o[n];if(!Br.web){e.next=8;break}return e.next=4,Br.web.subtle.digest("SHA-256",dr.apply(void 0,r));case 4:return a=e.sent,e.abrupt("return",new Uint8Array(a));case 8:if(!Br.node){e.next=15;break}return i=Br.node.createHash,s=i("sha256"),r.forEach((function(e){return s.update(e)})),e.abrupt("return",Uint8Array.from(s.digest()));case 15:throw new Error("The environment doesn't have sha256 function");case 16:case"end":return e.stop()}}),e)}))),function(){return Nr.apply(this,arguments)}),hmacSha256:(Lr=r(f.mark((function e(t){var r,n,a,i,s,o,u,c,l=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=l.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=l[a];if(!Br.web){e.next=12;break}return e.next=4,Br.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);case 4:return i=e.sent,s=dr.apply(void 0,n),e.next=8,Br.web.subtle.sign("HMAC",i,s);case 8:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 12:if(!Br.node){e.next=19;break}return u=Br.node.createHmac,c=u("sha256",t),n.forEach((function(e){return c.update(e)})),e.abrupt("return",Uint8Array.from(c.digest()));case 19:throw new Error("The environment doesn't have hmac-sha256 function");case 20:case"end":return e.stop()}}),e)}))),function(e){return Lr.apply(this,arguments)}),sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:(Ur=r(f.mark((function e(t){var r,n,a,i,s,o=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(r=Dr[t])){e.next=7;break}return e.next=4,jr.sha256(Uint8Array.from(t,(function(e){return e.charCodeAt(0)})));case 4:n=e.sent,r=dr(n,n),Dr[t]=r;case 7:for(a=o.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=o[s];return e.abrupt("return",jr.sha256.apply(jr,[r].concat(i)));case 9:case"end":return e.stop()}}),e)}))),function(e){return Ur.apply(this,arguments)}),taggedHashSync:function(e){if("function"!=typeof Ir)throw new ar("sha256Sync is undefined, you need to set it");var t=Dr[e];if(void 0===t){var r=Ir(Uint8Array.from(e,(function(e){return e.charCodeAt(0)})));t=dr(r,r),Dr[e]=t}for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return Ir.apply(void 0,[t].concat(a))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:or.BASE,r=t===or.BASE?t:new or(t.x,t.y);return r._setWindowSize(e),r.multiply(Qt),r}};Object.defineProperties(jr,{sha256Sync:{configurable:!1,get:function(){return Ir},set:function(e){Ir||(Ir=e)}},hmacSha256Sync:{configurable:!1,get:function(){return Tr},set:function(e){Tr||(Tr=e)}}});var Fr="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Gr=null;"undefined"!=typeof WebSocket?Gr=WebSocket:"undefined"!=typeof MozWebSocket?Gr=MozWebSocket:void 0!==Fr?Gr=Fr.WebSocket||Fr.MozWebSocket:"undefined"!=typeof window?Gr=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(Gr=self.WebSocket||self.MozWebSocket);var Mr,Hr=Gr,Wr={exports:{}},Vr="object"===("undefined"==typeof Reflect?"undefined":s(Reflect))?Reflect:null,zr=Vr&&"function"==typeof Vr.apply?Vr.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Mr=Vr&&"function"==typeof Vr.ownKeys?Vr.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Xr=Number.isNaN||function(e){return e!=e};function $r(){$r.init.call(this)}Wr.exports=$r,Wr.exports.once=function(e,t){return new Promise((function(r,n){function a(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",a),r([].slice.call(arguments))}an(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&an(e,"error",t,r)}(e,a,{once:!0})}))},$r.EventEmitter=$r,$r.prototype._events=void 0,$r.prototype._eventsCount=0,$r.prototype._maxListeners=void 0;var Yr=10;function Kr(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+s(e))}function Jr(e){return void 0===e._maxListeners?$r.defaultMaxListeners:e._maxListeners}function Zr(e,t,r,n){var a,i,s,o;if(Kr(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(a=Jr(e))>0&&s.length>a&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,o=u,console&&console.warn&&console.warn(o)}return e}function Qr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function en(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=Qr.bind(n);return a.listener=r,n.wrapFn=a,a}function tn(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):nn(a,a.length)}function rn(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function nn(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function an(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+s(e));e.addEventListener(t,(function a(i){n.once&&e.removeEventListener(t,a),r(i)}))}}Object.defineProperty($r,"defaultMaxListeners",{enumerable:!0,get:function(){return Yr},set:function(e){if("number"!=typeof e||e<0||Xr(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Yr=e}}),$r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},$r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Xr(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},$r.prototype.getMaxListeners=function(){return Jr(this)},$r.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var o=a[e];if(void 0===o)return!1;if("function"==typeof o)zr(o,this,t);else{var u=o.length,c=nn(o,u);for(r=0;r<u;++r)zr(c[r],this,t)}return!0},$r.prototype.addListener=function(e,t){return Zr(this,e,t,!1)},$r.prototype.on=$r.prototype.addListener,$r.prototype.prependListener=function(e,t){return Zr(this,e,t,!0)},$r.prototype.once=function(e,t){return Kr(t),this.on(e,en(this,e,t)),this},$r.prototype.prependOnceListener=function(e,t){return Kr(t),this.prependListener(e,en(this,e,t)),this},$r.prototype.removeListener=function(e,t){var r,n,a,i,s;if(Kr(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},$r.prototype.off=$r.prototype.removeListener,$r.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},$r.prototype.listeners=function(e){return tn(this,e,!0)},$r.prototype.rawListeners=function(e){return tn(this,e,!1)},$r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):rn.call(e,t)},$r.prototype.listenerCount=rn,$r.prototype.eventNames=function(){return this._eventsCount>0?Mr(this._events):[]};var sn=Wr.exports;function on(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function un(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?on(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function cn(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var ln=function(e){m(B,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,I,T,S,P,q,A,O,C,U,L,N=cn(B);function B(e,t,r){var a;return n(this,B),(a=N.call(this,e)).walletService=t,a.discoveryNodeSelectorService=r,a.chatSecrets={},a.eventEmitter=new sn,a.addEventListener=a.eventEmitter.addListener.bind(a.eventEmitter),a.removeEventListener=a.eventEmitter.removeListener.bind(a.eventEmitter),a.discoveryNodeSelectorService.addEventListener("change",(function(e){a.websocket&&(a.websocket.close(),a.createWebsocket(e).then((function(e){a.websocket=e})))})),a}return i(B,[{key:"listen",value:(L=r(f.mark((function e(){var t;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.discoveryNodeSelectorService.getSelectedEndpoint();case 2:if(!(t=e.sent)){e.next=9;break}return e.next=6,this.createWebsocket(t);case 6:this.websocket=e.sent,e.next=10;break;case 9:throw new Error("No services available to listen to");case 10:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"get",value:(U=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","getChat"),e.next=3,this.getRaw(t.chatId);case 3:if(r=e.sent,e.t0=un,e.t1=un({},r),e.t2={},!r.data){e.next=13;break}return e.next=10,this.decryptLastChatMessage(r.data);case 10:e.t3=e.sent,e.next=14;break;case 13:e.t3=r.data;case 14:return e.t4=e.t3,e.t5={data:e.t4},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t5));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"getAll",value:(C=r(f.mark((function e(t){var n,a,i,s,o=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={timestamp:(new Date).getTime()},null!=t&&t.limit&&(n.limit=t.limit),null!=t&&t.before&&(n.before=t.before),null!=t&&t.after&&(n.after=t.after),e.next=7,this.signAndSendRequest({method:"GET",headers:{},path:"/comms/chats",query:n});case 7:return a=e.sent,e.next=10,a.json();case 10:return i=e.sent,e.next=13,Promise.all(i.data.map(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.decryptLastChatMessage(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 13:return s=e.sent,e.abrupt("return",un(un({},i),{},{data:s}));case 15:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"getMessages",value:(O=r(f.mark((function e(t){var n,a,i,s,o,u,c=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","getMessages"),e.next=3,this.getChatSecret(t.chatId);case 3:return n=e.sent,a="/comms/chats/".concat(t.chatId,"/messages"),i={timestamp:(new Date).getTime()},t.limit&&(i.limit=t.limit),t.before&&(i.before=t.before),t.after&&(i.after=t.after),e.next=11,this.signAndSendRequest({method:"GET",headers:{},path:a,query:i});case 11:return s=e.sent,e.next=14,s.json();case 14:return o=e.sent,e.next=17,Promise.all(o.data.map(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=un,e.t1=un({},t),e.t2={},e.next=5,c.decryptString(n,qt.decode(t.message)).catch((function(e){return console.error("[audius-sdk]: Error: Couldn't decrypt chat message",t,e),"Error: Couldn't decrypt message"}));case 5:return e.t3=e.sent,e.t4={message:e.t3},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t4));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 17:return u=e.sent,e.abrupt("return",un(un({},o),{},{data:u}));case 19:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"getPermissions",value:(A=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={timestamp:(new Date).getTime()},null!=t&&t.userIds&&(r.id=t.userIds),e.next=4,this.signAndSendRequest({method:"GET",path:"/comms/chats/permissions",headers:{},query:r});case 4:return n=e.sent,e.next=7,n.json();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"getBlockers",value:(q=r(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={timestamp:(new Date).getTime()},e.next=3,this.signAndSendRequest({method:"GET",path:"/comms/chats/blockers",headers:{},query:t});case 3:return r=e.sent,e.next=6,r.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"getBlockees",value:(P=r(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={timestamp:(new Date).getTime()},e.next=3,this.signAndSendRequest({method:"GET",path:"/comms/chats/blockees",headers:{},query:t});case 3:return r=e.sent,e.next=6,r.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"unfurl",value:(S=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.urls,"requestParameters.urls","unfurl"),this.assertMinLength(t.urls,"requestParameters.urls","unfurl"),r={content:t.urls},e.next=5,this.request({method:"GET",path:"/comms/unfurl",query:r,headers:{}});case 5:return n=e.sent,e.next=8,n.json();case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"create",value:(T=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","create"),this.assertNotNullOrUndefined(t.invitedUserIds,"requestParameters.invitedUserIds","create"),this.assertMinLength(t.invitedUserIds,"requestParameters.invitedUserIds","create"),r=[t.userId].concat(E(t.invitedUserIds)).sort().join(":"),n=jr.randomPrivateKey(),this.chatSecrets[r]=n,e.next=8,this.createInvites(t.userId,t.invitedUserIds,n);case 8:return a=e.sent,e.next=11,this.sendRpc({method:"chat.create",params:{chat_id:r,invites:a}});case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"invite",value:(I=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","invite"),this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","invite"),this.assertNotNullOrUndefined(t.invitedUserIds,"requestParameters.invitedUserIds","invite"),this.assertMinLength(t.invitedUserIds,"requestParameters.invitedUserIds","invite"),e.next=6,this.getChatSecret(t.chatId);case 6:return r=e.sent,e.next=9,this.createInvites(t.userId,t.invitedUserIds,r);case 9:return n=e.sent,e.next=12,this.sendRpc({method:"chat.invite",params:{chat_id:t.chatId,invites:n}});case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"message",value:(R=r(f.mark((function e(t){var r,n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","message"),this.assertNotNullOrUndefined(t.message,"requestParameters.message","message"),e.next=4,this.getChatSecret(t.chatId);case 4:return n=e.sent,e.next=7,this.encryptString(n,t.message);case 7:return a=e.sent,i=qt.encode(a),e.next=11,this.sendRpc({method:"chat.message",params:{chat_id:t.chatId,message_id:null!==(r=t.messageId)&&void 0!==r?r:$t(),message:i}});case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"react",value:(_=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","react"),this.assertNotNullOrUndefined(t.messageId,"requestParameters.messageId","react"),this.assertNotUndefined(t.reaction,"requestParameters.reaction","react"),e.next=5,this.sendRpc({method:"chat.react",params:{chat_id:t.chatId,message_id:t.messageId,reaction:t.reaction}});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"read",value:(x=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","read"),e.next=3,this.sendRpc({method:"chat.read",params:{chat_id:t.chatId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"block",value:(b=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","block"),e.next=3,this.sendRpc({method:"chat.block",params:{user_id:t.userId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"delete",value:(k=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","delete"),e.next=3,this.sendRpc({method:"chat.delete",params:{chat_id:t.chatId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"permit",value:(g=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.permit,"requestParameters.permit","permit"),e.next=3,this.sendRpc({method:"chat.permit",params:{permit:t.permit}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"assertNotNullOrUndefined",value:function(e,t,r){if(null==e)throw new j(t,"Required parameter ".concat(t," was null or undefined when calling ").concat(r,"."))}},{key:"assertNotUndefined",value:function(e,t,r){if(void 0===e)throw new j(t,"Required parameter ".concat(t," was undefined when calling ").concat(r,"."))}},{key:"assertMinLength",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e.length<n)throw new j(t,"Required parameter ".concat(t," requires more than ").concat(n," element when calling ").concat(r))}},{key:"createInvites",value:(w=r(f.mark((function e(t,n,a){var i,s=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPublicKey(t);case 2:return i=e.sent,e.next=5,Promise.all([t].concat(E(n)).map(function(){var e=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getPublicKey(t);case 2:return r=e.sent,e.next=5,s.createInviteCode(i,r,a);case 5:return n=e.sent,e.abrupt("return",{user_id:t,invite_code:qt.encode(n)});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return w.apply(this,arguments)})},{key:"createInviteCode",value:(y=r(f.mark((function e(t,r,n){var a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.walletService.getSharedSecret(r);case 2:return a=e.sent,e.next=5,this.encrypt(a,n);case 5:return i=e.sent,(s=new Uint8Array(65+i.length)).set(t),s.set(i,65),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return y.apply(this,arguments)})},{key:"readInviteCode",value:(v=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.slice(0,65),n=t.slice(65),e.next=4,this.walletService.getSharedSecret(r);case 4:return a=e.sent,e.next=7,this.decrypt(a,n);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"encrypt",value:function(){var e=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ct(t.slice(t.length-32),r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"encryptString",value:(h=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.encrypt(t,(new TextEncoder).encode(r));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"decrypt",value:function(){var e=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dt(t.slice(t.length-32),r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"decryptString",value:(p=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=new TextDecoder,e.next=3,this.decrypt(t,r);case 3:return e.t1=e.sent,e.abrupt("return",e.t0.decode.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"decryptLastChatMessage",value:(d=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getChatSecret(t.chat_id);case 2:if(r=e.sent,n="",!(t.last_message&&t.last_message.length>0)){e.next=15;break}return e.prev=5,e.next=8,this.decryptString(r,qt.decode(t.last_message));case 8:n=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),console.error("[audius-sdk]: Error: Couldn't decrypt last chat message",t,e.t0),n="Error: Couldn't decrypt message";case 15:return e.abrupt("return",un(un({},t),{},{last_message:n}));case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(e){return d.apply(this,arguments)})},{key:"getRaw",value:(l=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="/comms/chats/".concat(t),n={timestamp:(new Date).getTime()},e.next=4,this.signAndSendRequest({method:"GET",headers:{},path:r,query:n});case 4:return a=e.sent,e.next=7,a.json();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getChatSecret",value:(c=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.chatSecrets[t]){e.next=10;break}return e.next=4,this.getRaw(t);case 4:return n=e.sent,e.next=7,this.readInviteCode(qt.decode(n.data.invite_code));case 7:return a=e.sent,this.chatSecrets[t]=a,e.abrupt("return",a);case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getPublicKey",value:(u=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.request({path:"/comms/pubkey/".concat(t),method:"GET",headers:{}});case 2:return r=e.sent,e.next=5,r.json();case 5:return n=e.sent,e.abrupt("return",qt.decode(n.data));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"getSignatureHeader",value:(o=r(f.mark((function e(t){var r,n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.walletService.sign(t);case 2:return r=e.sent,n=rt(r,2),a=n[0],i=n[1],(s=new Uint8Array(65)).set(a,0),s[64]=i,e.abrupt("return",{"x-sig":qt.encode(s)});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"signAndSendRequest",value:(s=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="GET"===t.method?t.query?"".concat(t.path,"?").concat(this.configuration.queryParamsStringify(t.query)):t.path:t.body,e.t0=this,e.t1=un,e.t2=un({},t),e.t3={},e.t4=un,e.t5=un({},t.headers),e.next=9,this.getSignatureHeader(r);case 9:return e.t6=e.sent,e.t7=(0,e.t4)(e.t5,e.t6),e.t8={headers:e.t7},e.t9=(0,e.t1)(e.t2,e.t3,e.t8),e.next=15,e.t0.request.call(e.t0,e.t9);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"sendRpc",value:(a=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=JSON.stringify(un(un({},t),{},{timestamp:(new Date).getTime()})),e.next=3,this.signAndSendRequest({method:"POST",headers:{"Content-Type":"application/json"},path:"/comms/mutate",body:r});case 3:return e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"createWebsocket",value:(t=r(f.mark((function e(t){var n,a,i,s,o,u,c=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),a="/comms/chats/ws?timestamp=".concat(n),e.next=4,this.getSignatureHeader(a);case 4:return i=e.sent,s=t.replace(/http(s?)/g,"ws$1"),o="".concat(s).concat(a,"&signature=").concat(encodeURIComponent(i["x-sig"])),(u=new Hr(o)).addEventListener("message",(function(e){var t=function(){var t=r(f.mark((function t(){var r,n;return f.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("chat.message"!==(r=JSON.parse(e.data)).rpc.method){t.next=19;break}return t.next=4,c.getChatSecret(r.rpc.params.chat_id);case 4:return n=t.sent,t.t0=c.eventEmitter,t.t1=r.rpc.params.chat_id,t.t2=r.rpc.params.message_id,t.next=10,c.decryptString(n,qt.decode(r.rpc.params.message)).catch((function(e){return console.error("[audius-sdk]: Error: Couldn't decrypt websocket chat message",r,e),"Error: Couldn't decrypt message"}));case 10:t.t3=t.sent,t.t4=r.metadata.userId,t.t5=r.metadata.timestamp,t.t6=[],t.t7={message_id:t.t2,message:t.t3,sender_user_id:t.t4,created_at:t.t5,reactions:t.t6},t.t8={chatId:t.t1,message:t.t7},t.t0.emit.call(t.t0,"message",t.t8),t.next=20;break;case 19:"chat.react"===r.rpc.method&&c.eventEmitter.emit("reaction",{chatId:r.rpc.params.chat_id,messageId:r.rpc.params.message_id,reaction:{reaction:r.rpc.params.reaction,user_id:r.metadata.userId,created_at:r.metadata.timestamp}});case 20:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t()})),u.addEventListener("open",(function(){c.eventEmitter.emit("open")})),u.addEventListener("close",(function(){c.eventEmitter.emit("close")})),u.addEventListener("error",(function(e){c.eventEmitter.emit("error",e)})),e.abrupt("return",u);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),B}(U);function dn(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}function fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pn(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?fn(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function hn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return vn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yn="/v1/full".replace(/\/+$/,""),mn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.configuration=t}return i(e,[{key:"config",set:function(e){this.configuration=e}},{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:yn}},{key:"fetchApi",get:function(){return this.configuration.fetchApi}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||Tn}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:r(f.mark((function t(){return f.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e);case 1:case"end":return t.stop()}}),t)})))}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}]),e}(),wn=new mn,gn=function(){function e(){var t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wn;n(this,e),this.configuration=a,this.fetchApi=function(){var e=r(f.mark((function e(r,n){var a,i,s,o,u,c,l,d,p,h,v;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={url:r,init:n},i=hn(t.middleware),e.prev=2,i.s();case 4:if((s=i.n()).done){e.next=15;break}if(!(o=s.value).pre){e.next=13;break}return e.next=9,o.pre(pn({fetch:t.fetchApi},a));case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0=a;case 12:a=e.t0;case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),i.e(e.t1);case 20:return e.prev=20,i.f(),e.finish(20);case 23:return u=void 0,e.prev=24,e.next=27,(t.configuration.fetchApi||fetch)(a.url,a.init);case 27:u=e.sent,e.next=60;break;case 30:e.prev=30,e.t2=e.catch(24),c=hn(t.middleware),e.prev=33,c.s();case 35:if((l=c.n()).done){e.next=46;break}if(!(d=l.value).onError){e.next=44;break}return e.next=40,d.onError({fetch:t.fetchApi,url:a.url,init:a.init,error:e.t2,response:u?u.clone():void 0});case 40:if(e.t3=e.sent,e.t3){e.next=43;break}e.t3=u;case 43:u=e.t3;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t4=e.catch(33),c.e(e.t4);case 51:return e.prev=51,c.f(),e.finish(51);case 54:if(void 0!==u){e.next=60;break}if(!(e.t2 instanceof Error)){e.next=59;break}throw new _n(e.t2,"The request failed and the interceptors did not return an alternative response");case 59:throw e.t2;case 60:p=hn(t.middleware),e.prev=61,p.s();case 63:if((h=p.n()).done){e.next=74;break}if(!(v=h.value).post){e.next=72;break}return e.next=68,v.post({fetch:t.fetchApi,url:a.url,init:a.init,response:u.clone()});case 68:if(e.t5=e.sent,e.t5){e.next=71;break}e.t5=u;case 71:u=e.t5;case 72:e.next=63;break;case 74:e.next=79;break;case 76:e.prev=76,e.t6=e.catch(61),p.e(e.t6);case 79:return e.prev=79,p.f(),e.finish(79);case 82:return e.abrupt("return",u);case 83:case"end":return e.stop()}}),e,null,[[2,17,20,23],[24,30],[33,48,51,54],[61,76,79,82]])})));return function(t,r){return e.apply(this,arguments)}}(),this.middleware=a.middleware}var t,a;return i(e,[{key:"withMiddleware",value:function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,arguments),t}},{key:"withPreMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{pre:e}}));return this.withMiddleware.apply(this,E(n))}},{key:"withPostMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{post:e}}));return this.withMiddleware.apply(this,E(n))}},{key:"request",value:(a=r(f.mark((function e(t,r){var n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createFetchParams(t,r);case 2:return n=e.sent,a=n.url,i=n.init,e.next=7,this.fetchApi(a,i);case 7:if(!((s=e.sent)&&s.status>=200&&s.status<300)){e.next=10;break}return e.abrupt("return",s);case 10:throw new xn(s,"Response returned an error code");case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createFetchParams",value:(t=r(f.mark((function e(t,n){var a,i,s,o,u,c;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.configuration.basePath+t.path,void 0!==t.query&&0!==Object.keys(t.query).length&&(a+="?"+this.configuration.queryParamsStringify(t.query)),i=Object.assign({},this.configuration.headers,t.headers),Object.keys(i).forEach((function(e){return void 0===i[e]?delete i[e]:{}})),s="function"==typeof n?n:r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}}),e)}))),o={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},e.t0=pn,e.t1=pn({},o),e.next=10,s({init:o,context:t});case 10:return e.t2=e.sent,u=(0,e.t0)(e.t1,e.t2),c=pn(pn({},u),{},{body:(l=u.body,"undefined"!=typeof FormData&&l instanceof FormData||u.body instanceof URLSearchParams||kn(u.body)||bn(u.body)?u.body:JSON.stringify(u.body))}),e.abrupt("return",{url:a,init:c});case 14:case"end":return e.stop()}var l}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"clone",value:function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}]),e}();function kn(e){return"undefined"!=typeof Blob&&e instanceof Blob}function bn(e){return"string"==typeof e}var xn=function(e){m(r,e);var t=dn(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).response=e,i.name="ResponseError",i}return i(r)}(x(Error)),_n=function(e){m(r,e);var t=dn(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).cause=e,i.name="FetchError",i}return i(r)}(x(Error)),Rn=function(e){m(r,e);var t=dn(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).field=e,i.name="RequiredError",i}return i(r)}(x(Error)),En=",";function In(e,t){var r=e[t];return null!=r}function Tn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).sort().map((function(r){return Sn(r,e[r],t)})).filter((function(e){return e.length>0})).join("&")}function Sn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r+(r.length?"[".concat(e,"]"):e);if(t instanceof Array){var a=t.map((function(e){return encodeURIComponent(String(e))})).join("&".concat(encodeURIComponent(n),"="));return"".concat(encodeURIComponent(n),"=").concat(a)}if(t instanceof Set){var i=Array.from(t);return Sn(e,i,r)}return t instanceof Date?"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.toISOString())):t instanceof Object?Tn(t,n):"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(t)))}var Pn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};n(this,e),this.raw=t,this.transformer=r}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,this.raw.json();case 3:return e.t1=e.sent,e.abrupt("return",e.t0.transformer.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),qn=function(){function e(t){n(this,e),this.raw=t}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),e}();function An(e){return function(e,t){if(null==e)return e;return{timestamp:In(e,"timestamp")?e.timestamp:void 0,itemType:In(e,"item_type")?e.item_type:void 0,item:In(e,"item")?e.item:void 0}}(e)}function On(e){return function(e,t){if(null==e)return e;return{_640x:In(e,"640x")?e["640x"]:void 0,_2000x:In(e,"2000x")?e["2000x"]:void 0}}(e)}function Cn(e){return function(e,t){if(null==e)return e;return{cid:In(e,"cid")?e.cid:void 0,isDownloadable:e.is_downloadable,requiresFollow:e.requires_follow}}(e)}function Un(e){return function(e,t){if(null==e)return e;return{favoriteItemId:e.favorite_item_id,favoriteType:e.favorite_type,userId:e.user_id,createdAt:e.created_at}}(e)}function Ln(e){return function(e,t){if(null==e)return e;return{service:e.service,version:e.version}}(e)}function Nn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(An):void 0}}(e)}function Bn(e){return function(e,t){if(null==e)return e;return{mood:In(e,"mood")?e.mood:void 0,tags:In(e,"tags")?e.tags:void 0,genre:In(e,"genre")?e.genre:void 0,share:In(e,"share")?e.share:void 0,playCount:In(e,"play_count")?e.play_count:void 0,remixes:In(e,"remixes")?e.remixes:void 0}}(e)}function Dn(e){return function(e,t){if(null==e)return e;return{contents:In(e,"contents")?e.contents:void 0}}(e)}function jn(e){return function(e,t){if(null==e)return e;return{_150x150:In(e,"150x150")?e["150x150"]:void 0,_480x480:In(e,"480x480")?e["480x480"]:void 0,_1000x1000:In(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function Fn(e){return function(e,t){if(null==e)return e;return{albumCount:e.album_count,artistPickTrackId:In(e,"artist_pick_track_id")?e.artist_pick_track_id:void 0,bio:In(e,"bio")?e.bio:void 0,coverPhoto:In(e,"cover_photo")?On(e.cover_photo):void 0,followeeCount:e.followee_count,followerCount:e.follower_count,doesFollowCurrentUser:In(e,"does_follow_current_user")?e.does_follow_current_user:void 0,handle:e.handle,id:e.id,isVerified:e.is_verified,location:In(e,"location")?e.location:void 0,name:e.name,playlistCount:e.playlist_count,profilePicture:In(e,"profile_picture")?jn(e.profile_picture):void 0,repostCount:e.repost_count,trackCount:e.track_count,isDeactivated:e.is_deactivated,ercWallet:In(e,"erc_wallet")?e.erc_wallet:void 0,splWallet:e.spl_wallet,supporterCount:e.supporter_count,supportingCount:e.supporting_count,balance:e.balance,associatedWalletsBalance:e.associated_wallets_balance,totalBalance:e.total_balance,waudioBalance:e.waudio_balance,associatedSolWalletsBalance:e.associated_sol_wallets_balance,blocknumber:e.blocknumber,wallet:e.wallet,createdAt:e.created_at,creatorNodeEndpoint:In(e,"creator_node_endpoint")?e.creator_node_endpoint:void 0,currentUserFolloweeFollowCount:e.current_user_followee_follow_count,doesCurrentUserFollow:e.does_current_user_follow,handleLc:e.handle_lc,updatedAt:e.updated_at,coverPhotoSizes:In(e,"cover_photo_sizes")?e.cover_photo_sizes:void 0,coverPhotoLegacy:In(e,"cover_photo_legacy")?e.cover_photo_legacy:void 0,profilePictureSizes:In(e,"profile_picture_sizes")?e.profile_picture_sizes:void 0,profilePictureLegacy:In(e,"profile_picture_legacy")?e.profile_picture_legacy:void 0,metadataMultihash:In(e,"metadata_multihash")?e.metadata_multihash:void 0,hasCollectibles:e.has_collectibles,playlistLibrary:In(e,"playlist_library")?Dn(e.playlist_library):void 0}}(e)}function Gn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function Mn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function Hn(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,subscriberIds:In(e,"subscriber_ids")?e.subscriber_ids:void 0}}(e)}function Wn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Hn):void 0}}(e)}function Vn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function zn(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,sender:Fn(e.sender)}}(e)}function Xn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?zn(e.data):void 0}}(e)}function $n(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(zn):void 0}}(e)}function Yn(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,receiver:Fn(e.receiver)}}(e)}function Kn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?Yn(e.data):void 0}}(e)}function Jn(e){return function(e,t){if(null==e)return e;return{metadataTimestamp:e.metadata_timestamp,timestamp:e.timestamp,trackId:e.track_id}}(e)}function Zn(e){return function(e,t){if(null==e)return e;return{_150x150:In(e,"150x150")?e["150x150"]:void 0,_480x480:In(e,"480x480")?e["480x480"]:void 0,_1000x1000:In(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function Qn(e){return function(e,t){if(null==e)return e;return{repostItemId:e.repost_item_id,repostType:e.repost_type,userId:e.user_id}}(e)}function ea(e){return function(e,t){if(null==e)return e;return{parentTrackId:e.parent_track_id,user:Fn(e.user),hasRemixAuthorReposted:e.has_remix_author_reposted,hasRemixAuthorSaved:e.has_remix_author_saved}}(e)}function ta(e){return function(e,t){if(null==e)return e;return{tracks:In(e,"tracks")?e.tracks.map(ea):void 0}}(e)}function ra(e){return function(e,t){if(null==e)return e;return{data:In(e,"data")?e.data:void 0,signature:In(e,"signature")?e.signature:void 0}}(e)}function na(e){return function(e,t){if(null==e)return e;return{category:e.category,parentTrackId:e.parent_track_id}}(e)}function aa(e){return function(e,t){if(null==e)return e;return{_150x150:In(e,"150x150")?e["150x150"]:void 0,_480x480:In(e,"480x480")?e["480x480"]:void 0,_1000x1000:In(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function ia(e){return function(e,t){if(null==e)return e;return{duration:e.duration,multihash:e.multihash}}(e)}function sa(e){return function(e,t){if(null==e)return e;return{artwork:In(e,"artwork")?aa(e.artwork):void 0,description:In(e,"description")?e.description:void 0,genre:In(e,"genre")?e.genre:void 0,id:e.id,trackCid:In(e,"track_cid")?e.track_cid:void 0,mood:In(e,"mood")?e.mood:void 0,releaseDate:In(e,"release_date")?e.release_date:void 0,remixOf:In(e,"remix_of")?ta(e.remix_of):void 0,repostCount:e.repost_count,favoriteCount:e.favorite_count,tags:In(e,"tags")?e.tags:void 0,title:e.title,user:Fn(e.user),duration:e.duration,downloadable:In(e,"downloadable")?e.downloadable:void 0,playCount:e.play_count,permalink:In(e,"permalink")?e.permalink:void 0,isStreamable:In(e,"is_streamable")?e.is_streamable:void 0,blocknumber:e.blocknumber,createDate:In(e,"create_date")?e.create_date:void 0,coverArtSizes:In(e,"cover_art_sizes")?e.cover_art_sizes:void 0,createdAt:In(e,"created_at")?e.created_at:void 0,creditsSplits:In(e,"credits_splits")?e.credits_splits:void 0,download:In(e,"download")?Cn(e.download):void 0,isrc:In(e,"isrc")?e.isrc:void 0,license:In(e,"license")?e.license:void 0,iswc:In(e,"iswc")?e.iswc:void 0,fieldVisibility:In(e,"field_visibility")?Bn(e.field_visibility):void 0,followeeReposts:e.followee_reposts.map(Qn),hasCurrentUserReposted:e.has_current_user_reposted,isUnlisted:e.is_unlisted,hasCurrentUserSaved:e.has_current_user_saved,followeeFavorites:e.followee_favorites.map(Un),routeId:e.route_id,stemOf:In(e,"stem_of")?na(e.stem_of):void 0,trackSegments:In(e,"track_segments")?e.track_segments.map(ia):void 0,updatedAt:In(e,"updated_at")?e.updated_at:void 0,userId:e.user_id,isDelete:In(e,"is_delete")?e.is_delete:void 0,coverArt:In(e,"cover_art")?e.cover_art:void 0,isAvailable:In(e,"is_available")?e.is_available:void 0,isPremium:In(e,"is_premium")?e.is_premium:void 0,premiumConditions:In(e,"premium_conditions")?e.premium_conditions:void 0,premiumContentSignature:In(e,"premium_content_signature")?ra(e.premium_content_signature):void 0}}(e)}function oa(e){return function(e,t){if(null==e)return e;return{artwork:In(e,"artwork")?Zn(e.artwork):void 0,description:In(e,"description")?e.description:void 0,permalink:In(e,"permalink")?e.permalink:void 0,id:e.id,isAlbum:e.is_album,playlistName:e.playlist_name,repostCount:e.repost_count,favoriteCount:e.favorite_count,totalPlayCount:e.total_play_count,user:Fn(e.user),blocknumber:e.blocknumber,createdAt:In(e,"created_at")?e.created_at:void 0,followeeReposts:e.followee_reposts.map(Qn),followeeFavorites:e.followee_favorites.map(Un),hasCurrentUserReposted:e.has_current_user_reposted,hasCurrentUserSaved:e.has_current_user_saved,isDelete:e.is_delete,isPrivate:e.is_private,updatedAt:In(e,"updated_at")?e.updated_at:void 0,addedTimestamps:e.added_timestamps.map(Jn),userId:e.user_id,tracks:e.tracks.map(sa),coverArt:In(e,"cover_art")?e.cover_art:void 0,coverArtSizes:In(e,"cover_art_sizes")?e.cover_art_sizes:void 0,trackCount:e.track_count}}(e)}function ua(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(oa):void 0}}(e)}function ca(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(sa):void 0}}(e)}function la(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(An):void 0}}(e)}function da(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function fa(e){return function(e,t){if(null==e)return e;return{userId:e.user_id}}(e)}function pa(e){return function(e,t){if(null==e)return e;return{amount:e.amount,sender:Fn(e.sender),receiver:Fn(e.receiver),createdAt:e.created_at,slot:e.slot,followeeSupporters:e.followee_supporters.map(fa),txSignature:e.tx_signature}}(e)}function ha(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?sa(e.data):void 0}}(e)}function va(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(sa):void 0}}(e)}function ya(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(sa):void 0}}(e)}function ma(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(oa):void 0}}(e)}function wa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function ga(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(pa):void 0}}(e)}function ka(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(An):void 0}}(e)}function ba(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function xa(e){return function(e,t){if(null==e)return e;return{count:e.count,tracks:In(e,"tracks")?e.tracks.map(sa):void 0}}(e)}function _a(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?xa(e.data):void 0}}(e)}function Ra(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(sa):void 0}}(e)}function Ea(e){return function(e,t){if(null==e)return e;return{users:e.users.map(Fn),followedUsers:In(e,"followed_users")?e.followed_users.map(Fn):void 0,tracks:e.tracks.map(sa),savedTracks:In(e,"saved_tracks")?e.saved_tracks.map(sa):void 0,playlists:e.playlists.map(oa),savedPlaylists:In(e,"saved_playlists")?e.saved_playlists.map(oa):void 0,albums:e.albums.map(oa),savedAlbums:In(e,"saved_albums")?e.saved_albums.map(oa):void 0}}(e)}function Ia(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?Ea(e.data):void 0}}(e)}function Ta(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?Ea(e.data):void 0}}(e)}function Sa(e){return function(e,t){if(null==e)return e;return{id:e.id,parentId:e.parent_id,category:e.category,cid:e.cid,userId:e.user_id,blocknumber:e.blocknumber}}(e)}function Pa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Sa):void 0}}(e)}function qa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function Aa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function Oa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function Ca(e){return function(e,t){if(null==e)return e;return{id:e.id}}(e)}function Ua(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(Fn):void 0}}(e)}function La(e){return function(e,t){if(null==e)return e;return{transactionDate:e.transaction_date,transactionType:e.transaction_type,method:e.method,signature:e.signature,userBank:e.user_bank,change:e.change,balance:e.balance,metadata:e.metadata}}(e)}function Na(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data:void 0}}(e)}function Ba(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?e.data.map(La):void 0}}(e)}function Da(e){return function(e,t){if(null==e)return e;return{week:In(e,"week")?e.week.map(Ca):void 0,month:In(e,"month")?e.month.map(Ca):void 0,year:In(e,"year")?e.year.map(Ca):void 0}}(e)}function ja(e){return function(e,t){if(null==e)return e;return{data:In(e,"data")?Da(e.data):void 0}}(e)}function Fa(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,wallet:e.wallet,primary:In(e,"primary")?e.primary:void 0,secondary1:In(e,"secondary1")?e.secondary1:void 0,secondary2:In(e,"secondary2")?e.secondary2:void 0,primarySpID:In(e,"primarySpID")?e.primarySpID:void 0,secondary1SpID:In(e,"secondary1SpID")?e.secondary1SpID:void 0,secondary2SpID:In(e,"secondary2SpID")?e.secondary2SpID:void 0}}(e)}function Ga(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:In(e,"data")?Fa(e.data):void 0}}(e)}function Ma(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ha=function(e){m(b,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k=Ma(b);function b(){return n(this,b),k.apply(this,arguments)}return i(b,[{key:"getPlaylistRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylist.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/playlists/{playlist_id}".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ua(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getPlaylist",value:(w=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getPlaylistByHandleAndSlugRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getPlaylistByHandleAndSlug.");case 2:if(null!==t.slug&&void 0!==t.slug){e.next=4;break}throw new Rn("slug","Required parameter requestParameters.slug was null or undefined when calling getPlaylistByHandleAndSlug.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/playlists/by_permalink/{handle}/{slug}".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))).replace("{".concat("slug","}"),encodeURIComponent(String(t.slug))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ua(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getPlaylistByHandleAndSlug",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistByHandleAndSlugRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getPlaylistTracksRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylistTracks.");case 2:return n={},a={},e.next=6,this.request({path:"/playlists/{playlist_id}/tracks".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ca(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getPlaylistTracks",value:(p=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistTracksRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getTrendingPlaylistsRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.time&&(n.time=t.time),a={},e.next=8,this.request({path:"/playlists/trending",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ma(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getTrendingPlaylists",value:(l=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingPlaylistsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"getTrendingPlaylistsWithVersionRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getTrendingPlaylistsWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.time&&(n.time=t.time),a={},e.next=10,this.request({path:"/playlists/trending/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ma(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getTrendingPlaylistsWithVersion",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrendingPlaylistsWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getUsersFromPlaylistFavoritesRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getUsersFromPlaylistFavorites.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/playlists/{playlist_id}/favorites".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Gn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getUsersFromPlaylistFavorites",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromPlaylistFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getUsersFromPlaylistRepostsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getUsersFromPlaylistReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/playlists/{playlist_id}/reposts".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Gn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUsersFromPlaylistReposts",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromPlaylistRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),b}(gn);function Wa(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Va=function(e){m(o,e);var t,a,s=Wa(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"bulkGetReactionsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.reactedToIds&&void 0!==t.reactedToIds){e.next=2;break}throw new Rn("reactedToIds","Required parameter requestParameters.reactedToIds was null or undefined when calling bulkGetReactions.");case 2:return n={},void 0!==t.type&&(n.type=t.type),t.reactedToIds&&(n.reacted_to_ids=t.reactedToIds.join(En)),a={},e.next=8,this.request({path:"/reactions",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new qn(i));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"bulkGetReactions",value:(t=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetReactionsRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),o}(gn);function za(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Xa=function(e){m(c,e);var t,a,s,o,u=za(c);function c(){return n(this,c),u.apply(this,arguments)}return i(c,[{key:"searchRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new Rn("query","Required parameter requestParameters.query was null or undefined when calling search.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.kind&&(n.kind=t.kind),a={},e.next=11,this.request({path:"/search/full",method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ta(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"search",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"searchAutocompleteRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new Rn("query","Required parameter requestParameters.query was null or undefined when calling searchAutocomplete.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.kind&&(n.kind=t.kind),a={},e.next=11,this.request({path:"/search/autocomplete",method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ia(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"searchAutocomplete",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchAutocompleteRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),c}(gn);function $a(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ya=function(e){m(o,e);var t,a,s=$a(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"getTipsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.receiverMinFollowers&&(n.receiver_min_followers=t.receiverMinFollowers),void 0!==t.receiverIsVerified&&(n.receiver_is_verified=t.receiverIsVerified),void 0!==t.currentUserFollows&&(n.current_user_follows=t.currentUserFollows),void 0!==t.uniqueBy&&(n.unique_by=t.uniqueBy),void 0!==t.minSlot&&(n.min_slot=t.minSlot),void 0!==t.maxSlot&&(n.max_slot=t.maxSlot),t.txSignatures&&(n.tx_signatures=t.txSignatures.join(En)),a={},e.next=14,this.request({path:"/tips",method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ga(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getTips",value:(t=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTipsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),o}(gn);function Ka(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ja=function(e){m(Y,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,E,I,T,S,P,q,A,O,C,U,L,N,B,D,j,F,G,M,H,W,V,z,X,$=Ka(Y);function Y(){return n(this,Y),$.apply(this,arguments)}return i(Y,[{key:"bestNewReleasesRaw",value:(X=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},n={},e.next=4,this.request({path:"/tracks/best_new_releases",method:"GET",headers:n,query:r},t);case 4:return a=e.sent,e.abrupt("return",new Pn(a,(function(e){return ya(e)})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"bestNewReleases",value:(z=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bestNewReleasesRaw(t);case 2:return r=e.sent,e.next=5,r.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return z.apply(this,arguments)})},{key:"getBulkTracksRaw",value:(V=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.userId&&(n.user_id=t.userId),t.permalink&&(n.permalink=t.permalink),t.id&&(n.id=t.id),a={},e.next=7,this.request({path:"/tracks",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ha(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return V.apply(this,arguments)})},{key:"getBulkTracks",value:(W=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getBulkTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return W.apply(this,arguments)})},{key:"getFeelingLuckyTracksRaw",value:(H=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.withUsers&&(n.with_users=t.withUsers),void 0!==t.minFollowers&&(n.min_followers=t.minFollowers),a={},e.next=8,this.request({path:"/tracks/feeling_lucky",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getFeelingLuckyTracks",value:(M=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getFeelingLuckyTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return M.apply(this,arguments)})},{key:"getMostLovedTracksRaw",value:(G=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.withUsers&&(n.with_users=t.withUsers),a={},e.next=7,this.request({path:"/tracks/most_loved",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"getMostLovedTracks",value:(F=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getMostLovedTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"getPremiumTrackSignaturesRaw",value:(j=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.userId&&void 0!==t.userId){e.next=2;break}throw new Rn("userId","Required parameter requestParameters.userId was null or undefined when calling getPremiumTrackSignatures.");case 2:return n={},t.trackIds&&(n.track_ids=t.trackIds),t.tokenIds&&(n.token_ids=t.tokenIds),a={},e.next=8,this.request({path:"/tracks/{user_id}/nft-gated-signatures".replace("{".concat("user_id","}"),encodeURIComponent(String(t.userId))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new qn(i));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"getPremiumTrackSignatures",value:(D=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPremiumTrackSignaturesRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getRecommendedTracksRaw",value:(B=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),t.exclusionList&&(n.exclusion_list=t.exclusionList),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/recommended",method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"getRecommendedTracks",value:(N=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getRecommendedTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return N.apply(this,arguments)})},{key:"getRecommendedTracksWithVersionRaw",value:(L=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getRecommendedTracksWithVersion.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),t.exclusionList&&(n.exclusion_list=t.exclusionList),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=11,this.request({path:"/tracks/recommended/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getRecommendedTracksWithVersion",value:(U=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRecommendedTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getRemixableTracksRaw",value:(C=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.withUsers&&(n.with_users=t.withUsers),a={},e.next=7,this.request({path:"/tracks/remixables",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ha(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getRemixableTracks",value:(O=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getRemixableTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"getTrackRaw",value:(A=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrack.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.handle&&(n.handle=t.handle),void 0!==t.urlTitle&&(n.url_title=t.urlTitle),void 0!==t.showUnlisted&&(n.show_unlisted=t.showUnlisted),a={},e.next=10,this.request({path:"/tracks/{track_id}".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ha(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getTrack",value:(q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getTrackRemixParentsRaw",value:(P=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrackRemixParents.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/remixing".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ra(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getTrackRemixParents",value:(S=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRemixParentsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getTrackRemixesRaw",value:(T=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrackRemixes.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/remixes".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return _a(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getTrackRemixes",value:(I=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRemixesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getTrackStemsRaw",value:(E=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrackStems.");case 2:return n={},a={},e.next=6,this.request({path:"/tracks/{track_id}/stems".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Pa(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"getTrackStems",value:(R=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackStemsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"getTrendingTrackIDsRaw",value:(_=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.genre&&(n.genre=t.genre),a={},e.next=5,this.request({path:"/tracks/trending/ids",method:"GET",headers:a,query:n},r);case 5:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ja(e)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"getTrendingTrackIDs",value:(x=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingTrackIDsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"getTrendingTracksRaw",value:(b=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),a={},e.next=9,this.request({path:"/tracks/trending",method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getTrendingTracks",value:(k=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"getTrendingTracksIDsWithVersionRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getTrendingTracksIDsWithVersion.");case 2:return n={},void 0!==t.genre&&(n.genre=t.genre),a={},e.next=7,this.request({path:"/tracks/trending/ids/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ja(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getTrendingTracksIDsWithVersion",value:(w=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrendingTracksIDsWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getTrendingTracksWithVersionRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getTrendingTracksWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),a={},e.next=11,this.request({path:"/tracks/trending/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getTrendingTracksWithVersion",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrendingTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getUnderTheRadarTracksRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.filter&&(n.filter=t.filter),void 0!==t.tracksOnly&&(n.tracks_only=t.tracksOnly),void 0!==t.withUsers&&(n.with_users=t.withUsers),a={},e.next=10,this.request({path:"/tracks/under_the_radar",method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getUnderTheRadarTracks",value:(p=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getUnderTheRadarTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getUndergroundTrendingTracksRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/tracks/trending/underground",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUndergroundTrendingTracks",value:(l=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getUndergroundTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersionRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getUndergroundTrendingTracksWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/trending/underground/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersion",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUndergroundTrendingTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getUsersFromFavoritesRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getUsersFromFavorites.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/favorites".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Oa(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getUsersFromFavorites",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getUsersFromRepostsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getUsersFromReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/reposts".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ua(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUsersFromReposts",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),Y}(gn);function Za(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Qa=function(e){m(c,e);var t,a,s,o,u=Za(c);function c(){return n(this,c),u.apply(this,arguments)}return i(c,[{key:"getAudioTransactionHistoryRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.encodedDataMessage&&void 0!==t.encodedDataMessage){e.next=2;break}throw new Rn("encodedDataMessage","Required parameter requestParameters.encodedDataMessage was null or undefined when calling getAudioTransactionHistory.");case 2:if(null!==t.encodedDataSignature&&void 0!==t.encodedDataSignature){e.next=4;break}throw new Rn("encodedDataSignature","Required parameter requestParameters.encodedDataSignature was null or undefined when calling getAudioTransactionHistory.");case 4:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},void 0!==t.encodedDataMessage&&null!==t.encodedDataMessage&&(a["Encoded-Data-Message"]=String(t.encodedDataMessage)),void 0!==t.encodedDataSignature&&null!==t.encodedDataSignature&&(a["Encoded-Data-Signature"]=String(t.encodedDataSignature)),e.next=14,this.request({path:"/transactions",method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ba(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getAudioTransactionHistory",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAudioTransactionHistoryRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getAudioTransactionHistoryCountRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.encodedDataMessage&&void 0!==t.encodedDataMessage){e.next=2;break}throw new Rn("encodedDataMessage","Required parameter requestParameters.encodedDataMessage was null or undefined when calling getAudioTransactionHistoryCount.");case 2:if(null!==t.encodedDataSignature&&void 0!==t.encodedDataSignature){e.next=4;break}throw new Rn("encodedDataSignature","Required parameter requestParameters.encodedDataSignature was null or undefined when calling getAudioTransactionHistoryCount.");case 4:return n={},a={},void 0!==t.encodedDataMessage&&null!==t.encodedDataMessage&&(a["Encoded-Data-Message"]=String(t.encodedDataMessage)),void 0!==t.encodedDataSignature&&null!==t.encodedDataSignature&&(a["Encoded-Data-Signature"]=String(t.encodedDataSignature)),e.next=10,this.request({path:"/transactions/count",method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Na(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getAudioTransactionHistoryCount",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAudioTransactionHistoryCountRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),c}(gn);function ei(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var ti=function(e){m(Y,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,E,I,T,S,P,q,A,O,C,U,L,N,B,D,j,F,G,M,H,W,V,z,X,$=ei(Y);function Y(){return n(this,Y),$.apply(this,arguments)}return i(Y,[{key:"bulkGetSubscribersRaw",value:(X=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new Rn("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribers.");case 2:return n={},t.ids&&(n.ids=t.ids.join(En)),a={},e.next=7,this.request({path:"/users/subscribers",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Wn(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return X.apply(this,arguments)})},{key:"bulkGetSubscribers",value:(z=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequestRaw",value:(V=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new Rn("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribersViaJSONRequest.");case 2:return n={},t.ids&&(n.ids=t.ids.join(En)),a={},e.next=7,this.request({path:"/users/subscribers",method:"POST",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Wn(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return V.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequest",value:(W=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersViaJSONRequestRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"getFavoritesRaw",value:(H=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getFavorites.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},e.next=12,this.request({path:"/users/{id}/favorites/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Nn(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getFavorites",value:(M=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getFollowersRaw",value:(G=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getFollowers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/followers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Vn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"getFollowers",value:(F=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return F.apply(this,arguments)})},{key:"getFollowingsRaw",value:(j=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getFollowings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/following".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Mn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"getFollowings",value:(D=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getRelatedUsersRaw",value:(B=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getRelatedUsers.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=8,this.request({path:"/users/{id}/related".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ba(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"getRelatedUsers",value:(N=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRelatedUsersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"getRepostsRaw",value:(L=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/reposts".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return la(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getReposts",value:(U=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getRepostsByHandleRaw",value:(C=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getRepostsByHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/handle/{handle}/reposts".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return la(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getRepostsByHandle",value:(O=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"getSubscribersRaw",value:(A=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSubscribers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/subscribers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return da(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getSubscribers",value:(q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getSupporterRaw",value:(P=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupporter.");case 2:if(null!==t.supporterUserId&&void 0!==t.supporterUserId){e.next=4;break}throw new Rn("supporterUserId","Required parameter requestParameters.supporterUserId was null or undefined when calling getSupporter.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporters/{supporter_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supporter_user_id","}"),encodeURIComponent(String(t.supporterUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Xn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getSupporter",value:(S=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupporterRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getSupportersRaw",value:(T=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupporters.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporters".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return $n(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getSupporters",value:(I=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getSupportingRaw",value:(E=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupporting.");case 2:if(null!==t.supportedUserId&&void 0!==t.supportedUserId){e.next=4;break}throw new Rn("supportedUserId","Required parameter requestParameters.supportedUserId was null or undefined when calling getSupporting.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporting/{supported_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supported_user_id","}"),encodeURIComponent(String(t.supportedUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Kn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"getSupporting",value:(R=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"getSupportingsRaw",value:(_=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupportings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporting".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Kn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"getSupportings",value:(x=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"getTopUsersRaw",value:(b=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Aa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getTopUsers",value:(k=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"getTopUsersInGenreRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),t.genre&&(n.genre=t.genre),a={},e.next=7,this.request({path:"/users/genre/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return qa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getTopUsersInGenre",value:(w=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersInGenreRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"getTracksByUserRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getTracksByUser.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/{id}/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return va(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getTracksByUser",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getTracksByUserHandleRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getTracksByUserHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/handle/{handle}/tracks".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return va(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getTracksByUserHandle",value:(p=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getUserRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getUser.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/{id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return wa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUser",value:(l=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getUserByHandleRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getUserByHandle.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/handle/{handle}".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return wa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUserByHandle",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getUserReplicaSetRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getUserReplicaSet.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/{id}/replica_set".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ga(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getUserReplicaSet",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserReplicaSetRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getUsersTrackHistoryRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getUsersTrackHistory.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},e.next=12,this.request({path:"/users/{id}/history/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ka(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUsersTrackHistory",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersTrackHistoryRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),Y}(gn),ri={exports:{}};!function(e,t){var r="undefined"!=typeof self?self:o,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,a="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,s="ArrayBuffer"in e;if(s)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,n,a=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),w.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function k(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(a))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];b.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function _(e,r){return new Promise((function(n,i){var s=new g(e,r);if(s.signal&&s.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var a=r.join(":").trim();t.append(n,a)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;n(new b(a,r))},o.onerror=function(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&a&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",u)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}_.polyfill=!0,e.fetch||(e.fetch=_,e.Headers=f,e.Request=g,e.Response=b),t.Headers=f,t.Request=g,t.Response=b,t.fetch=_,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var a=n;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t}(ri,ri.exports);var ni,ai=u(ri.exports),ii=function(e){var t,n=e.appName;return{pre:(t=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{url:t.url+(t.url.includes("?")?"&":"?")+M({app_name:n}),init:null!==(r=t.init)&&void 0!==r?r:{}});case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}};function si(){throw new Error("setTimeout has not been defined")}function oi(){throw new Error("clearTimeout has not been defined")}!function(e){e.CHECK_SHORT_CIRCUIT="Check Short Circuit",e.GET_ALL_SERVICES="Get All Services",e.FILTER_TO_WHITELIST="Filter To Whitelist",e.FILTER_FROM_BLACKLIST="Filter From Blacklist",e.FILTER_OUT_KNOWN_UNHEALTHY="Filter Out Known Unhealthy",e.GET_SELECTION_ROUND="Get Selection Round",e.NO_SERVICES_LEFT_TO_TRY="No Services Left To Try",e.SELECTED_FROM_BACKUP="Selected From Backup",e.FAILED_AND_RESETTING="Failed Everything -- Resetting",e.ROUND_FAILED_RETRY="Round Failed Retry",e.MADE_A_SELECTION="Made A Selection",e.RACED_AND_FOUND_BEST="Raced And Found Best"}(ni||(ni={}));var ui=si,ci=oi;function li(e){if(ui===setTimeout)return setTimeout(e,0);if((ui===si||!ui)&&setTimeout)return ui=setTimeout,setTimeout(e,0);try{return ui(e,0)}catch(t){try{return ui.call(null,e,0)}catch(t){return ui.call(this,e,0)}}}"function"==typeof Fr.setTimeout&&(ui=setTimeout),"function"==typeof Fr.clearTimeout&&(ci=clearTimeout);var di,fi=[],pi=!1,hi=-1;function vi(){pi&&di&&(pi=!1,di.length?fi=di.concat(fi):hi=-1,fi.length&&yi())}function yi(){if(!pi){var e=li(vi);pi=!0;for(var t=fi.length;t;){for(di=fi,fi=[];++hi<t;)di&&di[hi].run();hi=-1,t=fi.length}di=null,pi=!1,function(e){if(ci===clearTimeout)return clearTimeout(e);if((ci===oi||!ci)&&clearTimeout)return ci=clearTimeout,clearTimeout(e);try{ci(e)}catch(t){try{return ci.call(null,e)}catch(t){return ci.call(this,e)}}}(e)}}function mi(e,t){this.fun=e,this.array=t}mi.prototype.run=function(){this.fun.apply(null,this.array)};function wi(){}var gi=wi,ki=wi,bi=wi,xi=wi,_i=wi,Ri=wi,Ei=wi;var Ii=Fr.performance||{},Ti=Ii.now||Ii.mozNow||Ii.msNow||Ii.oNow||Ii.webkitNow||function(){return(new Date).getTime()};var Si=new Date;var Pi={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];fi.push(new mi(e,t)),1!==fi.length||pi||li(yi)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:gi,addListener:ki,once:bi,off:xi,removeListener:_i,removeAllListeners:Ri,emit:Ei,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ti.call(Ii),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Si)/1e3}},qi={exports:{}};!function(e,t){var r;t=e.exports=f,r="object"===s(Pi)&&Pi.env&&Pi.env.NODE_DEBUG&&/\bsemver\b/i.test(Pi.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=Number.MAX_SAFE_INTEGER||9007199254740991,a=t.re=[],i=t.src=[],o=t.tokens={},u=0;function c(e){o[e]=u++}c("NUMERICIDENTIFIER"),i[o.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),i[o.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),i[o.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),i[o.MAINVERSION]="("+i[o.NUMERICIDENTIFIER]+")\\.("+i[o.NUMERICIDENTIFIER]+")\\.("+i[o.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),i[o.MAINVERSIONLOOSE]="("+i[o.NUMERICIDENTIFIERLOOSE]+")\\.("+i[o.NUMERICIDENTIFIERLOOSE]+")\\.("+i[o.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),i[o.PRERELEASEIDENTIFIER]="(?:"+i[o.NUMERICIDENTIFIER]+"|"+i[o.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),i[o.PRERELEASEIDENTIFIERLOOSE]="(?:"+i[o.NUMERICIDENTIFIERLOOSE]+"|"+i[o.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),i[o.PRERELEASE]="(?:-("+i[o.PRERELEASEIDENTIFIER]+"(?:\\."+i[o.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),i[o.PRERELEASELOOSE]="(?:-?("+i[o.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+i[o.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),i[o.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),i[o.BUILD]="(?:\\+("+i[o.BUILDIDENTIFIER]+"(?:\\."+i[o.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),i[o.FULLPLAIN]="v?"+i[o.MAINVERSION]+i[o.PRERELEASE]+"?"+i[o.BUILD]+"?",i[o.FULL]="^"+i[o.FULLPLAIN]+"$",c("LOOSEPLAIN"),i[o.LOOSEPLAIN]="[v=\\s]*"+i[o.MAINVERSIONLOOSE]+i[o.PRERELEASELOOSE]+"?"+i[o.BUILD]+"?",c("LOOSE"),i[o.LOOSE]="^"+i[o.LOOSEPLAIN]+"$",c("GTLT"),i[o.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),i[o.XRANGEIDENTIFIERLOOSE]=i[o.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),i[o.XRANGEIDENTIFIER]=i[o.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),i[o.XRANGEPLAIN]="[v=\\s]*("+i[o.XRANGEIDENTIFIER]+")(?:\\.("+i[o.XRANGEIDENTIFIER]+")(?:\\.("+i[o.XRANGEIDENTIFIER]+")(?:"+i[o.PRERELEASE]+")?"+i[o.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),i[o.XRANGEPLAINLOOSE]="[v=\\s]*("+i[o.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+i[o.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+i[o.XRANGEIDENTIFIERLOOSE]+")(?:"+i[o.PRERELEASELOOSE]+")?"+i[o.BUILD]+"?)?)?",c("XRANGE"),i[o.XRANGE]="^"+i[o.GTLT]+"\\s*"+i[o.XRANGEPLAIN]+"$",c("XRANGELOOSE"),i[o.XRANGELOOSE]="^"+i[o.GTLT]+"\\s*"+i[o.XRANGEPLAINLOOSE]+"$",c("COERCE"),i[o.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),a[o.COERCERTL]=new RegExp(i[o.COERCE],"g"),c("LONETILDE"),i[o.LONETILDE]="(?:~>?)",c("TILDETRIM"),i[o.TILDETRIM]="(\\s*)"+i[o.LONETILDE]+"\\s+",a[o.TILDETRIM]=new RegExp(i[o.TILDETRIM],"g");c("TILDE"),i[o.TILDE]="^"+i[o.LONETILDE]+i[o.XRANGEPLAIN]+"$",c("TILDELOOSE"),i[o.TILDELOOSE]="^"+i[o.LONETILDE]+i[o.XRANGEPLAINLOOSE]+"$",c("LONECARET"),i[o.LONECARET]="(?:\\^)",c("CARETTRIM"),i[o.CARETTRIM]="(\\s*)"+i[o.LONECARET]+"\\s+",a[o.CARETTRIM]=new RegExp(i[o.CARETTRIM],"g");c("CARET"),i[o.CARET]="^"+i[o.LONECARET]+i[o.XRANGEPLAIN]+"$",c("CARETLOOSE"),i[o.CARETLOOSE]="^"+i[o.LONECARET]+i[o.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),i[o.COMPARATORLOOSE]="^"+i[o.GTLT]+"\\s*("+i[o.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),i[o.COMPARATOR]="^"+i[o.GTLT]+"\\s*("+i[o.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),i[o.COMPARATORTRIM]="(\\s*)"+i[o.GTLT]+"\\s*("+i[o.LOOSEPLAIN]+"|"+i[o.XRANGEPLAIN]+")",a[o.COMPARATORTRIM]=new RegExp(i[o.COMPARATORTRIM],"g");c("HYPHENRANGE"),i[o.HYPHENRANGE]="^\\s*("+i[o.XRANGEPLAIN]+")\\s+-\\s+("+i[o.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),i[o.HYPHENRANGELOOSE]="^\\s*("+i[o.XRANGEPLAINLOOSE]+")\\s+-\\s+("+i[o.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),i[o.STAR]="(<|>)?=?\\s*\\*";for(var l=0;l<u;l++)r(l,i[l]),a[l]||(a[l]=new RegExp(i[l]));function d(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof f)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?a[o.LOOSE]:a[o.FULL]).test(e))return null;try{return new f(e,t)}catch(e){return null}}function f(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof f){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof f))return new f(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?a[o.LOOSE]:a[o.FULL]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<n)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=d,t.valid=function(e,t){var r=d(e,t);return r?r.version:null},t.clean=function(e,t){var r=d(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=f,f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.toString=function(){return this.version},f.prototype.compare=function(e){return r("SemVer.compare",this.version,this.options,e),e instanceof f||(e=new f(e,this.options)),this.compareMain(e)||this.comparePre(e)},f.prototype.compareMain=function(e){return e instanceof f||(e=new f(e,this.options)),h(this.major,e.major)||h(this.minor,e.minor)||h(this.patch,e.patch)},f.prototype.comparePre=function(e){if(e instanceof f||(e=new f(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var n=this.prerelease[t],a=e.prerelease[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return-1;if(n!==a)return h(n,a)}while(++t)},f.prototype.compareBuild=function(e){e instanceof f||(e=new f(e,this.options));var t=0;do{var n=this.build[t],a=e.build[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return-1;if(n!==a)return h(n,a)}while(++t)},f.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new f(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(w(e,t))return null;var r=d(e),n=d(t),a="";if(r.prerelease.length||n.prerelease.length){a="pre";var i="prerelease"}for(var s in r)if(("major"===s||"minor"===s||"patch"===s)&&r[s]!==n[s])return a+s;return i},t.compareIdentifiers=h;var p=/^[0-9]+$/;function h(e,t){var r=p.test(e),n=p.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}function v(e,t,r){return new f(e,r).compare(new f(t,r))}function y(e,t,r){return v(e,t,r)>0}function m(e,t,r){return v(e,t,r)<0}function w(e,t,r){return 0===v(e,t,r)}function g(e,t,r){return 0!==v(e,t,r)}function k(e,t,r){return v(e,t,r)>=0}function b(e,t,r){return v(e,t,r)<=0}function x(e,t,r,n){switch(t){case"===":return"object"===s(e)&&(e=e.version),"object"===s(r)&&(r=r.version),e===r;case"!==":return"object"===s(e)&&(e=e.version),"object"===s(r)&&(r=r.version),e!==r;case"":case"=":case"==":return w(e,r,n);case"!=":return g(e,r,n);case">":return y(e,r,n);case">=":return k(e,r,n);case"<":return m(e,r,n);case"<=":return b(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function _(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof _){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof _))return new _(e,t);r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===R?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return h(t,e)},t.major=function(e,t){return new f(e,t).major},t.minor=function(e,t){return new f(e,t).minor},t.patch=function(e,t){return new f(e,t).patch},t.compare=v,t.compareLoose=function(e,t){return v(e,t,!0)},t.compareBuild=function(e,t,r){var n=new f(e,r),a=new f(t,r);return n.compare(a)||n.compareBuild(a)},t.rcompare=function(e,t,r){return v(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=y,t.lt=m,t.eq=w,t.neq=g,t.gte=k,t.lte=b,t.cmp=x,t.Comparator=_;var R={};function E(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof E)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new E(e.raw,t);if(e instanceof _)return new E(e.value,t);if(!(this instanceof E))return new E(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function I(e,t){for(var r=!0,n=e.slice(),a=n.pop();r&&n.length;)r=n.every((function(e){return a.intersects(e,t)})),a=n.pop();return r}function T(e){return!e||"x"===e.toLowerCase()||"*"===e}function S(e,t,r,n,a,i,s,o,u,c,l,d,f){return((t=T(r)?"":T(n)?">="+r+".0.0":T(a)?">="+r+"."+n+".0":">="+t)+" "+(o=T(u)?"":T(c)?"<"+(+u+1)+".0.0":T(l)?"<"+u+"."+(+c+1)+".0":d?"<="+u+"."+c+"."+l+"-"+d:"<="+o)).trim()}function P(e,t,n){for(var a=0;a<e.length;a++)if(!e[a].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(a=0;a<e.length;a++)if(r(e[a].semver),e[a].semver!==R&&e[a].semver.prerelease.length>0){var i=e[a].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function q(e,t,r){try{t=new E(t,r)}catch(e){return!1}return t.test(e)}function A(e,t,r,n){var a,i,s,o,u;switch(e=new f(e,n),t=new E(t,n),r){case">":a=y,i=b,s=m,o=">",u=">=";break;case"<":a=m,i=k,s=y,o="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(q(e,t,n))return!1;for(var c=0;c<t.set.length;++c){var l=t.set[c],d=null,p=null;if(l.forEach((function(e){e.semver===R&&(e=new _(">=0.0.0")),d=d||e,p=p||e,a(e.semver,d.semver,n)?d=e:s(e.semver,p.semver,n)&&(p=e)})),d.operator===o||d.operator===u)return!1;if((!p.operator||p.operator===o)&&i(e,p.semver))return!1;if(p.operator===u&&s(e,p.semver))return!1}return!0}_.prototype.parse=function(e){var t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new f(r[2],this.options.loose):this.semver=R},_.prototype.toString=function(){return this.value},_.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===R||e===R)return!0;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}return x(e,this.operator,this.semver,this.options)},_.prototype.intersects=function(e,t){if(!(e instanceof _))throw new TypeError("a Comparator is required");var r;if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new E(e.value,t),q(this.value,r,t));if(""===e.operator)return""===e.value||(r=new E(this.value,t),q(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),a=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=x(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=x(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||a||i&&o||u||c},t.Range=E,E.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},E.prototype.toString=function(){return this.range},E.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?a[o.HYPHENRANGELOOSE]:a[o.HYPHENRANGE];e=e.replace(n,S),r("hyphen replace",e),e=e.replace(a[o.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,a[o.COMPARATORTRIM]),e=(e=(e=e.replace(a[o.TILDETRIM],"$1~")).replace(a[o.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],s=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?a[o.CARETLOOSE]:a[o.CARET];return e.replace(n,(function(t,n,a,i,s){var o;return r("caret",e,t,n,a,i,s),T(n)?o="":T(a)?o=">="+n+".0.0 <"+(+n+1)+".0.0":T(i)?o="0"===n?">="+n+"."+a+".0 <"+n+"."+(+a+1)+".0":">="+n+"."+a+".0 <"+(+n+1)+".0.0":s?(r("replaceCaret pr",s),o="0"===n?"0"===a?">="+n+"."+a+"."+i+"-"+s+" <"+n+"."+a+"."+(+i+1):">="+n+"."+a+"."+i+"-"+s+" <"+n+"."+(+a+1)+".0":">="+n+"."+a+"."+i+"-"+s+" <"+(+n+1)+".0.0"):(r("no pr"),o="0"===n?"0"===a?">="+n+"."+a+"."+i+" <"+n+"."+a+"."+(+i+1):">="+n+"."+a+"."+i+" <"+n+"."+(+a+1)+".0":">="+n+"."+a+"."+i+" <"+(+n+1)+".0.0"),r("caret return",o),o}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?a[o.TILDELOOSE]:a[o.TILDE];return e.replace(n,(function(t,n,a,i,s){var o;return r("tilde",e,t,n,a,i,s),T(n)?o="":T(a)?o=">="+n+".0.0 <"+(+n+1)+".0.0":T(i)?o=">="+n+"."+a+".0 <"+n+"."+(+a+1)+".0":s?(r("replaceTilde pr",s),o=">="+n+"."+a+"."+i+"-"+s+" <"+n+"."+(+a+1)+".0"):o=">="+n+"."+a+"."+i+" <"+n+"."+(+a+1)+".0",r("tilde return",o),o}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?a[o.XRANGELOOSE]:a[o.XRANGE];return e.replace(n,(function(n,a,i,s,o,u){r("xRange",e,n,a,i,s,o,u);var c=T(i),l=c||T(s),d=l||T(o),f=d;return"="===a&&f&&(a=""),u=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&f?(l&&(s=0),o=0,">"===a?(a=">=",l?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===a&&(a="<",l?i=+i+1:s=+s+1),n=a+i+"."+s+"."+o+u):l?n=">="+i+".0.0"+u+" <"+(+i+1)+".0.0"+u:d&&(n=">="+i+"."+s+".0"+u+" <"+i+"."+(+s+1)+".0"+u),r("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(a[o.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s=s.map((function(e){return new _(e,this.options)}),this)},E.prototype.intersects=function(e,t){if(!(e instanceof E))throw new TypeError("a Range is required");return this.set.some((function(r){return I(r,t)&&e.set.some((function(e){return I(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new E(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},E.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(P(this.set[t],e,this.options))return!0;return!1},t.satisfies=q,t.maxSatisfying=function(e,t,r){var n=null,a=null;try{var i=new E(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(n&&-1!==a.compare(e)||(a=new f(n=e,r)))})),n},t.minSatisfying=function(e,t,r){var n=null,a=null;try{var i=new E(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(n&&1!==a.compare(e)||(a=new f(n=e,r)))})),n},t.minVersion=function(e,t){e=new E(e,t);var r=new f("0.0.0");if(e.test(r))return r;if(r=new f("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;n<e.set.length;++n){e.set[n].forEach((function(e){var t=new f(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!y(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new E(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return A(e,t,"<",r)},t.gtr=function(e,t,r){return A(e,t,">",r)},t.outside=A,t.prerelease=function(e,t){var r=d(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new E(e,r),t=new E(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof f)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=a[o.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),a[o.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;a[o.COERCERTL].lastIndex=-1}else r=e.match(a[o.COERCE]);if(null===r)return null;return d(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}(qi,qi.exports);var Ai=qi.exports;var Oi=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e};var Ci=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},Ui=Math.floor,Li=Math.random;var Ni=function(e,t){return e+Ui(Li()*(t-e+1))};var Bi=function(e,t){var r=-1,n=e.length,a=n-1;for(t=void 0===t?n:t;++r<t;){var i=Ni(r,a),s=e[i];e[i]=e[r],e[r]=s}return e.length=t,e},Di=Oi,ji=Ci,Fi=Bi;var Gi=function(e,t){return Fi(ji(e),Di(t,0,e.length))};var Mi=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a};var Hi=function(e,t){return Mi(t,(function(t){return e[t]}))};var Wi=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},Vi="object"==s(o)&&o&&o.Object===Object&&o,zi=Vi,Xi="object"==("undefined"==typeof self?"undefined":s(self))&&self&&self.Object===Object&&self,$i=zi||Xi||Function("return this")(),Yi=$i.Symbol,Ki=Yi,Ji=Object.prototype,Zi=Ji.hasOwnProperty,Qi=Ji.toString,es=Ki?Ki.toStringTag:void 0;var ts=function(e){var t=Zi.call(e,es),r=e[es];try{e[es]=void 0;var n=!0}catch(e){}var a=Qi.call(e);return n&&(t?e[es]=r:delete e[es]),a},rs=Object.prototype.toString;var ns=ts,as=function(e){return rs.call(e)},is=Yi?Yi.toStringTag:void 0;var ss=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":is&&is in Object(e)?ns(e):as(e)};var os=function(e){return null!=e&&"object"==s(e)},us=ss,cs=os;var ls=function(e){return cs(e)&&"[object Arguments]"==us(e)},ds=os,fs=Object.prototype,ps=fs.hasOwnProperty,hs=fs.propertyIsEnumerable,vs=ls(function(){return arguments}())?ls:function(e){return ds(e)&&ps.call(e,"callee")&&!hs.call(e,"callee")},ys=vs,ms=Array.isArray,ws={exports:{}};var gs=function(){return!1};!function(e,t){var r=$i,n=gs,a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?r.Buffer:void 0,o=(s?s.isBuffer:void 0)||n;e.exports=o}(ws,ws.exports);var ks=/^(?:0|[1-9]\d*)$/;var bs=function(e,t){var r=s(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ks.test(e))&&e>-1&&e%1==0&&e<t};var xs=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},_s=ss,Rs=xs,Es=os,Is={};Is["[object Float32Array]"]=Is["[object Float64Array]"]=Is["[object Int8Array]"]=Is["[object Int16Array]"]=Is["[object Int32Array]"]=Is["[object Uint8Array]"]=Is["[object Uint8ClampedArray]"]=Is["[object Uint16Array]"]=Is["[object Uint32Array]"]=!0,Is["[object Arguments]"]=Is["[object Array]"]=Is["[object ArrayBuffer]"]=Is["[object Boolean]"]=Is["[object DataView]"]=Is["[object Date]"]=Is["[object Error]"]=Is["[object Function]"]=Is["[object Map]"]=Is["[object Number]"]=Is["[object Object]"]=Is["[object RegExp]"]=Is["[object Set]"]=Is["[object String]"]=Is["[object WeakMap]"]=!1;var Ts=function(e){return Es(e)&&Rs(e.length)&&!!Is[_s(e)]};var Ss=function(e){return function(t){return e(t)}},Ps={exports:{}};!function(e,t){var r=Vi,n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s}(Ps,Ps.exports);var qs=Ts,As=Ss,Os=Ps.exports,Cs=Os&&Os.isTypedArray,Us=Cs?As(Cs):qs,Ls=Wi,Ns=ys,Bs=ms,Ds=ws.exports,js=bs,Fs=Us,Gs=Object.prototype.hasOwnProperty;var Ms=function(e,t){var r=Bs(e),n=!r&&Ns(e),a=!r&&!n&&Ds(e),i=!r&&!n&&!a&&Fs(e),s=r||n||a||i,o=s?Ls(e.length,String):[],u=o.length;for(var c in e)!t&&!Gs.call(e,c)||s&&("length"==c||a&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||js(c,u))||o.push(c);return o},Hs=Object.prototype;var Ws=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Hs)};var Vs=function(e,t){return function(r){return e(t(r))}},zs=Vs(Object.keys,Object),Xs=Ws,$s=zs,Ys=Object.prototype.hasOwnProperty;var Ks=function(e){var t=s(e);return null!=e&&("object"==t||"function"==t)},Js=ss,Zs=Ks;var Qs=function(e){if(!Zs(e))return!1;var t=Js(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},eo=Qs,to=xs;var ro=function(e){return null!=e&&to(e.length)&&!eo(e)},no=Ms,ao=function(e){if(!Xs(e))return $s(e);var t=[];for(var r in Object(e))Ys.call(e,r)&&"constructor"!=r&&t.push(r);return t},io=ro;var so=Hi,oo=function(e){return io(e)?no(e):ao(e)};var uo=Oi,co=Bi,lo=function(e){return null==e?[]:so(e,oo(e))};var fo=function(e,t){return e===t||e!=e&&t!=t},po=fo,ho=ro,vo=bs,yo=Ks;var mo=function(e,t,r){if(!yo(r))return!1;var n=s(t);return!!("number"==n?ho(r)&&vo(t,r.length):"string"==n&&t in r)&&po(r[t],e)},wo=/\s/;var go=function(e){for(var t=e.length;t--&&wo.test(e.charAt(t)););return t},ko=/^\s+/;var bo=ss,xo=os;var _o=function(e){return e?e.slice(0,go(e)+1).replace(ko,""):e},Ro=Ks,Eo=function(e){return"symbol"==s(e)||xo(e)&&"[object Symbol]"==bo(e)},Io=/^[-+]0x[0-9a-f]+$/i,To=/^0b[01]+$/i,So=/^0o[0-7]+$/i,Po=parseInt;var qo=function(e){if("number"==typeof e)return e;if(Eo(e))return NaN;if(Ro(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ro(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_o(e);var r=To.test(e);return r||So.test(e)?Po(e.slice(2),r?2:8):Io.test(e)?NaN:+e},Ao=1/0;var Oo=function(e){return e?(e=qo(e))===Ao||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Co=Gi,Uo=function(e,t){var r=lo(e);return co(r,uo(t,0,r.length))},Lo=ms,No=mo,Bo=function(e){var t=Oo(e),r=t%1;return t==t?r?t-r:t:0};var Do,jo=function(e,t,r){return t=(r?No(e,t,r):void 0===t)?1:Bo(t),(Lo(e)?Co:Uo)(e,t)};!function(e){e.UNHEALTHY="unhealthy",e.BEHIND="behind",e.HEALTHY="healthy"}(Do||(Do={}));var Fo={minVersion:"0.3.72",discoveryNodes:["https://audius-metadata-1.figment.io","https://audius-metadata-2.figment.io","https://audius-discovery-1.altego.net","https://audius-disco.ams-x01.nl.supercache.org","https://dn-jpn.audius.metadata.fyi","https://discoveryprovider3.audius.co","https://discoveryprovider2.audius.co","https://discoveryprovider.audius.co","https://audius-metadata-3.figment.io","https://audius-metadata-4.figment.io","https://dn1.monophonic.digital","https://dn-usa.audius.metadata.fyi","https://discovery-us-01.audius.openplayer.org","https://dn2.monophonic.digital","https://audius-discovery-2.altego.net","https://dn1.nodeoperator.io","https://audius-disco.dfw-x02.us.supercache.org","https://audius-discovery-3.altego.net","https://dn1.matterlightblooming.xyz","https://audius-dp.singapore.creatorseed.com","https://discovery.grassfed.network","https://audius-discovery-1.cultur3stake.com","https://audius-discovery-3.cultur3stake.com","https://audius-discovery-4.cultur3stake.com","https://audius-discovery-5.cultur3stake.com","https://audius-discovery-7.cultur3stake.com","https://audius-discovery-8.cultur3stake.com","https://audius-discovery-9.cultur3stake.com","https://audius-discovery-10.cultur3stake.com","https://discovery-au-02.audius.openplayer.org","https://disc-lon01.audius.hashbeam.com","https://audius-dp.amsterdam.creatorseed.com","https://blockdaemon-audius-discovery-01.bdnodes.net","https://blockdaemon-audius-discovery-02.bdnodes.net","https://blockdaemon-audius-discovery-03.bdnodes.net","https://blockdaemon-audius-discovery-04.bdnodes.net","https://blockdaemon-audius-discovery-05.bdnodes.net","https://blockdaemon-audius-discovery-06.bdnodes.net","https://blockdaemon-audius-discovery-07.bdnodes.net","https://blockchange-audius-discovery-01.bdnodes.net","https://blockchange-audius-discovery-02.bdnodes.net","https://blockchange-audius-discovery-03.bdnodes.net","https://audius-discovery-11.cultur3stake.com","https://audius-discovery-12.cultur3stake.com","https://audius-discovery-13.cultur3stake.com","https://audius-discovery-14.cultur3stake.com","https://audius-discovery-16.cultur3stake.com","https://audius-discovery-18.cultur3stake.com","https://audius-discovery-17.cultur3stake.com","https://audius-discovery-15.cultur3stake.com","https://audius-discovery-6.cultur3stake.com","https://audius-discovery-2.cultur3stake.com","https://blockdaemon-audius-discovery-08.bdnodes.net","https://audius-metadata-5.figment.io","https://audius-metadata-1.decentralizeaudio.xyz"]},Go="discovery-node",Mo={initialSelectedNode:null,blocklist:null,allowlist:null,maxConcurrentRequests:6,requestTimeout:3e4,unhealthyTTL:36e5,backupsTTL:12e4,healthCheckThresholds:{minVersion:Fo.minVersion,maxSlotDiffPlays:null,maxBlockDiff:15},bootstrapServices:Fo.discoveryNodes};function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wo(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ho(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ho(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Vo=function(e,t){return Ai.major(e)===Ai.major(t)&&Ai.minor(e)===Ai.minor(t)},zo=function(e){var t,r=e.data,n=e.healthCheckThresholds,a=n.minVersion,i=n.maxBlockDiff,s=n.maxSlotDiffPlays;if(null!==(t=r.version)&&void 0!==t&&t.service&&r.version.service!==Go)return{health:Do.UNHEALTHY,reason:"name"};if(a){if(r.version&&(!r.version.version||!Vo(r.version.version,a)))return{health:Do.UNHEALTHY,reason:"version"};if(r.version&&Ai.lt(r.version.version,a))return{health:Do.BEHIND,reason:"version"}}return function(e){var t=e.data,r=e.maxBlockDiff;return null===t.latest_chain_block||null===t.latest_indexed_block||void 0===t.latest_chain_block||void 0===t.latest_indexed_block||t.latest_chain_block-t.latest_indexed_block<=r}({data:r,maxBlockDiff:i})?function(e){var t=e.data,r=e.maxSlotDiffPlays;return!r||!t.latest_chain_slot_plays||!t.latest_indexed_slot_plays||t.latest_chain_slot_plays-t.latest_indexed_slot_plays<=r}({data:r,maxSlotDiffPlays:s})?{health:Do.HEALTHY}:{health:Do.BEHIND,reason:"slot diff"}:{health:Do.BEHIND,reason:"block diff"}},Xo=function(){var e=r(f.mark((function e(t,r){var n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(t,"/health_check"),a=null,e.next=4,ai(n,r);case 4:if((i=e.sent).ok){e.next=7;break}throw new Error(i.statusText);case 7:return e.next=9,i.json();case 9:if(s=e.sent,a=s.data){e.next=13;break}throw new Error("data");case 13:return e.abrupt("return",a);case 14:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),$o=function(e){var t=e.data,r=e.healthCheckThresholds,n=r.minVersion,a=r.maxBlockDiff,i=r.maxSlotDiffPlays;if(null===t)return{health:Do.UNHEALTHY,reason:"data"};if(t.service!==Go)return{health:Do.UNHEALTHY,reason:"name"};if(n){if(!t.version||!Vo(t.version,n))return{health:Do.UNHEALTHY,reason:"version"};if(Ai.lt(t.version,n))return{health:Do.BEHIND,reason:"version"}}return function(e){var t=e.data,r=e.maxBlockDiff;return void 0===t.block_difference||null===t.block_difference||t.block_difference<=r}({data:t,maxBlockDiff:a})?function(e){var t,r,n,a,i,s,o,u,c=e.data,l=e.maxSlotDiffPlays;return!(null!==(t=c.plays)&&void 0!==t&&t.is_unhealthy||null!==(r=c.rewards_manager)&&void 0!==r&&r.is_unhealthy||null!==(n=c.spl_audio_info)&&void 0!==n&&n.is_unhealthy||null!==(a=c.user_bank)&&void 0!==a&&a.is_unhealthy||null!==(i=c.plays)&&void 0!==i&&null!==(s=i.tx_info)&&void 0!==s&&s.slot_diff&&null!==l&&!((null===(o=c.plays)||void 0===o||null===(u=o.tx_info)||void 0===u?void 0:u.slot_diff)<=l))}({data:t,maxSlotDiffPlays:i})?{health:Do.HEALTHY}:{health:Do.BEHIND,reason:"slot diff"}:{health:Do.BEHIND,reason:"block diff"}},Yo=function(){var e=r(f.mark((function e(t){var r,n,a,i,s,o,u,c;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.endpoint,n=t.healthCheckThresholds,a=t.fetchOptions,i=t.timeoutMs,s=[],void 0!==i&&(o=new Promise((function(e,t){return setTimeout((function(){return t(new Error("timeout"))}),i)})),s.push(o)),e.prev=3,e.next=6,Promise.race([Xo(r,a)].concat(s));case 6:return u=e.sent,c=$o({data:u,healthCheckThresholds:n}),e.abrupt("return",Wo(Wo({},c),{},{data:u}));case 11:return e.prev=11,e.t0=e.catch(3),e.abrupt("return",{health:Do.UNHEALTHY,reason:null===e.t0||void 0===e.t0?void 0:e.t0.message,data:null});case 14:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),Ko=function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Promise.any){e.next=2;break}return e.abrupt("return",Promise.any(t));case 2:return e.next=4,Promise.all(E(t).map(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,r){Promise.resolve(t).then(r,e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.reject(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Jo="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;if(!Jo)throw new Error("Unable to find global scope. Are you sure this is running in the browser?");if(!Jo.AbortController)throw new Error('Could not find "AbortController" in the global scope. You need to polyfill it first');var Zo=Jo.AbortController;var Qo=function(){this.__data__=[],this.size=0},eu=fo;var tu=function(e,t){for(var r=e.length;r--;)if(eu(e[r][0],t))return r;return-1},ru=tu,nu=Array.prototype.splice;var au=tu;var iu=tu;var su=tu;var ou=Qo,uu=function(e){var t=this.__data__,r=ru(t,e);return!(r<0)&&(r==t.length-1?t.pop():nu.call(t,r,1),--this.size,!0)},cu=function(e){var t=this.__data__,r=au(t,e);return r<0?void 0:t[r][1]},lu=function(e){return iu(this.__data__,e)>-1},du=function(e,t){var r=this.__data__,n=su(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function fu(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fu.prototype.clear=ou,fu.prototype.delete=uu,fu.prototype.get=cu,fu.prototype.has=lu,fu.prototype.set=du;var pu=fu,hu=pu;var vu=function(){this.__data__=new hu,this.size=0};var yu=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var mu=function(e){return this.__data__.get(e)};var wu,gu=function(e){return this.__data__.has(e)},ku=$i["__core-js_shared__"],bu=(wu=/[^.]+$/.exec(ku&&ku.keys&&ku.keys.IE_PROTO||""))?"Symbol(src)_1."+wu:"";var xu=function(e){return!!bu&&bu in e},_u=Function.prototype.toString;var Ru=Qs,Eu=xu,Iu=Ks,Tu=function(e){if(null!=e){try{return _u.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Su=/^\[object .+?Constructor\]$/,Pu=Function.prototype,qu=Object.prototype,Au=Pu.toString,Ou=qu.hasOwnProperty,Cu=RegExp("^"+Au.call(Ou).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Uu=function(e){return!(!Iu(e)||Eu(e))&&(Ru(e)?Cu:Su).test(Tu(e))},Lu=function(e,t){return null==e?void 0:e[t]};var Nu=function(e,t){var r=Lu(e,t);return Uu(r)?r:void 0},Bu=Nu($i,"Map"),Du=Nu(Object,"create"),ju=Du;var Fu=function(){this.__data__=ju?ju(null):{},this.size=0};var Gu=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Mu=Du,Hu=Object.prototype.hasOwnProperty;var Wu=function(e){var t=this.__data__;if(Mu){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return Hu.call(t,e)?t[e]:void 0},Vu=Du,zu=Object.prototype.hasOwnProperty;var Xu=Du;var $u=Fu,Yu=Gu,Ku=Wu,Ju=function(e){var t=this.__data__;return Vu?void 0!==t[e]:zu.call(t,e)},Zu=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Xu&&void 0===t?"__lodash_hash_undefined__":t,this};function Qu(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qu.prototype.clear=$u,Qu.prototype.delete=Yu,Qu.prototype.get=Ku,Qu.prototype.has=Ju,Qu.prototype.set=Zu;var ec=Qu,tc=pu,rc=Bu;var nc=function(e){var t=s(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ac=function(e,t){var r=e.__data__;return nc(t)?r["string"==typeof t?"string":"hash"]:r.map},ic=ac;var sc=ac;var oc=ac;var uc=ac;var cc=function(){this.size=0,this.__data__={hash:new ec,map:new(rc||tc),string:new ec}},lc=function(e){var t=ic(this,e).delete(e);return this.size-=t?1:0,t},dc=function(e){return sc(this,e).get(e)},fc=function(e){return oc(this,e).has(e)},pc=function(e,t){var r=uc(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function hc(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}hc.prototype.clear=cc,hc.prototype.delete=lc,hc.prototype.get=dc,hc.prototype.has=fc,hc.prototype.set=pc;var vc=pu,yc=Bu,mc=hc;var wc=pu,gc=vu,kc=yu,bc=mu,xc=gu,_c=function(e,t){var r=this.__data__;if(r instanceof vc){var n=r.__data__;if(!yc||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new mc(n)}return r.set(e,t),this.size=r.size,this};function Rc(e){var t=this.__data__=new wc(e);this.size=t.size}Rc.prototype.clear=gc,Rc.prototype.delete=kc,Rc.prototype.get=bc,Rc.prototype.has=xc,Rc.prototype.set=_c;var Ec=Rc,Ic=Nu,Tc=function(){try{var e=Ic(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Sc=Tc;var Pc=function(e,t,r){"__proto__"==t&&Sc?Sc(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},qc=Pc,Ac=fo;var Oc=function(e,t,r){(void 0!==r&&!Ac(e[t],r)||void 0===r&&!(t in e))&&qc(e,t,r)};var Cc=function(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),o=s.length;o--;){var u=s[e?o:++a];if(!1===r(i[u],u,i))break}return t}}(),Uc={exports:{}};!function(e,t){var r=$i,n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}}(Uc,Uc.exports);var Lc=$i.Uint8Array;var Nc=function(e){var t=new e.constructor(e.byteLength);return new Lc(t).set(new Lc(e)),t};var Bc=function(e,t){var r=t?Nc(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Dc=Ks,jc=Object.create,Fc=function(){function e(){}return function(t){if(!Dc(t))return{};if(jc)return jc(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Gc=Vs(Object.getPrototypeOf,Object),Mc=Fc,Hc=Gc,Wc=Ws;var Vc=function(e){return"function"!=typeof e.constructor||Wc(e)?{}:Mc(Hc(e))},zc=ro,Xc=os;var $c=function(e){return Xc(e)&&zc(e)},Yc=ss,Kc=Gc,Jc=os,Zc=Function.prototype,Qc=Object.prototype,el=Zc.toString,tl=Qc.hasOwnProperty,rl=el.call(Object);var nl=function(e){if(!Jc(e)||"[object Object]"!=Yc(e))return!1;var t=Kc(e);if(null===t)return!0;var r=tl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&el.call(r)==rl};var al=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},il=Pc,sl=fo,ol=Object.prototype.hasOwnProperty;var ul=function(e,t,r){var n=e[t];ol.call(e,t)&&sl(n,r)&&(void 0!==r||t in e)||il(e,t,r)},cl=Pc;var ll=function(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var o=t[i],u=n?n(r[o],e[o],o,r,e):void 0;void 0===u&&(u=e[o]),a?cl(r,o,u):ul(r,o,u)}return r};var dl=Ks,fl=Ws,pl=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},hl=Object.prototype.hasOwnProperty;var vl=Ms,yl=function(e){if(!dl(e))return pl(e);var t=fl(e),r=[];for(var n in e)("constructor"!=n||!t&&hl.call(e,n))&&r.push(n);return r},ml=ro;var wl=function(e){return ml(e)?vl(e,!0):yl(e)},gl=ll,kl=wl;var bl=Oc,xl=Uc.exports,_l=Bc,Rl=Ci,El=Vc,Il=ys,Tl=ms,Sl=$c,Pl=ws.exports,ql=Qs,Al=Ks,Ol=nl,Cl=Us,Ul=al,Ll=function(e){return gl(e,kl(e))};var Nl=Ec,Bl=Oc,Dl=Cc,jl=function(e,t,r,n,a,i,s){var o=Ul(e,r),u=Ul(t,r),c=s.get(u);if(c)bl(e,r,c);else{var l=i?i(o,u,r+"",e,t,s):void 0,d=void 0===l;if(d){var f=Tl(u),p=!f&&Pl(u),h=!f&&!p&&Cl(u);l=u,f||p||h?Tl(o)?l=o:Sl(o)?l=Rl(o):p?(d=!1,l=xl(u,!0)):h?(d=!1,l=_l(u,!0)):l=[]:Ol(u)||Il(u)?(l=o,Il(o)?l=Ll(o):Al(o)&&!ql(o)||(l=El(u))):d=!1}d&&(s.set(u,l),a(l,u,n,i,s),s.delete(u)),bl(e,r,l)}},Fl=Ks,Gl=wl,Ml=al;var Hl=function e(t,r,n,a,i){t!==r&&Dl(r,(function(s,o){if(i||(i=new Nl),Fl(s))jl(t,r,o,n,e,a,i);else{var u=a?a(Ml(t,o),s,o+"",t,r,i):void 0;void 0===u&&(u=s),Bl(t,o,u)}}),Gl)};var Wl=function(e){return e};var Vl=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},zl=Math.max;var Xl=function(e,t,r){return t=zl(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=zl(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var o=Array(t+1);++a<t;)o[a]=n[a];return o[t]=r(s),Vl(e,this,o)}};var $l=function(e){return function(){return e}},Yl=Tc,Kl=Yl?function(e,t){return Yl(e,"toString",{configurable:!0,enumerable:!1,value:$l(t),writable:!0})}:Wl,Jl=Date.now;var Zl=function(e){var t=0,r=0;return function(){var n=Jl(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},Ql=Zl(Kl),ed=Wl,td=Xl,rd=Ql;var nd=function(e,t){return rd(td(e,t,ed),e+"")},ad=mo;var id=Hl,sd=function(e){return nd((function(t,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(a--,i):void 0,s&&ad(r[0],r[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++n<a;){var o=r[n];o&&e(t,o,n,i)}return t}))}((function(e,t,r,n){id(e,t,r,n)})),od=function(e,t){return sd({},t,e,(function(e,t){if(Array.isArray(t))return t}))},ud=function(){function e(t){var r,a;n(this,e),this.unhealthyCleanupTimeout=null,this.backupCleanupTimeout=null,this.config=od(t,Mo),this.services=this.config.bootstrapServices,this._isBehind=!1,this.unhealthyServices=new Set([]),this.backupServices={},this.selectedNode=!this.config.initialSelectedNode||this.config.allowlist&&(null===(r=this.config.allowlist)||void 0===r||!r.has(this.config.initialSelectedNode))||null!==(a=this.config.blocklist)&&void 0!==a&&a.has(this.config.initialSelectedNode)?null:this.config.initialSelectedNode,this.eventEmitter=new sn,this.addEventListener=this.eventEmitter.addListener.bind(this.eventEmitter),this.removeEventListener=this.eventEmitter.removeListener.bind(this.eventEmitter)}var t,a,s,o,u;return i(e,[{key:"isBehind",get:function(){return this._isBehind},set:function(e){e&&!this._isBehind?this.warn("using behind discovery node",this.selectedNode):!e&&this._isBehind&&this.info("discovery node no longer behind",this.selectedNode),this._isBehind=e}},{key:"updateConfig",value:function(e){var t;(this.config=od(e,this.config),this.selectedNode)&&((e.healthCheckThresholds||e.allowlist&&!e.allowlist.has(this.selectedNode)||null!==(t=e.blocklist)&&void 0!==t&&t.has(this.selectedNode))&&(this.selectedNode=null))}},{key:"createMiddleware",value:function(){var e,t,n=this,a=this.getSelectedEndpoint();return{pre:(t=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.url).startsWith("http")){e.next=6;break}return e.next=4,a;case 4:n=e.sent,r="".concat(n).concat(t.url);case 6:return e.abrupt("return",{url:r,init:t.init});case 7:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),post:(e=r(f.mark((function e(t){var r,i,s,o,u,c,l,d,p,h,v,y,m,w,g,k,b,x;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.response,e.next=3,a;case 3:if(i=e.sent){e.next=9;break}return e.next=7,n.select();case 7:case 17:e.next=33;break;case 9:if(!r.ok){e.next=19;break}return l=r.clone(),e.next=13,l.json();case 13:return d=e.sent,p=zo({data:d,healthCheckThresholds:n.config.healthCheckThresholds}),h=p.health,v=p.reason,e.next=17,n.reselectIfNecessary({endpoint:i,health:h,reason:v,data:{block_difference:(null!==(s=d.latest_chain_block)&&void 0!==s?s:0)-(null!==(o=d.latest_indexed_block)&&void 0!==o?o:0),version:null!==(u=null===(c=d.version)||void 0===c?void 0:c.version)&&void 0!==u?u:""}});case 19:return n.warn("request failed",i,t),e.next=22,Yo({endpoint:i,healthCheckThresholds:n.config.healthCheckThresholds});case 22:return w=e.sent,g=w.health,k=w.data,b=w.reason,e.next=28,n.reselectIfNecessary({endpoint:i,health:g,reason:b,data:{block_difference:null!==(y=null==k?void 0:k.block_difference)&&void 0!==y?y:0,version:null!==(m=null==k?void 0:k.version)&&void 0!==m?m:""}});case 28:if(!(x=e.sent)||x===i){e.next=33;break}return e.next=32,t.fetch("".concat(x).concat(t.url),t.init);case 32:return e.abrupt("return",e.sent);case 33:return e.abrupt("return",r);case 34:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}}},{key:"getSelectedEndpoint",value:(u=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.selectedNode){e.next=2;break}return e.abrupt("return",this.selectedNode);case 2:return e.next=4,this.select();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"getServices",value:function(){return this.services}},{key:"select",value:(o=r(f.mark((function e(){var t,r,n,a,i,s,o,u=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.debug("Selecting new discovery node..."),t=[],r=E(this.services),t.push({stage:ni.GET_ALL_SERVICES,val:r}),this.config.allowlist&&(r=r.filter((function(e){var t;return null===(t=u.config.allowlist)||void 0===t?void 0:t.has(e)})),t.push({stage:ni.FILTER_TO_WHITELIST,val:r})),this.config.blocklist&&(r=r.filter((function(e){var t;return!(null!==(t=u.config.blocklist)&&void 0!==t&&t.has(e))})),t.push({stage:ni.FILTER_FROM_BLACKLIST,val:r})),n=null,a=0;case 8:if(null!==n){e.next=37;break}if(i=r.filter((function(e){return!u.unhealthyServices.has(e)})),t.push({stage:ni.FILTER_OUT_KNOWN_UNHEALTHY,val:i}),0!==i.length){e.next=28;break}if(t.push({stage:ni.NO_SERVICES_LEFT_TO_TRY}),!(Object.keys(this.backupServices).length>0)){e.next=23;break}return e.next=16,this.selectFromBackups();case 16:return s=e.sent,t.push({stage:ni.SELECTED_FROM_BACKUP,val:s}),this.selectedNode=s,this.isBehind=!0,e.abrupt("return",s);case 23:return this.unhealthyServices=new Set([]),this.backupServices={},t.push({stage:ni.FAILED_AND_RESETTING}),this.error("Failed to select discovery node",t),e.abrupt("return",null);case 28:return o=jo(i,this.config.maxConcurrentRequests),t.push({stage:ni.GET_SELECTION_ROUND,val:o}),e.next=32,this.anyHealthyEndpoint(o);case 32:n=e.sent,a+=o.length,n||(t.push({stage:ni.ROUND_FAILED_RETRY}),this.debug("No healthy services found. Attempting another round...",{attemptedServicesCount:a})),e.next=8;break;case 37:return this.triggerCleanup(),t.push({stage:ni.MADE_A_SELECTION,val:n}),n&&(this.selectedNode=n,this.eventEmitter.emit("change",n)),this.info("Selected discprov ".concat(n),t,{attemptedServicesCount:a}),this.isBehind=!1,e.abrupt("return",n);case 43:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"anyHealthyEndpoint",value:(s=r(f.mark((function e(t){var n,a,i=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Zo,a=t.map(function(){var e=r(f.mark((function e(t){var r,a,s,o,u;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yo({endpoint:t,fetchOptions:{signal:n.signal},timeoutMs:i.config.requestTimeout,healthCheckThresholds:i.config.healthCheckThresholds});case 2:if(r=e.sent,a=r.health,s=r.data,o=r.reason,a===Do.HEALTHY){e.next=11;break}throw"Aborted"===o?i.debug("health_check",t,a,o):a===Do.UNHEALTHY?(i.unhealthyServices.add(t),i.warn("health_check",t,a,o)):a===Do.BEHIND&&(i.unhealthyServices.add(t),s&&(i.backupServices[t]={endpoint:t,block_difference:s.block_difference,version:s.version}),i.warn("health_check",t,a,o)),new Error("".concat(t," ").concat(a,": ").concat(o));case 11:return i.debug("health_check",t,a),n.abort(),null!=s&&null!==(u=s.network)&&void 0!==u&&u.discovery_nodes&&s.network.discovery_nodes.length>0?i.services=s.network.discovery_nodes:i.warn("Couldn't load new service list from healthy service",t),e.abrupt("return",t);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.prev=2,e.next=5,Ko(a);case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),this.error("No healthy nodes",e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e){return s.apply(this,arguments)})},{key:"reselectIfNecessary",value:(a=r(f.mark((function e(t){var r,n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.endpoint,n=t.health,a=t.reason,i=t.data,n!==Do.HEALTHY){e.next=6;break}return this.isBehind=!1,e.abrupt("return",r);case 6:if(!this.isBehind||!Do.BEHIND){e.next=10;break}return e.abrupt("return",r);case 10:return n!==Do.UNHEALTHY&&i?n===Do.BEHIND&&(this.backupServices[r]={endpoint:r,block_difference:i.block_difference,version:i.version}):this.unhealthyServices.add(r),this.warn("api_health_check failed, reselecting",r,n,a),e.next=14,this.select();case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"triggerCleanup",value:function(){var e=this;this.unhealthyCleanupTimeout&&clearTimeout(this.unhealthyCleanupTimeout),this.backupCleanupTimeout&&clearTimeout(this.backupCleanupTimeout),this.unhealthyCleanupTimeout=setTimeout((function(){e.unhealthyServices=new Set([])}),this.config.unhealthyTTL),this.backupCleanupTimeout=setTimeout((function(){e.backupServices={}}),this.config.backupsTTL)}},{key:"selectFromBackups",value:(t=r(f.mark((function e(){var t,r,n,a,i=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object.values(this.backupServices).sort((function(e,t){var r=Ai.rcompare(e.version,t.version);return 0===r?e.block_difference-t.block_difference:r})),n=r.find((function(e){return e.block_difference<=i.config.healthCheckThresholds.maxBlockDiff})),a=r[0],n||!a){e.next=5;break}return e.abrupt("return",a.endpoint);case 5:return e.abrupt("return",null!==(t=null==n?void 0:n.endpoint)&&void 0!==t?t:null);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"debug",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).debug.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).info.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).warn.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).warn.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}}]),e}(),cd=i((function e(){n(this,e),this.getSharedSecret=function(){throw new Error("WalletApi not initialized")},this.sign=function(){throw new Error("WalletApi not initialized")}}));function ld(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dd(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ld(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ld(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var fd=function(e){return dd(dd({},{discoveryNodeSelector:new ud,walletApi:new cd}),e.services)},pd=function(e){var t=e.appName,r=e.services,n=[ii({appName:t}),r.discoveryNodeSelector.createMiddleware()],a=new O({fetchApi:ai,middleware:n}),i=new Qe(a,r.discoveryNodeSelector),s=new Je(a),o=new Ve(a),u=new Xe(a),c=new tt(a).resolve,l=new ln(new O({fetchApi:ai,basePath:"",middleware:n}),r.walletApi,r.discoveryNodeSelector),d=new mn({fetchApi:ai,middleware:n});return{tracks:i,users:s,playlists:o,tips:u,resolve:c,full:{tracks:new Ja(d),users:new ti(d),search:new Xa(d),playlists:new Ha(d),reactions:new Va(d),tips:new Ya(d),transactions:new Qa(d)},chats:l}};window.audiusSdk=function(e){var t=e.appName,r=fd(e),n=pd({appName:t,services:r});return dd({oauth:"undefined"!=typeof window?new v({appName:t,usersApi:n.users}):void 0},n)}}();
|
|
3
|
+
e.exports=r=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var n={},a=Object.prototype,i=a.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),s=new E(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return S()}for(r.method=a,r.arg=i;;){var s=r.delegate;if(s){var o=_(s,r);if(o){if(o===p)continue;return o}}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 u=f(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,s),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p={};function h(){}function v(){}function y(){}var m={};l(m,o,(function(){return this}));var w=Object.getPrototypeOf,g=w&&w(w(T([])));g&&g!==a&&i.call(g,o)&&(m=g);var k=y.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,r){function n(a,s,o,u){var c=f(e[a],e,s);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(e){n("next",e,o,u)}),(function(e){n("throw",e,o,u)})):r.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,u)}))}u(c.arg)}var a;this._invoke=function(e,t){function i(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(i,i):i()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function R(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function T(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 r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=y,l(k,"constructor",y),l(y,"constructor",v),v.displayName=l(y,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,u,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,a,i){void 0===i&&(i=Promise);var s=new x(d(e,t,r,a),i);return n.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},b(k),l(k,c,"Generator"),l(k,o,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},n.values=T,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(I),!e)for(var t in this)"t"===t.charAt(0)&&i.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 r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(o&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(s)},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),p},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),I(r),p}},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 a=n.arg;I(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(c);var d=c.exports(),f=d;try{regeneratorRuntime=d}catch(e){"object"===("undefined"==typeof globalThis?"undefined":s(globalThis))?globalThis.regeneratorRuntime=d:Function("r","regeneratorRuntime = r")(d)}var p="https://audius.co/oauth/auth",h="audiusOauthState",v=function(){function e(t){if(n(this,e),this.config=t,"undefined"==typeof window)throw new Error("Audius OAuth SDK functions are only available in browser. Refer to our documentation to learn how to implement Audius OAuth manually.");this.activePopupWindow=null,this.loginSuccessCallback=null,this.loginErrorCallback=null,this.popupCheckInterval=null}var t,a;return i(e,[{key:"init",value:function(e,t){var r=this;this.loginSuccessCallback=e,this.loginErrorCallback=null!=t?t:null,window.addEventListener("message",(function(e){r._receiveMessage(e)}),!1)}},{key:"login",value:function(){var e=this;if(this.config.appName)if(this.loginSuccessCallback){var t,r=(t=new Uint8Array(20),(window.crypto||window.msCrypto).getRandomValues(t),Array.from(t,(function(e){return e.toString(16).padStart(2,"0")})).join(""));window.localStorage.setItem(h,r);var n=encodeURIComponent(window.location.origin),a=encodeURI(this.config.appName),i="".concat(p,"?scope=read&state=").concat(r,"&redirect_uri=postMessage&origin=").concat(n,"&app_name=").concat(a);this.activePopupWindow=window.open(i,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=375, height=720, top=100, left=100"),this._clearPopupCheckInterval(),this.popupCheckInterval=setInterval((function(){var t;null!==(t=e.activePopupWindow)&&void 0!==t&&t.closed&&(e._surfaceError("The login popup was closed prematurely."),e.popupCheckInterval&&clearInterval(e.popupCheckInterval))}),500)}else this._surfaceError("Login success callback not set (set with `init` method).");else this._surfaceError("App name not set (set with `init` method).")}},{key:"renderButton",value:function(e,t){var r,n,a=this;e||console.error("Target element for Audius OAuth button is empty.");var i=document.createElement("style");i.textContent="\n.audiusLoginButton {\n cursor: pointer;\n font-family: Helvetica, Arial, sans-serif;\n text-align: center;\n color: #FFFFFF;\n font-weight: 700;\n font-size: 14px;\n line-height: 100%;\n align-items: center;\n display: flex;\n border: 0;\n height: 28px;\n justify-content: center;\n padding: 0px 16px;\n background: #CC0FE0;\n border-radius: 4px;\n transition: all 0.07s ease-in-out;\n}\n\n.audiusLoginButton:hover {\n background: #D127E3;\n transform: perspective(1px) scale3d(1.04, 1.04, 1.04);\n}\n\n.audiusLoginButton.disableHoverGrow:hover {\n transform: none;\n}\n\n.audiusLoginButton:active {\n background: #A30CB3;\n}\n\n.audiusLoginButton.pill {\n border-radius: 99px;\n}\n\n.audiusLoginButton.fullWidth {\n width: 100%;\n}\n\n.audiusLoginButton.small {\n height: 20px;\n font-size: 11px;\n padding: 0px 32px;\n}\n\n.audiusLoginButton.large {\n height: 40px;\n font-size: 18px;\n padding: 0px 18px;\n}\n",document.head.appendChild(i);var s,o,u,c=document.createElement("button");c.id="audius-login-button",c.classList.add("audiusLoginButton"),"pill"===(null==t?void 0:t.corners)&&c.classList.add("pill"),"small"===(null==t?void 0:t.size)&&c.classList.add("small"),"large"===(null==t?void 0:t.size)&&c.classList.add("large"),null!=t&&t.fullWidth&&c.classList.add("fullWidth"),null!=t&&t.disableHoverGrow&&c.classList.add("disableHoverGrow"),c.innerHTML="".concat((s=null!==(r=null==t?void 0:t.size)&&void 0!==r?r:"medium","small"===s?(o=16,u=5):"medium"===s?(o=18,u=5):(o=24,u=10),'<svg width="'.concat(o,'px" height="').concat(o,'px" viewBox="0 0 56 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="padding-right: ').concat(u,'px;">\n<g id="Assets" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="assets" transform="translate(-1555.000000, -2588.000000)">\n <g id="audiusLogoGlyph" transform="translate(1555.000000, 2588.000000)">\n <path d="M55.8191698,46.0362519 L42.4551012,23.3458831 L36.1870263,12.7036635 L29.0910326,0.65551431 C28.5766233,-0.217848954 27.2890668,-0.218676884 26.7734944,0.654065432 L13.3787621,23.3270477 L7.90582764,32.5909699 C7.39025522,33.4637122 8.03324043,34.5553386 9.06332791,34.5560631 L19.4031138,34.56279 C19.881044,34.5631005 20.3230236,34.3136864 20.5623059,33.9087249 L25.9362708,24.8122516 L26.7580568,23.4212248 C26.790518,23.3662709 26.8260456,23.3149392 26.8641108,23.2669192 C27.4325516,22.5520012 28.5935412,22.6041608 29.0755951,23.4226737 L34.6514114,32.8894388 L35.682239,34.6396841 C35.7412402,34.7399672 35.7843808,34.8430445 35.813987,34.9470533 C36.0430129,35.7492145 35.4339691,36.6039494 34.5220954,36.6034319 L22.3586676,36.5954631 C21.8806317,36.5951526 21.4387578,36.8445667 21.1994756,37.2496317 L16.0236614,46.0105861 C15.5080889,46.8833284 16.1510741,47.9749548 17.1810559,47.9756793 L27.9002253,47.9827167 L41.2664086,47.9913065 L54.6590261,47.9999997 C55.6892193,48.0006207 56.3335791,46.9096152 55.8191698,46.0362519" id="Audius-Logo" fill="#ffffff" fill-rule="evenodd"></path>\n <rect id="bound" x="0" y="0" width="56" height="48"></rect>\n </g>\n </g>\n</g>\n</svg>'))," ").concat(null!==(n=null==t?void 0:t.customText)&&void 0!==n?n:"Continue With Audius"),c.onclick=function(){a.login()},e.replaceWith(c)}},{key:"verifyToken",value:(a=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.config.usersApi.verifyIDToken({token:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_surfaceError",value:function(e){this.loginErrorCallback?this.loginErrorCallback(e):console.error(e)}},{key:"_clearPopupCheckInterval",value:function(){this.popupCheckInterval&&clearInterval(this.popupCheckInterval)}},{key:"_receiveMessage",value:(t=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new URL(p).origin,t.origin===r&&t.source===this.activePopupWindow&&t.data.state&&t.data.token){e.next=3;break}return e.abrupt("return");case 3:return this._clearPopupCheckInterval(),this.activePopupWindow&&(this.activePopupWindow.closed||this.activePopupWindow.close(),this.activePopupWindow=null),window.localStorage.getItem(h)!==t.data.state&&this._surfaceError("State mismatch."),e.next=8,this.verifyToken(t.data.token);case 8:null!=(n=e.sent)&&n.data?this.loginSuccessCallback&&this.loginSuccessCallback(n.data):this._surfaceError("The token was invalid.");case 10:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function m(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&&y(e,t)}function w(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function k(){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 b(e,t,r){return b=k()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&y(a,r.prototype),a},b.apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return b(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)},x(e)}function _(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 R(e,t){if(e){if("string"==typeof e)return _(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)?_(e,t):void 0}}function I(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?T(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function P(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var A="/v1".replace(/\/+$/,""),O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.configuration=t}return i(e,[{key:"config",set:function(e){this.configuration=e}},{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:A}},{key:"fetchApi",get:function(){return this.configuration.fetchApi}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||M}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:r(f.mark((function t(){return f.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e);case 1:case"end":return t.stop()}}),t)})))}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}]),e}(),C=new O,U=function(){function e(){var t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C;n(this,e),this.configuration=a,this.fetchApi=function(){var e=r(f.mark((function e(r,n){var a,i,s,o,u,c,l,d,p,h,v;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={url:r,init:n},i=P(t.middleware),e.prev=2,i.s();case 4:if((s=i.n()).done){e.next=15;break}if(!(o=s.value).pre){e.next=13;break}return e.next=9,o.pre(S({fetch:t.fetchApi},a));case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0=a;case 12:a=e.t0;case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),i.e(e.t1);case 20:return e.prev=20,i.f(),e.finish(20);case 23:return u=void 0,e.prev=24,e.next=27,(t.configuration.fetchApi||fetch)(a.url,a.init);case 27:u=e.sent,e.next=60;break;case 30:e.prev=30,e.t2=e.catch(24),c=P(t.middleware),e.prev=33,c.s();case 35:if((l=c.n()).done){e.next=46;break}if(!(d=l.value).onError){e.next=44;break}return e.next=40,d.onError({fetch:t.fetchApi,url:a.url,init:a.init,error:e.t2,response:u?u.clone():void 0});case 40:if(e.t3=e.sent,e.t3){e.next=43;break}e.t3=u;case 43:u=e.t3;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t4=e.catch(33),c.e(e.t4);case 51:return e.prev=51,c.f(),e.finish(51);case 54:if(void 0!==u){e.next=60;break}if(!(e.t2 instanceof Error)){e.next=59;break}throw new D(e.t2,"The request failed and the interceptors did not return an alternative response");case 59:throw e.t2;case 60:p=P(t.middleware),e.prev=61,p.s();case 63:if((h=p.n()).done){e.next=74;break}if(!(v=h.value).post){e.next=72;break}return e.next=68,v.post({fetch:t.fetchApi,url:a.url,init:a.init,response:u.clone()});case 68:if(e.t5=e.sent,e.t5){e.next=71;break}e.t5=u;case 71:u=e.t5;case 72:e.next=63;break;case 74:e.next=79;break;case 76:e.prev=76,e.t6=e.catch(61),p.e(e.t6);case 79:return e.prev=79,p.f(),e.finish(79);case 82:return e.abrupt("return",u);case 83:case"end":return e.stop()}}),e,null,[[2,17,20,23],[24,30],[33,48,51,54],[61,76,79,82]])})));return function(t,r){return e.apply(this,arguments)}}(),this.middleware=a.middleware}var t,a;return i(e,[{key:"withMiddleware",value:function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,arguments),t}},{key:"withPreMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{pre:e}}));return this.withMiddleware.apply(this,I(n))}},{key:"withPostMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{post:e}}));return this.withMiddleware.apply(this,I(n))}},{key:"request",value:(a=r(f.mark((function e(t,r){var n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createFetchParams(t,r);case 2:return n=e.sent,a=n.url,i=n.init,e.next=7,this.fetchApi(a,i);case 7:if(!((s=e.sent)&&s.status>=200&&s.status<300)){e.next=10;break}return e.abrupt("return",s);case 10:throw new B(s,"Response returned an error code");case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createFetchParams",value:(t=r(f.mark((function e(t,n){var a,i,s,o,u,c;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.configuration.basePath+t.path,void 0!==t.query&&0!==Object.keys(t.query).length&&(a+="?"+this.configuration.queryParamsStringify(t.query)),i=Object.assign({},this.configuration.headers,t.headers),Object.keys(i).forEach((function(e){return void 0===i[e]?delete i[e]:{}})),s="function"==typeof n?n:r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}}),e)}))),o={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},e.t0=S,e.t1=S({},o),e.next=10,s({init:o,context:t});case 10:return e.t2=e.sent,u=(0,e.t0)(e.t1,e.t2),c=S(S({},u),{},{body:(l=u.body,"undefined"!=typeof FormData&&l instanceof FormData||u.body instanceof URLSearchParams||L(u.body)||N(u.body)?u.body:JSON.stringify(u.body))}),e.abrupt("return",{url:a,init:c});case 14:case"end":return e.stop()}var l}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"clone",value:function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}]),e}();function L(e){return"undefined"!=typeof Blob&&e instanceof Blob}function N(e){return"string"==typeof e}var B=function(e){m(r,e);var t=E(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).response=e,i.name="ResponseError",i}return i(r)}(x(Error)),D=function(e){m(r,e);var t=E(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).cause=e,i.name="FetchError",i}return i(r)}(x(Error)),j=function(e){m(r,e);var t=E(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).field=e,i.name="RequiredError",i}return i(r)}(x(Error)),F=",";function G(e,t){var r=e[t];return null!=r}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).sort().map((function(r){return H(r,e[r],t)})).filter((function(e){return e.length>0})).join("&")}function H(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r+(r.length?"[".concat(e,"]"):e);if(t instanceof Array){var a=t.map((function(e){return encodeURIComponent(String(e))})).join("&".concat(encodeURIComponent(n),"="));return"".concat(encodeURIComponent(n),"=").concat(a)}if(t instanceof Set){var i=Array.from(t);return H(e,i,r)}return t instanceof Date?"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.toISOString())):t instanceof Object?M(t,n):"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(t)))}function W(t,r){return Object.keys(t).reduce((function(n,a){return S(S({},n),{},e({},a,r(t[a])))}),{})}var V=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};n(this,e),this.raw=t,this.transformer=r}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,this.raw.json();case 3:return e.t1=e.sent,e.abrupt("return",e.t0.transformer.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),z=function(){function e(t){n(this,e),this.raw=t}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),e}();function X(e){return function(e,t){if(null==e)return e;return{timestamp:G(e,"timestamp")?e.timestamp:void 0,itemType:G(e,"item_type")?e.item_type:void 0,item:G(e,"item")?e.item:void 0}}(e)}function $(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,subscriberIds:G(e,"subscriber_ids")?e.subscriber_ids:void 0}}(e)}function Y(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map($):void 0}}(e)}function K(e){return function(e,t){if(null==e)return e;return{ercWallets:e.erc_wallets,splWallets:e.spl_wallets}}(e)}function J(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?K(e.data):void 0}}(e)}function Z(e){return function(e,t){if(null==e)return e;return{_640x:G(e,"640x")?e["640x"]:void 0,_2000x:G(e,"2000x")?e["2000x"]:void 0}}(e)}function Q(e){return function(e,t){if(null==e)return e;return{_150x150:G(e,"150x150")?e["150x150"]:void 0,_480x480:G(e,"480x480")?e["480x480"]:void 0,_1000x1000:G(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function ee(e){return function(e,t){if(null==e)return e;return{userId:e.userId,email:e.email,name:e.name,handle:e.handle,verified:e.verified,profilePicture:G(e,"profilePicture")?Q(e.profilePicture):void 0,sub:e.sub,iat:e.iat}}(e)}function te(e){return function(e,t){if(null==e)return e;return{userId:G(e,"user_id")?e.user_id:void 0}}(e)}function re(e){return function(e,t){if(null==e)return e;return{favoriteItemId:e.favorite_item_id,favoriteType:e.favorite_type,userId:e.user_id,createdAt:e.created_at}}(e)}function ne(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(re):void 0}}(e)}function ae(e){return function(e,t){if(null==e)return e;return{albumCount:e.album_count,artistPickTrackId:G(e,"artist_pick_track_id")?e.artist_pick_track_id:void 0,bio:G(e,"bio")?e.bio:void 0,coverPhoto:G(e,"cover_photo")?Z(e.cover_photo):void 0,followeeCount:e.followee_count,followerCount:e.follower_count,doesFollowCurrentUser:G(e,"does_follow_current_user")?e.does_follow_current_user:void 0,handle:e.handle,id:e.id,isVerified:e.is_verified,location:G(e,"location")?e.location:void 0,name:e.name,playlistCount:e.playlist_count,profilePicture:G(e,"profile_picture")?Q(e.profile_picture):void 0,repostCount:e.repost_count,trackCount:e.track_count,isDeactivated:e.is_deactivated,ercWallet:G(e,"erc_wallet")?e.erc_wallet:void 0,splWallet:e.spl_wallet,supporterCount:e.supporter_count,supportingCount:e.supporting_count}}(e)}function ie(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function se(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function oe(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,sender:ae(e.sender)}}(e)}function ue(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?oe(e.data):void 0}}(e)}function ce(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(oe):void 0}}(e)}function le(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,receiver:ae(e.receiver)}}(e)}function de(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(le):void 0}}(e)}function fe(e){return function(e,t){if(null==e)return e;return{amount:e.amount,sender:G(e,"sender")?ae(e.sender):void 0,receiver:G(e,"receiver")?ae(e.receiver):void 0,createdAt:e.created_at}}(e)}function pe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(fe):void 0}}(e)}function he(e){return function(e,t){if(null==e)return e;return{service:e.service,version:e.version}}(e)}function ve(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:he(e.version),data:G(e,"data")?e.data.map(X):void 0}}(e)}function ye(e){return function(e,t){if(null==e)return e;return{trackId:G(e,"trackId")?e.trackId:void 0,date:G(e,"date")?e.date:void 0,listens:G(e,"listens")?e.listens:void 0}}(e)}function me(e){return function(e,t){if(null==e)return e;return{totalListens:G(e,"totalListens")?e.totalListens:void 0,trackIds:G(e,"trackIds")?e.trackIds:void 0,listenCounts:G(e,"listenCounts")?e.listenCounts.map(ye):void 0}}(e)}function we(e){return function(e,t){if(null==e)return e;return{_150x150:G(e,"150x150")?e["150x150"]:void 0,_480x480:G(e,"480x480")?e["480x480"]:void 0,_1000x1000:G(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function ge(e){return function(e,t){if(null==e)return e;return{artwork:G(e,"artwork")?we(e.artwork):void 0,description:G(e,"description")?e.description:void 0,permalink:G(e,"permalink")?e.permalink:void 0,id:e.id,isAlbum:e.is_album,playlistName:e.playlist_name,repostCount:e.repost_count,favoriteCount:e.favorite_count,totalPlayCount:e.total_play_count,user:ae(e.user)}}(e)}function ke(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ge):void 0}}(e)}function be(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ge):void 0}}(e)}function xe(e){return function(e,t){if(null==e)return e;return{parentTrackId:e.parent_track_id}}(e)}function _e(e){return function(e,t){if(null==e)return e;return{tracks:G(e,"tracks")?e.tracks.map(xe):void 0}}(e)}function Re(e){return function(e,t){if(null==e)return e;return{_150x150:G(e,"150x150")?e["150x150"]:void 0,_480x480:G(e,"480x480")?e["480x480"]:void 0,_1000x1000:G(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function Ie(e){return function(e,t){if(null==e)return e;return{artwork:G(e,"artwork")?Re(e.artwork):void 0,description:G(e,"description")?e.description:void 0,genre:G(e,"genre")?e.genre:void 0,id:e.id,trackCid:G(e,"track_cid")?e.track_cid:void 0,mood:G(e,"mood")?e.mood:void 0,releaseDate:G(e,"release_date")?e.release_date:void 0,remixOf:G(e,"remix_of")?_e(e.remix_of):void 0,repostCount:e.repost_count,favoriteCount:e.favorite_count,tags:G(e,"tags")?e.tags:void 0,title:e.title,user:ae(e.user),duration:e.duration,downloadable:G(e,"downloadable")?e.downloadable:void 0,playCount:e.play_count,permalink:G(e,"permalink")?e.permalink:void 0,isStreamable:G(e,"is_streamable")?e.is_streamable:void 0}}(e)}function Ee(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(Ie):void 0}}(e)}function Te(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Se(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(X):void 0}}(e)}function Pe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function qe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data:void 0}}(e)}function Ae(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Oe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Ce(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?Ie(e.data):void 0}}(e)}function Ue(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(Ie):void 0}}(e)}function Le(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(Ie):void 0}}(e)}function Ne(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ge):void 0}}(e)}function Be(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?te(e.data):void 0}}(e)}function De(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,wallet:e.wallet,primary:G(e,"primary")?e.primary:void 0,secondary1:G(e,"secondary1")?e.secondary1:void 0,secondary2:G(e,"secondary2")?e.secondary2:void 0,primarySpID:G(e,"primarySpID")?e.primarySpID:void 0,secondary1SpID:G(e,"secondary1SpID")?e.secondary1SpID:void 0,secondary2SpID:G(e,"secondary2SpID")?e.secondary2SpID:void 0}}(e)}function je(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?ae(e.data):void 0}}(e)}function Fe(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?e.data.map(ae):void 0}}(e)}function Ge(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?W(e.data,me):void 0}}(e)}function Me(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?De(e.data):void 0}}(e)}function He(e){return function(e,t){if(null==e)return e;return{data:G(e,"data")?ee(e.data):void 0}}(e)}function We(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ve=function(e){m(h,e);var t,a,s,o,u,c,l,d,p=We(h);function h(){return n(this,h),p.apply(this,arguments)}return i(h,[{key:"getPlaylistRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new j("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylist.");case 2:return n={},a={},e.next=6,this.request({path:"/playlists/{playlist_id}".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ke(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getPlaylist",value:(l=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getPlaylistTracksRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new j("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylistTracks.");case 2:return n={},a={},e.next=6,this.request({path:"/playlists/{playlist_id}/tracks".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ee(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getPlaylistTracks",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistTracksRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getTrendingPlaylistsRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.time&&(n.time=t.time),a={},e.next=5,this.request({path:"/playlists/trending",method:"GET",headers:a,query:n},r);case 5:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ne(e)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getTrendingPlaylists",value:(s=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingPlaylistsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"searchPlaylistsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new j("query","Required parameter requestParameters.query was null or undefined when calling searchPlaylists.");case 2:return n={},void 0!==t.query&&(n.query=t.query),a={},e.next=7,this.request({path:"/playlists/search",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return be(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"searchPlaylists",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchPlaylistsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),h}(U);function ze(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Xe=function(e){m(o,e);var t,a,s=ze(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"getTipsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.receiverMinFollowers&&(n.receiver_min_followers=t.receiverMinFollowers),void 0!==t.receiverIsVerified&&(n.receiver_is_verified=t.receiverIsVerified),void 0!==t.currentUserFollows&&(n.current_user_follows=t.currentUserFollows),void 0!==t.uniqueBy&&(n.unique_by=t.uniqueBy),a={},e.next=11,this.request({path:"/tips",method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new V(i,(function(e){return pe(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getTips",value:(t=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTipsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),o}(U);function $e(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ye=function(e){m(b,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k=$e(b);function b(){return n(this,b),k.apply(this,arguments)}return i(b,[{key:"getBulkTracksRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.permalink&&(n.permalink=t.permalink),t.id&&(n.id=t.id),a={},e.next=6,this.request({path:"/tracks",method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getBulkTracks",value:(w=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getBulkTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"getTrackRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new j("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrack.");case 2:return n={},a={},e.next=6,this.request({path:"/tracks/{track_id}".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ce(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getTrack",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getTrendingTracksRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),a={},e.next=6,this.request({path:"/tracks/trending",method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getTrendingTracks",value:(p=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getUndergroundTrendingTracksRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=6,this.request({path:"/tracks/trending/underground",method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUndergroundTrendingTracks",value:(l=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getUndergroundTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersionRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new j("version","Required parameter requestParameters.version was null or undefined when calling getUndergroundTrendingTracksWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=8,this.request({path:"/tracks/trending/underground/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersion",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUndergroundTrendingTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"searchTracksRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new j("query","Required parameter requestParameters.query was null or undefined when calling searchTracks.");case 2:return n={},void 0!==t.query&&(n.query=t.query),void 0!==t.onlyDownloadable&&(n.only_downloadable=t.onlyDownloadable),a={},e.next=8,this.request({path:"/tracks/search",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ue(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"searchTracks",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchTracksRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"streamTrackRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new j("trackId","Required parameter requestParameters.trackId was null or undefined when calling streamTrack.");case 2:return n={},void 0!==t.userSignature&&(n.user_signature=t.userSignature),void 0!==t.userData&&(n.user_data=t.userData),void 0!==t.premiumContentSignature&&(n.premium_content_signature=t.premiumContentSignature),a={},e.next=9,this.request({path:"/tracks/{track_id}/stream".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new z(i));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"streamTrack",value:(t=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamTrackRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),b}(U);function Ke(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Je=function(e){m(_e,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,I,E,T,S,P,q,A,O,C,U,L,N,B,D,G,M,H,W,z,X,$,K,Z,Q,ee,te,re,ae,oe,le,fe,pe,he,ye,me,we,ge,ke,be,xe=Ke(_e);function _e(){return n(this,_e),xe.apply(this,arguments)}return i(_e,[{key:"bulkGetSubscribersRaw",value:(be=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new j("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribers.");case 2:return n={},t.ids&&(n.ids=t.ids.join(F)),a={},e.next=7,this.request({path:"/users/subscribers",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Y(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return be.apply(this,arguments)})},{key:"bulkGetSubscribers",value:(ke=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ke.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequestRaw",value:(ge=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new j("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribersViaJSONRequest.");case 2:return n={},t.ids&&(n.ids=t.ids.join(F)),a={},e.next=7,this.request({path:"/users/subscribers",method:"POST",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Y(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return ge.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequest",value:(we=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersViaJSONRequestRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return we.apply(this,arguments)})},{key:"getConnectedWalletsRaw",value:(me=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getConnectedWallets.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/connected_wallets".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return J(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return me.apply(this,arguments)})},{key:"getConnectedWallets",value:(ye=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getConnectedWalletsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ye.apply(this,arguments)})},{key:"getFavoriteAlbumsRaw",value:(he=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFavoriteAlbums.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/favorites/albums".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ne(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return he.apply(this,arguments)})},{key:"getFavoriteAlbums",value:(pe=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoriteAlbumsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return pe.apply(this,arguments)})},{key:"getFavoritePlaylistsRaw",value:(fe=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFavoritePlaylists.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/favorites/playlists".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ne(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return fe.apply(this,arguments)})},{key:"getFavoritePlaylists",value:(le=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoritePlaylistsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return le.apply(this,arguments)})},{key:"getFavoritesRaw",value:(oe=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFavorites.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/favorites".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ne(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return oe.apply(this,arguments)})},{key:"getFavorites",value:(ae=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ae.apply(this,arguments)})},{key:"getFollowersRaw",value:(re=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFollowers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/followers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ie(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return re.apply(this,arguments)})},{key:"getFollowers",value:(te=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"getFollowingsRaw",value:(ee=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getFollowings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/following".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return se(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return ee.apply(this,arguments)})},{key:"getFollowings",value:(Q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Q.apply(this,arguments)})},{key:"getRelatedUsersRaw",value:(Z=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getRelatedUsers.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=8,this.request({path:"/users/{id}/related".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Te(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return Z.apply(this,arguments)})},{key:"getRelatedUsers",value:(K=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRelatedUsersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"getRepostsRaw",value:($=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/reposts".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Se(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return $.apply(this,arguments)})},{key:"getReposts",value:(X=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return X.apply(this,arguments)})},{key:"getRepostsByHandleRaw",value:(z=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new j("handle","Required parameter requestParameters.handle was null or undefined when calling getRepostsByHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/handle/{handle}/reposts".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Se(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"getRepostsByHandle",value:(W=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"getSubscribersRaw",value:(H=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSubscribers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/subscribers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Pe(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getSubscribers",value:(M=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getSupporterRaw",value:(G=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupporter.");case 2:if(null!==t.supporterUserId&&void 0!==t.supporterUserId){e.next=4;break}throw new j("supporterUserId","Required parameter requestParameters.supporterUserId was null or undefined when calling getSupporter.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporters/{supporter_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supporter_user_id","}"),encodeURIComponent(String(t.supporterUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ue(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"getSupporter",value:(D=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupporterRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getSupportersRaw",value:(B=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupporters.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=8,this.request({path:"/users/{id}/supporters".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ce(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"getSupporters",value:(N=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"getSupportingRaw",value:(L=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupporting.");case 2:if(null!==t.supportedUserId&&void 0!==t.supportedUserId){e.next=4;break}throw new j("supportedUserId","Required parameter requestParameters.supportedUserId was null or undefined when calling getSupporting.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporting/{supported_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supported_user_id","}"),encodeURIComponent(String(t.supportedUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new V(i,(function(e){return de(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getSupporting",value:(U=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getSupportingsRaw",value:(C=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getSupportings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),a={},e.next=8,this.request({path:"/users/{id}/supporting".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return de(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getSupportings",value:(O=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"getTopTrackTagsRaw",value:(A=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getTopTrackTags.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=8,this.request({path:"/users/{id}/tags".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new V(i,(function(e){return qe(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getTopTrackTags",value:(q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTopTrackTagsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getTopUsersRaw",value:(P=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Oe(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getTopUsers",value:(S=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"getTopUsersInGenreRaw",value:(T=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),t.genre&&(n.genre=t.genre),a={},e.next=7,this.request({path:"/users/genre/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ae(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getTopUsersInGenre",value:(E=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersInGenreRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"getTracksByUserRaw",value:(I=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getTracksByUser.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/{id}/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getTracksByUser",value:(R=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"getTracksByUserHandleRaw",value:(_=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new j("handle","Required parameter requestParameters.handle was null or undefined when calling getTracksByUserHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/handle/{handle}/tracks".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Le(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"getTracksByUserHandle",value:(x=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"getUserRaw",value:(b=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUser.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return je(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getUser",value:(k=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getUserByHandleRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new j("handle","Required parameter requestParameters.handle was null or undefined when calling getUserByHandle.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/handle/{handle}".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return je(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getUserByHandle",value:(w=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getUserIDFromWalletRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.associatedWallet&&void 0!==t.associatedWallet){e.next=2;break}throw new j("associatedWallet","Required parameter requestParameters.associatedWallet was null or undefined when calling getUserIDFromWallet.");case 2:return n={},void 0!==t.associatedWallet&&(n.associated_wallet=t.associatedWallet),a={},e.next=7,this.request({path:"/users/id",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Be(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getUserIDFromWallet",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserIDFromWalletRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getUserMonthlyTrackListensRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUserMonthlyTrackListens.");case 2:if(null!==t.startTime&&void 0!==t.startTime){e.next=4;break}throw new j("startTime","Required parameter requestParameters.startTime was null or undefined when calling getUserMonthlyTrackListens.");case 4:if(null!==t.endTime&&void 0!==t.endTime){e.next=6;break}throw new j("endTime","Required parameter requestParameters.endTime was null or undefined when calling getUserMonthlyTrackListens.");case 6:return n={},void 0!==t.startTime&&(n.start_time=t.startTime),void 0!==t.endTime&&(n.end_time=t.endTime),a={},e.next=12,this.request({path:"/users/{id}/listen_counts_monthly".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Ge(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getUserMonthlyTrackListens",value:(p=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserMonthlyTrackListensRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getUserReplicaSetRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUserReplicaSet.");case 2:return n={},a={},e.next=6,this.request({path:"/users/{id}/replica_set".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Me(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUserReplicaSet",value:(l=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserReplicaSetRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getUsersTrackHistoryRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new j("id","Required parameter requestParameters.id was null or undefined when calling getUsersTrackHistory.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},e.next=12,this.request({path:"/users/{id}/history/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new V(i,(function(e){return ve(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUsersTrackHistory",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersTrackHistoryRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"searchUsersRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new j("query","Required parameter requestParameters.query was null or undefined when calling searchUsers.");case 2:return n={},void 0!==t.query&&(n.query=t.query),a={},e.next=7,this.request({path:"/users/search",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return Fe(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"searchUsers",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchUsersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"verifyIDTokenRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.token&&void 0!==t.token){e.next=2;break}throw new j("token","Required parameter requestParameters.token was null or undefined when calling verifyIDToken.");case 2:return n={},void 0!==t.token&&(n.token=t.token),a={},e.next=7,this.request({path:"/users/verify_token",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new V(i,(function(e){return He(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"verifyIDToken",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.verifyIDTokenRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),_e}(U);function Ze(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Qe=function(e){m(s,e);var t,a=Ze(s);function s(e,t){var r;return n(this,s),(r=a.call(this,e)).discoveryNodeSelectorService=t,r}return i(s,[{key:"streamTrack",value:(t=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new j("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrack.");case 2:return r="/tracks/{track_id}/stream".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),e.next=5,this.discoveryNodeSelectorService.getSelectedEndpoint();case 5:return n=e.sent,e.abrupt("return","".concat(n).concat(A).concat(r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),s}(Ye);function et(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var tt=function(e){m(o,e);var t,a,s=et(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"resolveRaw",value:(a=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.url&&void 0!==t.url){e.next=2;break}throw new j("url","Required parameter requestParameters.url was null or undefined when calling resolve.");case 2:return r={},void 0!==t.url&&(r.url=t.url),n={},e.next=7,this.request({path:"/resolve",method:"GET",headers:n,query:r});case 7:return a=e.sent,e.abrupt("return",new V(a,(function(e){return Ce(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"resolve",value:(t=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveRaw(t);case 2:return e.next=4,e.sent.value();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),o}(U);function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],s=!0,o=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){o=!0,a=e}finally{try{s||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||R(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nt=Object.freeze({__proto__:null,default:{}}),at={node:nt,web:"object"===("undefined"==typeof self?"undefined":s(self))&&"crypto"in self?self.crypto:void 0};function it(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+s(e));if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function st(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every((function(e){return e instanceof Uint8Array})))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),a=new Uint8Array(n),i=0,s=0;i<t.length;i++){var o=t[i];a.set(o,s),s+=o.length}return a}var ot="AES-GCM",ut={name:"AES-GCM",length:256};function ct(e,t){return lt.apply(this,arguments)}function lt(){return(lt=r(f.mark((function e(t,r){var n,a,i,s,o,u,c,l,d,p;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof r&&(r=pt.utf8ToBytes(r)),n=pt.randomBytes(12),!at.web){e.next=16;break}return e.next=5,at.web.subtle.importKey("raw",t,ut,!0,["encrypt"]);case 5:return a=e.sent,e.next=8,at.web.subtle.encrypt({name:ot,iv:n},a,r);case 8:return i=e.sent,s=new Uint8Array(i),(o=new Uint8Array(n.length+s.byteLength)).set(n,0),o.set(s,n.length),e.abrupt("return",o);case 16:return u=at.node.createCipheriv("aes-256-gcm",t,n),c=u.update(r,void 0,"hex"),c+=u.final("hex"),l=it(c),d=u.getAuthTag(),p=st(n,l,d),e.abrupt("return",p);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dt(e,t){return ft.apply(this,arguments)}function ft(){return(ft=r(f.mark((function e(t,r){var n,a,i,s,o,u,c,l,d,p;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof r&&(r=it(r)),n=r.slice(0,12),!at.web){e.next=13;break}return a=r.slice(12),e.next=6,at.web.subtle.importKey("raw",t,ut,!0,["decrypt"]);case 6:return i=e.sent,e.next=9,at.web.subtle.decrypt({name:ot,iv:n},i,a);case 9:return s=e.sent,e.abrupt("return",new Uint8Array(s));case 13:return o=r.slice(12,-16),u=r.slice(-16),(c=at.node.createDecipheriv("aes-256-gcm",t,n)).setAuthTag(u),l=c.update(o),d=Uint8Array.from(c.final()),p=st(l,d),e.abrupt("return",p);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pt={randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(at.web)return at.web.getRandomValues(new Uint8Array(e));if(at.node){var t=at.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},bytesToUtf8:function(e){return(new TextDecoder).decode(e)},utf8ToBytes:function(e){return(new TextEncoder).encode(e)},hexToBytes:it,concatBytes:st};function ht(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return vt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function vt(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}
|
|
4
|
+
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yt(e){if(!Number.isSafeInteger(e))throw new Error("Wrong integer: ".concat(e))}function mt(){for(var e=function(e,t){return function(r){return e(t(r))}},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=Array.from(r).reverse().reduce((function(t,r){return t?e(t,r.encode):r.encode}),void 0),i=r.reduce((function(t,r){return t?e(t,r.decode):r.decode}),void 0);return{encode:a,decode:i}}function wt(e){return{encode:function(t){if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((function(t){if(yt(t),t<0||t>=e.length)throw new Error("Digit index outside alphabet: ".concat(t," (alphabet: ").concat(e.length,")"));return e[t]}))},decode:function(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((function(t){if("string"!=typeof t)throw new Error("alphabet.decode: not string element=".concat(t));var r=e.indexOf(t);if(-1===r)throw new Error('Unknown letter: "'.concat(t,'". Allowed: ').concat(e));return r}))}}}function gt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"!=typeof e)throw new Error("join separator should be string");return{encode:function(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");var r,n=ht(t);try{for(n.s();!(r=n.n()).done;){var a=r.value;if("string"!=typeof a)throw new Error("join.encode: non-string input=".concat(a))}}catch(e){n.e(e)}finally{n.f()}return t.join(e)},decode:function(t){if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function kt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";if(yt(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode:function(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");var n,a=ht(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("string"!=typeof i)throw new Error("padding.encode: non-string input=".concat(i))}}catch(e){a.e(e)}finally{a.f()}for(;r.length*e%8;)r.push(t);return r},decode:function(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");var n,a=ht(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("string"!=typeof i)throw new Error("padding.decode: non-string input=".concat(i))}}catch(e){a.e(e)}finally{a.f()}var s=r.length;if(s*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;s>0&&r[s-1]===t;s--)if(!((s-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,s)}}}function bt(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:function(e){return e},decode:function(t){return e(t)}}}function xt(e,t,r){if(t<2)throw new Error("convertRadix: wrong from=".concat(t,", base cannot be less than 2"));if(r<2)throw new Error("convertRadix: wrong to=".concat(r,", base cannot be less than 2"));if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];var n=0,a=[],i=Array.from(e);for(i.forEach((function(e){if(yt(e),e<0||e>=t)throw new Error("Wrong integer: ".concat(e))}));;){for(var s=0,o=!0,u=n;u<i.length;u++){var c=i[u],l=t*s+c;if(!Number.isSafeInteger(l)||t*s/t!==s||l-c!=t*s)throw new Error("convertRadix: carry overflow");if(s=l%r,i[u]=Math.floor(l/r),!Number.isSafeInteger(i[u])||i[u]*r+s!==l)throw new Error("convertRadix: carry overflow");o&&(i[u]?o=!1:n=u)}if(a.push(s),o)break}for(var d=0;d<e.length-1&&0===e[d];d++)a.push(0);return a.reverse()}var _t=function e(t,r){return r?e(r,t%r):t},Rt=function(e,t){return e+(t-_t(e,t))};function It(e,t,r,n){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error("convertRadix2: wrong from=".concat(t));if(r<=0||r>32)throw new Error("convertRadix2: wrong to=".concat(r));if(Rt(t,r)>32)throw new Error("convertRadix2: carry overflow from=".concat(t," to=").concat(r," carryBits=").concat(Rt(t,r)));var a,i=0,s=0,o=Math.pow(2,r)-1,u=[],c=ht(e);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(yt(l),l>=Math.pow(2,t))throw new Error("convertRadix2: invalid data word=".concat(l," from=").concat(t));if(i=i<<t|l,s+t>32)throw new Error("convertRadix2: carry overflow pos=".concat(s," from=").concat(t));for(s+=t;s>=r;s-=r)u.push((i>>s-r&o)>>>0);i&=Math.pow(2,s)-1}}catch(e){c.e(e)}finally{c.f()}if(i=i<<r-s&o,!n&&s>=t)throw new Error("Excess padding");if(!n&&i)throw new Error("Non-zero padding: ".concat(i));return n&&s>0&&u.push(i>>>0),u}function Et(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(yt(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Rt(8,e)>32||Rt(e,8)>32)throw new Error("radix2: carry overflow");return{encode:function(r){if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return It(Array.from(r),8,e,!t)},decode:function(r){if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(It(r,e,8,t))}}}function Tt(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(null,r)}catch(e){}}}var St=mt(Et(4),wt("0123456789ABCDEF"),gt("")),Pt=mt(Et(5),wt("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),kt(5),gt(""));mt(Et(5),wt("0123456789ABCDEFGHIJKLMNOPQRSTUV"),kt(5),gt("")),mt(Et(5),wt("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),gt(""),bt((function(e){return e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")})));var qt=mt(Et(6),wt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),kt(6),gt("")),At=mt(Et(6),wt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),kt(6),gt("")),Ot=function(e){return mt((yt(t=58),{encode:function(e){if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return xt(Array.from(e),Math.pow(2,8),t)},decode:function(e){if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(xt(e,t,Math.pow(2,8)))}}),wt(e),gt(""));var t},Ct=Ot("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Ot("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Ot("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var Ut=[0,2,3,5,6,7,9,10,11],Lt={encode:function(e){for(var t="",r=0;r<e.length;r+=8){var n=e.subarray(r,r+8);t+=Ct.encode(n).padStart(Ut[n.length],"1")}return t},decode:function(e){for(var t=[],r=0;r<e.length;r+=11){for(var n=e.slice(r,r+11),a=Ut.indexOf(n.length),i=Ct.decode(n),s=0;s<i.length-a;s++)if(0!==i[s])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(i.slice(i.length-a)))}return Uint8Array.from(t)}},Nt=mt(wt("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),gt("")),Bt=[996825010,642813549,513874426,1027748829,705979059];function Dt(e){for(var t=e>>25,r=(33554431&e)<<5,n=0;n<Bt.length;n++)1==(t>>n&1)&&(r^=Bt[n]);return r}function jt(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=e.length,a=1,i=0;i<n;i++){var s=e.charCodeAt(i);if(s<33||s>126)throw new Error("Invalid prefix (".concat(e,")"));a=Dt(a)^s>>5}a=Dt(a);for(var o=0;o<n;o++)a=Dt(a)^31&e.charCodeAt(o);var u,c=ht(t);try{for(c.s();!(u=c.n()).done;){var l=u.value;a=Dt(a)^l}}catch(e){c.e(e)}finally{c.f()}for(var d=0;d<6;d++)a=Dt(a);return a^=r,Nt.encode(It([a%Math.pow(2,30)],30,5,!1))}function Ft(e){var t="bech32"===e?1:734539939,r=Et(5),n=r.decode,a=r.encode,i=Tt(n);function o(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:90;if("string"!=typeof e)throw new Error("bech32.decode input should be string, not ".concat(s(e)));if(e.length<8||!1!==r&&e.length>r)throw new TypeError("Wrong string length: ".concat(e.length," (").concat(e,"). Expected (8..").concat(r,")"));var n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");var a=(e=n).lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');var i=e.slice(0,a),o=e.slice(a+1);if(o.length<6)throw new Error("Data must be at least 6 characters long");var u=Nt.decode(o).slice(0,-6),c=jt(i,u,t);if(!o.endsWith(c))throw new Error("Invalid checksum in ".concat(e,': expected "').concat(c,'"'));return{prefix:i,words:u}}return{encode:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90;if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not ".concat(s(e)));if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not ".concat(s(r)));var a=e.length+7+r.length;if(!1!==n&&a>n)throw new TypeError("Length ".concat(a," exceeds limit ").concat(n));return e=e.toLowerCase(),"".concat(e,"1").concat(Nt.encode(r)).concat(jt(e,r,t))},decode:o,decodeToBytes:function(e){var t=o(e,!1),r=t.prefix,a=t.words;return{prefix:r,words:a,bytes:n(a)}},decodeUnsafe:Tt(o),fromWords:n,fromWordsUnsafe:i,toWords:a}}Ft("bech32"),Ft("bech32m");var Gt={utf8:{encode:function(e){return(new TextDecoder).decode(e)},decode:function(e){return(new TextEncoder).encode(e)}},hex:mt(Et(4),wt("0123456789abcdef"),gt(""),bt((function(e){if("string"!=typeof e||e.length%2)throw new TypeError("hex.decode: expected string, got ".concat(s(e)," with length ").concat(e.length));return e.toLowerCase()}))),base16:St,base32:Pt,base64:qt,base64url:At,base58:Ct,base58xmr:Lt};function Mt(e){var t=new Error(e);return t.source="ulid",t}"Invalid encoding type. Available types: ".concat(Object.keys(Gt).join(", "));var Ht="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Wt=Ht.length,Vt=Math.pow(2,48)-1;function zt(e){var t=Math.floor(e()*Wt);return t===Wt&&(t=Wt-1),Ht.charAt(t)}var Xt,$t=(Xt||(Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];t||(t="undefined"!=typeof window?window:null);var r=t&&(t.crypto||t.msCrypto);if(r)return function(){var e=new Uint8Array(1);return r.getRandomValues(e),e[0]/255};try{var n=require("crypto");return function(){return n.randomBytes(1).readUInt8()/255}}catch(e){}if(e){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch(e){}return function(){return Math.random()}}throw Mt("secure crypto unusable, insecure Math.random not allowed")}()),function(e){return isNaN(e)&&(e=Date.now()),function(e,t){if(isNaN(e))throw new Error(e+" must be a number");if(e>Vt)throw Mt("cannot encode time greater than "+Vt);if(e<0)throw Mt("time must be positive");if(!1===Number.isInteger(e))throw Mt("time must be an integer");for(var r=void 0,n="";t>0;t--)n=Ht.charAt(r=e%Wt)+n,e=(e-r)/Wt;return n}(e,10)+function(e,t){for(var r="";e>0;e--)r=zt(t)+r;return r}(16,Xt)});function Yt(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Kt=BigInt(0),Jt=BigInt(1),Zt=BigInt(2),Qt=BigInt(3),er=BigInt(8),tr=Object.freeze({a:Kt,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:Jt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});function rr(e){var t=tr.a,r=tr.b,n=_r(e*e),a=_r(n*e);return _r(a+t*e+r)}var nr=tr.a===Kt,ar=function(e){m(r,e);var t=Yt(r);function r(e){return n(this,r),t.call(this,e)}return i(r)}(x(Error)),ir=function(){function e(t,r,a){n(this,e),this.x=t,this.y=r,this.z=a}return i(e,[{key:"equals",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint expected");var r=this.x,n=this.y,a=this.z,i=t.x,s=t.y,o=t.z,u=_r(a*a),c=_r(o*o),l=_r(r*c),d=_r(i*u),f=_r(_r(n*o)*c),p=_r(_r(s*a)*u);return l===d&&f===p}},{key:"negate",value:function(){return new e(this.x,_r(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,r=this.y,n=this.z,a=_r(t*t),i=_r(r*r),s=_r(i*i),o=t+i,u=_r(Zt*(_r(o*o)-a-s)),c=_r(Qt*a),l=_r(c*c),d=_r(l-Zt*u);return new e(d,_r(c*(u-d)-er*s),_r(Zt*r*n))}},{key:"add",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint expected");var r=this.x,n=this.y,a=this.z,i=t.x,s=t.y,o=t.z;if(i===Kt||s===Kt)return this;if(r===Kt||n===Kt)return t;var u=_r(a*a),c=_r(o*o),l=_r(r*c),d=_r(i*u),f=_r(_r(n*o)*c),p=_r(_r(s*a)*u),h=_r(d-l),v=_r(p-f);if(h===Kt)return v===Kt?this.double():e.ZERO;var y=_r(h*h),m=_r(h*y),w=_r(l*y),g=_r(v*v-m-Zt*w);return new e(g,_r(v*(w-g)-f*m),_r(a*o*h))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var r=e.ZERO;if("bigint"==typeof t&&t===Kt)return r;var n=xr(t);if(n===Jt)return this;if(!nr){for(var a=r,i=this;n>Kt;)n&Jt&&(a=a.add(i)),i=i.double(),n>>=Jt;return a}for(var s=qr(n),o=s.k1neg,u=s.k1,c=s.k2neg,l=s.k2,d=r,f=r,p=this;u>Kt||l>Kt;)u&Jt&&(d=d.add(p)),l&Jt&&(f=f.add(p)),p=p.double(),u>>=Jt,l>>=Jt;return o&&(d=d.negate()),c&&(f=f.negate()),f=new e(_r(f.x*tr.beta),f.y,f.z),d.add(f)}},{key:"precomputeWindow",value:function(e){for(var t=nr?128/e+1:256/e+1,r=[],n=this,a=n,i=0;i<t;i++){a=n,r.push(a);for(var s=1;s<Math.pow(2,e-1);s++)a=a.add(n),r.push(a);n=a.double()}return r}},{key:"wNAF",value:function(t,r){!r&&this.equals(e.BASE)&&(r=or.BASE);var n=r&&r._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");var a=r&&sr.get(r);a||(a=this.precomputeWindow(n),r&&1!==n&&(a=e.normalizeZ(a),sr.set(r,a)));for(var i=e.ZERO,s=e.ZERO,o=1+(nr?128/n:256/n),u=Math.pow(2,n-1),c=BigInt(Math.pow(2,n)-1),l=Math.pow(2,n),d=BigInt(n),f=0;f<o;f++){var p=f*u,h=Number(t&c);if(t>>=d,h>u&&(h-=l,t+=Jt),0===h){var v=a[p];f%2&&(v=v.negate()),s=s.add(v)}else{var y=a[p+Math.abs(h)-1];h<0&&(y=y.negate()),i=i.add(y)}}return{p:i,f:s}}},{key:"multiply",value:function(t,r){var n,a,i=xr(t);if(nr){var s=qr(i),o=s.k1neg,u=s.k1,c=s.k2neg,l=s.k2,d=this.wNAF(u,r),f=d.p,p=d.f,h=this.wNAF(l,r),v=h.p,y=h.f;o&&(f=f.negate()),c&&(v=v.negate()),v=new e(_r(v.x*tr.beta),v.y,v.z),n=f.add(v),a=p.add(y)}else{var m=this.wNAF(i,r);n=m.p,a=m.f}return e.normalizeZ([n,a])[0]}},{key:"toAffine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ir(this.z),t=this.x,r=this.y,n=this.z,a=e,i=_r(a*a),s=_r(i*a),o=_r(t*i),u=_r(r*s),c=_r(n*a);if(c!==Jt)throw new Error("invZ was invalid");return new or(o,u)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof or))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new e(t.x,t.y,Jt)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tr.P,r=new Array(e.length),n=Ir(e.reduce((function(e,n,a){return n===Kt?e:(r[a]=e,_r(e*n,t))}),Jt),t);return e.reduceRight((function(e,n,a){return n===Kt?e:(r[a]=_r(e*r[a],t),_r(e*n,t))}),n),r}(e.map((function(e){return e.z})));return e.map((function(e,r){return e.toAffine(t[r])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();ir.BASE=new ir(tr.Gx,tr.Gy,Jt),ir.ZERO=new ir(Kt,Jt,Kt);var sr=new WeakMap,or=function(){function e(t,r){n(this,e),this.x=t,this.y=r}return i(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,sr.delete(this)}},{key:"hasEvenY",value:function(){return this.y%Zt===Kt}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return gr(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=vr(this.x);if(e){var r=this.hasEvenY()?"02":"03";return"".concat(r).concat(t)}return"04".concat(t).concat(vr(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,r=this.y;if(!Or(t)||!Or(r))throw new Error(e);var n=_r(r*r);if(_r(n-rr(t))!==Kt)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,_r(-this.y))}},{key:"double",value:function(){return ir.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ir.fromAffine(this).add(ir.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ir.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,r,n){var a=ir.fromAffine(this),i=r===Kt||r===Jt||this!==e.BASE?a.multiplyUnsafe(r):a.multiply(r),s=ir.fromAffine(t).multiplyUnsafe(n),o=i.add(s);return o.equals(ir.ZERO)?void 0:o.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var r=32===t.length,n=kr(r?t:t.subarray(1));if(!Or(n))throw new Error("Point is not on curve");var a=function(e){var t=tr.P,r=BigInt(6),n=BigInt(11),a=BigInt(22),i=BigInt(23),s=BigInt(44),o=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=Rr(c,Qt)*c%t,d=Rr(l,Qt)*c%t,f=Rr(d,Zt)*u%t,p=Rr(f,n)*f%t,h=Rr(p,a)*p%t,v=Rr(h,s)*h%t,y=Rr(v,o)*v%t,m=Rr(y,s)*h%t,w=Rr(m,Qt)*c%t,g=Rr(w,i)*p%t,k=Rr(g,r)*u%t;return Rr(k,Zt)}(rr(n)),i=(a&Jt)===Jt;r?i&&(a=_r(-a)):1==(1&t[0])!==i&&(a=_r(-a));var s=new e(n,a);return s.assertValidity(),s}},{key:"fromUncompressedHex",value:function(t){var r=new e(kr(t.subarray(1,33)),kr(t.subarray(33,65)));return r.assertValidity(),r}},{key:"fromHex",value:function(e){var t=br(e),r=t.length,n=t[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ".concat(r))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Cr(t))}},{key:"fromSignature",value:function(t,r,n){var a=function(e){var t=tr.n,r=8*e.length-256,n=kr(e);r>0&&(n>>=BigInt(r));n>=t&&(n-=t);return n}(t=br(t)),i=function(e){if(e instanceof lr)return e.assertValidity(),e;try{return lr.fromDER(e)}catch(t){return lr.fromCompact(e)}}(r),s=i.r,o=i.s;if(0!==n&&1!==n)throw new Error("Cannot recover signature: invalid recovery bit");var u=1&n?"03":"02",c=e.fromHex(u+vr(s)),l=tr.n,d=Ir(s,l),f=_r(-a*d,l),p=_r(o*d,l),h=e.BASE.multiplyAndAddUnsafe(c,f,p);if(!h)throw new Error("Cannot recover signature: point at infinify");return h.assertValidity(),h}}]),e}();function ur(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function cr(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(pr(e)));var t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:kr(r),left:e.subarray(t+2)}}or.BASE=new or(tr.Gx,tr.Gy),or.ZERO=new or(Kt,Kt);var lr=function(){function e(t,r){n(this,e),this.r=t,this.s=r,this.assertValidity()}return i(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!Ar(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Ar(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=tr.n>>Jt;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,tr.n-this.s):this}},{key:"toDERRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return gr(this.toDERHex(e))}},{key:"toDERHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ur(mr(this.s));if(e)return t;var r=ur(mr(this.r)),n=mr(r.length/2),a=mr(t.length/2),i=mr(r.length/2+t.length/2+4);return"30".concat(i,"02").concat(n).concat(r,"02").concat(a).concat(t)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return gr(this.toCompactHex())}},{key:"toCompactHex",value:function(){return vr(this.r)+vr(this.s)}}],[{key:"fromCompact",value:function(t){var r=t instanceof Uint8Array,n="Signature.fromCompact";if("string"!=typeof t&&!r)throw new TypeError("".concat(n,": Expected string or Uint8Array"));var a=r?pr(t):t;if(128!==a.length)throw new Error("".concat(n,": Expected 64-byte hex"));return new e(wr(a.slice(0,64)),wr(a.slice(64,128)))}},{key:"fromDER",value:function(t){var r=t instanceof Uint8Array;if("string"!=typeof t&&!r)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var n=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(pr(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=cr(e.subarray(2)),r=t.data,n=cr(t.left),a=n.data,i=n.left;if(i.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(pr(i)));return{r:r,s:a}}(r?t:gr(t));return new e(n.r,n.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function dr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every((function(e){return e instanceof Uint8Array})))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),a=new Uint8Array(n),i=0,s=0;i<t.length;i++){var o=t[i];a.set(o,s),s+=o.length}return a}var fr=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function pr(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var t="",r=0;r<e.length;r++)t+=fr[e[r]];return t}var hr=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function vr(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(Kt<=e&&e<hr))throw new Error("Expected number < 2^256");return e.toString(16).padStart(64,"0")}function yr(e){var t=gr(vr(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function mr(e){var t=e.toString(16);return 1&t.length?"0".concat(t):t}function wr(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+s(e));return BigInt("0x".concat(e))}function gr(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+s(e));if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function kr(e){return wr(pr(e))}function br(e){return e instanceof Uint8Array?Uint8Array.from(e):gr(e)}function xr(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&Ar(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function _r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tr.P,r=e%t;return r>=Kt?r:t+r}function Rr(e,t){for(var r=tr.P,n=e;t-- >Kt;)n*=n,n%=r;return n}function Ir(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tr.P;if(e===Kt||t<=Kt)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var r=_r(e,t),n=t,a=Kt,i=Jt;r!==Kt;){var s=n/r,o=n%r,u=a-i*s;n=r,r=o,a=i,i=u}var c=n;if(c!==Jt)throw new Error("invert: does not exist");return _r(a,t)}var Er,Tr,Sr=function(e,t){return(e+t/Zt)/t},Pr={a1:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),b1:-Jt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a2:BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),b2:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),POW_2_128:BigInt("0x100000000000000000000000000000000")};function qr(e){var t=tr.n,r=Pr.a1,n=Pr.b1,a=Pr.a2,i=Pr.b2,s=Pr.POW_2_128,o=Sr(i*e,t),u=Sr(-n*e,t),c=_r(e-o*r-u*a,t),l=_r(-o*n-u*i,t),d=c>s,f=l>s;if(d&&(c=t-c),f&&(l=t-l),c>s||l>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:f,k2:l}}function Ar(e){return Kt<e&&e<tr.n}function Or(e){return Kt<e&&e<tr.P}function Cr(e){var t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=wr(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=kr(e)}if(!Ar(t))throw new Error("Expected private key: 0 < key < n");return t}or.BASE._setWindowSize(8);var Ur,Lr,Nr,Br={node:nt,web:"object"===("undefined"==typeof self?"undefined":s(self))&&"crypto"in self?self.crypto:void 0},Dr={},jr={bytesToHex:pr,hexToBytes:gr,concatBytes:dr,mod:_r,invert:Ir,isValidPrivateKey:function(e){try{return Cr(e),!0}catch(e){return!1}},_bigintTo32Bytes:yr,_normalizePrivateKey:Cr,hashToPrivateKey:function(e){if((e=br(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return yr(_r(kr(e),tr.n-Jt)+Jt)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Br.web)return Br.web.getRandomValues(new Uint8Array(e));if(Br.node){var t=Br.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return jr.hashToPrivateKey(jr.randomBytes(40))},sha256:(Nr=r(f.mark((function e(){var t,r,n,a,i,s,o=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=o.length,r=new Array(t),n=0;n<t;n++)r[n]=o[n];if(!Br.web){e.next=8;break}return e.next=4,Br.web.subtle.digest("SHA-256",dr.apply(void 0,r));case 4:return a=e.sent,e.abrupt("return",new Uint8Array(a));case 8:if(!Br.node){e.next=15;break}return i=Br.node.createHash,s=i("sha256"),r.forEach((function(e){return s.update(e)})),e.abrupt("return",Uint8Array.from(s.digest()));case 15:throw new Error("The environment doesn't have sha256 function");case 16:case"end":return e.stop()}}),e)}))),function(){return Nr.apply(this,arguments)}),hmacSha256:(Lr=r(f.mark((function e(t){var r,n,a,i,s,o,u,c,l=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=l.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=l[a];if(!Br.web){e.next=12;break}return e.next=4,Br.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);case 4:return i=e.sent,s=dr.apply(void 0,n),e.next=8,Br.web.subtle.sign("HMAC",i,s);case 8:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 12:if(!Br.node){e.next=19;break}return u=Br.node.createHmac,c=u("sha256",t),n.forEach((function(e){return c.update(e)})),e.abrupt("return",Uint8Array.from(c.digest()));case 19:throw new Error("The environment doesn't have hmac-sha256 function");case 20:case"end":return e.stop()}}),e)}))),function(e){return Lr.apply(this,arguments)}),sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:(Ur=r(f.mark((function e(t){var r,n,a,i,s,o=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(r=Dr[t])){e.next=7;break}return e.next=4,jr.sha256(Uint8Array.from(t,(function(e){return e.charCodeAt(0)})));case 4:n=e.sent,r=dr(n,n),Dr[t]=r;case 7:for(a=o.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=o[s];return e.abrupt("return",jr.sha256.apply(jr,[r].concat(i)));case 9:case"end":return e.stop()}}),e)}))),function(e){return Ur.apply(this,arguments)}),taggedHashSync:function(e){if("function"!=typeof Er)throw new ar("sha256Sync is undefined, you need to set it");var t=Dr[e];if(void 0===t){var r=Er(Uint8Array.from(e,(function(e){return e.charCodeAt(0)})));t=dr(r,r),Dr[e]=t}for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return Er.apply(void 0,[t].concat(a))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:or.BASE,r=t===or.BASE?t:new or(t.x,t.y);return r._setWindowSize(e),r.multiply(Qt),r}};Object.defineProperties(jr,{sha256Sync:{configurable:!1,get:function(){return Er},set:function(e){Er||(Er=e)}},hmacSha256Sync:{configurable:!1,get:function(){return Tr},set:function(e){Tr||(Tr=e)}}});var Fr="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Gr=null;"undefined"!=typeof WebSocket?Gr=WebSocket:"undefined"!=typeof MozWebSocket?Gr=MozWebSocket:void 0!==Fr?Gr=Fr.WebSocket||Fr.MozWebSocket:"undefined"!=typeof window?Gr=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(Gr=self.WebSocket||self.MozWebSocket);var Mr,Hr=Gr,Wr={exports:{}},Vr="object"===("undefined"==typeof Reflect?"undefined":s(Reflect))?Reflect:null,zr=Vr&&"function"==typeof Vr.apply?Vr.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Mr=Vr&&"function"==typeof Vr.ownKeys?Vr.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Xr=Number.isNaN||function(e){return e!=e};function $r(){$r.init.call(this)}Wr.exports=$r,Wr.exports.once=function(e,t){return new Promise((function(r,n){function a(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",a),r([].slice.call(arguments))}an(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&an(e,"error",t,r)}(e,a,{once:!0})}))},$r.EventEmitter=$r,$r.prototype._events=void 0,$r.prototype._eventsCount=0,$r.prototype._maxListeners=void 0;var Yr=10;function Kr(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+s(e))}function Jr(e){return void 0===e._maxListeners?$r.defaultMaxListeners:e._maxListeners}function Zr(e,t,r,n){var a,i,s,o;if(Kr(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(a=Jr(e))>0&&s.length>a&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,o=u,console&&console.warn&&console.warn(o)}return e}function Qr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function en(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=Qr.bind(n);return a.listener=r,n.wrapFn=a,a}function tn(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):nn(a,a.length)}function rn(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function nn(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function an(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+s(e));e.addEventListener(t,(function a(i){n.once&&e.removeEventListener(t,a),r(i)}))}}Object.defineProperty($r,"defaultMaxListeners",{enumerable:!0,get:function(){return Yr},set:function(e){if("number"!=typeof e||e<0||Xr(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Yr=e}}),$r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},$r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Xr(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},$r.prototype.getMaxListeners=function(){return Jr(this)},$r.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var o=a[e];if(void 0===o)return!1;if("function"==typeof o)zr(o,this,t);else{var u=o.length,c=nn(o,u);for(r=0;r<u;++r)zr(c[r],this,t)}return!0},$r.prototype.addListener=function(e,t){return Zr(this,e,t,!1)},$r.prototype.on=$r.prototype.addListener,$r.prototype.prependListener=function(e,t){return Zr(this,e,t,!0)},$r.prototype.once=function(e,t){return Kr(t),this.on(e,en(this,e,t)),this},$r.prototype.prependOnceListener=function(e,t){return Kr(t),this.prependListener(e,en(this,e,t)),this},$r.prototype.removeListener=function(e,t){var r,n,a,i,s;if(Kr(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},$r.prototype.off=$r.prototype.removeListener,$r.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},$r.prototype.listeners=function(e){return tn(this,e,!0)},$r.prototype.rawListeners=function(e){return tn(this,e,!1)},$r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):rn.call(e,t)},$r.prototype.listenerCount=rn,$r.prototype.eventNames=function(){return this._eventsCount>0?Mr(this._events):[]};var sn=Wr.exports;function on(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function un(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?on(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function cn(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var ln=function(e){m(D,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,E,T,S,P,q,A,O,C,U,L,N,B=cn(D);function D(e,t,r){var a;return n(this,D),(a=B.call(this,e)).walletService=t,a.discoveryNodeSelectorService=r,a.chatSecrets={},a.eventEmitter=new sn,a.addEventListener=a.eventEmitter.addListener.bind(a.eventEmitter),a.removeEventListener=a.eventEmitter.removeListener.bind(a.eventEmitter),a.discoveryNodeSelectorService.addEventListener("change",(function(e){a.websocket&&(a.websocket.close(),a.createWebsocket(e).then((function(e){a.websocket=e})))})),a}return i(D,[{key:"listen",value:(N=r(f.mark((function e(){var t;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.discoveryNodeSelectorService.getSelectedEndpoint();case 2:if(!(t=e.sent)){e.next=9;break}return e.next=6,this.createWebsocket(t);case 6:this.websocket=e.sent,e.next=10;break;case 9:throw new Error("No services available to listen to");case 10:case"end":return e.stop()}}),e,this)}))),function(){return N.apply(this,arguments)})},{key:"get",value:(L=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","getChat"),e.next=3,this.getRaw(t.chatId);case 3:if(r=e.sent,e.t0=un,e.t1=un({},r),e.t2={},!r.data){e.next=13;break}return e.next=10,this.decryptLastChatMessage(r.data);case 10:e.t3=e.sent,e.next=14;break;case 13:e.t3=r.data;case 14:return e.t4=e.t3,e.t5={data:e.t4},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t5));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return L.apply(this,arguments)})},{key:"getAll",value:(U=r(f.mark((function e(t){var n,a,i,s,o=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={timestamp:(new Date).getTime()},null!=t&&t.limit&&(n.limit=t.limit),null!=t&&t.before&&(n.before=t.before),null!=t&&t.after&&(n.after=t.after),e.next=7,this.signAndSendRequest({method:"GET",headers:{},path:"/comms/chats",query:n});case 7:return a=e.sent,e.next=10,a.json();case 10:return i=e.sent,e.next=13,Promise.all(i.data.map(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.decryptLastChatMessage(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 13:return s=e.sent,e.abrupt("return",un(un({},i),{},{data:s}));case 15:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"getMessages",value:(C=r(f.mark((function e(t){var n,a,i,s,o,u,c=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","getMessages"),e.next=3,this.getChatSecret(t.chatId);case 3:return n=e.sent,a="/comms/chats/".concat(t.chatId,"/messages"),i={timestamp:(new Date).getTime()},t.limit&&(i.limit=t.limit),t.before&&(i.before=t.before),t.after&&(i.after=t.after),e.next=11,this.signAndSendRequest({method:"GET",headers:{},path:a,query:i});case 11:return s=e.sent,e.next=14,s.json();case 14:return o=e.sent,e.next=17,Promise.all(o.data.map(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=un,e.t1=un({},t),e.t2={},e.next=5,c.decryptString(n,qt.decode(t.message)).catch((function(e){return console.error("[audius-sdk]: Error: Couldn't decrypt chat message",t,e),"Error: Couldn't decrypt message"}));case 5:return e.t3=e.sent,e.t4={message:e.t3},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t4));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 17:return u=e.sent,e.abrupt("return",un(un({},o),{},{data:u}));case 19:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"getPermissions",value:(O=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={timestamp:(new Date).getTime()},null!=t&&t.userIds&&(r.id=t.userIds),e.next=4,this.signAndSendRequest({method:"GET",path:"/comms/chats/permissions",headers:{},query:r});case 4:return n=e.sent,e.next=7,n.json();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"getBlockers",value:(A=r(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={timestamp:(new Date).getTime()},e.next=3,this.signAndSendRequest({method:"GET",path:"/comms/chats/blockers",headers:{},query:t});case 3:return r=e.sent,e.next=6,r.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(){return A.apply(this,arguments)})},{key:"getBlockees",value:(q=r(f.mark((function e(){var t,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={timestamp:(new Date).getTime()},e.next=3,this.signAndSendRequest({method:"GET",path:"/comms/chats/blockees",headers:{},query:t});case 3:return r=e.sent,e.next=6,r.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"unfurl",value:(P=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.urls,"requestParameters.urls","unfurl"),this.assertMinLength(t.urls,"requestParameters.urls","unfurl"),r={content:t.urls},e.next=5,this.request({method:"GET",path:"/comms/unfurl",query:r,headers:{}});case 5:return n=e.sent,e.next=8,n.json();case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"create",value:(S=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","create"),this.assertNotNullOrUndefined(t.invitedUserIds,"requestParameters.invitedUserIds","create"),this.assertMinLength(t.invitedUserIds,"requestParameters.invitedUserIds","create"),r=[t.userId].concat(I(t.invitedUserIds)).sort().join(":"),n=jr.randomPrivateKey(),this.chatSecrets[r]=n,e.next=8,this.createInvites(t.userId,t.invitedUserIds,n);case 8:return a=e.sent,e.next=11,this.sendRpc({method:"chat.create",params:{chat_id:r,invites:a}});case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"invite",value:(T=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","invite"),this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","invite"),this.assertNotNullOrUndefined(t.invitedUserIds,"requestParameters.invitedUserIds","invite"),this.assertMinLength(t.invitedUserIds,"requestParameters.invitedUserIds","invite"),e.next=6,this.getChatSecret(t.chatId);case 6:return r=e.sent,e.next=9,this.createInvites(t.userId,t.invitedUserIds,r);case 9:return n=e.sent,e.next=12,this.sendRpc({method:"chat.invite",params:{chat_id:t.chatId,invites:n}});case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"message",value:(E=r(f.mark((function e(t){var r,n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","message"),this.assertNotNullOrUndefined(t.message,"requestParameters.message","message"),e.next=4,this.getChatSecret(t.chatId);case 4:return n=e.sent,e.next=7,this.encryptString(n,t.message);case 7:return a=e.sent,i=qt.encode(a),e.next=11,this.sendRpc({method:"chat.message",params:{chat_id:t.chatId,message_id:null!==(r=t.messageId)&&void 0!==r?r:$t(),message:i}});case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"react",value:(R=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","react"),this.assertNotNullOrUndefined(t.messageId,"requestParameters.messageId","react"),this.assertNotUndefined(t.reaction,"requestParameters.reaction","react"),e.next=5,this.sendRpc({method:"chat.react",params:{chat_id:t.chatId,message_id:t.messageId,reaction:t.reaction}});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"read",value:(_=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","read"),e.next=3,this.sendRpc({method:"chat.read",params:{chat_id:t.chatId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"block",value:(x=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","block"),e.next=3,this.sendRpc({method:"chat.block",params:{user_id:t.userId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"unblock",value:(b=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.userId,"requestParameters.userId","unblock"),e.next=3,this.sendRpc({method:"chat.unblock",params:{user_id:t.userId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"delete",value:(k=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.chatId,"requestParameters.chatId","delete"),e.next=3,this.sendRpc({method:"chat.delete",params:{chat_id:t.chatId}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"permit",value:(g=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotNullOrUndefined(t.permit,"requestParameters.permit","permit"),e.next=3,this.sendRpc({method:"chat.permit",params:{permit:t.permit}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"assertNotNullOrUndefined",value:function(e,t,r){if(null==e)throw new j(t,"Required parameter ".concat(t," was null or undefined when calling ").concat(r,"."))}},{key:"assertNotUndefined",value:function(e,t,r){if(void 0===e)throw new j(t,"Required parameter ".concat(t," was undefined when calling ").concat(r,"."))}},{key:"assertMinLength",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e.length<n)throw new j(t,"Required parameter ".concat(t," requires more than ").concat(n," element when calling ").concat(r))}},{key:"createInvites",value:(w=r(f.mark((function e(t,n,a){var i,s=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPublicKey(t);case 2:return i=e.sent,e.next=5,Promise.all([t].concat(I(n)).map(function(){var e=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getPublicKey(t);case 2:return r=e.sent,e.next=5,s.createInviteCode(i,r,a);case 5:return n=e.sent,e.abrupt("return",{user_id:t,invite_code:qt.encode(n)});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return w.apply(this,arguments)})},{key:"createInviteCode",value:(y=r(f.mark((function e(t,r,n){var a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.walletService.getSharedSecret(r);case 2:return a=e.sent,e.next=5,this.encrypt(a,n);case 5:return i=e.sent,(s=new Uint8Array(65+i.length)).set(t),s.set(i,65),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return y.apply(this,arguments)})},{key:"readInviteCode",value:(v=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.slice(0,65),n=t.slice(65),e.next=4,this.walletService.getSharedSecret(r);case 4:return a=e.sent,e.next=7,this.decrypt(a,n);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"encrypt",value:function(){var e=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ct(t.slice(t.length-32),r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"encryptString",value:(h=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.encrypt(t,(new TextEncoder).encode(r));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"decrypt",value:function(){var e=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dt(t.slice(t.length-32),r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"decryptString",value:(p=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=new TextDecoder,e.next=3,this.decrypt(t,r);case 3:return e.t1=e.sent,e.abrupt("return",e.t0.decode.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"decryptLastChatMessage",value:(d=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getChatSecret(t.chat_id);case 2:if(r=e.sent,n="",!(t.last_message&&t.last_message.length>0)){e.next=15;break}return e.prev=5,e.next=8,this.decryptString(r,qt.decode(t.last_message));case 8:n=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),console.error("[audius-sdk]: Error: Couldn't decrypt last chat message",t,e.t0),n="Error: Couldn't decrypt message";case 15:return e.abrupt("return",un(un({},t),{},{last_message:n}));case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(e){return d.apply(this,arguments)})},{key:"getRaw",value:(l=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="/comms/chats/".concat(t),n={timestamp:(new Date).getTime()},e.next=4,this.signAndSendRequest({method:"GET",headers:{},path:r,query:n});case 4:return a=e.sent,e.next=7,a.json();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getChatSecret",value:(c=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.chatSecrets[t]){e.next=10;break}return e.next=4,this.getRaw(t);case 4:return n=e.sent,e.next=7,this.readInviteCode(qt.decode(n.data.invite_code));case 7:return a=e.sent,this.chatSecrets[t]=a,e.abrupt("return",a);case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getPublicKey",value:(u=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.request({path:"/comms/pubkey/".concat(t),method:"GET",headers:{}});case 2:return r=e.sent,e.next=5,r.json();case 5:return n=e.sent,e.abrupt("return",qt.decode(n.data));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"getSignatureHeader",value:(o=r(f.mark((function e(t){var r,n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.walletService.sign(t);case 2:return r=e.sent,n=rt(r,2),a=n[0],i=n[1],(s=new Uint8Array(65)).set(a,0),s[64]=i,e.abrupt("return",{"x-sig":qt.encode(s)});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"signAndSendRequest",value:(s=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="GET"===t.method?t.query?"".concat(t.path,"?").concat(this.configuration.queryParamsStringify(t.query)):t.path:t.body,e.t0=this,e.t1=un,e.t2=un({},t),e.t3={},e.t4=un,e.t5=un({},t.headers),e.next=9,this.getSignatureHeader(r);case 9:return e.t6=e.sent,e.t7=(0,e.t4)(e.t5,e.t6),e.t8={headers:e.t7},e.t9=(0,e.t1)(e.t2,e.t3,e.t8),e.next=15,e.t0.request.call(e.t0,e.t9);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"sendRpc",value:(a=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=JSON.stringify(un(un({},t),{},{timestamp:(new Date).getTime()})),e.next=3,this.signAndSendRequest({method:"POST",headers:{"Content-Type":"application/json"},path:"/comms/mutate",body:r});case 3:return e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"createWebsocket",value:(t=r(f.mark((function e(t){var n,a,i,s,o,u,c=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),a="/comms/chats/ws?timestamp=".concat(n),e.next=4,this.getSignatureHeader(a);case 4:return i=e.sent,s=t.replace(/http(s?)/g,"ws$1"),o="".concat(s).concat(a,"&signature=").concat(encodeURIComponent(i["x-sig"])),(u=new Hr(o)).addEventListener("message",(function(e){var t=function(){var t=r(f.mark((function t(){var r,n;return f.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("chat.message"!==(r=JSON.parse(e.data)).rpc.method){t.next=19;break}return t.next=4,c.getChatSecret(r.rpc.params.chat_id);case 4:return n=t.sent,t.t0=c.eventEmitter,t.t1=r.rpc.params.chat_id,t.t2=r.rpc.params.message_id,t.next=10,c.decryptString(n,qt.decode(r.rpc.params.message)).catch((function(e){return console.error("[audius-sdk]: Error: Couldn't decrypt websocket chat message",r,e),"Error: Couldn't decrypt message"}));case 10:t.t3=t.sent,t.t4=r.metadata.userId,t.t5=r.metadata.timestamp,t.t6=[],t.t7={message_id:t.t2,message:t.t3,sender_user_id:t.t4,created_at:t.t5,reactions:t.t6},t.t8={chatId:t.t1,message:t.t7},t.t0.emit.call(t.t0,"message",t.t8),t.next=20;break;case 19:"chat.react"===r.rpc.method&&c.eventEmitter.emit("reaction",{chatId:r.rpc.params.chat_id,messageId:r.rpc.params.message_id,reaction:{reaction:r.rpc.params.reaction,user_id:r.metadata.userId,created_at:r.metadata.timestamp}});case 20:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t()})),u.addEventListener("open",(function(){c.eventEmitter.emit("open")})),u.addEventListener("close",(function(){c.eventEmitter.emit("close")})),u.addEventListener("error",(function(e){c.eventEmitter.emit("error",e)})),e.abrupt("return",u);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),D}(U);function dn(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}function fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pn(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?fn(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function hn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return vn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yn="/v1/full".replace(/\/+$/,""),mn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.configuration=t}return i(e,[{key:"config",set:function(e){this.configuration=e}},{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:yn}},{key:"fetchApi",get:function(){return this.configuration.fetchApi}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||Tn}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:r(f.mark((function t(){return f.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e);case 1:case"end":return t.stop()}}),t)})))}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}]),e}(),wn=new mn,gn=function(){function e(){var t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wn;n(this,e),this.configuration=a,this.fetchApi=function(){var e=r(f.mark((function e(r,n){var a,i,s,o,u,c,l,d,p,h,v;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={url:r,init:n},i=hn(t.middleware),e.prev=2,i.s();case 4:if((s=i.n()).done){e.next=15;break}if(!(o=s.value).pre){e.next=13;break}return e.next=9,o.pre(pn({fetch:t.fetchApi},a));case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0=a;case 12:a=e.t0;case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),i.e(e.t1);case 20:return e.prev=20,i.f(),e.finish(20);case 23:return u=void 0,e.prev=24,e.next=27,(t.configuration.fetchApi||fetch)(a.url,a.init);case 27:u=e.sent,e.next=60;break;case 30:e.prev=30,e.t2=e.catch(24),c=hn(t.middleware),e.prev=33,c.s();case 35:if((l=c.n()).done){e.next=46;break}if(!(d=l.value).onError){e.next=44;break}return e.next=40,d.onError({fetch:t.fetchApi,url:a.url,init:a.init,error:e.t2,response:u?u.clone():void 0});case 40:if(e.t3=e.sent,e.t3){e.next=43;break}e.t3=u;case 43:u=e.t3;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t4=e.catch(33),c.e(e.t4);case 51:return e.prev=51,c.f(),e.finish(51);case 54:if(void 0!==u){e.next=60;break}if(!(e.t2 instanceof Error)){e.next=59;break}throw new _n(e.t2,"The request failed and the interceptors did not return an alternative response");case 59:throw e.t2;case 60:p=hn(t.middleware),e.prev=61,p.s();case 63:if((h=p.n()).done){e.next=74;break}if(!(v=h.value).post){e.next=72;break}return e.next=68,v.post({fetch:t.fetchApi,url:a.url,init:a.init,response:u.clone()});case 68:if(e.t5=e.sent,e.t5){e.next=71;break}e.t5=u;case 71:u=e.t5;case 72:e.next=63;break;case 74:e.next=79;break;case 76:e.prev=76,e.t6=e.catch(61),p.e(e.t6);case 79:return e.prev=79,p.f(),e.finish(79);case 82:return e.abrupt("return",u);case 83:case"end":return e.stop()}}),e,null,[[2,17,20,23],[24,30],[33,48,51,54],[61,76,79,82]])})));return function(t,r){return e.apply(this,arguments)}}(),this.middleware=a.middleware}var t,a;return i(e,[{key:"withMiddleware",value:function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,arguments),t}},{key:"withPreMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{pre:e}}));return this.withMiddleware.apply(this,I(n))}},{key:"withPostMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{post:e}}));return this.withMiddleware.apply(this,I(n))}},{key:"request",value:(a=r(f.mark((function e(t,r){var n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createFetchParams(t,r);case 2:return n=e.sent,a=n.url,i=n.init,e.next=7,this.fetchApi(a,i);case 7:if(!((s=e.sent)&&s.status>=200&&s.status<300)){e.next=10;break}return e.abrupt("return",s);case 10:throw new xn(s,"Response returned an error code");case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createFetchParams",value:(t=r(f.mark((function e(t,n){var a,i,s,o,u,c;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.configuration.basePath+t.path,void 0!==t.query&&0!==Object.keys(t.query).length&&(a+="?"+this.configuration.queryParamsStringify(t.query)),i=Object.assign({},this.configuration.headers,t.headers),Object.keys(i).forEach((function(e){return void 0===i[e]?delete i[e]:{}})),s="function"==typeof n?n:r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}}),e)}))),o={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},e.t0=pn,e.t1=pn({},o),e.next=10,s({init:o,context:t});case 10:return e.t2=e.sent,u=(0,e.t0)(e.t1,e.t2),c=pn(pn({},u),{},{body:(l=u.body,"undefined"!=typeof FormData&&l instanceof FormData||u.body instanceof URLSearchParams||kn(u.body)||bn(u.body)?u.body:JSON.stringify(u.body))}),e.abrupt("return",{url:a,init:c});case 14:case"end":return e.stop()}var l}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"clone",value:function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}]),e}();function kn(e){return"undefined"!=typeof Blob&&e instanceof Blob}function bn(e){return"string"==typeof e}var xn=function(e){m(r,e);var t=dn(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).response=e,i.name="ResponseError",i}return i(r)}(x(Error)),_n=function(e){m(r,e);var t=dn(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).cause=e,i.name="FetchError",i}return i(r)}(x(Error)),Rn=function(e){m(r,e);var t=dn(r);function r(e,a){var i;return n(this,r),(i=t.call(this,a)).field=e,i.name="RequiredError",i}return i(r)}(x(Error)),In=",";function En(e,t){var r=e[t];return null!=r}function Tn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).sort().map((function(r){return Sn(r,e[r],t)})).filter((function(e){return e.length>0})).join("&")}function Sn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r+(r.length?"[".concat(e,"]"):e);if(t instanceof Array){var a=t.map((function(e){return encodeURIComponent(String(e))})).join("&".concat(encodeURIComponent(n),"="));return"".concat(encodeURIComponent(n),"=").concat(a)}if(t instanceof Set){var i=Array.from(t);return Sn(e,i,r)}return t instanceof Date?"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.toISOString())):t instanceof Object?Tn(t,n):"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(t)))}var Pn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};n(this,e),this.raw=t,this.transformer=r}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,this.raw.json();case 3:return e.t1=e.sent,e.abrupt("return",e.t0.transformer.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),qn=function(){function e(t){n(this,e),this.raw=t}var t;return i(e,[{key:"value",value:(t=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),e}();function An(e){return function(e,t){if(null==e)return e;return{timestamp:En(e,"timestamp")?e.timestamp:void 0,itemType:En(e,"item_type")?e.item_type:void 0,item:En(e,"item")?e.item:void 0}}(e)}function On(e){return function(e,t){if(null==e)return e;return{_640x:En(e,"640x")?e["640x"]:void 0,_2000x:En(e,"2000x")?e["2000x"]:void 0}}(e)}function Cn(e){return function(e,t){if(null==e)return e;return{cid:En(e,"cid")?e.cid:void 0,isDownloadable:e.is_downloadable,requiresFollow:e.requires_follow}}(e)}function Un(e){return function(e,t){if(null==e)return e;return{favoriteItemId:e.favorite_item_id,favoriteType:e.favorite_type,userId:e.user_id,createdAt:e.created_at}}(e)}function Ln(e){return function(e,t){if(null==e)return e;return{service:e.service,version:e.version}}(e)}function Nn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(An):void 0}}(e)}function Bn(e){return function(e,t){if(null==e)return e;return{mood:En(e,"mood")?e.mood:void 0,tags:En(e,"tags")?e.tags:void 0,genre:En(e,"genre")?e.genre:void 0,share:En(e,"share")?e.share:void 0,playCount:En(e,"play_count")?e.play_count:void 0,remixes:En(e,"remixes")?e.remixes:void 0}}(e)}function Dn(e){return function(e,t){if(null==e)return e;return{contents:En(e,"contents")?e.contents:void 0}}(e)}function jn(e){return function(e,t){if(null==e)return e;return{_150x150:En(e,"150x150")?e["150x150"]:void 0,_480x480:En(e,"480x480")?e["480x480"]:void 0,_1000x1000:En(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function Fn(e){return function(e,t){if(null==e)return e;return{albumCount:e.album_count,artistPickTrackId:En(e,"artist_pick_track_id")?e.artist_pick_track_id:void 0,bio:En(e,"bio")?e.bio:void 0,coverPhoto:En(e,"cover_photo")?On(e.cover_photo):void 0,followeeCount:e.followee_count,followerCount:e.follower_count,doesFollowCurrentUser:En(e,"does_follow_current_user")?e.does_follow_current_user:void 0,handle:e.handle,id:e.id,isVerified:e.is_verified,location:En(e,"location")?e.location:void 0,name:e.name,playlistCount:e.playlist_count,profilePicture:En(e,"profile_picture")?jn(e.profile_picture):void 0,repostCount:e.repost_count,trackCount:e.track_count,isDeactivated:e.is_deactivated,ercWallet:En(e,"erc_wallet")?e.erc_wallet:void 0,splWallet:e.spl_wallet,supporterCount:e.supporter_count,supportingCount:e.supporting_count,balance:e.balance,associatedWalletsBalance:e.associated_wallets_balance,totalBalance:e.total_balance,waudioBalance:e.waudio_balance,associatedSolWalletsBalance:e.associated_sol_wallets_balance,blocknumber:e.blocknumber,wallet:e.wallet,createdAt:e.created_at,creatorNodeEndpoint:En(e,"creator_node_endpoint")?e.creator_node_endpoint:void 0,currentUserFolloweeFollowCount:e.current_user_followee_follow_count,doesCurrentUserFollow:e.does_current_user_follow,handleLc:e.handle_lc,updatedAt:e.updated_at,coverPhotoSizes:En(e,"cover_photo_sizes")?e.cover_photo_sizes:void 0,coverPhotoLegacy:En(e,"cover_photo_legacy")?e.cover_photo_legacy:void 0,profilePictureSizes:En(e,"profile_picture_sizes")?e.profile_picture_sizes:void 0,profilePictureLegacy:En(e,"profile_picture_legacy")?e.profile_picture_legacy:void 0,metadataMultihash:En(e,"metadata_multihash")?e.metadata_multihash:void 0,hasCollectibles:e.has_collectibles,playlistLibrary:En(e,"playlist_library")?Dn(e.playlist_library):void 0}}(e)}function Gn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function Mn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function Hn(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,subscriberIds:En(e,"subscriber_ids")?e.subscriber_ids:void 0}}(e)}function Wn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Hn):void 0}}(e)}function Vn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function zn(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,sender:Fn(e.sender)}}(e)}function Xn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?zn(e.data):void 0}}(e)}function $n(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(zn):void 0}}(e)}function Yn(e){return function(e,t){if(null==e)return e;return{rank:e.rank,amount:e.amount,receiver:Fn(e.receiver)}}(e)}function Kn(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?Yn(e.data):void 0}}(e)}function Jn(e){return function(e,t){if(null==e)return e;return{metadataTimestamp:e.metadata_timestamp,timestamp:e.timestamp,trackId:e.track_id}}(e)}function Zn(e){return function(e,t){if(null==e)return e;return{_150x150:En(e,"150x150")?e["150x150"]:void 0,_480x480:En(e,"480x480")?e["480x480"]:void 0,_1000x1000:En(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function Qn(e){return function(e,t){if(null==e)return e;return{repostItemId:e.repost_item_id,repostType:e.repost_type,userId:e.user_id}}(e)}function ea(e){return function(e,t){if(null==e)return e;return{parentTrackId:e.parent_track_id,user:Fn(e.user),hasRemixAuthorReposted:e.has_remix_author_reposted,hasRemixAuthorSaved:e.has_remix_author_saved}}(e)}function ta(e){return function(e,t){if(null==e)return e;return{tracks:En(e,"tracks")?e.tracks.map(ea):void 0}}(e)}function ra(e){return function(e,t){if(null==e)return e;return{data:En(e,"data")?e.data:void 0,signature:En(e,"signature")?e.signature:void 0}}(e)}function na(e){return function(e,t){if(null==e)return e;return{category:e.category,parentTrackId:e.parent_track_id}}(e)}function aa(e){return function(e,t){if(null==e)return e;return{_150x150:En(e,"150x150")?e["150x150"]:void 0,_480x480:En(e,"480x480")?e["480x480"]:void 0,_1000x1000:En(e,"1000x1000")?e["1000x1000"]:void 0}}(e)}function ia(e){return function(e,t){if(null==e)return e;return{duration:e.duration,multihash:e.multihash}}(e)}function sa(e){return function(e,t){if(null==e)return e;return{artwork:En(e,"artwork")?aa(e.artwork):void 0,description:En(e,"description")?e.description:void 0,genre:En(e,"genre")?e.genre:void 0,id:e.id,trackCid:En(e,"track_cid")?e.track_cid:void 0,mood:En(e,"mood")?e.mood:void 0,releaseDate:En(e,"release_date")?e.release_date:void 0,remixOf:En(e,"remix_of")?ta(e.remix_of):void 0,repostCount:e.repost_count,favoriteCount:e.favorite_count,tags:En(e,"tags")?e.tags:void 0,title:e.title,user:Fn(e.user),duration:e.duration,downloadable:En(e,"downloadable")?e.downloadable:void 0,playCount:e.play_count,permalink:En(e,"permalink")?e.permalink:void 0,isStreamable:En(e,"is_streamable")?e.is_streamable:void 0,blocknumber:e.blocknumber,createDate:En(e,"create_date")?e.create_date:void 0,coverArtSizes:En(e,"cover_art_sizes")?e.cover_art_sizes:void 0,createdAt:En(e,"created_at")?e.created_at:void 0,creditsSplits:En(e,"credits_splits")?e.credits_splits:void 0,download:En(e,"download")?Cn(e.download):void 0,isrc:En(e,"isrc")?e.isrc:void 0,license:En(e,"license")?e.license:void 0,iswc:En(e,"iswc")?e.iswc:void 0,fieldVisibility:En(e,"field_visibility")?Bn(e.field_visibility):void 0,followeeReposts:e.followee_reposts.map(Qn),hasCurrentUserReposted:e.has_current_user_reposted,isUnlisted:e.is_unlisted,hasCurrentUserSaved:e.has_current_user_saved,followeeFavorites:e.followee_favorites.map(Un),routeId:e.route_id,stemOf:En(e,"stem_of")?na(e.stem_of):void 0,trackSegments:En(e,"track_segments")?e.track_segments.map(ia):void 0,updatedAt:En(e,"updated_at")?e.updated_at:void 0,userId:e.user_id,isDelete:En(e,"is_delete")?e.is_delete:void 0,coverArt:En(e,"cover_art")?e.cover_art:void 0,isAvailable:En(e,"is_available")?e.is_available:void 0,isPremium:En(e,"is_premium")?e.is_premium:void 0,premiumConditions:En(e,"premium_conditions")?e.premium_conditions:void 0,premiumContentSignature:En(e,"premium_content_signature")?ra(e.premium_content_signature):void 0}}(e)}function oa(e){return function(e,t){if(null==e)return e;return{artwork:En(e,"artwork")?Zn(e.artwork):void 0,description:En(e,"description")?e.description:void 0,permalink:En(e,"permalink")?e.permalink:void 0,id:e.id,isAlbum:e.is_album,playlistName:e.playlist_name,repostCount:e.repost_count,favoriteCount:e.favorite_count,totalPlayCount:e.total_play_count,user:Fn(e.user),blocknumber:e.blocknumber,createdAt:En(e,"created_at")?e.created_at:void 0,followeeReposts:e.followee_reposts.map(Qn),followeeFavorites:e.followee_favorites.map(Un),hasCurrentUserReposted:e.has_current_user_reposted,hasCurrentUserSaved:e.has_current_user_saved,isDelete:e.is_delete,isPrivate:e.is_private,updatedAt:En(e,"updated_at")?e.updated_at:void 0,addedTimestamps:e.added_timestamps.map(Jn),userId:e.user_id,tracks:e.tracks.map(sa),coverArt:En(e,"cover_art")?e.cover_art:void 0,coverArtSizes:En(e,"cover_art_sizes")?e.cover_art_sizes:void 0,trackCount:e.track_count}}(e)}function ua(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(oa):void 0}}(e)}function ca(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(sa):void 0}}(e)}function la(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(An):void 0}}(e)}function da(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function fa(e){return function(e,t){if(null==e)return e;return{userId:e.user_id}}(e)}function pa(e){return function(e,t){if(null==e)return e;return{amount:e.amount,sender:Fn(e.sender),receiver:Fn(e.receiver),createdAt:e.created_at,slot:e.slot,followeeSupporters:e.followee_supporters.map(fa),txSignature:e.tx_signature}}(e)}function ha(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?sa(e.data):void 0}}(e)}function va(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(sa):void 0}}(e)}function ya(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(sa):void 0}}(e)}function ma(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(oa):void 0}}(e)}function wa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function ga(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(pa):void 0}}(e)}function ka(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(An):void 0}}(e)}function ba(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function xa(e){return function(e,t){if(null==e)return e;return{count:e.count,tracks:En(e,"tracks")?e.tracks.map(sa):void 0}}(e)}function _a(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?xa(e.data):void 0}}(e)}function Ra(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(sa):void 0}}(e)}function Ia(e){return function(e,t){if(null==e)return e;return{users:e.users.map(Fn),followedUsers:En(e,"followed_users")?e.followed_users.map(Fn):void 0,tracks:e.tracks.map(sa),savedTracks:En(e,"saved_tracks")?e.saved_tracks.map(sa):void 0,playlists:e.playlists.map(oa),savedPlaylists:En(e,"saved_playlists")?e.saved_playlists.map(oa):void 0,albums:e.albums.map(oa),savedAlbums:En(e,"saved_albums")?e.saved_albums.map(oa):void 0}}(e)}function Ea(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?Ia(e.data):void 0}}(e)}function Ta(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?Ia(e.data):void 0}}(e)}function Sa(e){return function(e,t){if(null==e)return e;return{id:e.id,parentId:e.parent_id,category:e.category,cid:e.cid,userId:e.user_id,blocknumber:e.blocknumber}}(e)}function Pa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Sa):void 0}}(e)}function qa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function Aa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function Oa(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function Ca(e){return function(e,t){if(null==e)return e;return{id:e.id}}(e)}function Ua(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(Fn):void 0}}(e)}function La(e){return function(e,t){if(null==e)return e;return{transactionDate:e.transaction_date,transactionType:e.transaction_type,method:e.method,signature:e.signature,userBank:e.user_bank,change:e.change,balance:e.balance,metadata:e.metadata}}(e)}function Na(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data:void 0}}(e)}function Ba(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?e.data.map(La):void 0}}(e)}function Da(e){return function(e,t){if(null==e)return e;return{week:En(e,"week")?e.week.map(Ca):void 0,month:En(e,"month")?e.month.map(Ca):void 0,year:En(e,"year")?e.year.map(Ca):void 0}}(e)}function ja(e){return function(e,t){if(null==e)return e;return{data:En(e,"data")?Da(e.data):void 0}}(e)}function Fa(e){return function(e,t){if(null==e)return e;return{userId:e.user_id,wallet:e.wallet,primary:En(e,"primary")?e.primary:void 0,secondary1:En(e,"secondary1")?e.secondary1:void 0,secondary2:En(e,"secondary2")?e.secondary2:void 0,primarySpID:En(e,"primarySpID")?e.primarySpID:void 0,secondary1SpID:En(e,"secondary1SpID")?e.secondary1SpID:void 0,secondary2SpID:En(e,"secondary2SpID")?e.secondary2SpID:void 0}}(e)}function Ga(e){return function(e,t){if(null==e)return e;return{latestChainBlock:e.latest_chain_block,latestIndexedBlock:e.latest_indexed_block,latestChainSlotPlays:e.latest_chain_slot_plays,latestIndexedSlotPlays:e.latest_indexed_slot_plays,signature:e.signature,timestamp:e.timestamp,version:Ln(e.version),data:En(e,"data")?Fa(e.data):void 0}}(e)}function Ma(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ha=function(e){m(b,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k=Ma(b);function b(){return n(this,b),k.apply(this,arguments)}return i(b,[{key:"getPlaylistRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylist.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/playlists/{playlist_id}".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ua(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getPlaylist",value:(w=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getPlaylistByHandleAndSlugRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getPlaylistByHandleAndSlug.");case 2:if(null!==t.slug&&void 0!==t.slug){e.next=4;break}throw new Rn("slug","Required parameter requestParameters.slug was null or undefined when calling getPlaylistByHandleAndSlug.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/playlists/by_permalink/{handle}/{slug}".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))).replace("{".concat("slug","}"),encodeURIComponent(String(t.slug))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ua(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getPlaylistByHandleAndSlug",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistByHandleAndSlugRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getPlaylistTracksRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getPlaylistTracks.");case 2:return n={},a={},e.next=6,this.request({path:"/playlists/{playlist_id}/tracks".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ca(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getPlaylistTracks",value:(p=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPlaylistTracksRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getTrendingPlaylistsRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.time&&(n.time=t.time),a={},e.next=8,this.request({path:"/playlists/trending",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ma(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getTrendingPlaylists",value:(l=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingPlaylistsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"getTrendingPlaylistsWithVersionRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getTrendingPlaylistsWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.time&&(n.time=t.time),a={},e.next=10,this.request({path:"/playlists/trending/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ma(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getTrendingPlaylistsWithVersion",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrendingPlaylistsWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getUsersFromPlaylistFavoritesRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getUsersFromPlaylistFavorites.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/playlists/{playlist_id}/favorites".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Gn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getUsersFromPlaylistFavorites",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromPlaylistFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getUsersFromPlaylistRepostsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.playlistId&&void 0!==t.playlistId){e.next=2;break}throw new Rn("playlistId","Required parameter requestParameters.playlistId was null or undefined when calling getUsersFromPlaylistReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/playlists/{playlist_id}/reposts".replace("{".concat("playlist_id","}"),encodeURIComponent(String(t.playlistId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Gn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUsersFromPlaylistReposts",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromPlaylistRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),b}(gn);function Wa(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Va=function(e){m(o,e);var t,a,s=Wa(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"bulkGetReactionsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.reactedToIds&&void 0!==t.reactedToIds){e.next=2;break}throw new Rn("reactedToIds","Required parameter requestParameters.reactedToIds was null or undefined when calling bulkGetReactions.");case 2:return n={},void 0!==t.type&&(n.type=t.type),t.reactedToIds&&(n.reacted_to_ids=t.reactedToIds.join(In)),a={},e.next=8,this.request({path:"/reactions",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new qn(i));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"bulkGetReactions",value:(t=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetReactionsRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),o}(gn);function za(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Xa=function(e){m(c,e);var t,a,s,o,u=za(c);function c(){return n(this,c),u.apply(this,arguments)}return i(c,[{key:"searchRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new Rn("query","Required parameter requestParameters.query was null or undefined when calling search.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.kind&&(n.kind=t.kind),a={},e.next=11,this.request({path:"/search/full",method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ta(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"search",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"searchAutocompleteRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.query&&void 0!==t.query){e.next=2;break}throw new Rn("query","Required parameter requestParameters.query was null or undefined when calling searchAutocomplete.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.kind&&(n.kind=t.kind),a={},e.next=11,this.request({path:"/search/autocomplete",method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ea(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"searchAutocomplete",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.searchAutocompleteRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),c}(gn);function $a(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ya=function(e){m(o,e);var t,a,s=$a(o);function o(){return n(this,o),s.apply(this,arguments)}return i(o,[{key:"getTipsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.receiverMinFollowers&&(n.receiver_min_followers=t.receiverMinFollowers),void 0!==t.receiverIsVerified&&(n.receiver_is_verified=t.receiverIsVerified),void 0!==t.currentUserFollows&&(n.current_user_follows=t.currentUserFollows),void 0!==t.uniqueBy&&(n.unique_by=t.uniqueBy),void 0!==t.minSlot&&(n.min_slot=t.minSlot),void 0!==t.maxSlot&&(n.max_slot=t.maxSlot),t.txSignatures&&(n.tx_signatures=t.txSignatures.join(In)),a={},e.next=14,this.request({path:"/tips",method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ga(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getTips",value:(t=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTipsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),o}(gn);function Ka(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Ja=function(e){m(Y,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,I,E,T,S,P,q,A,O,C,U,L,N,B,D,j,F,G,M,H,W,V,z,X,$=Ka(Y);function Y(){return n(this,Y),$.apply(this,arguments)}return i(Y,[{key:"bestNewReleasesRaw",value:(X=r(f.mark((function e(t){var r,n,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},n={},e.next=4,this.request({path:"/tracks/best_new_releases",method:"GET",headers:n,query:r},t);case 4:return a=e.sent,e.abrupt("return",new Pn(a,(function(e){return ya(e)})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"bestNewReleases",value:(z=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bestNewReleasesRaw(t);case 2:return r=e.sent,e.next=5,r.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return z.apply(this,arguments)})},{key:"getBulkTracksRaw",value:(V=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.userId&&(n.user_id=t.userId),t.permalink&&(n.permalink=t.permalink),t.id&&(n.id=t.id),a={},e.next=7,this.request({path:"/tracks",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ha(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return V.apply(this,arguments)})},{key:"getBulkTracks",value:(W=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getBulkTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return W.apply(this,arguments)})},{key:"getFeelingLuckyTracksRaw",value:(H=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.withUsers&&(n.with_users=t.withUsers),void 0!==t.minFollowers&&(n.min_followers=t.minFollowers),a={},e.next=8,this.request({path:"/tracks/feeling_lucky",method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getFeelingLuckyTracks",value:(M=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getFeelingLuckyTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return M.apply(this,arguments)})},{key:"getMostLovedTracksRaw",value:(G=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.withUsers&&(n.with_users=t.withUsers),a={},e.next=7,this.request({path:"/tracks/most_loved",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"getMostLovedTracks",value:(F=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getMostLovedTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"getPremiumTrackSignaturesRaw",value:(j=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.userId&&void 0!==t.userId){e.next=2;break}throw new Rn("userId","Required parameter requestParameters.userId was null or undefined when calling getPremiumTrackSignatures.");case 2:return n={},t.trackIds&&(n.track_ids=t.trackIds),t.tokenIds&&(n.token_ids=t.tokenIds),a={},e.next=8,this.request({path:"/tracks/{user_id}/nft-gated-signatures".replace("{".concat("user_id","}"),encodeURIComponent(String(t.userId))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new qn(i));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"getPremiumTrackSignatures",value:(D=r(f.mark((function e(t,r){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPremiumTrackSignaturesRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getRecommendedTracksRaw",value:(B=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),t.exclusionList&&(n.exclusion_list=t.exclusionList),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/recommended",method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"getRecommendedTracks",value:(N=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getRecommendedTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return N.apply(this,arguments)})},{key:"getRecommendedTracksWithVersionRaw",value:(L=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getRecommendedTracksWithVersion.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),t.exclusionList&&(n.exclusion_list=t.exclusionList),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=11,this.request({path:"/tracks/recommended/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getRecommendedTracksWithVersion",value:(U=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRecommendedTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getRemixableTracksRaw",value:(C=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.withUsers&&(n.with_users=t.withUsers),a={},e.next=7,this.request({path:"/tracks/remixables",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ha(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getRemixableTracks",value:(O=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getRemixableTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"getTrackRaw",value:(A=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrack.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.handle&&(n.handle=t.handle),void 0!==t.urlTitle&&(n.url_title=t.urlTitle),void 0!==t.showUnlisted&&(n.show_unlisted=t.showUnlisted),a={},e.next=10,this.request({path:"/tracks/{track_id}".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ha(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getTrack",value:(q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getTrackRemixParentsRaw",value:(P=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrackRemixParents.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/remixing".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ra(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getTrackRemixParents",value:(S=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRemixParentsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getTrackRemixesRaw",value:(T=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrackRemixes.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/remixes".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return _a(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getTrackRemixes",value:(E=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackRemixesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"getTrackStemsRaw",value:(I=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getTrackStems.");case 2:return n={},a={},e.next=6,this.request({path:"/tracks/{track_id}/stems".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 6:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Pa(e)})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getTrackStems",value:(R=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrackStemsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"getTrendingTrackIDsRaw",value:(_=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.genre&&(n.genre=t.genre),a={},e.next=5,this.request({path:"/tracks/trending/ids",method:"GET",headers:a,query:n},r);case 5:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ja(e)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"getTrendingTrackIDs",value:(x=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingTrackIDsRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"getTrendingTracksRaw",value:(b=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),a={},e.next=9,this.request({path:"/tracks/trending",method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getTrendingTracks",value:(k=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"getTrendingTracksIDsWithVersionRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getTrendingTracksIDsWithVersion.");case 2:return n={},void 0!==t.genre&&(n.genre=t.genre),a={},e.next=7,this.request({path:"/tracks/trending/ids/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ja(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getTrendingTracksIDsWithVersion",value:(w=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrendingTracksIDsWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getTrendingTracksWithVersionRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getTrendingTracksWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.genre&&(n.genre=t.genre),void 0!==t.time&&(n.time=t.time),a={},e.next=11,this.request({path:"/tracks/trending/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 11:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getTrendingTracksWithVersion",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTrendingTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getUnderTheRadarTracksRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.filter&&(n.filter=t.filter),void 0!==t.tracksOnly&&(n.tracks_only=t.tracksOnly),void 0!==t.withUsers&&(n.with_users=t.withUsers),a={},e.next=10,this.request({path:"/tracks/under_the_radar",method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getUnderTheRadarTracks",value:(p=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getUnderTheRadarTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getUndergroundTrendingTracksRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/tracks/trending/underground",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUndergroundTrendingTracks",value:(l=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getUndergroundTrendingTracksRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersionRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.version&&void 0!==t.version){e.next=2;break}throw new Rn("version","Required parameter requestParameters.version was null or undefined when calling getUndergroundTrendingTracksWithVersion.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/trending/underground/{version}".replace("{".concat("version","}"),encodeURIComponent(String(t.version))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ya(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUndergroundTrendingTracksWithVersion",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUndergroundTrendingTracksWithVersionRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getUsersFromFavoritesRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getUsersFromFavorites.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/favorites".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Oa(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getUsersFromFavorites",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getUsersFromRepostsRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.trackId&&void 0!==t.trackId){e.next=2;break}throw new Rn("trackId","Required parameter requestParameters.trackId was null or undefined when calling getUsersFromReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/tracks/{track_id}/reposts".replace("{".concat("track_id","}"),encodeURIComponent(String(t.trackId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ua(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUsersFromReposts",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersFromRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),Y}(gn);function Za(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var Qa=function(e){m(c,e);var t,a,s,o,u=Za(c);function c(){return n(this,c),u.apply(this,arguments)}return i(c,[{key:"getAudioTransactionHistoryRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.encodedDataMessage&&void 0!==t.encodedDataMessage){e.next=2;break}throw new Rn("encodedDataMessage","Required parameter requestParameters.encodedDataMessage was null or undefined when calling getAudioTransactionHistory.");case 2:if(null!==t.encodedDataSignature&&void 0!==t.encodedDataSignature){e.next=4;break}throw new Rn("encodedDataSignature","Required parameter requestParameters.encodedDataSignature was null or undefined when calling getAudioTransactionHistory.");case 4:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},void 0!==t.encodedDataMessage&&null!==t.encodedDataMessage&&(a["Encoded-Data-Message"]=String(t.encodedDataMessage)),void 0!==t.encodedDataSignature&&null!==t.encodedDataSignature&&(a["Encoded-Data-Signature"]=String(t.encodedDataSignature)),e.next=14,this.request({path:"/transactions",method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ba(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getAudioTransactionHistory",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAudioTransactionHistoryRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getAudioTransactionHistoryCountRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.encodedDataMessage&&void 0!==t.encodedDataMessage){e.next=2;break}throw new Rn("encodedDataMessage","Required parameter requestParameters.encodedDataMessage was null or undefined when calling getAudioTransactionHistoryCount.");case 2:if(null!==t.encodedDataSignature&&void 0!==t.encodedDataSignature){e.next=4;break}throw new Rn("encodedDataSignature","Required parameter requestParameters.encodedDataSignature was null or undefined when calling getAudioTransactionHistoryCount.");case 4:return n={},a={},void 0!==t.encodedDataMessage&&null!==t.encodedDataMessage&&(a["Encoded-Data-Message"]=String(t.encodedDataMessage)),void 0!==t.encodedDataSignature&&null!==t.encodedDataSignature&&(a["Encoded-Data-Signature"]=String(t.encodedDataSignature)),e.next=10,this.request({path:"/transactions/count",method:"GET",headers:a,query:n},r);case 10:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Na(e)})));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getAudioTransactionHistoryCount",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAudioTransactionHistoryCountRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),c}(gn);function ei(e){var t=function(){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}}();return function(){var r,n=g(e);if(t){var a=g(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return w(this,r)}}var ti=function(e){m(Y,e);var t,a,s,o,u,c,l,d,p,h,v,y,w,g,k,b,x,_,R,I,E,T,S,P,q,A,O,C,U,L,N,B,D,j,F,G,M,H,W,V,z,X,$=ei(Y);function Y(){return n(this,Y),$.apply(this,arguments)}return i(Y,[{key:"bulkGetSubscribersRaw",value:(X=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new Rn("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribers.");case 2:return n={},t.ids&&(n.ids=t.ids.join(In)),a={},e.next=7,this.request({path:"/users/subscribers",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Wn(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return X.apply(this,arguments)})},{key:"bulkGetSubscribers",value:(z=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequestRaw",value:(V=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.ids&&void 0!==t.ids){e.next=2;break}throw new Rn("ids","Required parameter requestParameters.ids was null or undefined when calling bulkGetSubscribersViaJSONRequest.");case 2:return n={},t.ids&&(n.ids=t.ids.join(In)),a={},e.next=7,this.request({path:"/users/subscribers",method:"POST",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Wn(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return V.apply(this,arguments)})},{key:"bulkGetSubscribersViaJSONRequest",value:(W=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.bulkGetSubscribersViaJSONRequestRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"getFavoritesRaw",value:(H=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getFavorites.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},e.next=12,this.request({path:"/users/{id}/favorites/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Nn(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"getFavorites",value:(M=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFavoritesRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getFollowersRaw",value:(G=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getFollowers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/followers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Vn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"getFollowers",value:(F=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return F.apply(this,arguments)})},{key:"getFollowingsRaw",value:(j=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getFollowings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/following".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Mn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"getFollowings",value:(D=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFollowingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"getRelatedUsersRaw",value:(B=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getRelatedUsers.");case 2:return n={},void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=8,this.request({path:"/users/{id}/related".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 8:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ba(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"getRelatedUsers",value:(N=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRelatedUsersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"getRepostsRaw",value:(L=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getReposts.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/reposts".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return la(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"getReposts",value:(U=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"getRepostsByHandleRaw",value:(C=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getRepostsByHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/handle/{handle}/reposts".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return la(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"getRepostsByHandle",value:(O=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRepostsByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"getSubscribersRaw",value:(A=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSubscribers.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/subscribers".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return da(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getSubscribers",value:(q=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSubscribersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getSupporterRaw",value:(P=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupporter.");case 2:if(null!==t.supporterUserId&&void 0!==t.supporterUserId){e.next=4;break}throw new Rn("supporterUserId","Required parameter requestParameters.supporterUserId was null or undefined when calling getSupporter.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporters/{supporter_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supporter_user_id","}"),encodeURIComponent(String(t.supporterUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Xn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getSupporter",value:(S=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupporterRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getSupportersRaw",value:(T=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupporters.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporters".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return $n(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getSupporters",value:(E=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportersRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"getSupportingRaw",value:(I=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupporting.");case 2:if(null!==t.supportedUserId&&void 0!==t.supportedUserId){e.next=4;break}throw new Rn("supportedUserId","Required parameter requestParameters.supportedUserId was null or undefined when calling getSupporting.");case 4:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporting/{supported_user_id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("supported_user_id","}"),encodeURIComponent(String(t.supportedUserId))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Kn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getSupporting",value:(R=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"getSupportingsRaw",value:(_=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getSupportings.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=9,this.request({path:"/users/{id}/supporting".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 9:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Kn(e)})));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"getSupportings",value:(x=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSupportingsRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"getTopUsersRaw",value:(b=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Aa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getTopUsers",value:(k=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"getTopUsersInGenreRaw",value:(g=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),t.genre&&(n.genre=t.genre),a={},e.next=7,this.request({path:"/users/genre/top",method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return qa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getTopUsersInGenre",value:(w=r(f.mark((function e(){var t,r,n,a=arguments;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=a.length>1?a[1]:void 0,e.next=4,this.getTopUsersInGenreRaw(t,r);case 4:return n=e.sent,e.next=7,n.value();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"getTracksByUserRaw",value:(y=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getTracksByUser.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/{id}/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return va(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getTracksByUser",value:(v=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"getTracksByUserHandleRaw",value:(h=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getTracksByUserHandle.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.sort&&(n.sort=t.sort),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),void 0!==t.filterTracks&&(n.filter_tracks=t.filterTracks),a={},e.next=14,this.request({path:"/users/handle/{handle}/tracks".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 14:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return va(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getTracksByUserHandle",value:(p=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTracksByUserHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getUserRaw",value:(d=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getUser.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/{id}".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return wa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getUser",value:(l=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getUserByHandleRaw",value:(c=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.handle&&void 0!==t.handle){e.next=2;break}throw new Rn("handle","Required parameter requestParameters.handle was null or undefined when calling getUserByHandle.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/handle/{handle}".replace("{".concat("handle","}"),encodeURIComponent(String(t.handle))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return wa(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getUserByHandle",value:(u=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserByHandleRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getUserReplicaSetRaw",value:(o=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getUserReplicaSet.");case 2:return n={},void 0!==t.userId&&(n.user_id=t.userId),a={},e.next=7,this.request({path:"/users/{id}/replica_set".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 7:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return Ga(e)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getUserReplicaSet",value:(s=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUserReplicaSetRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getUsersTrackHistoryRaw",value:(a=r(f.mark((function e(t,r){var n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id&&void 0!==t.id){e.next=2;break}throw new Rn("id","Required parameter requestParameters.id was null or undefined when calling getUsersTrackHistory.");case 2:return n={},void 0!==t.offset&&(n.offset=t.offset),void 0!==t.limit&&(n.limit=t.limit),void 0!==t.userId&&(n.user_id=t.userId),void 0!==t.query&&(n.query=t.query),void 0!==t.sortMethod&&(n.sort_method=t.sortMethod),void 0!==t.sortDirection&&(n.sort_direction=t.sortDirection),a={},e.next=12,this.request({path:"/users/{id}/history/tracks".replace("{".concat("id","}"),encodeURIComponent(String(t.id))),method:"GET",headers:a,query:n},r);case 12:return i=e.sent,e.abrupt("return",new Pn(i,(function(e){return ka(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUsersTrackHistory",value:(t=r(f.mark((function e(t,r){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getUsersTrackHistoryRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),Y}(gn),ri={exports:{}};!function(e,t){var r="undefined"!=typeof self?self:o,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,a="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,s="ArrayBuffer"in e;if(s)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,n,a=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),w.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function k(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(a))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];b.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function _(e,r){return new Promise((function(n,i){var s=new g(e,r);if(s.signal&&s.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var a=r.join(":").trim();t.append(n,a)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;n(new b(a,r))},o.onerror=function(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&a&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",u)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}_.polyfill=!0,e.fetch||(e.fetch=_,e.Headers=f,e.Request=g,e.Response=b),t.Headers=f,t.Request=g,t.Response=b,t.fetch=_,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var a=n;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t}(ri,ri.exports);var ni,ai=u(ri.exports),ii=function(e){var t,n=e.appName;return{pre:(t=r(f.mark((function e(t){var r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{url:t.url+(t.url.includes("?")?"&":"?")+M({app_name:n}),init:null!==(r=t.init)&&void 0!==r?r:{}});case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}};function si(){throw new Error("setTimeout has not been defined")}function oi(){throw new Error("clearTimeout has not been defined")}!function(e){e.CHECK_SHORT_CIRCUIT="Check Short Circuit",e.GET_ALL_SERVICES="Get All Services",e.FILTER_TO_WHITELIST="Filter To Whitelist",e.FILTER_FROM_BLACKLIST="Filter From Blacklist",e.FILTER_OUT_KNOWN_UNHEALTHY="Filter Out Known Unhealthy",e.GET_SELECTION_ROUND="Get Selection Round",e.NO_SERVICES_LEFT_TO_TRY="No Services Left To Try",e.SELECTED_FROM_BACKUP="Selected From Backup",e.FAILED_AND_RESETTING="Failed Everything -- Resetting",e.ROUND_FAILED_RETRY="Round Failed Retry",e.MADE_A_SELECTION="Made A Selection",e.RACED_AND_FOUND_BEST="Raced And Found Best"}(ni||(ni={}));var ui=si,ci=oi;function li(e){if(ui===setTimeout)return setTimeout(e,0);if((ui===si||!ui)&&setTimeout)return ui=setTimeout,setTimeout(e,0);try{return ui(e,0)}catch(t){try{return ui.call(null,e,0)}catch(t){return ui.call(this,e,0)}}}"function"==typeof Fr.setTimeout&&(ui=setTimeout),"function"==typeof Fr.clearTimeout&&(ci=clearTimeout);var di,fi=[],pi=!1,hi=-1;function vi(){pi&&di&&(pi=!1,di.length?fi=di.concat(fi):hi=-1,fi.length&&yi())}function yi(){if(!pi){var e=li(vi);pi=!0;for(var t=fi.length;t;){for(di=fi,fi=[];++hi<t;)di&&di[hi].run();hi=-1,t=fi.length}di=null,pi=!1,function(e){if(ci===clearTimeout)return clearTimeout(e);if((ci===oi||!ci)&&clearTimeout)return ci=clearTimeout,clearTimeout(e);try{ci(e)}catch(t){try{return ci.call(null,e)}catch(t){return ci.call(this,e)}}}(e)}}function mi(e,t){this.fun=e,this.array=t}mi.prototype.run=function(){this.fun.apply(null,this.array)};function wi(){}var gi=wi,ki=wi,bi=wi,xi=wi,_i=wi,Ri=wi,Ii=wi;var Ei=Fr.performance||{},Ti=Ei.now||Ei.mozNow||Ei.msNow||Ei.oNow||Ei.webkitNow||function(){return(new Date).getTime()};var Si=new Date;var Pi={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];fi.push(new mi(e,t)),1!==fi.length||pi||li(yi)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:gi,addListener:ki,once:bi,off:xi,removeListener:_i,removeAllListeners:Ri,emit:Ii,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ti.call(Ei),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Si)/1e3}},qi={exports:{}};!function(e,t){var r;t=e.exports=f,r="object"===s(Pi)&&Pi.env&&Pi.env.NODE_DEBUG&&/\bsemver\b/i.test(Pi.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=Number.MAX_SAFE_INTEGER||9007199254740991,a=t.re=[],i=t.src=[],o=t.tokens={},u=0;function c(e){o[e]=u++}c("NUMERICIDENTIFIER"),i[o.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),i[o.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),i[o.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),i[o.MAINVERSION]="("+i[o.NUMERICIDENTIFIER]+")\\.("+i[o.NUMERICIDENTIFIER]+")\\.("+i[o.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),i[o.MAINVERSIONLOOSE]="("+i[o.NUMERICIDENTIFIERLOOSE]+")\\.("+i[o.NUMERICIDENTIFIERLOOSE]+")\\.("+i[o.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),i[o.PRERELEASEIDENTIFIER]="(?:"+i[o.NUMERICIDENTIFIER]+"|"+i[o.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),i[o.PRERELEASEIDENTIFIERLOOSE]="(?:"+i[o.NUMERICIDENTIFIERLOOSE]+"|"+i[o.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),i[o.PRERELEASE]="(?:-("+i[o.PRERELEASEIDENTIFIER]+"(?:\\."+i[o.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),i[o.PRERELEASELOOSE]="(?:-?("+i[o.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+i[o.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),i[o.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),i[o.BUILD]="(?:\\+("+i[o.BUILDIDENTIFIER]+"(?:\\."+i[o.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),i[o.FULLPLAIN]="v?"+i[o.MAINVERSION]+i[o.PRERELEASE]+"?"+i[o.BUILD]+"?",i[o.FULL]="^"+i[o.FULLPLAIN]+"$",c("LOOSEPLAIN"),i[o.LOOSEPLAIN]="[v=\\s]*"+i[o.MAINVERSIONLOOSE]+i[o.PRERELEASELOOSE]+"?"+i[o.BUILD]+"?",c("LOOSE"),i[o.LOOSE]="^"+i[o.LOOSEPLAIN]+"$",c("GTLT"),i[o.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),i[o.XRANGEIDENTIFIERLOOSE]=i[o.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),i[o.XRANGEIDENTIFIER]=i[o.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),i[o.XRANGEPLAIN]="[v=\\s]*("+i[o.XRANGEIDENTIFIER]+")(?:\\.("+i[o.XRANGEIDENTIFIER]+")(?:\\.("+i[o.XRANGEIDENTIFIER]+")(?:"+i[o.PRERELEASE]+")?"+i[o.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),i[o.XRANGEPLAINLOOSE]="[v=\\s]*("+i[o.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+i[o.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+i[o.XRANGEIDENTIFIERLOOSE]+")(?:"+i[o.PRERELEASELOOSE]+")?"+i[o.BUILD]+"?)?)?",c("XRANGE"),i[o.XRANGE]="^"+i[o.GTLT]+"\\s*"+i[o.XRANGEPLAIN]+"$",c("XRANGELOOSE"),i[o.XRANGELOOSE]="^"+i[o.GTLT]+"\\s*"+i[o.XRANGEPLAINLOOSE]+"$",c("COERCE"),i[o.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),a[o.COERCERTL]=new RegExp(i[o.COERCE],"g"),c("LONETILDE"),i[o.LONETILDE]="(?:~>?)",c("TILDETRIM"),i[o.TILDETRIM]="(\\s*)"+i[o.LONETILDE]+"\\s+",a[o.TILDETRIM]=new RegExp(i[o.TILDETRIM],"g");c("TILDE"),i[o.TILDE]="^"+i[o.LONETILDE]+i[o.XRANGEPLAIN]+"$",c("TILDELOOSE"),i[o.TILDELOOSE]="^"+i[o.LONETILDE]+i[o.XRANGEPLAINLOOSE]+"$",c("LONECARET"),i[o.LONECARET]="(?:\\^)",c("CARETTRIM"),i[o.CARETTRIM]="(\\s*)"+i[o.LONECARET]+"\\s+",a[o.CARETTRIM]=new RegExp(i[o.CARETTRIM],"g");c("CARET"),i[o.CARET]="^"+i[o.LONECARET]+i[o.XRANGEPLAIN]+"$",c("CARETLOOSE"),i[o.CARETLOOSE]="^"+i[o.LONECARET]+i[o.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),i[o.COMPARATORLOOSE]="^"+i[o.GTLT]+"\\s*("+i[o.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),i[o.COMPARATOR]="^"+i[o.GTLT]+"\\s*("+i[o.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),i[o.COMPARATORTRIM]="(\\s*)"+i[o.GTLT]+"\\s*("+i[o.LOOSEPLAIN]+"|"+i[o.XRANGEPLAIN]+")",a[o.COMPARATORTRIM]=new RegExp(i[o.COMPARATORTRIM],"g");c("HYPHENRANGE"),i[o.HYPHENRANGE]="^\\s*("+i[o.XRANGEPLAIN]+")\\s+-\\s+("+i[o.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),i[o.HYPHENRANGELOOSE]="^\\s*("+i[o.XRANGEPLAINLOOSE]+")\\s+-\\s+("+i[o.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),i[o.STAR]="(<|>)?=?\\s*\\*";for(var l=0;l<u;l++)r(l,i[l]),a[l]||(a[l]=new RegExp(i[l]));function d(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof f)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?a[o.LOOSE]:a[o.FULL]).test(e))return null;try{return new f(e,t)}catch(e){return null}}function f(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof f){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof f))return new f(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?a[o.LOOSE]:a[o.FULL]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<n)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=d,t.valid=function(e,t){var r=d(e,t);return r?r.version:null},t.clean=function(e,t){var r=d(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=f,f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.toString=function(){return this.version},f.prototype.compare=function(e){return r("SemVer.compare",this.version,this.options,e),e instanceof f||(e=new f(e,this.options)),this.compareMain(e)||this.comparePre(e)},f.prototype.compareMain=function(e){return e instanceof f||(e=new f(e,this.options)),h(this.major,e.major)||h(this.minor,e.minor)||h(this.patch,e.patch)},f.prototype.comparePre=function(e){if(e instanceof f||(e=new f(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var n=this.prerelease[t],a=e.prerelease[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return-1;if(n!==a)return h(n,a)}while(++t)},f.prototype.compareBuild=function(e){e instanceof f||(e=new f(e,this.options));var t=0;do{var n=this.build[t],a=e.build[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return-1;if(n!==a)return h(n,a)}while(++t)},f.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new f(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(w(e,t))return null;var r=d(e),n=d(t),a="";if(r.prerelease.length||n.prerelease.length){a="pre";var i="prerelease"}for(var s in r)if(("major"===s||"minor"===s||"patch"===s)&&r[s]!==n[s])return a+s;return i},t.compareIdentifiers=h;var p=/^[0-9]+$/;function h(e,t){var r=p.test(e),n=p.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}function v(e,t,r){return new f(e,r).compare(new f(t,r))}function y(e,t,r){return v(e,t,r)>0}function m(e,t,r){return v(e,t,r)<0}function w(e,t,r){return 0===v(e,t,r)}function g(e,t,r){return 0!==v(e,t,r)}function k(e,t,r){return v(e,t,r)>=0}function b(e,t,r){return v(e,t,r)<=0}function x(e,t,r,n){switch(t){case"===":return"object"===s(e)&&(e=e.version),"object"===s(r)&&(r=r.version),e===r;case"!==":return"object"===s(e)&&(e=e.version),"object"===s(r)&&(r=r.version),e!==r;case"":case"=":case"==":return w(e,r,n);case"!=":return g(e,r,n);case">":return y(e,r,n);case">=":return k(e,r,n);case"<":return m(e,r,n);case"<=":return b(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function _(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof _){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof _))return new _(e,t);r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===R?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return h(t,e)},t.major=function(e,t){return new f(e,t).major},t.minor=function(e,t){return new f(e,t).minor},t.patch=function(e,t){return new f(e,t).patch},t.compare=v,t.compareLoose=function(e,t){return v(e,t,!0)},t.compareBuild=function(e,t,r){var n=new f(e,r),a=new f(t,r);return n.compare(a)||n.compareBuild(a)},t.rcompare=function(e,t,r){return v(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=y,t.lt=m,t.eq=w,t.neq=g,t.gte=k,t.lte=b,t.cmp=x,t.Comparator=_;var R={};function I(e,t){if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof I)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new I(e.raw,t);if(e instanceof _)return new I(e.value,t);if(!(this instanceof I))return new I(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function E(e,t){for(var r=!0,n=e.slice(),a=n.pop();r&&n.length;)r=n.every((function(e){return a.intersects(e,t)})),a=n.pop();return r}function T(e){return!e||"x"===e.toLowerCase()||"*"===e}function S(e,t,r,n,a,i,s,o,u,c,l,d,f){return((t=T(r)?"":T(n)?">="+r+".0.0":T(a)?">="+r+"."+n+".0":">="+t)+" "+(o=T(u)?"":T(c)?"<"+(+u+1)+".0.0":T(l)?"<"+u+"."+(+c+1)+".0":d?"<="+u+"."+c+"."+l+"-"+d:"<="+o)).trim()}function P(e,t,n){for(var a=0;a<e.length;a++)if(!e[a].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(a=0;a<e.length;a++)if(r(e[a].semver),e[a].semver!==R&&e[a].semver.prerelease.length>0){var i=e[a].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function q(e,t,r){try{t=new I(t,r)}catch(e){return!1}return t.test(e)}function A(e,t,r,n){var a,i,s,o,u;switch(e=new f(e,n),t=new I(t,n),r){case">":a=y,i=b,s=m,o=">",u=">=";break;case"<":a=m,i=k,s=y,o="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(q(e,t,n))return!1;for(var c=0;c<t.set.length;++c){var l=t.set[c],d=null,p=null;if(l.forEach((function(e){e.semver===R&&(e=new _(">=0.0.0")),d=d||e,p=p||e,a(e.semver,d.semver,n)?d=e:s(e.semver,p.semver,n)&&(p=e)})),d.operator===o||d.operator===u)return!1;if((!p.operator||p.operator===o)&&i(e,p.semver))return!1;if(p.operator===u&&s(e,p.semver))return!1}return!0}_.prototype.parse=function(e){var t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new f(r[2],this.options.loose):this.semver=R},_.prototype.toString=function(){return this.value},_.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===R||e===R)return!0;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}return x(e,this.operator,this.semver,this.options)},_.prototype.intersects=function(e,t){if(!(e instanceof _))throw new TypeError("a Comparator is required");var r;if(t&&"object"===s(t)||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new I(e.value,t),q(this.value,r,t));if(""===e.operator)return""===e.value||(r=new I(this.value,t),q(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),a=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=x(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=x(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||a||i&&o||u||c},t.Range=I,I.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},I.prototype.toString=function(){return this.range},I.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?a[o.HYPHENRANGELOOSE]:a[o.HYPHENRANGE];e=e.replace(n,S),r("hyphen replace",e),e=e.replace(a[o.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,a[o.COMPARATORTRIM]),e=(e=(e=e.replace(a[o.TILDETRIM],"$1~")).replace(a[o.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],s=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?a[o.CARETLOOSE]:a[o.CARET];return e.replace(n,(function(t,n,a,i,s){var o;return r("caret",e,t,n,a,i,s),T(n)?o="":T(a)?o=">="+n+".0.0 <"+(+n+1)+".0.0":T(i)?o="0"===n?">="+n+"."+a+".0 <"+n+"."+(+a+1)+".0":">="+n+"."+a+".0 <"+(+n+1)+".0.0":s?(r("replaceCaret pr",s),o="0"===n?"0"===a?">="+n+"."+a+"."+i+"-"+s+" <"+n+"."+a+"."+(+i+1):">="+n+"."+a+"."+i+"-"+s+" <"+n+"."+(+a+1)+".0":">="+n+"."+a+"."+i+"-"+s+" <"+(+n+1)+".0.0"):(r("no pr"),o="0"===n?"0"===a?">="+n+"."+a+"."+i+" <"+n+"."+a+"."+(+i+1):">="+n+"."+a+"."+i+" <"+n+"."+(+a+1)+".0":">="+n+"."+a+"."+i+" <"+(+n+1)+".0.0"),r("caret return",o),o}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?a[o.TILDELOOSE]:a[o.TILDE];return e.replace(n,(function(t,n,a,i,s){var o;return r("tilde",e,t,n,a,i,s),T(n)?o="":T(a)?o=">="+n+".0.0 <"+(+n+1)+".0.0":T(i)?o=">="+n+"."+a+".0 <"+n+"."+(+a+1)+".0":s?(r("replaceTilde pr",s),o=">="+n+"."+a+"."+i+"-"+s+" <"+n+"."+(+a+1)+".0"):o=">="+n+"."+a+"."+i+" <"+n+"."+(+a+1)+".0",r("tilde return",o),o}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?a[o.XRANGELOOSE]:a[o.XRANGE];return e.replace(n,(function(n,a,i,s,o,u){r("xRange",e,n,a,i,s,o,u);var c=T(i),l=c||T(s),d=l||T(o),f=d;return"="===a&&f&&(a=""),u=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&f?(l&&(s=0),o=0,">"===a?(a=">=",l?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===a&&(a="<",l?i=+i+1:s=+s+1),n=a+i+"."+s+"."+o+u):l?n=">="+i+".0.0"+u+" <"+(+i+1)+".0.0"+u:d&&(n=">="+i+"."+s+".0"+u+" <"+i+"."+(+s+1)+".0"+u),r("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(a[o.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s=s.map((function(e){return new _(e,this.options)}),this)},I.prototype.intersects=function(e,t){if(!(e instanceof I))throw new TypeError("a Range is required");return this.set.some((function(r){return E(r,t)&&e.set.some((function(e){return E(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new I(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},I.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(P(this.set[t],e,this.options))return!0;return!1},t.satisfies=q,t.maxSatisfying=function(e,t,r){var n=null,a=null;try{var i=new I(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(n&&-1!==a.compare(e)||(a=new f(n=e,r)))})),n},t.minSatisfying=function(e,t,r){var n=null,a=null;try{var i=new I(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(n&&1!==a.compare(e)||(a=new f(n=e,r)))})),n},t.minVersion=function(e,t){e=new I(e,t);var r=new f("0.0.0");if(e.test(r))return r;if(r=new f("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;n<e.set.length;++n){e.set[n].forEach((function(e){var t=new f(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!y(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new I(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return A(e,t,"<",r)},t.gtr=function(e,t,r){return A(e,t,">",r)},t.outside=A,t.prerelease=function(e,t){var r=d(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new I(e,r),t=new I(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof f)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=a[o.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),a[o.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;a[o.COERCERTL].lastIndex=-1}else r=e.match(a[o.COERCE]);if(null===r)return null;return d(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}(qi,qi.exports);var Ai=qi.exports;var Oi=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e};var Ci=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},Ui=Math.floor,Li=Math.random;var Ni=function(e,t){return e+Ui(Li()*(t-e+1))};var Bi=function(e,t){var r=-1,n=e.length,a=n-1;for(t=void 0===t?n:t;++r<t;){var i=Ni(r,a),s=e[i];e[i]=e[r],e[r]=s}return e.length=t,e},Di=Oi,ji=Ci,Fi=Bi;var Gi=function(e,t){return Fi(ji(e),Di(t,0,e.length))};var Mi=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a};var Hi=function(e,t){return Mi(t,(function(t){return e[t]}))};var Wi=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},Vi="object"==s(o)&&o&&o.Object===Object&&o,zi=Vi,Xi="object"==("undefined"==typeof self?"undefined":s(self))&&self&&self.Object===Object&&self,$i=zi||Xi||Function("return this")(),Yi=$i.Symbol,Ki=Yi,Ji=Object.prototype,Zi=Ji.hasOwnProperty,Qi=Ji.toString,es=Ki?Ki.toStringTag:void 0;var ts=function(e){var t=Zi.call(e,es),r=e[es];try{e[es]=void 0;var n=!0}catch(e){}var a=Qi.call(e);return n&&(t?e[es]=r:delete e[es]),a},rs=Object.prototype.toString;var ns=ts,as=function(e){return rs.call(e)},is=Yi?Yi.toStringTag:void 0;var ss=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":is&&is in Object(e)?ns(e):as(e)};var os=function(e){return null!=e&&"object"==s(e)},us=ss,cs=os;var ls=function(e){return cs(e)&&"[object Arguments]"==us(e)},ds=os,fs=Object.prototype,ps=fs.hasOwnProperty,hs=fs.propertyIsEnumerable,vs=ls(function(){return arguments}())?ls:function(e){return ds(e)&&ps.call(e,"callee")&&!hs.call(e,"callee")},ys=vs,ms=Array.isArray,ws={exports:{}};var gs=function(){return!1};!function(e,t){var r=$i,n=gs,a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?r.Buffer:void 0,o=(s?s.isBuffer:void 0)||n;e.exports=o}(ws,ws.exports);var ks=/^(?:0|[1-9]\d*)$/;var bs=function(e,t){var r=s(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ks.test(e))&&e>-1&&e%1==0&&e<t};var xs=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},_s=ss,Rs=xs,Is=os,Es={};Es["[object Float32Array]"]=Es["[object Float64Array]"]=Es["[object Int8Array]"]=Es["[object Int16Array]"]=Es["[object Int32Array]"]=Es["[object Uint8Array]"]=Es["[object Uint8ClampedArray]"]=Es["[object Uint16Array]"]=Es["[object Uint32Array]"]=!0,Es["[object Arguments]"]=Es["[object Array]"]=Es["[object ArrayBuffer]"]=Es["[object Boolean]"]=Es["[object DataView]"]=Es["[object Date]"]=Es["[object Error]"]=Es["[object Function]"]=Es["[object Map]"]=Es["[object Number]"]=Es["[object Object]"]=Es["[object RegExp]"]=Es["[object Set]"]=Es["[object String]"]=Es["[object WeakMap]"]=!1;var Ts=function(e){return Is(e)&&Rs(e.length)&&!!Es[_s(e)]};var Ss=function(e){return function(t){return e(t)}},Ps={exports:{}};!function(e,t){var r=Vi,n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s}(Ps,Ps.exports);var qs=Ts,As=Ss,Os=Ps.exports,Cs=Os&&Os.isTypedArray,Us=Cs?As(Cs):qs,Ls=Wi,Ns=ys,Bs=ms,Ds=ws.exports,js=bs,Fs=Us,Gs=Object.prototype.hasOwnProperty;var Ms=function(e,t){var r=Bs(e),n=!r&&Ns(e),a=!r&&!n&&Ds(e),i=!r&&!n&&!a&&Fs(e),s=r||n||a||i,o=s?Ls(e.length,String):[],u=o.length;for(var c in e)!t&&!Gs.call(e,c)||s&&("length"==c||a&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||js(c,u))||o.push(c);return o},Hs=Object.prototype;var Ws=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Hs)};var Vs=function(e,t){return function(r){return e(t(r))}},zs=Vs(Object.keys,Object),Xs=Ws,$s=zs,Ys=Object.prototype.hasOwnProperty;var Ks=function(e){var t=s(e);return null!=e&&("object"==t||"function"==t)},Js=ss,Zs=Ks;var Qs=function(e){if(!Zs(e))return!1;var t=Js(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},eo=Qs,to=xs;var ro=function(e){return null!=e&&to(e.length)&&!eo(e)},no=Ms,ao=function(e){if(!Xs(e))return $s(e);var t=[];for(var r in Object(e))Ys.call(e,r)&&"constructor"!=r&&t.push(r);return t},io=ro;var so=Hi,oo=function(e){return io(e)?no(e):ao(e)};var uo=Oi,co=Bi,lo=function(e){return null==e?[]:so(e,oo(e))};var fo=function(e,t){return e===t||e!=e&&t!=t},po=fo,ho=ro,vo=bs,yo=Ks;var mo=function(e,t,r){if(!yo(r))return!1;var n=s(t);return!!("number"==n?ho(r)&&vo(t,r.length):"string"==n&&t in r)&&po(r[t],e)},wo=/\s/;var go=function(e){for(var t=e.length;t--&&wo.test(e.charAt(t)););return t},ko=/^\s+/;var bo=ss,xo=os;var _o=function(e){return e?e.slice(0,go(e)+1).replace(ko,""):e},Ro=Ks,Io=function(e){return"symbol"==s(e)||xo(e)&&"[object Symbol]"==bo(e)},Eo=/^[-+]0x[0-9a-f]+$/i,To=/^0b[01]+$/i,So=/^0o[0-7]+$/i,Po=parseInt;var qo=function(e){if("number"==typeof e)return e;if(Io(e))return NaN;if(Ro(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ro(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_o(e);var r=To.test(e);return r||So.test(e)?Po(e.slice(2),r?2:8):Eo.test(e)?NaN:+e},Ao=1/0;var Oo=function(e){return e?(e=qo(e))===Ao||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Co=Gi,Uo=function(e,t){var r=lo(e);return co(r,uo(t,0,r.length))},Lo=ms,No=mo,Bo=function(e){var t=Oo(e),r=t%1;return t==t?r?t-r:t:0};var Do,jo=function(e,t,r){return t=(r?No(e,t,r):void 0===t)?1:Bo(t),(Lo(e)?Co:Uo)(e,t)};!function(e){e.UNHEALTHY="unhealthy",e.BEHIND="behind",e.HEALTHY="healthy"}(Do||(Do={}));var Fo={minVersion:"0.3.72",discoveryNodes:["https://audius-metadata-1.figment.io","https://audius-metadata-2.figment.io","https://audius-discovery-1.altego.net","https://audius-disco.ams-x01.nl.supercache.org","https://dn-jpn.audius.metadata.fyi","https://discoveryprovider3.audius.co","https://discoveryprovider2.audius.co","https://discoveryprovider.audius.co","https://audius-metadata-3.figment.io","https://audius-metadata-4.figment.io","https://dn1.monophonic.digital","https://dn-usa.audius.metadata.fyi","https://discovery-us-01.audius.openplayer.org","https://dn2.monophonic.digital","https://audius-discovery-2.altego.net","https://dn1.nodeoperator.io","https://audius-disco.dfw-x02.us.supercache.org","https://audius-discovery-3.altego.net","https://dn1.matterlightblooming.xyz","https://audius-dp.singapore.creatorseed.com","https://discovery.grassfed.network","https://audius-discovery-1.cultur3stake.com","https://audius-discovery-3.cultur3stake.com","https://audius-discovery-4.cultur3stake.com","https://audius-discovery-5.cultur3stake.com","https://audius-discovery-7.cultur3stake.com","https://audius-discovery-8.cultur3stake.com","https://audius-discovery-9.cultur3stake.com","https://audius-discovery-10.cultur3stake.com","https://discovery-au-02.audius.openplayer.org","https://disc-lon01.audius.hashbeam.com","https://audius-dp.amsterdam.creatorseed.com","https://blockdaemon-audius-discovery-01.bdnodes.net","https://blockdaemon-audius-discovery-02.bdnodes.net","https://blockdaemon-audius-discovery-03.bdnodes.net","https://blockdaemon-audius-discovery-04.bdnodes.net","https://blockdaemon-audius-discovery-05.bdnodes.net","https://blockdaemon-audius-discovery-06.bdnodes.net","https://blockdaemon-audius-discovery-07.bdnodes.net","https://blockchange-audius-discovery-01.bdnodes.net","https://blockchange-audius-discovery-02.bdnodes.net","https://blockchange-audius-discovery-03.bdnodes.net","https://audius-discovery-11.cultur3stake.com","https://audius-discovery-12.cultur3stake.com","https://audius-discovery-13.cultur3stake.com","https://audius-discovery-14.cultur3stake.com","https://audius-discovery-16.cultur3stake.com","https://audius-discovery-18.cultur3stake.com","https://audius-discovery-17.cultur3stake.com","https://audius-discovery-15.cultur3stake.com","https://audius-discovery-6.cultur3stake.com","https://audius-discovery-2.cultur3stake.com","https://blockdaemon-audius-discovery-08.bdnodes.net","https://audius-metadata-5.figment.io","https://audius-metadata-1.decentralizeaudio.xyz"]},Go="discovery-node",Mo={initialSelectedNode:null,blocklist:null,allowlist:null,maxConcurrentRequests:6,requestTimeout:3e4,unhealthyTTL:36e5,backupsTTL:12e4,healthCheckThresholds:{minVersion:Fo.minVersion,maxSlotDiffPlays:null,maxBlockDiff:15},bootstrapServices:Fo.discoveryNodes};function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wo(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ho(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ho(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Vo=function(e,t){return Ai.major(e)===Ai.major(t)&&Ai.minor(e)===Ai.minor(t)},zo=function(e){var t,r=e.data,n=e.healthCheckThresholds,a=n.minVersion,i=n.maxBlockDiff,s=n.maxSlotDiffPlays;if(null!==(t=r.version)&&void 0!==t&&t.service&&r.version.service!==Go)return{health:Do.UNHEALTHY,reason:"name"};if(a){if(r.version&&(!r.version.version||!Vo(r.version.version,a)))return{health:Do.UNHEALTHY,reason:"version"};if(r.version&&Ai.lt(r.version.version,a))return{health:Do.BEHIND,reason:"version"}}return function(e){var t=e.data,r=e.maxBlockDiff;return null===t.latest_chain_block||null===t.latest_indexed_block||void 0===t.latest_chain_block||void 0===t.latest_indexed_block||t.latest_chain_block-t.latest_indexed_block<=r}({data:r,maxBlockDiff:i})?function(e){var t=e.data,r=e.maxSlotDiffPlays;return!r||!t.latest_chain_slot_plays||!t.latest_indexed_slot_plays||t.latest_chain_slot_plays-t.latest_indexed_slot_plays<=r}({data:r,maxSlotDiffPlays:s})?{health:Do.HEALTHY}:{health:Do.BEHIND,reason:"slot diff"}:{health:Do.BEHIND,reason:"block diff"}},Xo=function(){var e=r(f.mark((function e(t,r){var n,a,i,s;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(t,"/health_check"),a=null,e.next=4,ai(n,r);case 4:if((i=e.sent).ok){e.next=7;break}throw new Error(i.statusText);case 7:return e.next=9,i.json();case 9:if(s=e.sent,a=s.data){e.next=13;break}throw new Error("data");case 13:return e.abrupt("return",a);case 14:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),$o=function(e){var t=e.data,r=e.healthCheckThresholds,n=r.minVersion,a=r.maxBlockDiff,i=r.maxSlotDiffPlays;if(null===t)return{health:Do.UNHEALTHY,reason:"data"};if(t.service!==Go)return{health:Do.UNHEALTHY,reason:"name"};if(n){if(!t.version||!Vo(t.version,n))return{health:Do.UNHEALTHY,reason:"version"};if(Ai.lt(t.version,n))return{health:Do.BEHIND,reason:"version"}}return function(e){var t=e.data,r=e.maxBlockDiff;return void 0===t.block_difference||null===t.block_difference||t.block_difference<=r}({data:t,maxBlockDiff:a})?function(e){var t,r,n,a,i,s,o,u,c=e.data,l=e.maxSlotDiffPlays;return!(null!==(t=c.plays)&&void 0!==t&&t.is_unhealthy||null!==(r=c.rewards_manager)&&void 0!==r&&r.is_unhealthy||null!==(n=c.spl_audio_info)&&void 0!==n&&n.is_unhealthy||null!==(a=c.user_bank)&&void 0!==a&&a.is_unhealthy||null!==(i=c.plays)&&void 0!==i&&null!==(s=i.tx_info)&&void 0!==s&&s.slot_diff&&null!==l&&!((null===(o=c.plays)||void 0===o||null===(u=o.tx_info)||void 0===u?void 0:u.slot_diff)<=l))}({data:t,maxSlotDiffPlays:i})?{health:Do.HEALTHY}:{health:Do.BEHIND,reason:"slot diff"}:{health:Do.BEHIND,reason:"block diff"}},Yo=function(){var e=r(f.mark((function e(t){var r,n,a,i,s,o,u,c;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.endpoint,n=t.healthCheckThresholds,a=t.fetchOptions,i=t.timeoutMs,s=[],void 0!==i&&(o=new Promise((function(e,t){return setTimeout((function(){return t(new Error("timeout"))}),i)})),s.push(o)),e.prev=3,e.next=6,Promise.race([Xo(r,a)].concat(s));case 6:return u=e.sent,c=$o({data:u,healthCheckThresholds:n}),e.abrupt("return",Wo(Wo({},c),{},{data:u}));case 11:return e.prev=11,e.t0=e.catch(3),e.abrupt("return",{health:Do.UNHEALTHY,reason:null===e.t0||void 0===e.t0?void 0:e.t0.message,data:null});case 14:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),Ko=function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Promise.any){e.next=2;break}return e.abrupt("return",Promise.any(t));case 2:return e.next=4,Promise.all(I(t).map(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,r){Promise.resolve(t).then(r,e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then(function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.reject(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(){var e=r(f.mark((function e(t){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Jo="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;if(!Jo)throw new Error("Unable to find global scope. Are you sure this is running in the browser?");if(!Jo.AbortController)throw new Error('Could not find "AbortController" in the global scope. You need to polyfill it first');var Zo=Jo.AbortController;var Qo=function(){this.__data__=[],this.size=0},eu=fo;var tu=function(e,t){for(var r=e.length;r--;)if(eu(e[r][0],t))return r;return-1},ru=tu,nu=Array.prototype.splice;var au=tu;var iu=tu;var su=tu;var ou=Qo,uu=function(e){var t=this.__data__,r=ru(t,e);return!(r<0)&&(r==t.length-1?t.pop():nu.call(t,r,1),--this.size,!0)},cu=function(e){var t=this.__data__,r=au(t,e);return r<0?void 0:t[r][1]},lu=function(e){return iu(this.__data__,e)>-1},du=function(e,t){var r=this.__data__,n=su(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function fu(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fu.prototype.clear=ou,fu.prototype.delete=uu,fu.prototype.get=cu,fu.prototype.has=lu,fu.prototype.set=du;var pu=fu,hu=pu;var vu=function(){this.__data__=new hu,this.size=0};var yu=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var mu=function(e){return this.__data__.get(e)};var wu,gu=function(e){return this.__data__.has(e)},ku=$i["__core-js_shared__"],bu=(wu=/[^.]+$/.exec(ku&&ku.keys&&ku.keys.IE_PROTO||""))?"Symbol(src)_1."+wu:"";var xu=function(e){return!!bu&&bu in e},_u=Function.prototype.toString;var Ru=Qs,Iu=xu,Eu=Ks,Tu=function(e){if(null!=e){try{return _u.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Su=/^\[object .+?Constructor\]$/,Pu=Function.prototype,qu=Object.prototype,Au=Pu.toString,Ou=qu.hasOwnProperty,Cu=RegExp("^"+Au.call(Ou).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Uu=function(e){return!(!Eu(e)||Iu(e))&&(Ru(e)?Cu:Su).test(Tu(e))},Lu=function(e,t){return null==e?void 0:e[t]};var Nu=function(e,t){var r=Lu(e,t);return Uu(r)?r:void 0},Bu=Nu($i,"Map"),Du=Nu(Object,"create"),ju=Du;var Fu=function(){this.__data__=ju?ju(null):{},this.size=0};var Gu=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Mu=Du,Hu=Object.prototype.hasOwnProperty;var Wu=function(e){var t=this.__data__;if(Mu){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return Hu.call(t,e)?t[e]:void 0},Vu=Du,zu=Object.prototype.hasOwnProperty;var Xu=Du;var $u=Fu,Yu=Gu,Ku=Wu,Ju=function(e){var t=this.__data__;return Vu?void 0!==t[e]:zu.call(t,e)},Zu=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Xu&&void 0===t?"__lodash_hash_undefined__":t,this};function Qu(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qu.prototype.clear=$u,Qu.prototype.delete=Yu,Qu.prototype.get=Ku,Qu.prototype.has=Ju,Qu.prototype.set=Zu;var ec=Qu,tc=pu,rc=Bu;var nc=function(e){var t=s(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ac=function(e,t){var r=e.__data__;return nc(t)?r["string"==typeof t?"string":"hash"]:r.map},ic=ac;var sc=ac;var oc=ac;var uc=ac;var cc=function(){this.size=0,this.__data__={hash:new ec,map:new(rc||tc),string:new ec}},lc=function(e){var t=ic(this,e).delete(e);return this.size-=t?1:0,t},dc=function(e){return sc(this,e).get(e)},fc=function(e){return oc(this,e).has(e)},pc=function(e,t){var r=uc(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function hc(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}hc.prototype.clear=cc,hc.prototype.delete=lc,hc.prototype.get=dc,hc.prototype.has=fc,hc.prototype.set=pc;var vc=pu,yc=Bu,mc=hc;var wc=pu,gc=vu,kc=yu,bc=mu,xc=gu,_c=function(e,t){var r=this.__data__;if(r instanceof vc){var n=r.__data__;if(!yc||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new mc(n)}return r.set(e,t),this.size=r.size,this};function Rc(e){var t=this.__data__=new wc(e);this.size=t.size}Rc.prototype.clear=gc,Rc.prototype.delete=kc,Rc.prototype.get=bc,Rc.prototype.has=xc,Rc.prototype.set=_c;var Ic=Rc,Ec=Nu,Tc=function(){try{var e=Ec(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Sc=Tc;var Pc=function(e,t,r){"__proto__"==t&&Sc?Sc(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},qc=Pc,Ac=fo;var Oc=function(e,t,r){(void 0!==r&&!Ac(e[t],r)||void 0===r&&!(t in e))&&qc(e,t,r)};var Cc=function(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),o=s.length;o--;){var u=s[e?o:++a];if(!1===r(i[u],u,i))break}return t}}(),Uc={exports:{}};!function(e,t){var r=$i,n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}}(Uc,Uc.exports);var Lc=$i.Uint8Array;var Nc=function(e){var t=new e.constructor(e.byteLength);return new Lc(t).set(new Lc(e)),t};var Bc=function(e,t){var r=t?Nc(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Dc=Ks,jc=Object.create,Fc=function(){function e(){}return function(t){if(!Dc(t))return{};if(jc)return jc(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Gc=Vs(Object.getPrototypeOf,Object),Mc=Fc,Hc=Gc,Wc=Ws;var Vc=function(e){return"function"!=typeof e.constructor||Wc(e)?{}:Mc(Hc(e))},zc=ro,Xc=os;var $c=function(e){return Xc(e)&&zc(e)},Yc=ss,Kc=Gc,Jc=os,Zc=Function.prototype,Qc=Object.prototype,el=Zc.toString,tl=Qc.hasOwnProperty,rl=el.call(Object);var nl=function(e){if(!Jc(e)||"[object Object]"!=Yc(e))return!1;var t=Kc(e);if(null===t)return!0;var r=tl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&el.call(r)==rl};var al=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},il=Pc,sl=fo,ol=Object.prototype.hasOwnProperty;var ul=function(e,t,r){var n=e[t];ol.call(e,t)&&sl(n,r)&&(void 0!==r||t in e)||il(e,t,r)},cl=Pc;var ll=function(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var o=t[i],u=n?n(r[o],e[o],o,r,e):void 0;void 0===u&&(u=e[o]),a?cl(r,o,u):ul(r,o,u)}return r};var dl=Ks,fl=Ws,pl=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},hl=Object.prototype.hasOwnProperty;var vl=Ms,yl=function(e){if(!dl(e))return pl(e);var t=fl(e),r=[];for(var n in e)("constructor"!=n||!t&&hl.call(e,n))&&r.push(n);return r},ml=ro;var wl=function(e){return ml(e)?vl(e,!0):yl(e)},gl=ll,kl=wl;var bl=Oc,xl=Uc.exports,_l=Bc,Rl=Ci,Il=Vc,El=ys,Tl=ms,Sl=$c,Pl=ws.exports,ql=Qs,Al=Ks,Ol=nl,Cl=Us,Ul=al,Ll=function(e){return gl(e,kl(e))};var Nl=Ic,Bl=Oc,Dl=Cc,jl=function(e,t,r,n,a,i,s){var o=Ul(e,r),u=Ul(t,r),c=s.get(u);if(c)bl(e,r,c);else{var l=i?i(o,u,r+"",e,t,s):void 0,d=void 0===l;if(d){var f=Tl(u),p=!f&&Pl(u),h=!f&&!p&&Cl(u);l=u,f||p||h?Tl(o)?l=o:Sl(o)?l=Rl(o):p?(d=!1,l=xl(u,!0)):h?(d=!1,l=_l(u,!0)):l=[]:Ol(u)||El(u)?(l=o,El(o)?l=Ll(o):Al(o)&&!ql(o)||(l=Il(u))):d=!1}d&&(s.set(u,l),a(l,u,n,i,s),s.delete(u)),bl(e,r,l)}},Fl=Ks,Gl=wl,Ml=al;var Hl=function e(t,r,n,a,i){t!==r&&Dl(r,(function(s,o){if(i||(i=new Nl),Fl(s))jl(t,r,o,n,e,a,i);else{var u=a?a(Ml(t,o),s,o+"",t,r,i):void 0;void 0===u&&(u=s),Bl(t,o,u)}}),Gl)};var Wl=function(e){return e};var Vl=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},zl=Math.max;var Xl=function(e,t,r){return t=zl(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=zl(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var o=Array(t+1);++a<t;)o[a]=n[a];return o[t]=r(s),Vl(e,this,o)}};var $l=function(e){return function(){return e}},Yl=Tc,Kl=Yl?function(e,t){return Yl(e,"toString",{configurable:!0,enumerable:!1,value:$l(t),writable:!0})}:Wl,Jl=Date.now;var Zl=function(e){var t=0,r=0;return function(){var n=Jl(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},Ql=Zl(Kl),ed=Wl,td=Xl,rd=Ql;var nd=function(e,t){return rd(td(e,t,ed),e+"")},ad=mo;var id=Hl,sd=function(e){return nd((function(t,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(a--,i):void 0,s&&ad(r[0],r[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++n<a;){var o=r[n];o&&e(t,o,n,i)}return t}))}((function(e,t,r,n){id(e,t,r,n)})),od=function(e,t){return sd({},t,e,(function(e,t){if(Array.isArray(t))return t}))},ud=function(){function e(t){var r,a;n(this,e),this.unhealthyCleanupTimeout=null,this.backupCleanupTimeout=null,this.config=od(t,Mo),this.services=this.config.bootstrapServices,this._isBehind=!1,this.unhealthyServices=new Set([]),this.backupServices={},this.selectedNode=!this.config.initialSelectedNode||this.config.allowlist&&(null===(r=this.config.allowlist)||void 0===r||!r.has(this.config.initialSelectedNode))||null!==(a=this.config.blocklist)&&void 0!==a&&a.has(this.config.initialSelectedNode)?null:this.config.initialSelectedNode,this.eventEmitter=new sn,this.addEventListener=this.eventEmitter.addListener.bind(this.eventEmitter),this.removeEventListener=this.eventEmitter.removeListener.bind(this.eventEmitter)}var t,a,s,o,u;return i(e,[{key:"isBehind",get:function(){return this._isBehind},set:function(e){e&&!this._isBehind?this.warn("using behind discovery node",this.selectedNode):!e&&this._isBehind&&this.info("discovery node no longer behind",this.selectedNode),this._isBehind=e}},{key:"updateConfig",value:function(e){var t;(this.config=od(e,this.config),this.selectedNode)&&((e.healthCheckThresholds||e.allowlist&&!e.allowlist.has(this.selectedNode)||null!==(t=e.blocklist)&&void 0!==t&&t.has(this.selectedNode))&&(this.selectedNode=null))}},{key:"createMiddleware",value:function(){var e,t,n=this,a=this.getSelectedEndpoint();return{pre:(t=r(f.mark((function e(t){var r,n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.url).startsWith("http")){e.next=6;break}return e.next=4,a;case 4:n=e.sent,r="".concat(n).concat(t.url);case 6:return e.abrupt("return",{url:r,init:t.init});case 7:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),post:(e=r(f.mark((function e(t){var r,i,s,o,u,c,l,d,p,h,v,y,m,w,g,k,b,x;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.response,e.next=3,a;case 3:if(i=e.sent){e.next=9;break}return e.next=7,n.select();case 7:case 17:e.next=33;break;case 9:if(!r.ok){e.next=19;break}return l=r.clone(),e.next=13,l.json();case 13:return d=e.sent,p=zo({data:d,healthCheckThresholds:n.config.healthCheckThresholds}),h=p.health,v=p.reason,e.next=17,n.reselectIfNecessary({endpoint:i,health:h,reason:v,data:{block_difference:(null!==(s=d.latest_chain_block)&&void 0!==s?s:0)-(null!==(o=d.latest_indexed_block)&&void 0!==o?o:0),version:null!==(u=null===(c=d.version)||void 0===c?void 0:c.version)&&void 0!==u?u:""}});case 19:return n.warn("request failed",i,t),e.next=22,Yo({endpoint:i,healthCheckThresholds:n.config.healthCheckThresholds});case 22:return w=e.sent,g=w.health,k=w.data,b=w.reason,e.next=28,n.reselectIfNecessary({endpoint:i,health:g,reason:b,data:{block_difference:null!==(y=null==k?void 0:k.block_difference)&&void 0!==y?y:0,version:null!==(m=null==k?void 0:k.version)&&void 0!==m?m:""}});case 28:if(!(x=e.sent)||x===i){e.next=33;break}return e.next=32,t.fetch("".concat(x).concat(t.url),t.init);case 32:return e.abrupt("return",e.sent);case 33:return e.abrupt("return",r);case 34:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}}},{key:"getSelectedEndpoint",value:(u=r(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.selectedNode){e.next=2;break}return e.abrupt("return",this.selectedNode);case 2:return e.next=4,this.select();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"getServices",value:function(){return this.services}},{key:"select",value:(o=r(f.mark((function e(){var t,r,n,a,i,s,o,u=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.debug("Selecting new discovery node..."),t=[],r=I(this.services),t.push({stage:ni.GET_ALL_SERVICES,val:r}),this.config.allowlist&&(r=r.filter((function(e){var t;return null===(t=u.config.allowlist)||void 0===t?void 0:t.has(e)})),t.push({stage:ni.FILTER_TO_WHITELIST,val:r})),this.config.blocklist&&(r=r.filter((function(e){var t;return!(null!==(t=u.config.blocklist)&&void 0!==t&&t.has(e))})),t.push({stage:ni.FILTER_FROM_BLACKLIST,val:r})),n=null,a=0;case 8:if(null!==n){e.next=37;break}if(i=r.filter((function(e){return!u.unhealthyServices.has(e)})),t.push({stage:ni.FILTER_OUT_KNOWN_UNHEALTHY,val:i}),0!==i.length){e.next=28;break}if(t.push({stage:ni.NO_SERVICES_LEFT_TO_TRY}),!(Object.keys(this.backupServices).length>0)){e.next=23;break}return e.next=16,this.selectFromBackups();case 16:return s=e.sent,t.push({stage:ni.SELECTED_FROM_BACKUP,val:s}),this.selectedNode=s,this.isBehind=!0,e.abrupt("return",s);case 23:return this.unhealthyServices=new Set([]),this.backupServices={},t.push({stage:ni.FAILED_AND_RESETTING}),this.error("Failed to select discovery node",t),e.abrupt("return",null);case 28:return o=jo(i,this.config.maxConcurrentRequests),t.push({stage:ni.GET_SELECTION_ROUND,val:o}),e.next=32,this.anyHealthyEndpoint(o);case 32:n=e.sent,a+=o.length,n||(t.push({stage:ni.ROUND_FAILED_RETRY}),this.debug("No healthy services found. Attempting another round...",{attemptedServicesCount:a})),e.next=8;break;case 37:return this.triggerCleanup(),t.push({stage:ni.MADE_A_SELECTION,val:n}),n&&(this.selectedNode=n,this.eventEmitter.emit("change",n)),this.info("Selected discprov ".concat(n),t,{attemptedServicesCount:a}),this.isBehind=!1,e.abrupt("return",n);case 43:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"anyHealthyEndpoint",value:(s=r(f.mark((function e(t){var n,a,i=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Zo,a=t.map(function(){var e=r(f.mark((function e(t){var r,a,s,o,u;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yo({endpoint:t,fetchOptions:{signal:n.signal},timeoutMs:i.config.requestTimeout,healthCheckThresholds:i.config.healthCheckThresholds});case 2:if(r=e.sent,a=r.health,s=r.data,o=r.reason,a===Do.HEALTHY){e.next=11;break}throw"Aborted"===o?i.debug("health_check",t,a,o):a===Do.UNHEALTHY?(i.unhealthyServices.add(t),i.warn("health_check",t,a,o)):a===Do.BEHIND&&(i.unhealthyServices.add(t),s&&(i.backupServices[t]={endpoint:t,block_difference:s.block_difference,version:s.version}),i.warn("health_check",t,a,o)),new Error("".concat(t," ").concat(a,": ").concat(o));case 11:return i.debug("health_check",t,a),n.abort(),null!=s&&null!==(u=s.network)&&void 0!==u&&u.discovery_nodes&&s.network.discovery_nodes.length>0?i.services=s.network.discovery_nodes:i.warn("Couldn't load new service list from healthy service",t),e.abrupt("return",t);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.prev=2,e.next=5,Ko(a);case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),this.error("No healthy nodes",e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e){return s.apply(this,arguments)})},{key:"reselectIfNecessary",value:(a=r(f.mark((function e(t){var r,n,a,i;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.endpoint,n=t.health,a=t.reason,i=t.data,n!==Do.HEALTHY){e.next=6;break}return this.isBehind=!1,e.abrupt("return",r);case 6:if(!this.isBehind||!Do.BEHIND){e.next=10;break}return e.abrupt("return",r);case 10:return n!==Do.UNHEALTHY&&i?n===Do.BEHIND&&(this.backupServices[r]={endpoint:r,block_difference:i.block_difference,version:i.version}):this.unhealthyServices.add(r),this.warn("api_health_check failed, reselecting",r,n,a),e.next=14,this.select();case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"triggerCleanup",value:function(){var e=this;this.unhealthyCleanupTimeout&&clearTimeout(this.unhealthyCleanupTimeout),this.backupCleanupTimeout&&clearTimeout(this.backupCleanupTimeout),this.unhealthyCleanupTimeout=setTimeout((function(){e.unhealthyServices=new Set([])}),this.config.unhealthyTTL),this.backupCleanupTimeout=setTimeout((function(){e.backupServices={}}),this.config.backupsTTL)}},{key:"selectFromBackups",value:(t=r(f.mark((function e(){var t,r,n,a,i=this;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object.values(this.backupServices).sort((function(e,t){var r=Ai.rcompare(e.version,t.version);return 0===r?e.block_difference-t.block_difference:r})),n=r.find((function(e){return e.block_difference<=i.config.healthCheckThresholds.maxBlockDiff})),a=r[0],n||!a){e.next=5;break}return e.abrupt("return",a.endpoint);case 5:return e.abrupt("return",null!==(t=null==n?void 0:n.endpoint)&&void 0!==t?t:null);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"debug",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).debug.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).info.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).warn.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).warn.apply(e,["[audius-sdk][discovery-node-selector]"].concat(r))}}]),e}(),cd=i((function e(){n(this,e),this.getSharedSecret=function(){throw new Error("WalletApi not initialized")},this.sign=function(){throw new Error("WalletApi not initialized")}}));function ld(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dd(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ld(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ld(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var fd=function(e){return dd(dd({},{discoveryNodeSelector:new ud,walletApi:new cd}),e.services)},pd=function(e){var t=e.appName,r=e.services,n=[ii({appName:t}),r.discoveryNodeSelector.createMiddleware()],a=new O({fetchApi:ai,middleware:n}),i=new Qe(a,r.discoveryNodeSelector),s=new Je(a),o=new Ve(a),u=new Xe(a),c=new tt(a).resolve,l=new ln(new O({fetchApi:ai,basePath:"",middleware:n}),r.walletApi,r.discoveryNodeSelector),d=new mn({fetchApi:ai,middleware:n});return{tracks:i,users:s,playlists:o,tips:u,resolve:c,full:{tracks:new Ja(d),users:new ti(d),search:new Xa(d),playlists:new Ha(d),reactions:new Va(d),tips:new Ya(d),transactions:new Qa(d)},chats:l}};window.audiusSdk=function(e){var t=e.appName,r=fd(e),n=pd({appName:t,services:r});return dd({oauth:"undefined"!=typeof window?new v({appName:t,usersApi:n.users}):void 0},n)}}();
|
|
5
5
|
//# sourceMappingURL=sdk.js.map
|