UNPKG

laudantiumculpa

Version:
1 lines 827 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Sendbird={})}(this,(function(e){function t(){t=function(){return n};var e,n={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var a=t&&t.prototype instanceof g?t:g,s=Object.create(a.prototype),o=new M(r||[]);return i(s,"_invoke",{value:S(e,n,o)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var f="suspendedStart",p="suspendedYield",v="executing",_="completed",m={};function g(){}function y(){}function E(){}var k={};l(k,o,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(U([])));w&&w!==r&&a.call(w,o)&&(k=w);var C=E.prototype=g.prototype=Object.create(k);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(r,i,s,o){var u=h(e[r],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&a.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,o)}),(function(e){n("throw",e,s,o)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,o)}))}o(u.arg)}var r;i(this,"_invoke",{value:function(e,a){function i(){return new t((function(t,r){n(e,a,t,r)}))}return r=r?r.then(i,i):i()}})}function S(t,n,r){var a=f;return function(i,s){if(a===v)throw new Error("Generator is already running");if(a===_){if("throw"===i)throw s;return{value:e,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var u=I(o,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=_,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=v;var c=h(t,n,r);if("normal"===c.type){if(a=r.done?_:p,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=_,r.method="throw",r.arg=c.arg)}}}function I(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var s=i.arg;return s?s.done?(n[t.resultName]=s.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function U(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(a.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=E,i(C,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:y,configurable:!0}),y.displayName=l(E,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,l(e,c,"GeneratorFunction")),e.prototype=Object.create(C),e},n.awrap=function(e){return{__await:e}},x(T.prototype),l(T.prototype,u,(function(){return this})),n.AsyncIterator=T,n.async=function(e,t,r,a,i){void 0===i&&(i=Promise);var s=new T(d(e,t,r,a),i);return n.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},x(C),l(C,c,"Generator"),l(C,o,(function(){return this})),l(C,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=U,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,a){return o.type="throw",o.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):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),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;A(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:U(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},n}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function i(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(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&&u(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function c(){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 l(e,t,n){return l=c()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&u(a,n.prototype),a},l.apply(null,arguments)}function d(e){var t="function"==typeof Map?new Map:void 0;return d=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;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 l(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},d(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t=c();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,n)}}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},p.apply(this,arguments)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,s,o=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}(e,t)||m(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.")}()}function _(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(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 m(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=m(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function E(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function k(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function o(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}u((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var b,w="4.11.2",C=function(){function e(){r(this,e)}return i(e,null,[{key:"OS_VERSION",get:function(){return"undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.replace(/,/g,"."):"noAgent"}},{key:"SDK_VERSION",get:function(){return w}},{key:"SDK_MAJOR_VERSION",get:function(){return e.SDK_VERSION.split(".")[0]}},{key:"DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL",get:function(){return 100}},{key:"INTERNAL_CALL",get:function(){return"ic"}}]),e}();!function(e){e[e.NON_AUTHORIZED=400108]="NON_AUTHORIZED",e[e.INVALID_TOKEN=400111]="INVALID_TOKEN",e[e.NOT_FOUND_IN_DATABASE=400201]="NOT_FOUND_IN_DATABASE",e[e.USER_AUTH_DEACTIVATED=400300]="USER_AUTH_DEACTIVATED",e[e.USER_AUTH_DELETED_OR_NOT_FOUND=400301]="USER_AUTH_DELETED_OR_NOT_FOUND",e[e.SESSION_TOKEN_EXPIRED=400302]="SESSION_TOKEN_EXPIRED",e[e.APPLICATION_NOT_FOUND=400304]="APPLICATION_NOT_FOUND",e[e.SESSION_KEY_EXPIRED=400309]="SESSION_KEY_EXPIRED",e[e.SESSION_REVOKED=400310]="SESSION_REVOKED",e[e.INVALID_SESSION_TYPE=400312]="INVALID_SESSION_TYPE",e[e.STAT_UPLOAD_NOT_ALLOWED=403200]="STAT_UPLOAD_NOT_ALLOWED",e[e.NOT_SUPPORTED_PINNED_MESSAGE_IN_REVIEW_MESSAGE=400940]="NOT_SUPPORTED_PINNED_MESSAGE_IN_REVIEW_MESSAGE",e[e.INTERNAL_SERVER_ERROR=500901]="INTERNAL_SERVER_ERROR",e[e.RATE_LIMIT_EXCEEDED=500910]="RATE_LIMIT_EXCEEDED",e[e.INVALID_FORM_KEY=400111]="INVALID_FORM_KEY",e[e.INVALID_REQUIRED_FORM_VALUE=400105]="INVALID_REQUIRED_FORM_VALUE",e[e.UNKNOWN_SERVER_ERROR=900200]="UNKNOWN_SERVER_ERROR",e[e.NOT_SUPPORTED_FEATURE_IN_IN_REVIEW_MESSAGE=901500]="NOT_SUPPORTED_FEATURE_IN_IN_REVIEW_MESSAGE",e[e.ERR_DUPLICATED_DATA=400202]="ERR_DUPLICATED_DATA",e[e.DEBUG_MODE_REQUIRED=7e5]="DEBUG_MODE_REQUIRED",e[e.LOST_INSTANCE=700100]="LOST_INSTANCE",e[e.CONNECTION_RENEW=700102]="CONNECTION_RENEW",e[e.INVALID_CONNECTION_STATE_TRANSITION=700200]="INVALID_CONNECTION_STATE_TRANSITION",e[e.INVALID_COMMAND=700700]="INVALID_COMMAND",e[e.XMLHTTPREQUEST_NOT_SUPPORTED=700800]="XMLHTTPREQUEST_NOT_SUPPORTED",e[e.UNKNOWN_ERROR=77e4]="UNKNOWN_ERROR",e[e.INVALID_INITIALIZATION=800100]="INVALID_INITIALIZATION",e[e.CONNECTION_REQUIRED=800101]="CONNECTION_REQUIRED",e[e.CONNECTION_CANCELED=800102]="CONNECTION_CANCELED",e[e.INVALID_PARAMETER=800110]="INVALID_PARAMETER",e[e.NOT_SUPPORTED_ERROR=800111]="NOT_SUPPORTED_ERROR",e[e.NETWORK_ERROR=800120]="NETWORK_ERROR",e[e.NETWORK_ROUTING_ERROR=800121]="NETWORK_ROUTING_ERROR",e[e.MALFORMED_DATA=800130]="MALFORMED_DATA",e[e.MALFORMED_ERROR_DATA=800140]="MALFORMED_ERROR_DATA",e[e.WRONG_CHANNEL_TYPE=800150]="WRONG_CHANNEL_TYPE",e[e.MARK_AS_READ_RATE_LIMIT_EXCEEDED=800160]="MARK_AS_READ_RATE_LIMIT_EXCEEDED",e[e.QUERY_IN_PROGRESS=800170]="QUERY_IN_PROGRESS",e[e.ACK_TIMEOUT=800180]="ACK_TIMEOUT",e[e.LOGIN_TIMEOUT=800190]="LOGIN_TIMEOUT",e[e.WEBSOCKET_CONNECTION_CLOSED=800200]="WEBSOCKET_CONNECTION_CLOSED",e[e.WEBSOCKET_CONNECTION_FAILED=800210]="WEBSOCKET_CONNECTION_FAILED",e[e.REQUEST_FAILED=800220]="REQUEST_FAILED",e[e.FILE_UPLOAD_CANCEL_FAILED=800230]="FILE_UPLOAD_CANCEL_FAILED",e[e.REQUEST_CANCELED=800240]="REQUEST_CANCELED",e[e.REQUEST_DUPLICATED=800250]="REQUEST_DUPLICATED",e[e.FILE_SIZE_LIMIT_EXCEEDED=800260]="FILE_SIZE_LIMIT_EXCEEDED",e[e.SESSION_TOKEN_REQUEST_FAILED=800500]="SESSION_TOKEN_REQUEST_FAILED",e[e.SESSION_TOKEN_REFRESHED=800501]="SESSION_TOKEN_REFRESHED",e[e.SESSION_TOKEN_REFRESH_FAILED=800502]="SESSION_TOKEN_REFRESH_FAILED",e[e.COLLECTION_DISPOSED=800600]="COLLECTION_DISPOSED",e[e.DATABASE_ERROR=800700]="DATABASE_ERROR"}(b||(b={}));var x,T,S,I,N,A=function(e){return!(e instanceof M&&!e.shouldThrowOutside)},M=function(e){s(n,e);var t=f(n);function n(e){var a,i=e.code,s=void 0===i?0:i,o=e.message,u=void 0===o?"":o;return r(this,n),(a=t.call(this,u)).shouldThrowOutside=!1,a._detail="",a.name="SendbirdError",a.code=s,Object.setPrototypeOf(h(a),n.prototype),a}return i(n,[{key:"detail",get:function(){return this._detail}},{key:"setDetail",value:function(e){this._detail=e}},{key:"isInvalidTokenError",get:function(){return this.code===b.INVALID_TOKEN}},{key:"isSessionExpiredError",get:function(){return this.isSessionTokenExpiredError||this.isSessionKeyExpiredError}},{key:"isSessionTokenExpiredError",get:function(){return this.code===b.SESSION_TOKEN_EXPIRED}},{key:"isSessionKeyExpiredError",get:function(){return this.code===b.SESSION_KEY_EXPIRED}},{key:"isSessionInvalidatedError",get:function(){return this.isSessionRevokedError||this.isUserAuthDeactivedError||this.isUserAuthDeletedOrNotFoundError}},{key:"isSessionRevokedError",get:function(){return this.code===b.SESSION_REVOKED}},{key:"isUserAuthDeactivedError",get:function(){return this.code===b.USER_AUTH_DEACTIVATED}},{key:"isUserAuthDeletedOrNotFoundError",get:function(){return this.code===b.USER_AUTH_DELETED_OR_NOT_FOUND}},{key:"isNetworkError",get:function(){return this.code===b.NETWORK_ERROR||this.code===b.NETWORK_ROUTING_ERROR}},{key:"throwOutside",value:function(){throw this.shouldThrowOutside=!0,this}}],[{key:"debugModeRequired",get:function(){return new n({code:b.DEBUG_MODE_REQUIRED,message:"Cannot run this operation in production mode."})}},{key:"lostInstance",get:function(){return new n({code:b.LOST_INSTANCE,message:"Instance ID is missing. It should belong to an instance."})}},{key:"invalidCommand",get:function(){return new n({code:b.INVALID_COMMAND,message:"Cannot send invalid command."})}},{key:"unknown",get:function(){return new n({code:b.UNKNOWN_ERROR,message:"Unknown error occurred."})}},{key:"connectionRenew",get:function(){return new n({code:b.CONNECTION_RENEW,message:"Connection restarts."})}},{key:"invalidConnectionStateTransition",get:function(){return new n({code:b.INVALID_CONNECTION_STATE_TRANSITION,message:"Invalid connection state transition."})}},{key:"xmlHttpRequestNotSupported",get:function(){return new n({code:b.XMLHTTPREQUEST_NOT_SUPPORTED,message:"Cannot upload file. XMLHttpRequest is not defined in this environment."})}},{key:"connectionRequired",get:function(){return new n({code:b.CONNECTION_REQUIRED,message:"Connection is required."})}},{key:"connectionCanceled",get:function(){return new n({code:b.CONNECTION_CANCELED,message:"Connection is canceled."})}},{key:"invalidParameters",get:function(){return new n({code:b.INVALID_PARAMETER,message:"Invalid parameters."})}},{key:"notSupportedError",get:function(){return new n({code:b.NOT_SUPPORTED_ERROR,message:"Given parameters are not supported."})}},{key:"channelTypeNotSupportedError",get:function(){return new n({code:b.NOT_SUPPORTED_ERROR,message:"Called method is not supported in the current channel's channel type."})}},{key:"networkError",get:function(){return new n({code:b.NETWORK_ERROR,message:"There was a network error."})}},{key:"markAsReadAllRateLimitExceeded",get:function(){return new n({code:b.MARK_AS_READ_RATE_LIMIT_EXCEEDED,message:"markAsRead rate limit exceeded."})}},{key:"queryInProgress",get:function(){return new n({code:b.QUERY_IN_PROGRESS,message:"Query in progress."})}},{key:"noAckTimeout",get:function(){return new n({code:b.ACK_TIMEOUT,message:"Command received no ack."})}},{key:"loginTimeout",get:function(){return new n({code:b.LOGIN_TIMEOUT,message:"Connection timeout."})}},{key:"connectionClosed",get:function(){return new n({code:b.WEBSOCKET_CONNECTION_CLOSED,message:"Connection is closed. Please reconnect."})}},{key:"requestFailed",get:function(){return new n({code:b.REQUEST_FAILED,message:"Request failed."})}},{key:"alreadyConnectedAsAnotherUser",get:function(){return new n({code:b.REQUEST_FAILED,message:"Already logged in as a different user. Call disconnect() first."})}},{key:"fileUploadCanceled",get:function(){return new n({code:b.FILE_UPLOAD_CANCEL_FAILED,message:"File upload has been canceled."})}},{key:"requestCanceled",get:function(){return new n({code:b.REQUEST_CANCELED,message:"Request has been canceled."})}},{key:"sessionTokenRefreshFailed",get:function(){return new n({code:b.SESSION_TOKEN_REFRESH_FAILED,message:"Failed to refresh the session key."})}},{key:"sessionTokenRequestFailed",get:function(){return new n({code:b.SESSION_TOKEN_REQUEST_FAILED,message:"Failed to get the session token."})}},{key:"databaseError",get:function(){return new n({code:b.DATABASE_ERROR,message:"Database error."})}},{key:"fileSizeLimitExceededError",get:function(){return new n({code:b.FILE_SIZE_LIMIT_EXCEEDED,message:"File size exceeds the file size limit."})}}]),n}(d(Error)),U=[b.CONNECTION_REQUIRED,b.NETWORK_ERROR,b.ACK_TIMEOUT,b.WEBSOCKET_CONNECTION_CLOSED,b.WEBSOCKET_CONNECTION_FAILED,b.FILE_UPLOAD_CANCEL_FAILED,b.REQUEST_CANCELED,b.INTERNAL_SERVER_ERROR,b.RATE_LIMIT_EXCEEDED,b.UNKNOWN_SERVER_ERROR],O=[b.WEBSOCKET_CONNECTION_CLOSED,b.WEBSOCKET_CONNECTION_FAILED,b.CONNECTION_REQUIRED],R=function(e,t){if(e!==t){var n=Object.assign({},e),r=Object.assign({},t);return(!n.hasOwnProperty("messageId")||!r.hasOwnProperty("messageId")||n.messageId===r.messageId)&&((!n.hasOwnProperty("reqId")||!r.hasOwnProperty("reqId")||n.reqId===r.reqId)&&(n.hasOwnProperty("messageId")&&delete n.messageId,n.hasOwnProperty("reqId")&&delete n.reqId,r.hasOwnProperty("messageId")&&delete r.messageId,r.hasOwnProperty("reqId")&&delete r.reqId,JSON.stringify(n)===JSON.stringify(r)))}return!0},D=function(e,t){return!!(arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&j(t))||("string"!=typeof e?"object"===n(e)?L(e,t):P(e,t):n(t)===e)},L=function(e,t){return!!(arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&j(t))||Object.values(e).includes(t)},P=function(e,t){return t instanceof e},F=function(e,t){return!!(arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&j(t))||Array.isArray(t)&&t.every((function(t){return D(e,t)}))},H=function(e){return!!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&j(e))||"number"==typeof e&&13===e.toString().length},q=function(e){return e>0&&O.indexOf(e)>=0},G=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&j(e))return!0;var t="object"===n(e)&&null!==e&&e.hasOwnProperty("name")&&"string"==typeof e.name&&e.hasOwnProperty("uri")&&"string"==typeof e.uri&&e.hasOwnProperty("type")&&"string"==typeof e.type;if(!t){if("undefined"!=typeof Blob)return e instanceof Blob;if("undefined"!=typeof File)return e instanceof File}return t},j=function(e){return null==e},V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.useMemberInfoInMessage,a=void 0===n||n,i=t.typingIndicatorInvalidateTime,s=void 0===i?1e4:i,o=t.typingIndicatorThrottle,u=void 0===o?1e3:o,c=t.websocketResponseTimeout,l=void 0===c?1e4:c,d=t.websocketPayloadDecompression,h=void 0===d||d,f=t.sessionTokenRefreshTimeout,p=void 0===f?60:f;r(this,e),this._useMemberInfoInMessage=!0,this._typingIndicatorInvalidateTime=1e4,this._typingIndicatorThrottle=1e3,this._websocketResponseTimeout=1e4,this._sessionTokenRefreshTimeout=60,this._useMemberInfoInMessage=a,this._typingIndicatorInvalidateTime=s,this._typingIndicatorThrottle=u,this._websocketResponseTimeout=l,this._sessionTokenRefreshTimeout=p,this.websocketPayloadDecompression=h}return i(e,[{key:"useMemberInfoInMessage",get:function(){return this._useMemberInfoInMessage},set:function(e){D("boolean",e)&&(this._useMemberInfoInMessage=e)}},{key:"typingIndicatorInvalidateTime",get:function(){return this._typingIndicatorInvalidateTime},set:function(e){D("number",e)&&(this._typingIndicatorInvalidateTime=e)}},{key:"typingIndicatorThrottle",get:function(){return this._typingIndicatorThrottle},set:function(e){D("number",e)&&e>=1e3&&e<=9e3&&(this._typingIndicatorThrottle=e)}},{key:"websocketResponseTimeout",get:function(){return this._websocketResponseTimeout},set:function(e){D("number",e)&&e>=5e3&&e<=3e4&&(this._websocketResponseTimeout=e)}},{key:"sessionTokenRefreshTimeout",get:function(){return this._sessionTokenRefreshTimeout},set:function(e){D("number",e)&&(e<60?e=60:e>1800&&(e=1800),this._sessionTokenRefreshTimeout=e)}}]),e}(),z={encrypt:function(e){return e},decrypt:function(e){return e}},B=function(){function e(t){var n=t.store;r(this,e),this._preference=new Map,this._store=n}return i(e,[{key:"_savePreferenceKeys",value:function(){return k(this,void 0,void 0,t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._store.set({key:this._keysAddress,value:_(this._preference.keys())});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"init",value:function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return k(this,void 0,void 0,t().mark((function a(){var i,s,o,u,c,l,d;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._version=r,this._keysAddress=e,i="".concat(e,".metadata.version"),t.next=5,this._store.get(i);case 5:return s=t.sent,t.next=8,this._store.get(e);case 8:if(t.t1=n=t.sent,t.t0=null!==t.t1,!t.t0){t.next=12;break}t.t0=void 0!==n;case 12:if(!t.t0){t.next=16;break}t.t2=n,t.next=17;break;case 16:t.t2=[];case 17:if(o=t.t2,s&&!(s.version<this._version)){t.next=23;break}return t.next=21,this._resetPreferenceData(o,i);case 21:t.next=42;break;case 23:u=y(o),t.prev=24,u.s();case 26:if((c=u.n()).done){t.next=34;break}return l=c.value,t.next=30,this._store.get(l);case 30:(d=t.sent)&&this._preference.set(l,d);case 32:t.next=26;break;case 34:t.next=39;break;case 36:t.prev=36,t.t3=t.catch(24),u.e(t.t3);case 39:return t.prev=39,u.f(),t.finish(39);case 42:case"end":return t.stop()}}),a,this,[[24,36,39,42]])})))}},{key:"_resetPreferenceData",value:function(e,n){return k(this,void 0,void 0,t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._preference=new Map,t.next=3,this._store.removeMany(e);case 3:return t.next=5,this._store.set({key:n,value:{version:this._version}});case 5:case"end":return t.stop()}}),r,this)})))}},{key:"get",value:function(e){return k(this,void 0,void 0,t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._preference.get(e));case 1:case"end":return t.stop()}}),n,this)})))}},{key:"set",value:function(e,n){return k(this,void 0,void 0,t().mark((function r(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=!this._preference.has(e),t.next=3,this._store.set({key:e,value:n});case 3:if(this._preference.set(e,n),!a){t.next=7;break}return t.next=7,this._savePreferenceKeys();case 7:case"end":return t.stop()}}),r,this)})))}},{key:"remove",value:function(e){return k(this,void 0,void 0,t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._store.remove(e);case 2:return this._preference.delete(e),t.next=5,this._savePreferenceKeys();case 5:case"end":return t.stop()}}),n,this)})))}},{key:"clear",value:function(){return k(this,void 0,void 0,t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._store.removeMany(_(this._preference.keys()));case 2:return this._preference.clear(),e.next=5,this._savePreferenceKeys();case 5:case"end":return e.stop()}}),e,this)})))}}]),e}(),Q=function(){function e(t){var n=t.encryption,a=t.store,i=t.localCacheEnabled,s=t.localCacheConfig;r(this,e),this.store=a,this.preference=new B({store:a}),this.encryption=null!=n?n:z,this.localCacheEnabled=i,this.localCacheConfig=s}return i(e,[{key:"replaceStore",value:function(e){this.store=e,this.preference=new B({store:e})}}]),e}();e.PushTokenRegistrationState=void 0,(x=e.PushTokenRegistrationState||(e.PushTokenRegistrationState={})).SUCCESS="success",x.PENDING="pending",x.ERROR="error",e.PushTriggerOption=void 0,(T=e.PushTriggerOption||(e.PushTriggerOption={})).DEFAULT="default",T.ALL="all",T.MENTION_ONLY="mention_only",T.OFF="off",e.PushTokenType=void 0,(S=e.PushTokenType||(e.PushTokenType={})).FCM="gcm",S.APNS="apns",S.UNKNOWN="unknown",e.PushTemplate=void 0,(I=e.PushTemplate||(e.PushTemplate={})).ALTERNATIVE="alternative",I.DEFAULT="default",e.CachedDataClearOrder=void 0,(N=e.CachedDataClearOrder||(e.CachedDataClearOrder={})).CUSTOM="custom",N.MESSAGE_COLLECTION_ACCESSED_AT="messagecollection_accessed_at";var K,W=function(){function e(t){var n=t.channel,a=t.cachedMessageCount;r(this,e),this._cachedMessageCount=0,this._channel=n,this._cachedMessageCount=a}return i(e,[{key:"channel",get:function(){return this._channel}},{key:"cachedMessageCount",get:function(){return this._cachedMessageCount}}]),e}(),Y=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=n.maxSize,i=void 0===a?256:a,s=n.clearOrder,o=void 0===s?e.CachedDataClearOrder.MESSAGE_COLLECTION_ACCESSED_AT:s,u=n.customClearOrderComparator,c=n.enableAutoResend,l=void 0===c||c;r(this,t),this._clearOrderComparatorUseMessageCollectionAccessedAt=function(e,t){return e.channel.messageCollectionLastAccessedAt===t.channel.messageCollectionLastAccessedAt?e.channel.lastMessage&&!t.channel.lastMessage?1:!e.channel.lastMessage&&t.channel.lastMessage?-1:e.channel.lastMessage||t.channel.lastMessage?e.channel.lastMessage.createdAt-t.channel.lastMessage.createdAt:0:e.channel.messageCollectionLastAccessedAt>t.channel.messageCollectionLastAccessedAt?1:-1},this._maxSize=Math.max(i,64),u?(this._clearOrder=o,this._customClearOrderComparator=u):this._clearOrder=e.CachedDataClearOrder.MESSAGE_COLLECTION_ACCESSED_AT,this._enableAutoResend=l}return i(t,[{key:"maxSize",get:function(){return this._maxSize}},{key:"clearOrder",get:function(){return this._clearOrder}},{key:"clearOrderComparator",get:function(){var t;return this._clearOrder===e.CachedDataClearOrder.MESSAGE_COLLECTION_ACCESSED_AT?this._clearOrderComparatorUseMessageCollectionAccessedAt:null!==(t=this._customClearOrderComparator)&&void 0!==t?t:this._clearOrderComparatorUseMessageCollectionAccessedAt}},{key:"enableAutoResend",get:function(){return this._enableAutoResend}}]),t}();!function(e){e.FEED="feed",e.CHAT="chat"}(K||(K={}));var Z,J,X,$,ee,te,ne,re,ae,ie,se,oe,ue,ce=function(){function e(){r(this,e),this.isRefreshing=!1}return i(e,[{key:"hasSession",get:function(){return!!this.sessionKey}},{key:"clear",value:function(){this.authToken=void 0,this.sessionKey=void 0,this.services=[]}}]),e}(),le=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))},de=function(){function e(t){var n=t.container;r(this,e),this._container={},this._container=n,this.key=le()}return i(e,[{key:"_register",value:function(e,t,n){var r;return e in this._container||(this._container[e]=new Map),null===(r=this._container[e])||void 0===r||r.set(this.key,{occurence:t,handler:n}),this}},{key:"on",value:function(e,t){return this._register(e,-1,t)}},{key:"once",value:function(e,t){return this._register(e,1,t)}},{key:"close",value:function(){var e;for(var t in this._container)null===(e=this._container[t])||void 0===e||e.delete(this.key)}}]),e}(),he=function(){function e(){r(this,e),this._container={}}return i(e,[{key:"on",value:function(e,t){return new de({container:this._container}).on(e,t)}},{key:"once",value:function(e,t){return new de({container:this._container}).once(e,t)}},{key:"dispatch",value:function(e,t){var n=this._container[e];if(n){var r,a=[],i=y(n.keys());try{for(i.s();!(r=i.n()).done;){var s=r.value,o=n.get(s);o.handler(t),o.occurence>0&&(o.occurence--,0===o.occurence&&a.push(s))}}catch(e){i.e(e)}finally{i.f()}a.forEach((function(e){return n.delete(e)}))}}}]),e}(),fe=function(){function e(){r(this,e),this._dispatcher=new he}return i(e,[{key:"on",value:function(e){return this._dispatcher.on("event",e)}},{key:"once",value:function(e){return this._dispatcher.once("event",e)}},{key:"dispatch",value:function(e){this._dispatcher.dispatch("event",e)}}]),e}(),pe=i((function e(){r(this,e)})),ve=function(e){var t={};return e&&Object.keys(e).forEach((function(n){void 0===e[n]||Number.isNaN(e[n])||null===e[n]||(t[n]=e[n])})),t},_e=function e(t){if(null!=t){if("object"===n(t)){if(Array.isArray(t)){var r=_(t);for(var a in r)r[a]=e(r[a]);return r}for(var i in t)null===t[i]&&delete t[i];return t}return t}};e.ChannelType=void 0,(Z=e.ChannelType||(e.ChannelType={})).BASE="base",Z.GROUP="group",Z.OPEN="open",Z.FEED="feed",e.Role=void 0,(J=e.Role||(e.Role={})).OPERATOR="operator",J.NONE="none",e.MutedState=void 0,(X=e.MutedState||(e.MutedState={})).MUTED="muted",X.UNMUTED="unmuted",e.MessageType=void 0,($=e.MessageType||(e.MessageType={})).BASE="base",$.USER="user",$.FILE="file",$.ADMIN="admin",e.MessageTypeFilter=void 0,(ee=e.MessageTypeFilter||(e.MessageTypeFilter={})).ALL="",ee.USER="MESG",ee.FILE="FILE",ee.ADMIN="ADMM",function(e){e.USER="MESG",e.FILE="FILE",e.ADMIN="ADMM"}(te||(te={})),e.MentionType=void 0,(ne=e.MentionType||(e.MentionType={})).USERS="users",ne.CHANNEL="channel",e.ReplyType=void 0,(re=e.ReplyType||(e.ReplyType={})).ALL="all",re.NONE="none",re.ONLY_REPLY_TO_CHANNEL="only_reply_to_channel",e.PushNotificationDeliveryOption=void 0,(ae=e.PushNotificationDeliveryOption||(e.PushNotificationDeliveryOption={})).DEFAULT="default",ae.SUPPRESS="suppress",e.SendingStatus=void 0,(ie=e.SendingStatus||(e.SendingStatus={})).PENDING="pending",ie.SCHEDULED="scheduled",ie.SUCCEEDED="succeeded",ie.FAILED="failed",ie.CANCELED="canceled",e.MessageReviewStatus=void 0,(se=e.MessageReviewStatus||(e.MessageReviewStatus={})).INREVIEW="InReview",se.APPROVED="Approved",function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(oe||(oe={})),function(e){e.CREATED_AT="created_at",e.UPDATED_AT="updated_at"}(ue||(ue={}));var me,ge="v3",ye="/".concat(ge,"/users"),Ee="/".concat(ge,"/storage/file"),ke="/".concat(ge,"/group_channels"),be="/".concat(ge,"/sdk/group_channels"),we="/".concat(ge,"/open_channels"),Ce="/".concat(ge,"/sdk/open_channels"),xe="/".concat(ge,"/search"),Te="/".concat(ge,"/report"),Se="/".concat(ge,"/emojis"),Ie="/".concat(ge,"/emoji_categories"),Ne="/".concat(ge,"/polls"),Ae="/".concat(ge,"/scheduled_messages"),Me="/".concat(ge,"/sdk/ui_kit/configuration"),Ue="/".concat(ge,"/sdk/statistics"),Oe="/".concat(ge,"/message_templates"),Re=function(t){switch(t){case e.ChannelType.FEED:case e.ChannelType.GROUP:return ke;case e.ChannelType.OPEN:return we;default:return null}},De=function(t){switch(t){case e.ChannelType.GROUP:return"".concat(Te,"/group_channels");case e.ChannelType.OPEN:return"".concat(Te,"/open_channels");default:return null}},Le=function(t,n,r){switch(t){case e.MentionType.CHANNEL:return!0;case e.MentionType.USERS:if(n){var a,i=y(n);try{for(i.s();!(a=i.n()).done;){if(a.value===r)return!0}}catch(e){i.e(e)}finally{i.f()}}}return!1},Pe=function(e,t,n){var r,a,i,s,o=Le(null!==(r=e.mentionType)&&void 0!==r?r:null,null!==(a=e.mentionedUserIds)&&void 0!==a?a:[],n),u=Le(null!==(i=t.mentionType)&&void 0!==i?i:null,null!==(s=t.mentionedUserIds)&&void 0!==s?s:[],n);return!o&&u?1:o&&!u?-1:0},Fe=function e(t,r,a){var i,s=r||new FormData;for(var o in t)if(t.hasOwnProperty(o)){var u=t[o],c=a?"".concat(a,"[").concat(o,"]"):o;G(u)?s.append(c,u,null!==(i=u.name)&&void 0!==i?i:"filename"):"object"!==n(u)||null===u||Array.isArray(u)||u instanceof Blob?s.append(c,String(u)):s=e(u,s,c)}return s};!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(me||(me={}));var He,qe=function(e){s(a,e);var t=f(a);function a(){var e;return r(this,a),(e=t.apply(this,arguments)).params={},e.requireAuth=!0,e.headers={},e.requestId=le(),e}return i(a,[{key:"encodeParams",value:function(e){var t=this;return null==e||""===e?encodeURIComponent(""):Array.isArray(e)?e.map((function(e){return t.encodeParams(e)})).join(","):"object"===n(e)?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(String(e))}},{key:"query",get:function(){var e=this,t=ve(this.params);return"?".concat(Object.keys(t).map((function(n){return"".concat(encodeURIComponent(n),"=").concat(e.encodeParams(t[n]))})).join("&"))}},{key:"payload",get:function(){var e=ve(this.params);return Object.keys(e).some((function(t){return G(e[t])}))?Fe(e):JSON.stringify(e)}}]),a}(pe),Ge=function(e){s(n,e);var t=f(n);function n(e,a){var i;return r(this,n),(i=t.call(this))._iid=e,i._payload=a,i}return i(n,[{key:"payload",get:function(){return Object.assign({},this._payload)}},{key:"as",value:function(e){return new e(this._iid,this.payload)}}]),n}(pe),je=function(e){s(n,e);var t=f(n);function n(e){var a;return r(this,n),(a=t.call(this)).requestId=e,a}return i(n)}(pe),Ve=function(e){s(n,e);var t=f(n);function n(e){var a,i=e.expires_in,s=e.reason,o=void 0===s?b.SESSION_KEY_EXPIRED:s;switch(r(this,n),(a=t.call(this)).expiresIn=null!=i?i:0,o){case b.SESSION_KEY_EXPIRED:case b.SESSION_TOKEN_EXPIRED:case b.SESSION_REVOKED:case b.USER_AUTH_DEACTIVATED:case b.USER_AUTH_DELETED_OR_NOT_FOUND:a.error=new M({code:o})}return a}return i(n,[{key:"invalidateSessionToken",get:function(){var e;return!!(null===(e=this.error)||void 0===e?void 0:e.isSessionTokenExpiredError)}}]),n}(pe),ze=function(e){s(n,e);var t=f(n);function n(e,a,i){var s,o,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return r(this,n),(s=t.call(this))._iid=e,s.code=a,s.payload=i,s.requestId=null!==(o=i.req_id)&&void 0!==o?o:u,s}return i(n,[{key:"convertToMessage",value:function(){return"".concat(this.code).concat(JSON.stringify(this.payload),"\n")}},{key:"as",value:function(e){return new e(this._iid,this.code,this.payload)}}],[{key:"createFromRawMessage",value:function(e,t){var r=t.substring(0,4),a={};try{a=JSON.parse(t.substring(4))}catch(e){r="NOOP"}finally{return new n(e,r,a)}}}]),n}(pe),Be=function(e){s(n,e);var t=f(n);function n(e){var a,i,s=e.code,o=e.ackRequired,u=e.payload,c=void 0===u?{}:u;return r(this,n),(a=t.call(this)).code=s,a.payload=c,a.requestId=null!==(i=a.payload.req_id)&&void 0!==i?i:le(),a.ackRequired=o,a.payload.req_id=a.requestId,a}return i(n,[{key:"convertToMessage",value:function(){return"".concat(this.code).concat(JSON.stringify(this.payload),"\n")}}]),n}(pe),Qe=function(e){s(n,e);var t=f(n);function n(e){var a,i=e.userId,s=e.authToken,o=e.services,u=e.expiringSession,c=void 0===u||u;return r(this,n),(a=t.call(this)).path="".concat(ye,"/").concat(i,"/session_key"),a.method=me.POST,a.params=ve({token:s,services:o,expiring_session:!!c}),a.requireAuth=!1,a}return i(n)}(qe),Ke=function(e){s(n,e);var t=f(n);function n(e){var a=e.authToken,i=e.expiringSession,s=void 0===i||i,o=e.requestId,u=void 0===o?void 0:o;return r(this,n),t.call(this,{code:"LOGI",payload:{token:a,expiring_session:s?1:0,req_id:u},ackRequired:!0})}return i(n)}(Be),We=function(e){s(n,e);var t=f(n);function n(e,a){var i;r(this,n),i=t.call(this,e,a);var s=a.key,o=a.expires_at,u=a.services;return i.key=s,i.expiresAt=o,i.services=u,i}return i(n)}(Ge),Ye=function(e){s(n,e);var t=f(n);function n(e,a,i){var s,o;return r(this,n),(s=t.call(this,e,"LOGI",i)).error=null,s.newKey=null,s.newKey=null!==(o=i.new_key)&&void 0!==o?o:null,s.error=i.error?new M(i):null,s}return i(n)}(ze),Ze=function(e){s(n,e);var t=f(n);function n(e){var a;return r(this,n),(a=t.call(this)).statLog=e,a}return i(n)}(pe),Je=function(e){s(n,e);var t=f(n);function n(e){var a,i=e.request,s=e.deferred,o=e.error,u=void 0===o?M.requestFailed:o;return r(this,n),(a=t.call(this)).request=i,a.deferred=s,a.error=u,a}return i(n)}(pe);!function(e){e.FEATURE_LOCALCACHE="feature:local_cache",e.FEATURE_LOCALCACHE_EVENT="feature:local_cache_event",e.NOTIFICATION="noti:stats",e.WEBSOCKET_CONNECT="ws:connect",e.API_RESULT="api:result"}(He||(He={}));var Xe,$e,et,tt=function(){function e(t){var n=t.type,a=t.data,i=t.ts,s=void 0===i?Date.now():i;r(this,e),this.type=n,this.createdAt=s,this.data=a}return i(e,null,[{key:"payloadify",value:function(e){return ve({stat_type:e.type,ts:e.createdAt,data:ve(e.data)})}}]),e}(),nt=function(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"==navigator.product},rt=function(){return!("undefined"==typeof navigator||!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone/i.test(navigator.userAgent))};e.SendbirdProduct=void 0,(Xe=e.SendbirdProduct||(e.SendbirdProduct={})).CHAT="chat",Xe.CALLS="calls",Xe.DESK="desk",Xe.LIVE="live",Xe.UIKIT_CHAT="uikit-chat",Xe.UIKIT_LIVE="uikit-live",e.SendbirdPlatform=void 0,($e=e.SendbirdPlatform||(e.SendbirdPlatform={})).ANDROID="android",$e.IOS="ios",$e.JS="js",$e.UNREAL="unreal",$e.UNITY="unity",$e.REACT_NATIVE="react-native",$e.FLUTTER="flutter",e.DeviceOsPlatform=void 0,(et=e.DeviceOsPlatform||(e.DeviceOsPlatform={})).ANDROID="android",et.IOS="ios",et.WEB="web",et.MOBILE_WEB="mobile_web",et.WINDOWS="windows";var at=i((function e(){r(this,e)}));at.sendbirdSdkUserAgentWithExtension=function(t){var n=nt()?e.SendbirdPlatform.REACT_NATIVE:e.SendbirdPlatform.JS,r={main_sdk_info:"chat/".concat(n,"/").concat(C.SDK_VERSION),device_os_platform:rt()?"mobile-web":"web",os_version:C.OS_VERSION};if(t){var a=t.sendbirdExtensions,i=t.deviceOS,s=t.customData,o=void 0===s?{}:s;i.version&&(r.os_version=i.version),i.platform&&(r.device_os_platform=i.platform),a.length>0&&(r.extension_sdk_info=a.map((function(e){var t=e.product,n=e.platform,r=e.version;return"".concat(t,"/").concat(n,"/").concat(r)})).join(",")),Object.keys(r).forEach((function(e){return delete o[e]})),Object.keys(o).length>0&&(r=Object.assign(Object.assign({},r),o))}return Object.entries(r).map((function(e){var t=v(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(r)})).join("&")},at.userAgentWithExtension=function(e){var t=nt()?"reactnative":"JS",n=e.sb_syncmanager?"s".concat(e.sb_syncmanager):"",r=e.sb_uikit?"u".concat(e.sb_uikit):"",a=e["device-os-platform"]?"o".concat(e["device-os-platform"]):rt()?"omobile-web":"oweb";return"".concat(t,"/c").concat(C.SDK_VERSION,"/").concat(n,"/").concat(r,"/").concat(a)};var it=i((function e(){var t=this;r(this,e),this.promise=new Promise((function(e,n){t.resolve=e,t.reject=function(e){n(e)}}))})),st=function(e){s(n,e);var t=f(n);function n(e){var a;return r(this,n),(a=t.call(this)).requestId=e.requestId,a}return i(n)}(pe),ot=function(){function e(t,n){var a=this,i=n.session,s=n.sdkState,o=n.dispatcher,u=n.logger,c=n.useFetchCompat,l=void 0!==c&&c;r(this,e),this._abortControl=new Map,this._shouldImportFetchCompat=!1,this._iid=t,this._session=i,this._sdkState=s,this._dispatcher=o,this._dispatcher.on((function(e){e instanceof je&&a.cancel(e.requestId)})),this._logger=u,this._shouldImportFetchCompat=l}return i(e,[{key:"_createHeader",value:function(e,t){var n=this._sdkState,r=n.appId,a=n.appVersion,i=n.sendbirdRuntimeEnvironment,s=Object.assign(Object.assign({},e.headers),{SendBird:"JS,".concat(C.OS_VERSION,",").concat(C.SDK_VERSION,",").concat(r).concat(a?",".concat(a):""),"SB-User-Agent":at.userAgentWithExtension(this._sdkState.extensions),"Request-Sent-Timestamp":Date.now().toString(),"SB-SDK-User-Agent":at.sendbirdSdkUserAgentWithExtension(i)});return t||(s["Content-Type"]="application/json; charset=utf-8"),e.requireAuth&&this._session.hasSession&&(s["Session-Key"]=this._session.sessionKey),this._session&&this._session.authToken&&(s["App-Id"]=r,s["Access-Token"]=this._session.authToken),s}},{key:"_statLogApiResult",value:function(e,t,n){this._dispatcher.dispatch(new Ze(new tt({type:He.API_RESULT,data:{endpoint:e.path,method:e.method,success:!n,latency:Date.now()-t,error_code:null==n?void 0:n.code,error_description:null==n?void 0:n.message}})))}},{key:"send",value:function(e){return k(this,void 0,void 0,t().mark((function n(){var r,a,i,s,o,u,c,l,d,h,f,p,v,_,m,g,y,E,k;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.path,a=e.method,i=e.uploadProgressHandler,s=![me.GET,me.DELETE].includes(a),o=this._sdkState.api,u="".concat(o.host).concat(r).concat(s?"":e.query),c=s?e.payload:null,l=this._createHeader(e,c instanceof FormData?c:void 0),d=new AbortController,h=d.signal,this._abortControl.set(e.requestId,d),f=Date.now(),t.prev=10,!i){t.next=32;break}return t.next=14,Promise.resolve().then((function(){return rm}));case 14:return p=t.sent,v=p.xmlHttpRequest,t.prev=16,t.next=19,v(this._iid,{requestId:e.requestId,method:e.method,url:u,headers:l,data:null!=c?c:void 0,uploadProgressHandler:i});case 19:return _=t.sent,this._logger.debug("receive api response",e.requestId),this._statLogApiResult(e,f),t.abrupt("return",_);case 25:if(t.prev=25,t.t0=t.catch(16),!(t.t0 instanceof M&&t.t0.code===b.XMLHTTPREQUEST_NOT_SUPPORTED)){t.next=31;break}this._logger.debug("XMLHttpRequest is not available in this environment. progressHandler is ignored."),t.next=32;break;case 31:throw t.t0;case 32:if(this._shouldImportFetchCompat&&(this._shouldImportFetchCompat=!1,("undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{fetch:null}).fetch=null),"undefined"!=typeof AbortController){t.next=36;break}return t.next=36,Promise.resolve().then((function(){return am}));case 36:if("function"==typeof fetch){t.next=39;break}return t.next=39,Promise.resolve().then((function(){return Nm}));case 39:return t.next=41,fetch(u,{method:a,body:c,headers:l,signal:h});case 41:return m=t.sent,t.next=44,m.json();case 44:if(g=t.sent,!m.ok&&!m.redirected){t.next=51;break}return this._logger.debug("receive api response",e.requestId),this._statLogApiResult(e,f),t.abrupt("return",new Ge(this._iid,g));case 51:if(!g){t.next=70;break}if(!(y=new M(g)).isSessionExpiredError){t.next=62;break}if(this._dispatcher.dispatch(new Ve({reason:y.code})),e instanceof Qe){t.next=59;break}return E=new it,this._dispatcher.dispatch(new Je({request:e,deferred:E,error:y})),t.abrupt("return",E.promise);case 59:case 67:throw y;case 62:if(!y.isSessionInvalidatedError){t.next=67;break}throw this._dispatcher.dispatch(new Ve({reason:y.code})),y;case 68:t.next=71;break;case 70:throw M.requestFailed;case 71:t.next=88;break;case 73:if(t.prev=73,t.t1=t.catch(10),this._statLogApiResult(e,f,t.t1),!(t.t1 instanceof M)){t.next=81;break}throw this._logger.debug("fail api request",t.t1),t.t1;case 81:if("AbortError"!==(null===t.t1||void 0===t.t1?void 0:t.t1.name)){t.next=85;break}throw M.requestCanceled;case 85:throw k=M.networkError,this._logger.debug("fail api request",k),k;case 88:case"end":return t.stop()}}),n,this,[[10,73],[16,25]])})))}},{key:"cancel",value:function(e){this._abortControl.has(e)&&(this._abortControl.get(e).abort(),this._abortControl.delete(e));this._dispatcher.dispatch(new st({requestId:e}))}},{key:"cancelAll",value:function(){var e,t=y(this._abortControl.values());try{for(t.s();!(e=t.n()).done;){e.value.abort()}}catch(e){t.e(e)}finally{t.f()}this._abortControl.clear(),this._dispatcher.dispatch(new st({}))}}]),e}(),ut=function(){};function ct(e){let t=e.length;for(;--t>=0;)e[t]=0}const lt=256,dt=286,ht=30,ft=15,pt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),vt=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),_t=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gt=new Array(576);ct(gt);const yt=new Array(60);ct(yt);const Et=new Array(512);ct(Et);const kt=new Array(256);ct(kt);const bt=new Array(29);ct(bt);const wt=new Array(ht);function Ct(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}let xt,Tt,St;function It(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ct(wt);const Nt=e=>e<256?Et[e]:Et[256+(e>>>7)],At=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Mt=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,At(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ut=(e,t,n)=>{Mt(e,n[2*t],n[2*t+1])},Ot=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Rt=(e,t,n)=>{const r=new Array(16);let a,i,s=0;for(a=1;a<=ft;a++)s=s+n[a-1]<<1,r[a]=s;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=Ot(r[t]++,t))}},Dt=e=>{let t;for(t=0;t<dt;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ht;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Lt=e=>{e.bi_valid>8?At(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Pt=(e,t,n,r)=>{const a=2*t,i=2*n;return e[a]<e[i]||e[a]===e[i]&&r[t]<=r[n]},Ft=(e,t,n)=>{const r=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a<e.heap_len&&Pt(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!Pt(t,r,e.heap[a],e.depth));)e.heap[n]=e.heap[a],n=a,a<<=1;e.heap[n]=r},Ht=(e,t,n)=>{let r,a,i,s,o=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+o++],r+=(255&e.pending_buf[e.sym_buf+o++])<<8,a=e.pending_buf[e.sym_buf+o++],0===r?Ut(e,a,t):(i=kt[a],Ut(e,i+lt+1,t),s=pt[i],0!==s&&(a-=bt[i],Mt(e,a,s)),r--,i=Nt(r),Ut(e,i,n),s=vt[i],0!==s&&(r-=wt[i],Mt(e,r,s)))}while(o<e.sym_next);Ut(e,256,t)},qt=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let s,o,u,c=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<i;s++)0!==n[2*s]?(e.heap[++e.heap_len]=c=s,e.depth[s]=0):n[2*s+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,a&&(e.static_len-=r[2*u+1]);for(t.max_code=c,s=e.heap_len>>1;s>=1;s--)Ft(e,n,s);u=i;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ft(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,n[2*u]=n[2*s]+n[2*o],e.depth[u]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,n[2*s+1]=n[2*o+1]=u,e.heap[1]=u++,Ft(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,u=t.stat_desc.max_length;let c,l,d,h,f,p,v=0;for(h=0;h<=ft;h++)e.bl