UNPKG

laudantiumculpa

Version:
1 lines 50.5 kB
import{i as e,a as t,_ as i,b as s,C as o,c as a,E as u,A as c,d,e as l,u as h,f,U as v,g,h as b,P as m,j as _,k as I,l as k,S as T,L as A,m as N,n as M,V as Q,o as j,p as H,v as W,q as K,r as V,s as J,t as ee,w as te,x as ne,y as re,z as ie,B as se,D as oe,W as ae,F as ue,G as ce,H as de,I as le,J as he,K as fe,M as pe,N as ve,O as ge,Q as be,R as me,T as _e,X as ye,Y as we}from"./lib/__bundle-ed5804d1.js";export{Z as AppInfo,a0 as CachedChannelInfo,a1 as CachedDataClearOrder,C as ChannelType,$ as CollectionEventSource,q as ConnectionState,a2 as DeviceOsPlatform,L as LocalCacheConfig,a3 as LogLevel,a4 as NotificationInfo,Y as PushTemplate,R as PushTokenRegistrationState,P as PushTokenType,X as PushTriggerOption,a5 as Role,S as SendbirdChatOptions,r as SendbirdError,a9 as SendbirdPlatform,a8 as SendbirdProduct,a6 as UIKitConfigInfo,U as User,a7 as UserOnlineState}from"./lib/__bundle-ed5804d1.js";import{N as Ie,a as Ce,b as ke,c as Se,g as Te,M as Ee,d as Pe,e as Ue,f as De,h as Oe,i as Ae,j as Ne,k as Le,l as Me,m as Re,n as ze,A as Qe,I as je,o as Fe,U as qe,C as He,p as xe,B as Ge,F as We,q as Be,S as Ke,r as Ve,s as Je,t as Xe,u as Ye,v as Ze}from"./lib/__bundle-4b17d25d.js";export{p as ApplicationUserListQuery,w as BannedUserListQuery,x as BaseChannel,B as BlockedUserListQuery,C as ConnectionHandler,F as FriendListQuery,n as MemoryStore,y as MutedUserListQuery,O as OperatorListQuery,P as Participant,z as Plugin,R as ReportCategory,D as RestrictedUser,E as RestrictionInfo,G as RestrictionType,S as SessionHandler,U as UserEventHandler}from"./lib/__bundle-4b17d25d.js";import{PollModule as $e}from"./poll.js";import{g as et,G as tt,A as nt,U as rt,a as it,b as st,D as ot,R as at}from"./lib/__bundle-c678031e.js";import{g as ut,N as ct}from"./lib/__bundle-0120cd70.js";import"./lib/__bundle-acd77193.js";var dt=function(e){this.key=e.key,this.url=e.url},lt=function(e){this.id=e.id,this.name=e.name,this.url=e.url,this.emojis=e.emojis?e.emojis.map((function(e){return new dt(e)})):[]},ht=function(e){this.emojiHash=e.emoji_hash||"",this.emojiCategories=e.emoji_categories?e.emoji_categories.map((function(e){return new lt(e)})):[]},ft={profileImage:void 0,profileUrl:void 0,nickname:void 0},pt=function(e){return function(t,n){return i(void 0,void 0,void 0,(function(){var r,a,u,c,d;return s(this,(function(l){switch(l.label){case 0:switch(t){case 1:case 2:case 3:return[3,1];case 4:return[3,2];case 5:return[3,9]}return[3,13];case 1:return n(),[3,14];case 2:return l.trys.push([2,7,,8]),[4,e.clear()];case 3:return l.sent(),r=function(e){return{v2:function(){return i(void 0,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Ce,keyName:ke,index:[et(tt.LATEST_LAST_MESSAGE),et(tt.CHRONOLOGICAL),et(tt.CHANNEL_NAME_ALPHABETICAL)]},{collectionName:Ie,keyName:Se,index:[Te(Ee.CHANNEL_LATEST),Te(Ee.NEWEST_CHILD_MESSAGE)]},{collectionName:Pe,keyName:Ue,index:[Te(Ee.CHANNEL_LATEST),Te(Ee.NEWEST_CHILD_MESSAGE)]},{collectionName:De,keyName:Oe}])];case 1:return[2,t.sent()]}}))}))},v3:function(){return i(void 0,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Ae,keyName:Ne,index:[ut("latest_last_message")]}])];case 1:return[2,t.sent()]}}))}))},v4:function(){return i(void 0,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Le,keyName:Me,index:[Re()]}])];case 1:return[2,t.sent()]}}))}))}}}(e),a=r.v2,u=r.v3,c=r.v4,[4,a()];case 4:return l.sent(),[4,u()];case 5:return l.sent(),[4,c()];case 6:return l.sent(),n(),[3,8];case 7:return d=l.sent(),n(d),[3,8];case 8:return[3,14];case 9:return l.trys.push([9,11,,12]),[4,e.collection(Ie).removeIf({where:{channelType:o.OPEN}})];case 10:case 11:return l.sent(),[3,12];case 12:return n(),[3,14];case 13:n(),l.label=14;case 14:return[2]}}))}))}},vt=function(){return"undefined"!=typeof document?document.visibilityState:"visible"},gt=function(e){function t(t){var n=t.getVisibilityState,r=void 0===n?vt:n,i=t.initialState,s=void 0===i?"visible":i,o=t.isEnabled,a=void 0===o||o,u=t.pauseCheckDelay,c=void 0===u?3e4:u,d=e.call(this)||this;return d._pauseCheckDelay=3e4,d._currentState="visible",d._getVisibilityState=r,d._pauseCheckDelay=c,d._currentState=s,d._isEnabled=a,d._boundToggleState=d._toggleState.bind(d),d}return a(t,e),Object.defineProperty(t.prototype,"currentState",{get:function(){return this._currentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAvailable",{get:function(){return"undefined"!=typeof window&&!!window.addEventListener&&!!window.removeEventListener},enumerable:!1,configurable:!0}),t.prototype._toggleState=function(){var e=this,t=this._getVisibilityState();"hidden"!==t?"hidden"===this._currentState&&(this._pauseDelayTimer&&(clearTimeout(this._pauseDelayTimer),this._pauseDelayTimer=void 0),this.dispatch("resume")):"hidden"!==this._currentState&&(this._pauseDelayTimer=setTimeout((function(){e._pauseDelayTimer=void 0,e.dispatch("pause")}),this._pauseCheckDelay)),this._currentState=t},t.prototype.start=function(){this._isEnabled&&this.isAvailable&&(this._boundToggleState=this._toggleState.bind(this),window.addEventListener("visibilitychange",this._boundToggleState,{capture:!0}))},t.prototype.stop=function(){this._isEnabled&&this.isAvailable&&this._boundToggleState&&window.removeEventListener("visibilitychange",this._boundToggleState,{capture:!0})},t}(u),bt=function(){function e(e){var t=e.logger,n=e.connectionDelegate,r=void 0===n?null:n,i=this;this._onlineWorker=function(){var e;return null===(e=i.connectionDelegate)||void 0===e?void 0:e.reconnect()},this._offlineWorker=function(){var e;return null===(e=i.connectionDelegate)||void 0===e?void 0:e.disconnect()},this.unsubscribes=[],this._onlineListener=function(e){if(i.isAvailableOnWeb)return window.addEventListener("online",e),function(){return window.removeEventListener("online",e,!1)}},this._offlineListener=function(e){if(i.isAvailableOnWeb)return window.addEventListener("offline",e),function(){return window.removeEventListener("offline",e,!1)}},this.logger=t,r&&(this.connectionDelegate=r)}return Object.defineProperty(e.prototype,"isAvailableOnWeb",{get:function(){return"undefined"!=typeof window&&!!window.addEventListener&&"ononline"in window&&"onoffline"in window&&"undefined"!=typeof navigator&&void 0!==navigator.onLine},enumerable:!1,configurable:!0}),e.prototype.setOnlineListener=function(e){Boolean(e)&&"function"==typeof e&&(this._onlineListener=e)},e.prototype.setOfflineListener=function(e){Boolean(e)&&"function"==typeof e&&(this._offlineListener=e)},e.prototype.start=function(){this.unsubscribes=[this._onlineListener(this._onlineWorker),this._offlineListener(this._offlineWorker)]},e.prototype.stop=function(){var e=this;this.unsubscribes.forEach((function(t){try{null==t||t()}catch(t){e.logger.warn(t.message)}})),this.unsubscribes=[]},e.prototype.isOnline=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return this.isAvailableOnWeb?[2,navigator.onLine]:[2,new Promise((function(e){fetch("https://www.google.com",{method:c.GET,mode:"no-cors"}).then((function(){return e(!0)})).catch((function(){return e(!1)}))}))]}))}))},e}(),mt=function(e){function t(t){var n=t.userId,r=t.nickname,i=t.profileUrl,s=t.profileImage,o=t.preferredLanguages,a=e.call(this)||this;return a.method=c.PUT,a.path="".concat(d,"/").concat(encodeURIComponent(n)),a.params=l(h({nickname:r,profile_url:i,profile_file:s,preferred_languages:o})),a}return a(t,e),t}(f),_t=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new v(t,g({},n)),r}return a(t,e),t}(b),yt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=c.POST,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/apns"),i.params={apns_device_token:r,always_push:!0},i}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.type=n.type?m[n.type.toLowerCase()]:m.UNKNOWN,r.user=new v(t,n.user),r}a(t,e)}(b);var wt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=c.POST,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/gcm"),i.params={gcm_reg_token:r,always_push:!0},i}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.type=n.type?m[n.type.toLowerCase()]:m.UNKNOWN,r.user=new v(t,n.user),r}a(t,e)}(b);var It=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=c.DELETE,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/apns/").concat(encodeURIComponent(r)),i}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new v(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}a(t,e)}(b);var Ct=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=c.DELETE,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/gcm/").concat(encodeURIComponent(r)),i}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new v(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}a(t,e)}(b);var kt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.DELETE,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/apns"),r}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?m[n.type.toLowerCase()]:m.UNKNOWN,r.user=new v(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}a(t,e)}(b);var St=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.DELETE,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/gcm"),r}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?m[n.type.toLowerCase()]:m.UNKNOWN,r.user=new v(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}a(t,e)}(b);var Tt=function(e){function t(t){var n=t.userId,r=t.type,i=t.token,s=t.ts,o=e.call(this)||this;return o.method=c.GET,o.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/").concat(encodeURIComponent(r),"/device_tokens"),o.params={created_ts:s,token:i},o}return a(t,e),t}(f),Et=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTokens={type:n.type?m[n.type.toLowerCase()]:m.UNKNOWN,deviceTokens:n.device_tokens,hasMore:n.has_more,token:n.token},r}return a(t,e),t}(b),Pt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),r}return a(t,e),t}(f),Ut=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return a(t,e),t}(b),Dt=function(e){function t(t){var n=t.userId,r=t.willAutoAccept,i=e.call(this)||this;return i.method=c.PUT,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),i.params={auto_accept:r},i}return a(t,e),t}(f),Ot=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return a(t,e),t}(b),At=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(f),Nt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return a(t,e),t}(b),Lt=function(e){function t(t){var n=t.userId,r=t.doNotDisturbOn,i=t.startHour,s=t.startMin,o=t.endHour,a=t.endMin,u=t.timezone,l=e.call(this)||this;return l.method=c.PUT,l.path="".concat(d,"/").concat(encodeURIComponent(n),"/push_preference"),l.params={do_not_disturb:r,start_hour:i,start_min:s,end_hour:o,end_min:a,timezone:u},l}return a(t,e),t}(f),Mt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return a(t,e),t}(b),Rt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(f),zt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return a(t,e),t}(b),Qt=function(e){function t(t){var n=t.userId,r=t.snoozeOn,i=t.startTs,s=t.endTs,o=e.call(this)||this;return o.method=c.PUT,o.path="".concat(d,"/").concat(encodeURIComponent(n),"/push_preference"),o.params={snooze_enabled:r,snooze_start_ts:i,snooze_end_ts:s},o}return a(t,e),t}(f),jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return a(t,e),t}(b),Ft=function(e){function t(t){var n=t.userId,r=t.blockedUserId,i=e.call(this)||this;return i.method=c.POST,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/block"),i.params={target_id:r},i}return a(t,e),t}(f);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new v(t,n),r}a(t,e)}(b);var qt=function(e){function t(t){var n=t.userId,r=t.unblockedUserId,i=e.call(this)||this;return i.method=c.DELETE,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/block/").concat(encodeURIComponent(r)),i}return a(t,e),t}(f);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var Ht=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(f),xt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return a(t,e),t}(b),Gt=function(e){function t(t){var n=t.userId,r=t.pushTriggerOption,i=e.call(this)||this;return i.method=c.PUT,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/push_preference"),i.params={push_trigger_option:r},i}return a(t,e),t}(f),Wt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return a(t,e),t}(b),Bt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/template"),r}return a(t,e),t}(f),Kt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return a(t,e),t}(b),Vt=function(e){function t(t){var n=t.userId,r=t.templateName,i=e.call(this)||this;return i.method=c.PUT,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/push/template"),i.params={name:r},i}return a(t,e),t}(f),Jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return a(t,e),t}(b),Xt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=c.GET,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/friends/changelogs"),i.params={token:r},i}return a(t,e),t}(f),Yt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.changelogs={addedUsers:n.added.map((function(e){return new v(t,e)})),updatedUsers:n.updated.map((function(e){return new v(t,e)})),deletedUserIds:n.deleted,hasMore:n.has_more,token:n.next},r}return a(t,e),t}(b),Zt=function(e){function t(t){var n=t.userId,r=t.discoveries,i=e.call(this)||this;return i.method=c.PUT,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discoveries:r.map((function(e){return{friend_discovery_key:e.friendDiscoveryKey,friend_name:e.friendName}}))},i}return a(t,e),t}(f),$t=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.friendDiscoveryRequestId=n.friend_discovery_request_id,r}return a(t,e),t}(b),en=function(e){function t(t){var n=t.userId,r=t.discoveryKeys,i=e.call(this)||this;return i.method=c.DELETE,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discovery_keys:r},i}return a(t,e),t}(f);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var tn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=c.POST,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return a(t,e),t}(f),nn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new v(t,e)})),r}return a(t,e),t}(b),rn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=c.DELETE,i.path="".concat(d,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return a(t,e),t}(f);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var sn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(d,"/").concat(n,"/allow_friend_discovery"),r.params={},r}return a(t,e),t}(f),on=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.allowFriendDiscovery=n.allow_friend_discovery,r}return a(t,e),t}(b),an=function(e){function t(t){var n=t.userId,r=t.allowFriendDiscovery,i=e.call(this)||this;return i.method=c.PUT,i.path="".concat(d,"/").concat(n,"/allow_friend_discovery"),i.params={allow_friend_discovery:r},i}return a(t,e),t}(f);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var un,cn=function(e){function t(){var t=e.call(this)||this;return t.method=c.GET,t.path=_,t}return a(t,e),t}(f),dn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiContainer=new ht(n),r}return a(t,e),t}(b),ln=function(e){function t(t){var n=t.categoryId,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(_,"/").concat(n),r}return a(t,e),t}(f),hn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiCategory=new lt(n),r}return a(t,e),t}(b),fn=function(e){function t(t){var n=t.key,r=e.call(this)||this;return r.method=c.GET,r.path="".concat(I,"/").concat(n),r}return a(t,e),t}(f),pn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emoji=new dt(n),r}return a(t,e),t}(b),vn=function(e){function t(){var t=e.call(this)||this;return t.method=c.GET,t.path="".concat(k),t}return a(t,e),t}(f),gn=function(e){function t(t,n){var r,i=this,s=null!=n?n:{};return(i=e.call(this,t,n)||this).uikitConfiguration={string:JSON.stringify(s),json:s},i.updatedAt=null!==(r=null==n?void 0:n.updated_at)&&void 0!==r?r:0,i}return a(t,e),t}(b),bn=function(){function n(e,t,n){var r=this;this._storeInitialized=!1,this._iid=e,this.options=t;var o=Q.of(e),a=o.sdkState,u=o.cacheContext,c=o.dispatcher,d=o.sessionManager,l=o.requestQueue,h=o.logger,f=o.userEventHandlers,p=o.appStateToggleEnabled;this._onlineDetector=new bt({logger:h,connectionDelegate:{reconnect:function(){return i(r,void 0,void 0,(function(){var t,n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:if(t=Q.of(e),n=t.sdkState,r=t.connectionManager,(i=t.sessionManager).session.hasSession)return[3,5];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r.connect(i.session.authToken)];case 2:return s.sent(),[3,4];case 3:if(o=s.sent(),ve(o))throw o;return h.debug("connect failed by reconnect event = ",o),[3,4];case 4:return[3,9];case 5:if("foreground"!==n.appState)return[3,9];s.label=6;case 6:return s.trys.push([6,8,,9]),[4,r.resetAndReconnect()];case 7:return s.sent(),[3,9];case 8:if(a=s.sent(),ve(a))throw a;return h.debug("resetAndReconnect failed by reconnect event = ",a),[3,9];case 9:return c.dispatch(new ct),[2]}}))}))},disconnect:function(){ie((function(){return i(r,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,Q.of(e).connectionManager.disconnect()];case 1:return t.sent(),[2]}}))}))}))}}});var v=new nt(e,{localCacheEnabled:u.localCacheEnabled,enableAutoResend:u.localCacheConfig.enableAutoResend,dispatcher:c,sdkState:a,logger:h});n.forEach((function(t){t.init(e,{sdkState:a,cacheContext:u,dispatcher:c,sessionManager:d,requestQueue:l,logger:h,onlineDetector:r._onlineDetector}),r[t.name]=t})),this._appStateChangeDetector=new gt({isEnabled:p}),this._appStateChangeDetector.on("resume",(function(){h.debug("the page resumes from freeze"),r.setForegroundState()})).on("pause",(function(){h.debug("the page freezes"),r.setBackgroundState()})),c.on((function(t){var n;if(t instanceof se){if(t.stateType===oe.CONNECTED)v.processNonAutoResendRegisteredPendingMessages()}else if(t instanceof ae){if("USEV"===t.code){var o=t.as(rt).event;if(o.category===it.FRIEND_DISCOVERED){var c=st.getDataAsFriendDiscoveredEvent(e,o).friendDiscoveries;ue((function(){return i(r,void 0,void 0,(function(){return s(this,(function(e){return[2,f.forEach((function(e){e.onFriendsDiscovered&&e.onFriendsDiscovered(c)}))]}))}))}))}}}else if(t instanceof ce){var d=Q.of(r._iid).subscribedUnreadMessageCount,l=!1,p=t.ts;if("number"==typeof p&&p>d.ts){if(d.all!==t.all&&(l=!0),d.all=t.all>=0?t.all:0,t.customTypes)for(var g in t.customTypes)d.customTypes[g]!==t.customTypes[g]&&(l=!0),d.customTypes[g]=t.customTypes[g];l=l&&d.ts>0,d.ts=p}l&&ue((function(){return i(r,void 0,void 0,(function(){return s(this,(function(e){return[2,f.forEach((function(e){e.onTotalUnreadMessageCountChanged&&e.onTotalUnreadMessageCountChanged({groupChannelCount:d.all,feedChannelCount:d.feed,customTypeUnreadCount:d.customTypes}),e.onTotalUnreadMessageCountUpdated&&e.onTotalUnreadMessageCountUpdated(d.all,d.customTypes)}))]}))}))}))}else t instanceof de?(u.preference.set(r._getUserProfileCacheKey(a.userId),le.payloadify(t.userProfile)),(null===(n=t.userProfile.appInfo.notificationInfo)||void 0===n?void 0:n.isEnabled)&&u.preference.set(he(r.appId),{value:!0})):t instanceof fe&&t.error&&t.error.isSessionInvalidatedError&&(h.debug("session revoked."),r.disconnect())}))}return n.init=function(e){var t=e.appId,r=e.appVersion,i=e.modules,s=void 0===i?[]:i,o=e.options,a=void 0===o?new T:o,u=e.debugMode,c=void 0!==u&&u,d=e.customApiHost,l=e.customWebSocketHost,h=e.newInstance,f=void 0!==h&&h,p=e.logLevel,v=e.localCacheEnabled,g=void 0!==v&&v,b=e.localCacheConfig,m=void 0===b?new A:b,_=e.localCacheEncryption,y=e.useAsyncStorageStore,w=void 0===y?null:y,I=e.appStateToggleEnabled,C=void 0===I||I;if(!un||f){var k="su-".concat(N()),S=null!=_?_:{encrypt:function(e){return e},decrypt:function(e){return e}},E=new ze({encryption:S});c||(E=M()?w?new Qe({AsyncStorage:w,encryption:S}):new ze({encryption:S}):new je({encryption:S})),new Q(k,{appId:t,appVersion:r,options:a,apiHost:null!=d?d:"https://api-".concat(t,".sendbird.com"),websocketHost:null!=l?l:"wss://ws-".concat(t,".sendbird.com"),store:E,encryption:S,logLevel:p,localCacheEnabled:g,localCacheConfig:m,debugMode:c,appStateToggleEnabled:C});var P=[new Fe,new $e],U=new n(k,a,j(j([],H(s),!1),H(P),!1));return un||(un=U),U}return un},Object.defineProperty(n,"instance",{get:function(){return un},enumerable:!1,configurable:!0}),Object.defineProperty(n,"version",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"appId",{get:function(){return Q.of(this._iid).sdkState.appId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"appInfo",{get:function(){var e=Q.of(this._iid).appInfo;return null!=e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"appVersion",{get:function(){var e;return null!==(e=Q.of(this._iid).sdkState.appVersion)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"debugMode",{get:function(){return!!Q.of(this._iid).debugMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"logLevel",{get:function(){return Q.of(this._iid).logger.level},set:function(e){Q.of(this._iid).logger.level=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isCacheEnabled",{get:function(){return Q.of(this._iid).cacheContext.localCacheEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localCacheConfig",{get:function(){var e=Q.of(this._iid).cacheContext;return e.localCacheEnabled?e.localCacheConfig:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ekey",{get:function(){return Q.of(this._iid).sessionManager.ekey},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentUser",{get:function(){var e;return null!==(e=Q.of(this._iid).sessionManager.currentUser)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectionState",{get:function(){var e=Q.of(this._iid).connectionManager;return e.isConnected?K.OPEN:e.isConnecting?K.CONNECTING:K.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastConnectedAt",{get:function(){var e=Q.of(this._iid),t=e.connectedAt;return e.connectionManager.isConnected?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fcmPushToken",{get:function(){var e;return null!==(e=this._fcmPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"apnsPushToken",{get:function(){var e;return null!==(e=this._apnsPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),n.prototype._getNestDBVersion=function(){return 6},n.prototype._getPreferenceCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".pref")},n.prototype._getUserProfileCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".profile")},n.prototype.getMemoryStoreForDebugging=function(){var e=Q.of(this._iid),t=e.debugMode,n=e.cacheContext;if(t)return n.store instanceof ze?n.store:null;throw V.debugModeRequired},n.prototype.addExtension=function(e,t){var n=Q.of(this._iid).sdkState;["sb_uikit","sb_syncmanager","device-os-platform"].indexOf(e)>-1&&n.extensions&&(n.extensions[e]=t)},n.prototype.addSendbirdExtensions=function(e,t,n){var r,i,s=Q.of(this._iid),o=s.logger,a=s.sdkState,u=new RegExp(pe);if(0===e.length)return o.debug("sb.addSendbirdExtensions() has failed because the given sendbirdExtensions is empty."),!1;if(e.find((function(e){return!u.test(e.version)})))return o.debug("sb.addSendbirdExtensions() has failed because the given version did not satisfy the SemVer specification."),!1;if(n)try{for(var c=J(Object.entries(n)),d=c.next();!d.done;d=c.next()){var l=H(d.value,2),h=l[0],f=l[1];if(/&|=/.test(h)||/&|=/.test(f))return o.debug("sb.addSendbirdExtensions() has failed because the given customData includes at least one invalid character: = or &."),!1}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return a.sendbirdRuntimeEnvironment={sendbirdExtensions:e,deviceOS:t,customData:n},!0},n.prototype.setOnlineListener=function(e){this._onlineDetector.setOnlineListener(e)},n.prototype.setOfflineListener=function(e){this._onlineDetector.setOfflineListener(e)},n.prototype._safeInitializeStore=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:t=Q.of(this._iid).cacheContext,n.label=1;case 1:return n.trys.push([1,3,,5]),[4,t.store.init(e)];case 2:return n.sent(),this._storeInitialized=!0,[3,5];case 3:return n.sent(),t.replaceStore(new ze),[4,this._safeInitializeStore(e)];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))},n.prototype.initializeCache=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i,o,a,u,c,d;return s(this,(function(s){switch(s.label){case 0:if(t=Q.of(this._iid),n=t.sdkState,r=t.cacheContext,i=t.dispatcher,o=t.logger,n.userId&&n.userId===e)return[3,9];if(a="sendbird@".concat(n.appId,"/").concat(e,".db"),!r.localCacheEnabled)return[3,7];s.label=1;case 1:return s.trys.push([1,4,,6]),r.nestdb&&r.nestdb.state!==Ze.CLOSED&&r.nestdb.name===a?[3,3]:(u="sendbird@".concat(n.appId,"/").concat(e,".db"),(c=r.nestdb=new Ve({name:u,version:this._getNestDBVersion(),store:r.store,config:new Je({dbname:u,itemSizeLimit:61440})})).on("upgrade",pt(c)),c.on("storeReplaced",(function(e){r.replaceStore(e),r.localCacheEnabled=!1,c.on("upgrade",pt(c))})),[4,c.open()]);case 2:s.sent(),this._storeInitialized=!0,i.dispatch(new ot(this._iid,{userId:e})),s.label=3;case 3:return n.userId=e,[3,6];case 4:return d=s.sent(),o.warn("Nest DB Open Failed. ",d),r.store instanceof ze||(r.replaceStore(new ze),r.localCacheEnabled=!1),[4,this._safeInitializeStore(a)];case 5:throw s.sent(),n.userId=e,V.databaseError;case 6:return[3,9];case 7:return[4,this._safeInitializeStore(a)];case 8:s.sent(),n.userId=e,s.label=9;case 9:return[2]}}))}))},n.prototype.getCacheDataSize=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(e=Q.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.estimateUsage()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,0]}}))}))},n.prototype.clearCachedData=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(e=Q.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.clear()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this._storeInitialized?[4,e.preference.clear()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},n.prototype.clearCachedMessages=function(e){return i(this,void 0,void 0,(function(){var t,n,r=this;return s(this,(function(o){switch(o.label){case 0:return ee(ge("string",e)).throw(V.invalidParameters),t=Xe.of(this._iid),n=Ye.of(this._iid),t&&n?[4,Promise.all(e.map((function(e){return i(r,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,t.removeMessagesOfChannel(e)];case 1:return r.sent(),[4,n.removeMessagesOfChannel(e)];case 2:return r.sent(),[2]}}))}))})))]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype._setupPreference=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i,o;return s(this,(function(s){switch(s.label){case 0:return t=Q.of(this._iid),n=t.sdkState,r=t.cacheContext,i=t.statLogCollector,[4,r.preference.init(this._getPreferenceCacheKey(e),this._getNestDBVersion())];case 1:return s.sent(),[4,r.preference.get(this._getUserProfileCacheKey(e))];case 2:return(o=s.sent())&&new le(this._iid,o).apply(),[4,i.init("sendbird@".concat(n.appId,"/").concat(e,".statlog"))];case 3:return s.sent(),[2]}}))}))},n.prototype._ready=function(e,n,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){var i,o,a,u,c,d;return s(this,(function(s){switch(s.label){case 0:return ee(t("string",e)&&t("string",n,!0)).throw(V.invalidParameters),i=Q.of(this._iid),o=i.sdkState,a=i.cacheContext,u=i.connectionManager,c=r.errorForOtherUser,o.userId&&o.userId!==e?c?[3,2]:[4,u.logout()]:[3,3];case 1:return s.sent(),[3,3];case 2:throw c;case 3:return s.trys.push([3,5,6,8]),[4,this.initializeCache(e)];case 4:return s.sent(),Q.of(this._iid).dispatcher.dispatch(new at),[3,8];case 5:return s.sent(),d=Q.of(this._iid).logger,a.localCacheEnabled=!1,d.warn("Cache initialization failed - cache is not available."),[3,8];case 6:return[4,this._setupPreference(e)];case 7:return s.sent(),[7];case 8:return[2]}}))}))},n.prototype.authenticateFeed=function(e,t){var n;return i(this,void 0,void 0,(function(){var r,i,o;return s(this,(function(s){switch(s.label){case 0:return r=Q.of(this._iid),i=r.sessionManager,o=r.connectionManager,[4,this._ready(e,t,{errorForOtherUser:o.isConnected?V.alreadyConnectedAsAnotherUser:void 0})];case 1:return s.sent(),(null===(n=i.session.services)||void 0===n?void 0:n.includes(be.CHAT))?[3,3]:[4,i.authenticateFeed(e,t)];case 2:s.sent(),s.label=3;case 3:return[2,this.currentUser]}}))}))},n.prototype.connect=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._ready(e,t)];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Q.of(this._iid).connectionManager.connect(t)];case 3:return n.sent(),[3,5];case 4:return this._onlineDetector.start(),this._appStateChangeDetector.start(),[7];case 5:return[2,this.currentUser]}}))}))},n.prototype.reconnect=function(){var e=Q.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.sessionManager.session.hasSession;return r&&(this._appStateChangeDetector.start(),this._onlineDetector.start(),t.resetAndReconnect().then((function(){n.appState="foreground"})).catch((function(){}))),r},n.prototype.disconnect=function(){return i(this,void 0,void 0,(function(){var e,t,n,r;return s(this,(function(i){switch(i.label){case 0:return e=Q.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),r.cancelAll(),[4,t.logout()];case 1:return i.sent(),[4,this.clearCachedData()];case 2:return i.sent(),n.appState="foreground",[2]}}))}))},n.prototype.disconnectWebSocket=function(){return i(this,void 0,void 0,(function(){var e,t,n;return s(this,(function(r){switch(r.label){case 0:return e=Q.of(this._iid),t=e.connectionManager,n=e.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),n.cancelAll(),[4,t.disconnectWebSocket(!0)];case 1:return r.sent(),[2]}}))}))},n.prototype.setBackgroundState=function(){var e=Q.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.logger;"foreground"===n.appState&&(n.appState="background",r.debug("going background state"),t.background().catch((function(e){r.debug("setBackgroundState error = ",e)})))},n.prototype.setForegroundState=function(){var e=Q.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.dispatcher,i=e.logger;"background"===n.appState&&(n.appState="foreground",i.debug("going foreground state"),t.resetAndReconnect().catch((function(e){i.debug("setForgroundState error = ",e)})),r.dispatch(new ct))},n.prototype.setSessionHandler=function(e){ee(e instanceof Ke).throw(V.invalidParameters),Q.of(this._iid).sessionManager.handler=e},n.prototype.addUserEventHandler=function(e,n){ee(t("string",e)&&n instanceof qe).throw(V.invalidParameters),Q.of(this._iid).userEventHandlers.set(e,n)},n.prototype.removeUserEventHandler=function(e){Q.of(this._iid).userEventHandlers.delete(e)},n.prototype.removeAllUserEventHandler=function(){Q.of(this._iid).userEventHandlers.clear()},n.prototype.addConnectionHandler=function(e,n){ee(t("string",e)&&n instanceof He).throw(V.invalidParameters),Q.of(this._iid).connectionHandlers.set(e,n)},n.prototype.removeConnectionHandler=function(e){Q.of(this._iid).connectionHandlers.delete(e)},n.prototype.removeAllConnectionHandler=function(){Q.of(this._iid).connectionHandlers.clear()},n.prototype.createApplicationUserListQuery=function(e){return void 0===e&&(e={}),new xe(this._iid,e)},n.prototype.createBlockedUserListQuery=function(e){return void 0===e&&(e={}),new Ge(this._iid,e)},n.prototype.createFriendListQuery=function(e){return void 0===e&&(e={}),new We(this._iid,e)},n.prototype.createMessageSearchQuery=function(e){return new Be(this._iid,e)},n.prototype.createPollListQuery=function(e){return new te(this._iid,g({},e))},n.prototype.createPollVoterListQuery=function(e){return new ne(this._iid,g({},e))},n.prototype.buildUserFromSerializedData=function(e){var t=re(e);return new v(this._iid,v.payloadify(t))},n.prototype.updateCurrentUserInfo=function(n){return void 0===n&&(n={}),i(this,void 0,void 0,(function(){var r,i,o,a,u,c,d;return s(this,(function(s){switch(s.label){case 0:return r=g(g({},ft),n),ee(function(n){return e(n.profileImage,!0)&&t("string",n.profileUrl,!0)&&t("string",n.nickname,!0)}(r)).throw(V.invalidParameters),this.currentUser?(i=Q.of(this._iid),o=i.sdkState,a=i.requestQueue,u=new mt(g({userId:o.userId},r)),[4,a.send(u)]):[3,2];case 1:return c=s.sent(),d=c.as(_t).user,this.currentUser&&(r.nickname&&(this.currentUser.nickname=d.nickname),(r.profileUrl||r.profileImage)&&(this.currentUser.plainProfileUrl=d.profileUrl)),[2,d];case 2:throw V.connectionRequired}}))}))},n.prototype.updateCurrentUserInfoWithPreferredLanguages=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return ee(ge("string",e)).throw(V.invalidParameters),this.currentUser?(t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new mt({userId:n.userId,preferredLanguages:e}),[4,r.send(i)]):[3,2];case 1:return o=s.sent(),a=o.as(_t).user,this.currentUser&&(this.currentUser.preferredLanguages=a.preferredLanguages),[2,a];case 2:throw V.connectionRequired}}))}))},n.prototype.registerFCMPushTokenForCurrentUser=function(e){return i(this,void 0,void 0,(function(){var n,r,o,a,u,c=this;return s(this,(function(d){switch(d.label){case 0:if(ee(t("string",e)).throw(V.invalidParameters),!this.currentUser)return[3,6];d.label=1;case 1:return d.trys.push([1,4,,5]),n=Q.of(this._iid),r=n.sessionManager,o=n.sdkState,a=n.requestQueue,r.hasDeviceToken(m.FCM,e)?[2,me.SUCCESS]:(u=new wt({userId:o.userId,token:e}),[4,a.send(u)]);case 2:return d.sent(),[4,ie((function(){return i(c,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return r.setDeviceToken(m.FCM,e),[4,r.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return d.sent(),this._fcmPushToken="",[2,me.SUCCESS];case 4:return d.sent(),[2,me.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,me.PENDING];case 7:return[2]}}))}))},n.prototype.unregisterFCMPushTokenForCurrentUser=function(e){return i(this,void 0,void 0,(function(){var n,r,o,a,u,c,d=this;return s(this,(function(l){switch(l.label){case 0:if(ee(t("string",e)).throw(V.invalidParameters),!this.currentUser)return[3,6];l.label=1;case 1:return l.trys.push([1,4,,5]),n=Q.of(this._iid),r=n.sessionManager,o=n.sdkState,a=n.requestQueue,u=new Ct({userId:o.userId,token:e}),[4,a.send(u)];case 2:return c=l.sent().lastDeletedAt,[4,ie((function(){return i(d,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return r.unsetDeviceToken(m.FCM,e),r.setDeviceTokenDeletedAt(c),[4,r.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return l.sent(),this._fcmPushToken="",[2,me.SUCCESS];case 4:return l.sent(),[2,me.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,me.PENDING];case 7:return[2]}}))}))},n.prototype.unregisterFCMPushTokenAllForCurrentUser=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,o,a,u=this;return s(this,(function(c){switch(c.label){case 0:return this.currentUser?(e=Q.of(this._iid),t=e.sessionManager,n=e.sdkState,r=e.requestQueue,o=new St({userId:n.userId}),[4,r.send(o)]):[3,3];case 1:return a=c.sent().lastDeletedAt,[4,ie((function(){return i(u,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(m.FCM),t.setDeviceTokenDeletedAt(a),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:c.sent(),c.label=3;case 3:return[2]}}))}))},n.prototype.registerAPNSPushTokenForCurrentUser=function(e){return i(this,void 0,void 0,(function(){var n,r,o,a,u,c=this;return s(this,(function(d){switch(d.label){case 0:if(ee(t("string",e)).throw(V.invalidParameters),!this.currentUser)return[3,6];d.label=1;case 1:return d.trys.push([1,4,,5]),n=Q.of(this._iid),r=n.sessionManager,o=n.sdkState,a=n.requestQueue,r.hasDeviceToken(m.APNS,e)?[2,me.SUCCESS]:(u=new yt({userId:o.userId,token:e}),[4,a.send(u)]);case 2:return d.sent(),[4,ie((function(){return i(c,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return r.setDeviceToken(m.APNS,e),[4,r.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return d.sent(),this._apnsPushToken="",[2,me.SUCCESS];case 4:return d.sent(),[2,me.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,me.PENDING];case 7:return[2]}}))}))},n.prototype.unregisterAPNSPushTokenForCurrentUser=function(e){return i(this,void 0,void 0,(function(){var n,r,o,a,u,c,d=this;return s(this,(function(l){switch(l.label){case 0:if(ee(t("string",e)).throw(V.invalidParameters),!this.currentUser)return[3,6];l.label=1;case 1:return l.trys.push([1,4,,5]),n=Q.of(this._iid),r=n.sessionManager,o=n.sdkState,a=n.requestQueue,u=new It({userId:o.userId,token:e}),[4,a.send(u)];case 2:return c=l.sent().lastDeletedAt,[4,ie((function(){return i(d,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return r.unsetDeviceToken(m.APNS,e),r.setDeviceTokenDeletedAt(c),[4,r.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return l.sent(),this._apnsPushToken="",[2,me.SUCCESS];case 4:return l.sent(),[2,me.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,me.PENDING];case 7:return[2]}}))}))},n.prototype.unregisterAPNSPushTokenAllForCurrentUser=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,o,a,u=this;return s(this,(function(c){switch(c.label){case 0:return this.currentUser?(e=Q.of(this._iid),t=e.sessionManager,n=e.sdkState,r=e.requestQueue,o=new kt({userId:n.userId}),[4,r.send(o)]):[3,3];case 1:return a=c.sent().lastDeletedAt,[4,ie((function(){return i(u,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(m.APNS),t.setDeviceTokenDeletedAt(a),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:c.sent(),c.label=3;case 3:return[2]}}))}))},n.prototype.getChannelInvitationPreference=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return e=Q.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Pt({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,{autoAccept:i.as(Ut).autoAccept}]}}))}))},n.prototype.setChannelInvitationPreference=function(e){return i(this,void 0,void 0,(function(){var n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return ee(t("boolean",e)).throw(V.invalidParameters),n=Q.of(this._iid),r=n.sdkState,i=n.requestQueue,o=new Dt({userId:r.userId,willAutoAccept:e}),[4,i.send(o)];case 1:return a=s.sent(),[2,{autoAccept:a.as(Ot).autoAccept}]}}))}))},n.prototype.getDoNotDisturb=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return e=Q.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new At({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,i.as(Nt).preference]}}))}))},n.prototype.setDoNotDisturb=function(e,n,r,o,a,u){return void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===u&&(u=""),i(this,void 0,void 0,(function(){var i,c,d,l,h;return s(this,(function(s){switch(s.label){case 0:return ee(t("boolean",e)&&t("number",n)&&t("number",r)&&t("number",o)&&t("number",a)&&t("string",u)).throw(V.invalidParameters),i=Q.of(this._iid),c=i.sdkState,d=i.requestQueue,l=new Lt({userId:c.userId,doNotDisturbOn:e,startHour:n,startMin:r,endHour:o,endMin:a,timezone:u}),[4,d.send(l)];case 1:return h=s.sent(),[2,h.as(Mt).preference]}}))}))},n.prototype.getSnoozePeriod=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return e=Q.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Rt({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,i.as(zt).snoozePeriod]}}))}))},n.prototype.setSnoozePeriod=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=0),i(this,void 0,void 0,(function(){var i,o,a,u,c;return s(this,(function(s){switch(s.label){case 0:return ee(t("boolean",e)&&t("number",n)&&t("number",r)).throw(V.invalidParameters),i=Q.of(this._iid),o=i.sdkState,a=i.requestQueue,u=new Qt({userId:o.userId,snoozeOn:e,startTs:n,endTs:r}),[4,a.send(u)];case 1:return c=s.sent(),[2,c.as(jt).snoozePeriod]}}))}))},n.prototype.getMyPushTokensByToken=function(e,n){return i(this,void 0,void 0,(function(){var r,i,o,a,u,c,d,l,h,f,p,v;return s(this,(function(s){switch(s.label){case 0:return ee(t("string",e)&&_e(m,n)).throw(V.invalidParameters),r=Q.of(this._iid),i=r.sdkState,o=r.requestQueue,a=r.sessionManager,u=new Tt({userId:i.userId,type:n,token:e}),[4,o.send(u)];case 1:c=s.sent(),d=c.as(Et).pushTokens;try{for(l=J(d.deviceTokens),h=l.next();!h.done;h=l.next())f=h.value,a.setDeviceToken(d.type,f)}catch(e){p={error:e}}finally{try{h&&!h.done&&(v=l.return)&&v.call(l)}finally{if(p)throw p.error}}return[4,a.saveDeviceToken()];case 2:return s.sent(),[2,d]}}))}))},n.prototype.getPushTriggerOption=function(){return i(this,void 0,void 0,(function(){var e,t,n,r;return s(this,(function(i){switch(i.label){case 0:return e=Q.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Ht({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(xt).pushTriggerOption]}}))}))},n.prototype.setPushTriggerOption=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return ee(_e(ye,e)).throw(V.invalidParameters),t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new Gt({userId:n.userId,pushTriggerOption:e}),[4,r.send(i)];case 1:return[2,s.sent().as(Wt).pushTriggerOption]}}))}))},n.prototype.getPushTemplate=function(){return i(this,void 0,void 0,(function(){var e,t,n,r;return s(this,(function(i){switch(i.label){case 0:return e=Q.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Bt({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(Kt).name]}}))}))},n.prototype.setPushTemplate=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return ee(_e(we,e)).throw(V.invalidParameters),t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new Vt({userId:n.userId,templateName:e}),[4,r.send(i)];case 1:return[2,s.sent().as(Jt).name]}}))}))},n.prototype.blockUser=function(e){return i(this,void 0,void 0,(function(){var n,r,i,o;return s(this,(function(s){switch(s.label){case 0:return ee(e instanceof v||t("string",e)).throw(V.invalidParameters),n=Q.of(this._iid),r=n.sdkState,i=n.requestQueue,o=new Ft({userId:r.userId,blockedUserId:e instanceof v?e.userId:e}),[4,i.send(o)];case 1:return s.sent(),[2]}}))}))},n.prototype.blockUserWithUserId=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.blockUser(e)]}))}))},n.prototype.unblockUser=function(e){return i(this,void 0,void 0,(function(){var n,r,i,o;return s(this,(function(s){switch(s.label){case 0:return ee(e instanceof v||t("string",e)).throw(V.invalidParameters),n=Q.of(this._iid),r=n.sdkState,i=n.requestQueue,o=new qt({userId:r.userId,unblockedUserId:e instanceof v?e.userId:e}),[4,i.send(o)];case 1:return s.sent(),[2]}}))}))},n.prototype.unblockUserWithUserId=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.unblockUser(e)]}))}))},n.prototype.getFriendChangeLogsByToken=function(e){return i(this,void 0,void 0,(function(){var n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return ee(t("string",e)).throw(V.invalidParameters),n=Q.of(this._iid),r=n.sdkState,i=n.requestQueue,o=new Xt({userId:r.userId,token:e}),[4,i.send(o)];case 1:return a=s.sent(),[2,a.as(Yt).changelogs]}}))}))},n.prototype.getAllowFriendDiscovery=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return e=Q.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new sn({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,i.as(on).allowFriendDiscovery]}}))}))},n.prototype.setAllowFriendDiscovery=function(e){return i(this,void 0,void 0,(function(){var n,r,i,o;return s(this,(function(s){switch(s.label){case 0:return ee(t("boolean",e)).throw(V.invalidParameters),n=Q.of(this._iid),r=n.sdkState,i=n.requestQueue,o=new an({userId:r.userId,allowFriendDiscovery:e}),[4,i.send(o)];case 1:return s.sent(),[2,e]}}))}))},n.prototype.uploadFriendDiscoveries=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i,o;return s(this,(function(s){switch(s.label){case 0:return t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new Zt({userId:n.userId,discoveries:e}),[4,r.send(i)];case 1:return o=s.sent(),[2,o.as($t).friendDiscoveryRequestId]}}))}))},n.prototype.deleteFriendDiscovery=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.deleteFriendDiscoveries([e])]}))}))},n.prototype.deleteFriendDiscoveries=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return ee(ge("string",e)).throw(V.invalidParameters),t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new en({userId:n.userId,discoveryKeys:e}),[4,r.send(i)];case 1:return s.sent(),[2]}}))}))},n.prototype.addFriends=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i,o;return s(this,(function(s){switch(s.label){case 0:return ee(ge("string",e)).throw(V.invalidParameters),t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new tn({userId:n.userId,userIds:e}),[4,r.send(i)];case 1:return o=s.sent(),[2,o.as(nn).users]}}))}))},n.prototype.deleteFriend=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.deleteFriends([e])]}))}))},n.prototype.deleteFriends=function(e){return i(this,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return ee(ge("string",e)).throw(V.invalidParameters),t=Q.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new rn({userId:n.userId,userIds:e}),[4,r.send(i)];case 1:return s.sent(),[2]}}))}))},n.prototype.getAllEmoji=function(){return i(this,void 0,void 0,(function(){var e,t,n;return s(this,(function(r){switch(r.label){case 0:return e=Q.of(this._iid).requestQueue,t=new cn,[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(dn).emojiContainer]}}))}))},n.prototype.getEmojiCategory=function(e){return i(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(i){switch(i.label){case 0:return t=Q.of(this._iid).requestQueue,n=new ln({categoryId:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(hn).emojiCategory]}}))}))},n.prototype.getEmoji=function(e){return i(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(i){switch(i.label){case 0:return