-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.js
More file actions
1 lines (1 loc) · 67 KB
/
Copy pathindex.js
File metadata and controls
1 lines (1 loc) · 67 KB
1
import{i as e,a as n,_ as r,b as i,C as s,c as o,u as a,d as c,E as u,A as d,e as l,f as h,g as f,h as v,j as g,k as _,U as b,P as m,l as k,m as I,n as T,o as A,S as N,L as M,p as Q,q as j,r as x,V,s as W,t as X,v as Y,w as Z,x as $,y as ee,z as te,B as ne,D as re,F as ie,G as se,H as oe,I as ce,J as ue,K as de,M as le,W as he,N as fe,O as pe,Q as ve,R as ge,T as _e,X as be,Y as me,Z as ye,$ as we,a0 as Ce,a1 as ke,a2 as Se,a3 as Ie,a4 as Ee,a5 as Te,a6 as De,a7 as Pe,a8 as Ae,a9 as Ue}from"./lib/__bundle-eec21c16.js";export{aa as AppInfo,y as AuthTokenType,ac as CachedChannelInfo,ad as CachedDataClearOrder,C as ChannelType,ab as CollectionEventSource,w as ConnectionState,ae as DayOfWeek,a6 as DeviceOsPlatform,af as LastMessageThreadingPolicy,L as LocalCacheConfig,ag as NotificationInfo,a9 as PushTemplate,a4 as PushTokenRegistrationState,P as PushTokenType,a8 as PushTriggerOption,ah as ReportCategoryInfo,ai as Role,S as SendbirdChatOptions,q as SendbirdError,F as SendbirdErrorCode,an as SendbirdPlatform,am as SendbirdProduct,aj as UIKitConfigInfo,ak as UnreadCountThreadingPolicy,U as User,al as UserOnlineState}from"./lib/__bundle-eec21c16.js";import{MessageModule as Oe,MessageSearchQuery as Ne}from"./message.js";import{PollModule as Me}from"./poll.js";import{L as Re,N as Le,a as qe,b as Fe,c as ze,g as Qe,M as je,d as xe,e as Ke,f as Ve,h as He,i as Be,j as We,k as Ge,l as Je,m as Xe,n as Ye,o as Ze,D as $e,p as et,q as tt,r as nt,A as rt,I as it,s as st,U as ot,C as at,t as ct,B as ut,F as dt,S as lt,u as ht,v as ft,w as pt,x as vt}from"./lib/__bundle-19771e2c.js";export{t as ApplicationUserListQuery,y as BannedUserListQuery,z as BaseChannel,B as BlockedUserListQuery,C as ConnectionHandler,D as DndSchedule,F as FriendListQuery,p as LogLevel,q as MemoryStore,E as MutedUserListQuery,O as OperatorListQuery,P as Participant,G as Plugin,R as ReportCategory,H as RestrictedUser,J as RestrictionInfo,K as RestrictionType,S as SessionHandler,U as UserEventHandler}from"./lib/__bundle-19771e2c.js";import{g as gt,G as _t,A as bt,F as mt,U as yt,a as wt,b as Ct,S as kt,c as St,d as It,D as Et,R as Tt}from"./lib/__bundle-c577e079.js";import{g as Dt,N as Pt}from"./lib/__bundle-21aa1d46.js";import{A as At}from"./lib/__bundle-356d9e16.js";import"./lib/__bundle-71f4d3f4.js";import"./lib/__bundle-acd77193.js";var Ut=function(e){this.key=e.key,this.url=e.url},Ot=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 Ut(e)})):[]},Nt=function(e){this.emojiHash=e.emoji_hash||"",this.emojiCategories=e.emoji_categories?e.emoji_categories.map((function(e){return new Ot(e)})):[]},Mt={profileImage:void 0,profileUrl:void 0,nickname:void 0},Rt=function(e){return{v2:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:qe,keyName:Fe,index:[gt(_t.LATEST_LAST_MESSAGE),gt(_t.CHRONOLOGICAL),gt(_t.CHANNEL_NAME_ALPHABETICAL)]},{collectionName:Le,keyName:ze,index:[Qe(je.CHANNEL_LATEST),Qe(je.NEWEST_CHILD_MESSAGE)]},{collectionName:xe,keyName:Ke,index:[Qe(je.CHANNEL_LATEST),Qe(je.NEWEST_CHILD_MESSAGE)]},{collectionName:Ve,keyName:He}])];case 1:return[2,t.sent()]}}))}))},v3:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Be,keyName:We,index:[Dt("latest_last_message")]}])];case 1:return[2,t.sent()]}}))}))},v4:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Ge,keyName:Je,index:[Xe()]}])];case 1:return[2,t.sent()]}}))}))},v5:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Ye,keyName:Ze,index:[["-userId","-updatedAt"]]}])];case 1:return[2,t.sent()]}}))}))}}},Lt=function(e){var t=new Re;return function(n,o){return r(void 0,void 0,void 0,(function(){var r,a,c,u;return i(this,(function(i){switch(i.label){case 0:switch(n){case 1:case 2:case 3:case 4:return[3,1];case 5:return[3,2];case 6:return[3,4];case 7:return[3,11]}return[3,15];case 1:return o(),[3,16];case 2:return[4,e.reset()];case 3:return i.sent(),o(),[3,16];case 4:return i.trys.push([4,9,,10]),r=Rt(e),a=r.v2,c=r.v3,u=r.v4,[4,a()];case 5:return i.sent(),[4,c()];case 6:return i.sent(),[4,u()];case 7:return i.sent(),[4,e.collection(Le).removeIf({where:{channelType:s.OPEN}})];case 8:return i.sent(),[3,10];case 9:return i.sent(),t.warn("Failed to migrate to v2, v3, v4"),[3,10];case 10:return o(),[3,16];case 11:return i.trys.push([11,13,,14]),[4,(0,Rt(e).v5)()];case 12:return i.sent(),[3,14];case 13:return i.sent(),t.warn("Failed to migrate to v5"),[3,14];case 14:return o(),[3,16];case 15:o(),i.label=16;case 16:return[2]}}))}))}},qt=function(){return"undefined"!=typeof document?document.visibilityState:"visible"},Ft=function(e){function t(t){var n=t.getVisibilityState,r=void 0===n?qt:n,i=t.initialState,s=void 0===i?"visible":i,o=t.isEnabled,a=void 0===o||o,u=t.pauseCheckDelay,d=t.supportMultipleTabs,l=void 0!==d&&d,h=t.localCacheEnabled,f=void 0!==h&&h,p=e.call(this)||this;return p._currentVisibility="visible",p._activeTimestamp=0,p._storageKey="",p._onMessage=function(e){if(p.isActive){var t=e.data;if(t.tabId!==p._tabId&&"SB_ACTIVE_APP"===t.type){if(t.timestamp<=p._activeTimestamp)return;p._changeAppStateToInactive()}}},p._onStorage=function(e){if(p.isActive&&e.key===p._storageKey&&e.newValue)try{var t=JSON.parse(e.newValue);if(t.tabId===p._tabId||t.timestamp<=p._activeTimestamp)return;p._changeAppStateToInactive()}catch(e){console.warn("failed to parse active tab info from storage",e)}},p._toggleFocusState=function(){p.isActive||"visible"===p._currentVisibility&&p._changeAppStateToActive()},p._toggleStateByVisibilityState=function(){var e=p._getVisibilityState();if("visible"===e&&p.dispatch("page_visible"),"visible"===e){if("hidden"===p._currentVisibility){if(p.isActive)return;p._changeAppStateToActive(),p._dispatchAppStateEvent()}}else if("hidden"===e&&"visible"===p._currentVisibility){if(!p.isActive)return;p._changeAppStateToInactive()}p._currentVisibility=e},p._dispatchAppStateEvent=function(){p.isActive?p.dispatch("resume"):(p._clearPauseTimer(),p._pauseCheckDelay&&(p._pauseDelayTimer=setTimeout((function(){p._pauseDelayTimer=void 0,p.dispatch("pause")}),p._pauseCheckDelay)))},p._dispatchLocalCacheEvent=function(){p.isActive?p.dispatch("enable_local_cache"):p.dispatch("disable_local_cache")},p._changeAppStateToActive=function(){if(p._clearPauseTimer(),p._activeTimestamp=Date.now(),p._currentState="ACTIVE",!p._supportMultipleTabs&&p._pauseCheckDelay||p._dispatchLocalCacheEvent(),p._supportMultipleTabs){var e={tabId:p._tabId,timestamp:p._activeTimestamp};p._broadcastChannel?p._broadcastChannel.postMessage(c({type:"SB_ACTIVE_APP"},e)):localStorage.setItem(p._storageKey,JSON.stringify(e))}},p._changeAppStateToInactive=function(){var e=p._getVisibilityState();p._currentState="INACTIVE",!p._supportMultipleTabs&&p._pauseCheckDelay||p._dispatchLocalCacheEvent(),"hidden"===e&&p._dispatchAppStateEvent()},p._clearPauseTimer=function(){p._pauseDelayTimer&&(clearTimeout(p._pauseDelayTimer),p._pauseDelayTimer=void 0)},p._getVisibilityState=r,p._isEnabled=a,p._supportMultipleTabs=!!f&&l,p._pauseCheckDelay=u,p._currentVisibility=s,p}return o(t,e),Object.defineProperty(t.prototype,"isActive",{get:function(){return"ACTIVE"===this._currentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentVisibility",{get:function(){return this._currentVisibility},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAvailableBroadCast",{get:function(){return"undefined"!=typeof BroadcastChannel},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.start=function(e){var t=e.appId,n=e.userId,r=e.backgroundConnectionCloseTimeout;if(this._isEnabled&&this.isAvailable){if(void 0!==r&&-1!==r&&(this._pauseCheckDelay=0===r?10:1e3*r),this._supportMultipleTabs){var i="sendbird-".concat(t,"-").concat(n);if(this._tabId="".concat(i,"-").concat(a()),this._storageKey="".concat("sendbird-active-app:").concat(t,"-").concat(n),this.isAvailableBroadCast)try{this._broadcastChannel=new BroadcastChannel(i),this._broadcastChannel.onmessage=this._onMessage}catch(e){window.addEventListener("storage",this._onStorage,{capture:!0})}else window.addEventListener("storage",this._onStorage,{capture:!0});window.addEventListener("focus",this._toggleFocusState,{capture:!0}),window.addEventListener("pointerdown",this._toggleFocusState,{capture:!0})}window.addEventListener("visibilitychange",this._toggleStateByVisibilityState,{capture:!0}),"hidden"!==this.currentVisibility?this._changeAppStateToActive():this._currentState="INACTIVE"}},t.prototype.stop=function(){this._isEnabled&&this.isAvailable&&(this._clearPauseTimer(),this._supportMultipleTabs&&(this._broadcastChannel?(this._broadcastChannel.onmessage=null,this._broadcastChannel.close(),this._broadcastChannel=void 0):window.removeEventListener("storage",this._onStorage,{capture:!0}),window.removeEventListener("focus",this._toggleFocusState,{capture:!0}),window.removeEventListener("pointerdown",this._toggleFocusState,{capture:!0})),window.removeEventListener("visibilitychange",this._toggleStateByVisibilityState,{capture:!0}),this._tabId="",this._currentState="INACTIVE",this._activeTimestamp=0)},t}(u),zt=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 r(this,void 0,void 0,(function(){return i(this,(function(e){return this.isAvailableOnWeb?[2,navigator.onLine]:[2,new Promise((function(e){fetch("https://www.google.com",{method:d.GET,mode:"no-cors"}).then((function(){return e(!0)})).catch((function(){return e(!1)}))}))]}))}))},e}(),Qt=function(e){function t(t){var n,r=this;return(r=e.call(this)||this).method=d.GET,r.path=l,r.params=h(f({ts:"number"==typeof t.token?t.token:void 0,token:"string"==typeof t.token?t.token:void 0,limit:null!==(n=t.limit)&&void 0!==n?n:100})),r}return o(t,e),t}(v),jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.configs=n.configs,r.hasMore=n.has_more,r.nextToken=n.next,r.ts=n.ts,r}return o(t,e),t}(g),xt="explicit_disconnect",Kt="explicit_disconnect_websocket",Vt="session_invalidated",Ht="app_id_changed",Bt=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=d.PUT,a.path="".concat(_,"/").concat(encodeURIComponent(n)),a.params=h(f({nickname:r,profile_url:i,profile_file:s,preferred_languages:o})),a}return o(t,e),t}(v),Wt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new b(t,c({},n)),r}return o(t,e),t}(g),Gt=function(e){function t(t){var n=t.userId,r=t.token,i=t.deviceOS,s=t.deviceManufacturer,o=t.systemPushEnabled,a=t.unique,c=e.call(this)||this;return c.method=d.POST,c.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/apns"),c.params=h({apns_device_token:r,always_push:!0,device_os:i,device_manufacturer:s,system_push_enabled:o,is_unique:a}),c}return o(t,e),t}(v),Jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.lastDeletedAt=n.device_token_last_deleted_at,r}return o(t,e),t}(g),Xt=function(e){function t(t){var n=t.userId,r=t.token,i=t.deviceOS,s=t.deviceManufacturer,o=t.systemPushEnabled,a=t.unique,c=e.call(this)||this;return c.method=d.POST,c.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/gcm"),c.params=h({gcm_reg_token:r,always_push:!0,device_os:i,device_manufacturer:s,system_push_enabled:o,is_unique:a}),c}return o(t,e),t}(v),Yt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.lastDeletedAt=n.device_token_last_deleted_at,r}return o(t,e),t}(g),Zt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=d.DELETE,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/apns/").concat(encodeURIComponent(r)),i}return o(t,e),t}(v),$t=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new b(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return o(t,e),t}(g),en=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=d.DELETE,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/gcm/").concat(encodeURIComponent(r)),i}return o(t,e),t}(v),tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new b(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return o(t,e),t}(g),nn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.DELETE,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/apns"),r}return o(t,e),t}(v),rn=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 b(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return o(t,e),t}(g),sn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.DELETE,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/gcm"),r}return o(t,e),t}(v),on=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 b(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return o(t,e),t}(g),cn=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=d.GET,o.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/").concat(encodeURIComponent(r),"/device_tokens"),o.params={created_ts:s,token:i},o}return o(t,e),t}(v),un=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 o(t,e),t}(g),dn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),r}return o(t,e),t}(v),ln=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return o(t,e),t}(g),hn=function(e){function t(t){var n=t.userId,r=t.willAutoAccept,i=e.call(this)||this;return i.method=d.PUT,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),i.params={auto_accept:r},i}return o(t,e),t}(v),fn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return o(t,e),t}(g),pn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),r}return o(t,e),t}(v),vn=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 o(t,e),t}(g),gn=function(e){function t(t){var n=t.userId,r=t.doNotDisturbOn,i=t.startHour,s=t.startMin,o=t.endHour,a=t.endMin,c=t.timezone,u=e.call(this)||this;return u.method=d.PUT,u.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),u.params={do_not_disturb:r,start_hour:i,start_min:s,end_hour:o,end_min:a,timezone:c},u}return o(t,e),t}(v),_n=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 o(t,e),t}(g),bn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),r}return o(t,e),t}(v),mn=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 o(t,e),t}(g),yn=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=d.PUT,o.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),o.params={snooze_enabled:r,snooze_start_ts:i,snooze_end_ts:s},o}return o(t,e),t}(v),wn=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 o(t,e),t}(g),Cn=function(e){function t(t){var n=t.userId,r=t.blockedUserId,i=e.call(this)||this;return i.method=d.POST,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/block"),i.params={target_id:r},i}return o(t,e),t}(v);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new b(t,n),r}o(t,e)}(g);var kn=function(e){function t(t){var n=t.userId,r=t.unblockedUserId,i=e.call(this)||this;return i.method=d.DELETE,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/block/").concat(encodeURIComponent(r)),i}return o(t,e),t}(v);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}o(t,e)}(g);var Sn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),r}return o(t,e),t}(v),In=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return o(t,e),t}(g),En=function(e){function t(t){var n=t.userId,r=t.pushTriggerOption,i=e.call(this)||this;return i.method=d.PUT,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),i.params={push_trigger_option:r},i}return o(t,e),t}(v),Tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return o(t,e),t}(g),Dn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/template"),r}return o(t,e),t}(v),Pn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return o(t,e),t}(g),An=function(e){function t(t){var n=t.userId,r=t.templateName,i=e.call(this)||this;return i.method=d.PUT,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/push/template"),i.params={name:r},i}return o(t,e),t}(v),Un=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return o(t,e),t}(g),On=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=d.GET,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/friends/changelogs"),i.params={token:r},i}return o(t,e),t}(v),Nn=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 b(t,e)})),updatedUsers:n.updated.map((function(e){return new b(t,e)})),deletedUserIds:n.deleted,hasMore:n.has_more,token:n.next},r}return o(t,e),t}(g),Mn=function(e){function t(t){var n=t.userId,r=t.discoveries,i=e.call(this)||this;return i.method=d.PUT,i.path="".concat(_,"/").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 o(t,e),t}(v),Rn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.friendDiscoveryRequestId=n.friend_discovery_request_id,r}return o(t,e),t}(g),Ln=function(e){function t(t){var n=t.userId,r=t.discoveryKeys,i=e.call(this)||this;return i.method=d.DELETE,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discovery_keys:r},i}return o(t,e),t}(v);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}o(t,e)}(g);var qn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=d.POST,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return o(t,e),t}(v),Fn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new b(t,e)})),r}return o(t,e),t}(g),zn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=d.DELETE,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return o(t,e),t}(v);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}o(t,e)}(g);var Qn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/allow_friend_discovery"),r.params={},r}return o(t,e),t}(v),jn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.allowFriendDiscovery=n.allow_friend_discovery,r}return o(t,e),t}(g),xn=function(e){function t(t){var n=t.userId,r=t.allowFriendDiscovery,i=e.call(this)||this;return i.method=d.PUT,i.path="".concat(_,"/").concat(encodeURIComponent(n),"/allow_friend_discovery"),i.params={allow_friend_discovery:r},i}return o(t,e),t}(v);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}o(t,e)}(g);var Kn,Vn=function(e){function t(t){var n=t.doNotDisturbOn,r=void 0===n||n,i=t.userId,s=t.weeklyDndSchedules,o=t.timezone,a=e.call(this)||this;return a.method=d.PUT,a.path="".concat(_,"/").concat(encodeURIComponent(i),"/push_preference"),a.params=h({do_not_disturb:r,dnd_schedules:s?$e.payloadify(s):[],timezone:o}),a}return o(t,e),t}(v),Hn=function(e){function t(t,n){var r,i=this;return(i=e.call(this,t,n)||this).preference={doNotDisturbOn:n.do_not_disturb,dndSchedules:$e.buildDndScheduleFromPayload(null!==(r=n.dnd_schedules)&&void 0!==r?r:[]),timezone:n.timezone},i}return o(t,e),t}(g),Bn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),r}return o(t,e),t}(v),Wn=function(e){function t(t,n){var r,i=this;return(i=e.call(this,t,n)||this).preference={doNotDisturbOn:n.do_not_disturb,dndSchedules:$e.buildDndScheduleFromPayload(null!==(r=n.dnd_schedules)&&void 0!==r?r:[]),timezone:n.timezone},i}return o(t,e),t}(g),Gn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=d.DELETE,r.path="".concat(_,"/").concat(encodeURIComponent(n),"/push_preference"),r}return o(t,e),t}(v),Jn=function(e){function t(){var t=e.call(this)||this;return t.method=d.GET,t.path=k,t}return o(t,e),t}(v),Xn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiContainer=new Nt(n),r}return o(t,e),t}(g),Yn=function(e){function t(t){var n=t.categoryId,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(k,"/").concat(n),r}return o(t,e),t}(v),Zn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiCategory=new Ot(n),r}return o(t,e),t}(g),$n=function(e){function t(t){var n=t.key,r=e.call(this)||this;return r.method=d.GET,r.path="".concat(I,"/").concat(n),r}return o(t,e),t}(v),er=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emoji=new Ut(n),r}return o(t,e),t}(g),tr=function(e){function t(){var t=e.call(this)||this;return t.method=d.GET,t.path="".concat(T),t}return o(t,e),t}(v),nr=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 o(t,e),t}(g);!function(e){e.DELIVERED="DELIVERED",e.CLICKED="CLICKED"}(Kn||(Kn={}));var rr,ir=function(e){function t(t){var n=t.deviceToken,r=t.pushTrackingId,i=t.messageId,s=t.allowedPushNotification,o=t.channelKey,a=t.templateKey,c=t.eventType,u=t.notificationEventDeadline,l=e.call(this)||this;return l.method=d.POST,l.path=A,l.params=h({device_token:n,push_tracking_id:r,message_id:i,allowed_push_notification:s,channel_key:o,template_key:a,event_type:c,notification_event_deadline:u}),l}return o(t,e),t}(v),sr=function(){function t(e,t,n){var s=this;this._storeInitialized=!1,this._iid=e,this.options=t;var o=V.of(e),a=o.sdkState,c=o.cacheContext,u=o.dispatcher,d=o.sessionManager,l=o.requestQueue,h=o.logger,f=o.userEventHandlers,p=o.appStateToggleEnabled,v=o.supportMultipleTabs;this._onlineDetector=new zt({logger:h,connectionDelegate:{reconnect:function(){return r(s,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:if(t=V.of(e),n=t.sdkState,r=t.connectionManager,(s=t.sessionManager).session.hasSession)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.connect(s.session.authToken)];case 2:return i.sent(),[3,4];case 3:if(o=i.sent(),ke(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];i.label=6;case 6:return i.trys.push([6,8,,9]),[4,r.resetAndReconnect()];case 7:return i.sent(),[3,9];case 8:if(a=i.sent(),ke(a))throw a;return h.debug("resetAndReconnect failed by reconnect event = ",a),[3,9];case 9:return u.dispatch(new Pt),[2]}}))}))},disconnect:function(){ue((function(){return r(s,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=V.of(e),n=t.connectionManager,r=t.dispatcher,[4,n.disconnect()];case 1:return i.sent(),r.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:ie.NETWORK_ERROR,error_description:"cause=network_closed"}}))),[2]}}))}))}))}}});var g=new bt(e,{localCacheEnabled:c.localCacheEnabled,enableAutoResend:c.localCacheConfig.enableAutoResend,hasAiAgentModule:n.some((function(e){return"aiAgent"===e.name})),dispatcher:u,sdkState:a,logger:h});n.forEach((function(t){t.init(e,{sdkState:a,cacheContext:c,dispatcher:u,sessionManager:d,requestQueue:l,logger:h,onlineDetector:s._onlineDetector}),s[t.name]=t})),this._appStateChangeDetector=new Ft({isEnabled:p,supportMultipleTabs:v,localCacheEnabled:c.localCacheEnabled}),this._appStateChangeDetector.on("resume",(function(){h.debug("the page resumes from freeze"),s.setForegroundState()})).on("pause",(function(){h.debug("the page freezes"),s.setBackgroundState()})).on("enable_local_cache",(function(){h.debug("the local cache is enabled because the page is active"),c.localCacheEnabled=!0,s._setAppActiveState(!0),"foreground"===a.appState&&u.dispatch(new mt)})).on("disable_local_cache",(function(){h.debug("the local cache is disabled because the page is inactive"),c.localCacheEnabled=!1,s._setAppActiveState(!1)})).on("page_visible",(function(){s.setForegroundState()})),u.on((function(t){var n;if(t instanceof de){if(t.stateType===le.CONNECTED)g.processNonAutoResendRegisteredPendingMessages()}else if(t instanceof he){if("USEV"===t.code){var o=t.as(yt).event;if(o.category===wt.FRIEND_DISCOVERED){var u=Ct.getDataAsFriendDiscoveredEvent(e,o).friendDiscoveries;fe((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){return[2,f.forEach((function(e){e.onFriendsDiscovered&&e.onFriendsDiscovered(u)}))]}))}))}))}}}else if(t instanceof pe){var d=V.of(s._iid).subscribedUnreadMessageCount,l=!1,p=t.ts;"number"==typeof p&&p>d.ts&&(d.all!==t.all&&(l=!0),d.all=t.all>=0?t.all:0,t.customTypes&&Object.keys(t.customTypes).forEach((function(e){d.customTypes[e]!==t.customTypes[e]&&(l=!0),d.customTypes[e]=t.customTypes[e]})),l=l&&d.ts>0,d.ts=p),l&&fe((function(){return r(s,void 0,void 0,(function(){return i(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 if(t instanceof ve)c.preference.set(s._getUserProfileCacheKey(a.userId),ge.payloadify(t.userProfile)),(null===(n=t.userProfile.appInfo.notificationInfo)||void 0===n?void 0:n.isEnabled)&&c.preference.set(_e(s.appId),{value:!0});else if(t instanceof be)t.configSyncNeeded&&ue((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getAppConfigsInfo()];case 1:return e.sent(),[2]}}))}))}));else if(t instanceof kt)c.preference.set(me(s.appId),{configTs:t.configTs});else if(t instanceof ye)t.error&&t.error.isSessionInvalidatedError&&(h.debug("session revoked."),s._internalDisconnect(t.error));else if(t instanceof we)switch(t.event){case"resume":s.setForegroundState();break;case"pause":s.setBackgroundState()}}))}return t.init=function(e){var r=e.appId,i=e.appVersion,s=e.modules,o=void 0===s?[]:s,c=e.options,u=void 0===c?new N:c,d=e.debugMode,l=void 0!==d&&d,h=e.customApiHost,f=e.customWebSocketHost,p=e.newInstance,v=void 0!==p&&p,g=e.logLevel,_=e.localCacheEnabled,b=void 0!==_&&_,m=e.localCacheConfig,y=void 0===m?new M:m,w=e.localCacheEncryption,C=e.supportMultipleTabs,k=void 0!==C&&C,S=e.useAsyncStorageStore,I=void 0===S?null:S,E=e.useMMKVStorageStore,T=void 0===E?null:E,D=e.appStateToggleEnabled,P=void 0===D||D;if(Q(n("string",r)&&r.length>0).throw(j.invalidParameters),rr&&!v&&rr.appId!==r&&rr._release(),!rr||v){var A="su-".concat(a()),U=null!=w?w:{encrypt:function(e){return e},decrypt:function(e){return e}},O=new Re;O.level=null!=g?g:et.WARN;var R=new tt({encryption:U});l||(x()?T?R=new nt({MMKV:T,encryption:U}):I&&(R=new rt({AsyncStorage:I,encryption:U}),O.warn("AsyncStorage store is deprecated due to the small size limit. Please use MMKVStorage store instead.")):R=new it({encryption:U})),new V(A,{appId:r,appVersion:i,options:u,apiHost:null!=h?h:"https://api-".concat(r,".sendbird.com"),websocketHost:null!=f?f:"wss://ws-".concat(r,".sendbird.com"),store:R,encryption:U,logger:O,localCacheEnabled:b,localCacheConfig:y,debugMode:l,appStateToggleEnabled:P,supportMultipleTabs:k});var L=[new Oe,new Me],q=new t(A,u,W(W([],X(o),!1),X(L),!1));return rr||(rr=q),q}return rr},Object.defineProperty(t,"instance",{get:function(){return rr},enumerable:!1,configurable:!0}),Object.defineProperty(t,"version",{get:function(){return Y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appId",{get:function(){return V.of(this._iid).sdkState.appId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appInfo",{get:function(){var e=V.of(this._iid).appInfo;return null!=e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appVersion",{get:function(){var e;return null!==(e=V.of(this._iid).sdkState.appVersion)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugMode",{get:function(){return!!V.of(this._iid).debugMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logLevel",{get:function(){return V.of(this._iid).logger.level},set:function(e){V.of(this._iid).logger.level=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCacheEnabled",{get:function(){return V.of(this._iid).cacheContext.localCacheEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCacheConfig",{get:function(){var e=V.of(this._iid).cacheContext;return e.localCacheEnabled?e.localCacheConfig:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ekey",{get:function(){return V.of(this._iid).sessionManager.ekey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){var e;return null!==(e=V.of(this._iid).sessionManager.currentUser)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionState",{get:function(){var e=V.of(this._iid).connectionManager;return e.isConnected?Z.OPEN:e.isConnecting?Z.CONNECTING:Z.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastConnectedAt",{get:function(){var e=V.of(this._iid),t=e.connectedAt;return e.connectionManager.isConnected?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fcmPushToken",{get:function(){var e;return null!==(e=this._fcmPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"apnsPushToken",{get:function(){var e;return null!==(e=this._apnsPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),t.prototype._getNestDBVersion=function(){return 8},t.prototype._getPreferenceVersion=function(){return 9},t.prototype._getPreferenceCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".pref")},t.prototype._getUserProfileCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".profile")},t.prototype._internalDisconnect=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid),n=t.connectionManager,r=t.sdkState,s=t.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),s.cancelAll(e?Vt:xt),[4,n.logout(e)];case 1:return i.sent(),[4,this.clearCachedData()];case 2:return i.sent(),r.appState="foreground",r.isAppActive=!1,[2]}}))}))},t.prototype._getAppConfigsInfo=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u,d=this;return i(this,(function(l){switch(l.label){case 0:return e=V.of(this._iid),t=e.requestQueue,n=e.dispatcher,s=e.cacheContext,o=e.sdkState,a={},[4,s.preference.get(me(o.appId))];case 1:return(u=l.sent())&&(c=u.configTs),new St("appConfigsInfo",(function(e){return r(d,void 0,void 0,(function(){var r,s,o,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return r={hasNext:!0,nextToken:e},s=new Qt({token:e}),[4,t.send(s)];case 1:return o=i.sent(),c=o.as(jt),u=c.configs,d=c.hasMore,l=c.nextToken,h=c.ts,Object.keys(u).forEach((function(e){a[e]=u[e]})),r.hasNext=d,r.nextToken=l,d||n.dispatch(new It({appConfigsInfo:a,configTs:h})),[2,r]}}))}))})).start(c),[2]}}))}))},t.prototype.getMemoryStoreForDebugging=function(){var e=V.of(this._iid),t=e.debugMode,n=e.cacheContext;if(t)return n.store instanceof tt?n.store:null;throw j.debugModeRequired},t.prototype.addExtension=function(e,t){var n=V.of(this._iid).sdkState;["sb_uikit","sb_syncmanager","device-os-platform"].indexOf(e)>-1&&n.extensions&&(n.extensions[e]=t)},t.prototype.addSendbirdExtensions=function(e,t,n){var r,i,s=V.of(this._iid),o=s.logger,a=s.sdkState,c=new RegExp(Ce);if(0===e.length)return o.debug("sb.addSendbirdExtensions() has failed because the given sendbirdExtensions is empty."),!1;if(e.find((function(e){return!c.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 u=$(Object.entries(n)),d=u.next();!d.done;d=u.next()){var l=X(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=u.return)&&i.call(u)}finally{if(r)throw r.error}}return a.sendbirdRuntimeEnvironment={sendbirdExtensions:e,deviceOS:t,customData:n},!0},t.prototype.setOnlineListener=function(e){this._onlineDetector.setOnlineListener(e)},t.prototype.setOfflineListener=function(e){this._onlineDetector.setOfflineListener(e)},t.prototype._safeInitializeStore=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:t=V.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 tt),[4,this._safeInitializeStore(e)];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))},t.prototype.initializeCache=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a,c,u,d;return i(this,(function(i){switch(i.label){case 0:if(t=V.of(this._iid),n=t.sdkState,r=t.cacheContext,s=t.dispatcher,o=t.logger,n.userId&&n.userId===e)return[3,13];a="sendbird@".concat(n.appId,"/").concat(e,".db"),i.label=1;case 1:return i.trys.push([1,9,11,13]),r.localCacheEnabled?r.nestdb&&r.nestdb.state!==st.CLOSED&&r.nestdb.name===a?[3,3]:(c="sendbird@".concat(n.appId,"/").concat(e,".db"),(u=r.nestdb=new pt({name:c,version:this._getNestDBVersion(),store:r.store,config:new vt({dbname:c,cacheLimit:64,itemSizeLimit:61440})})).on("upgrade",Lt(u)),u.on("storeReplaced",(function(e){r.replaceStore(e),r.localCacheEnabled=!1,u.on("upgrade",Lt(u))})),[4,u.open()]):[3,6];case 2:return i.sent(),this._storeInitialized=!0,s.dispatch(new Et(this._iid,{userId:e})),[3,5];case 3:return[4,this._safeInitializeStore(a)];case 4:i.sent(),i.label=5;case 5:return n.userId=e,[3,8];case 6:return[4,this._safeInitializeStore(a)];case 7:i.sent(),n.userId=e,i.label=8;case 8:return[3,13];case 9:return d=i.sent(),o.warn("Nest DB Open Failed. ",d),r.store instanceof tt||(r.replaceStore(new tt),r.localCacheEnabled=!1),[4,this._safeInitializeStore(a)];case 10:throw i.sent(),n.userId=e,j.databaseError;case 11:return[4,this._setupPreference(e)];case 12:return i.sent(),[7];case 13:return[2]}}))}))},t.prototype.getCacheDataSize=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return(e=V.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.estimateUsage()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,0]}}))}))},t.prototype.clearCachedData=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return(e=V.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.clear()]:[3,2];case 1:t.sent(),e.nestdb.trim(),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]}}))}))},t.prototype.clearCachedMessages=function(e){return r(this,void 0,void 0,(function(){var t,n,s,o=this;return i(this,(function(a){switch(a.label){case 0:return Q(Se("string",e)).throw(j.invalidParameters),t=V.of(this._iid).cacheContext,n=ht.of(this._iid),s=ft.of(this._iid),n&&s?[4,Promise.all(e.map((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,n.removeMessagesOfChannel(e)];case 1:return t.sent(),[4,s.removeMessagesOfChannel(e)];case 2:return t.sent(),[2]}}))}))})))]:[3,2];case 1:a.sent(),a.label=2;case 2:return t.localCacheEnabled&&t.nestdb&&t.nestdb.trim(),[2]}}))}))},t.prototype._setupPreference=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid),n=t.sdkState,r=t.cacheContext,s=t.statManager,[4,r.preference.init(this._getPreferenceCacheKey(e),this._getPreferenceVersion())];case 1:return i.sent(),[4,r.preference.get(this._getUserProfileCacheKey(e))];case 2:return(o=i.sent())&&new ge(this._iid,o).apply(),[4,s.init("sendbird@".concat(n.appId,"/").concat(e,".statlog"))];case 3:return i.sent(),[2]}}))}))},t.prototype._willReuseOpenedCacheDatabase=function(e){var t=V.of(this._iid),n=t.sdkState,r=t.cacheContext,i="sendbird@".concat(n.appId,"/").concat(e,".db");return!(!r.localCacheConfig||!r.nestdb||r.nestdb.state===st.CLOSED||r.nestdb.name!==i)},t.prototype._ready=function(e,t,s){return void 0===s&&(s={}),r(this,void 0,void 0,(function(){var r,o,a,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return Q(n("string",e)&&n("string",t,!0)).throw(j.invalidParameters),r=V.of(this._iid),o=r.sdkState,a=r.cacheContext,c=r.connectionManager,u=r.dispatcher,d=s.errorForOtherUser,o.userId&&o.userId!==e?d?[3,2]:[4,c.logout()]:[3,3];case 1:return i.sent(),[3,3];case 2:throw d;case 3:return i.trys.push([3,5,,6]),l=this._willReuseOpenedCacheDatabase(e),[4,this.initializeCache(e)];case 4:return i.sent(),a.localCacheEnabled&&l&&u.dispatch(new Tt),[3,6];case 5:return i.sent(),h=V.of(this._iid).logger,a.localCacheEnabled=!1,h.warn("Cache initialization failed - cache is not available."),[3,6];case 6:return[2]}}))}))},t.prototype.authenticateFeed=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.authenticate(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.authenticate=function(e,t,n){var s;return void 0===n&&(n=ee.SESSION_TOKEN),r(this,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return r=V.of(this._iid),o=r.sessionManager,a=r.connectionManager,[4,this._ready(e,t,{errorForOtherUser:a.isConnected?j.alreadyConnectedAsAnotherUser:void 0})];case 1:return i.sent(),(null===(s=o.session.services)||void 0===s?void 0:s.includes(Ie.CHAT))?[3,3]:(o.handler||t&&n!==ee.ACCESS_TOKEN||this.setSessionHandler(new lt),[4,o.authenticate(e,t)]);case 2:i.sent(),i.label=3;case 3:return[2,this.currentUser]}}))}))},t.prototype.connect=function(e,t){var n;return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this._ready(e,t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,V.of(this._iid).connectionManager.connect(t)];case 3:return r.sent(),[3,5];case 4:return this._onlineDetector.start(),this._appStateChangeDetector.start({appId:this.appId,userId:e,backgroundConnectionCloseTimeout:null===(n=this.appInfo)||void 0===n?void 0:n.backgroundConnectionCloseTimeout}),[7];case 5:return[2,this.currentUser]}}))}))},t.prototype.reconnect=function(){var e=V.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.sessionManager,i=e.dispatcher,s=r.session.hasSession;return s&&(i.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:0,error_description:"cause=explicit_reconnect"}}))),this._appStateChangeDetector.start({appId:this.appId,userId:this.currentUser.userId,backgroundConnectionCloseTimeout:this.appInfo.backgroundConnectionCloseTimeout}),this._onlineDetector.start(),t.resetAndReconnect().then((function(){n.appState="foreground"})).catch((function(){}))),s},t.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._internalDisconnect()];case 1:return e.sent(),[2]}}))}))},t.prototype.disconnectWebSocket=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=V.of(this._iid),t=e.connectionManager,n=e.requestQueue,e.dispatcher.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:0,error_description:"cause=explicit_disconnect_websocket"}}))),this._appStateChangeDetector.stop(),this._onlineDetector.stop(),n.cancelAll(Kt),[4,t.disconnectWebSocket(!0)];case 1:return r.sent(),[2]}}))}))},t.prototype._release=function(){var e=this;if(V.exists(this._iid)){var t=V.of(this._iid),n=t.cacheContext,r=t.requestQueue,i=t.logger,s=r.commandRouter.websocketClient,o=function(e,t){try{t()}catch(t){i.debug("release: ".concat(e," failed = "),t)}};o("app state detector stop",(function(){return e._appStateChangeDetector.stop()})),o("online detector stop",(function(){return e._onlineDetector.stop()})),o("request cancellation",(function(){return r.cancelAll(Ht)})),o("websocket force close",(function(){s.ws&&s.forceClose(!1)})),o("nestdb close",(function(){var e;null===(e=n.nestdb)||void 0===e||e.close()})),V.clear(this._iid),rr===this&&(rr=void 0)}else rr===this&&(rr=void 0)},t.prototype.setBackgroundState=function(){var e=V.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.logger,i=e.dispatcher;"foreground"===n.appState&&(n.appState="background",n.isAppActive=!1,r.debug("going background state"),i.dispatch(new At),i.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:ie.WEBSOCKET_CONNECTION_CLOSED,error_description:"cause=background"}}))),t.background().catch((function(e){r.debug("setBackgroundState error = ",e)})))},t.prototype.setForegroundState=function(){var e=V.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.dispatcher,i=e.logger;"background"===n.appState?(n.appState="foreground",n.isAppActive=!0,i.debug("going foreground state"),t.resetAndReconnect().catch((function(e){i.debug("setForgroundState error = ",e)})),r.dispatch(new Pt)):"foreground"===n.appState&&t.shouldReconnectOnForeground&&(i.debug("foreground resume: connection is not alive, reconnecting"),t.resetAndReconnect().catch((function(e){i.debug("setForegroundState (foreground reconnect) error = ",e)})),r.dispatch(new Pt))},t.prototype._setAppActiveState=function(e){V.of(this._iid).sdkState.isAppActive=e},t.prototype.setSessionHandler=function(e){Q(e instanceof lt).throw(j.invalidParameters),V.of(this._iid).sessionManager.handler=e},t.prototype.addUserEventHandler=function(e,t){Q(n("string",e)&&t instanceof ot).throw(j.invalidParameters),V.of(this._iid).userEventHandlers.set(e,t)},t.prototype.removeUserEventHandler=function(e){V.of(this._iid).userEventHandlers.delete(e)},t.prototype.removeAllUserEventHandler=function(){V.of(this._iid).userEventHandlers.clear()},t.prototype.addConnectionHandler=function(e,t){Q(n("string",e)&&t instanceof at).throw(j.invalidParameters),V.of(this._iid).connectionHandlers.set(e,t)},t.prototype.removeConnectionHandler=function(e){V.of(this._iid).connectionHandlers.delete(e)},t.prototype.removeAllConnectionHandler=function(){V.of(this._iid).connectionHandlers.clear()},t.prototype.createApplicationUserListQuery=function(e){return void 0===e&&(e={}),new ct(this._iid,e)},t.prototype.createBlockedUserListQuery=function(e){return void 0===e&&(e={}),new ut(this._iid,e)},t.prototype.createFriendListQuery=function(e){return void 0===e&&(e={}),new dt(this._iid,e)},t.prototype.createMessageSearchQuery=function(e){return new Ne(this._iid,e)},t.prototype.createPollListQuery=function(e){return new se(this._iid,c({},e))},t.prototype.createPollVoterListQuery=function(e){return new oe(this._iid,c({},e))},t.prototype.buildUserFromSerializedData=function(e){var t=ce(e);return new b(this._iid,b.payloadify(t))},t.prototype.updateCurrentUserInfo=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var r,s,o,a,u,d,l;return i(this,(function(i){switch(i.label){case 0:return r=c(c({},Mt),t),Q(function(t){return e(t.profileImage,!0)&&n("string",t.profileUrl,!0)&&n("string",t.nickname,!0)}(r)).throw(j.invalidParameters),this.currentUser?(s=V.of(this._iid),o=s.sdkState,a=s.requestQueue,u=new Bt(c({userId:o.userId},r)),[4,a.send(u)]):[3,2];case 1:return d=i.sent(),l=d.as(Wt).user,this.currentUser&&(r.nickname&&(this.currentUser.nickname=l.nickname),(r.profileUrl||r.profileImage)&&(this.currentUser.plainProfileUrl=l.profileUrl)),[2,l];case 2:throw j.connectionRequired}}))}))},t.prototype.updateCurrentUserInfoWithPreferredLanguages=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return Q(Se("string",e)).throw(j.invalidParameters),this.currentUser?(t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Bt({userId:n.userId,preferredLanguages:e}),[4,r.send(s)]):[3,2];case 1:return o=i.sent(),a=o.as(Wt).user,this.currentUser&&(this.currentUser.preferredLanguages=a.preferredLanguages),[2,a];case 2:throw j.connectionRequired}}))}))},t.prototype.registerFCMPushTokenForCurrentUser=function(e,t){var s,o;return r(this,void 0,void 0,(function(){var a,c,u,d,l,h,f,p=this;return i(this,(function(v){switch(v.label){case 0:if(Q(n("string",e)&&n("string",null==t?void 0:t.deviceManufacturer,!0)&&n("boolean",null==t?void 0:t.unique,!0)).throw(j.invalidParameters),0===e.trim().length)return V.of(this._iid).logger.warn("registerFCMPushTokenForCurrentUser() failed because the token is empty."),[2,Ee.ERROR];if((null==t?void 0:t.deviceOS)&&Q(Te(De,t.deviceOS.platform,!0)&&n("string",t.deviceOS.version,!0)).throw(j.invalidParameters),!this.currentUser)return[3,6];a={deviceOS:"".concat((null===(s=null==t?void 0:t.deviceOS)||void 0===s?void 0:s.platform)||De.ANDROID,"-").concat((null===(o=null==t?void 0:t.deviceOS)||void 0===o?void 0:o.version)||"unknown"),deviceManufacturer:null==t?void 0:t.deviceManufacturer,systemPushEnabled:null==t?void 0:t.systemPushEnabled},v.label=1;case 1:return v.trys.push([1,4,,5]),c=V.of(this._iid),u=c.sessionManager,d=c.sdkState,l=c.requestQueue,!(null==t?void 0:t.unique)&&u.hasDeviceToken(m.FCM,e)?[2,Ee.SUCCESS]:(h=new Xt({userId:d.userId,token:e,deviceOS:a.deviceOS,deviceManufacturer:a.deviceManufacturer,systemPushEnabled:a.systemPushEnabled,unique:null==t?void 0:t.unique}),[4,l.send(h)]);case 2:return f=v.sent(),[4,ue((function(){return r(p,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=f.as(Yt).lastDeletedAt,(null==t?void 0:t.unique)&&"number"==typeof n&&(u.unsetDeviceTokens(),u.setDeviceTokenDeletedAt(n)),u.setDeviceToken(m.FCM,e,a),[4,u.saveDeviceToken()];case 1:return r.sent(),[2]}}))}))}))];case 3:return v.sent(),this._fcmPushToken="",[2,Ee.SUCCESS];case 4:return v.sent(),[2,Ee.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,Ee.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterFCMPushTokenForCurrentUser=function(e){return r(this,void 0,void 0,(function(){var t,s,o,a,c,u,d,l=this;return i(this,(function(h){switch(h.label){case 0:if(Q(n("string",e)).throw(j.invalidParameters),0===e.trim().length)return V.of(this._iid).logger.warn("unregisterFCMPushTokenForCurrentUser() failed because the token is empty."),[2,Ee.ERROR];if(!this.currentUser)return[3,6];h.label=1;case 1:return h.trys.push([1,4,,5]),t=V.of(this._iid),s=t.sessionManager,o=t.sdkState,a=t.requestQueue,c=new en({userId:o.userId,token:e}),[4,a.send(c)];case 2:return u=h.sent(),d=u.as(tn).lastDeletedAt,[4,ue((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s.unsetDeviceToken(m.FCM,e),s.setDeviceTokenDeletedAt(d),[4,s.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return h.sent(),this._fcmPushToken="",[2,Ee.SUCCESS];case 4:return h.sent(),[2,Ee.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,Ee.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterFCMPushTokenAllForCurrentUser=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u=this;return i(this,(function(d){switch(d.label){case 0:return this.currentUser?(e=V.of(this._iid),t=e.sessionManager,n=e.sdkState,s=e.requestQueue,o=new sn({userId:n.userId}),[4,s.send(o)]):[3,3];case 1:return a=d.sent(),c=a.as(on).lastDeletedAt,[4,ue((function(){return r(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(m.FCM),t.setDeviceTokenDeletedAt(c),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},t.prototype.registerAPNSPushTokenForCurrentUser=function(e,t){var s,o;return r(this,void 0,void 0,(function(){var a,c,u,d,l,h,f,p=this;return i(this,(function(v){switch(v.label){case 0:if(Q(n("string",e)&&n("string",null==t?void 0:t.deviceManufacturer,!0)&&n("boolean",null==t?void 0:t.unique,!0)).throw(j.invalidParameters),0===e.trim().length)return V.of(this._iid).logger.warn("registerAPNSPushTokenForCurrentUser() failed because the token is empty."),[2,Ee.ERROR];if((null==t?void 0:t.deviceOS)&&Q(Te(De,t.deviceOS.platform,!0)&&n("string",t.deviceOS.version,!0)).throw(j.invalidParameters),!this.currentUser)return[3,6];a={deviceOS:"".concat((null===(s=null==t?void 0:t.deviceOS)||void 0===s?void 0:s.platform)||De.IOS,"-").concat((null===(o=null==t?void 0:t.deviceOS)||void 0===o?void 0:o.version)||"unknown"),deviceManufacturer:null==t?void 0:t.deviceManufacturer,systemPushEnabled:null==t?void 0:t.systemPushEnabled},v.label=1;case 1:return v.trys.push([1,4,,5]),c=V.of(this._iid),u=c.sessionManager,d=c.sdkState,l=c.requestQueue,!(null==t?void 0:t.unique)&&u.hasDeviceToken(m.APNS,e)?[2,Ee.SUCCESS]:(h=new Gt({userId:d.userId,token:e,deviceOS:a.deviceOS,deviceManufacturer:a.deviceManufacturer,systemPushEnabled:a.systemPushEnabled,unique:null==t?void 0:t.unique}),[4,l.send(h)]);case 2:return f=v.sent(),[4,ue((function(){return r(p,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=f.as(Jt).lastDeletedAt,(null==t?void 0:t.unique)&&"number"==typeof n&&(u.unsetDeviceTokens(),u.setDeviceTokenDeletedAt(n)),u.setDeviceToken(m.APNS,e,a),[4,u.saveDeviceToken()];case 1:return r.sent(),[2]}}))}))}))];case 3:return v.sent(),this._apnsPushToken="",[2,Ee.SUCCESS];case 4:return v.sent(),[2,Ee.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,Ee.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterAPNSPushTokenForCurrentUser=function(e){return r(this,void 0,void 0,(function(){var t,s,o,a,c,u,d,l=this;return i(this,(function(h){switch(h.label){case 0:if(Q(n("string",e)).throw(j.invalidParameters),0===e.trim().length)return V.of(this._iid).logger.warn("unregisterAPNSPushTokenForCurrentUser() failed because the token is empty."),[2,Ee.ERROR];if(!this.currentUser)return[3,6];h.label=1;case 1:return h.trys.push([1,4,,5]),t=V.of(this._iid),s=t.sessionManager,o=t.sdkState,a=t.requestQueue,c=new Zt({userId:o.userId,token:e}),[4,a.send(c)];case 2:return u=h.sent(),d=u.as($t).lastDeletedAt,[4,ue((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s.unsetDeviceToken(m.APNS,e),s.setDeviceTokenDeletedAt(d),[4,s.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return h.sent(),this._apnsPushToken="",[2,Ee.SUCCESS];case 4:return h.sent(),[2,Ee.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,Ee.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterAPNSPushTokenAllForCurrentUser=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u=this;return i(this,(function(d){switch(d.label){case 0:return this.currentUser?(e=V.of(this._iid),t=e.sessionManager,n=e.sdkState,s=e.requestQueue,o=new nn({userId:n.userId}),[4,s.send(o)]):[3,3];case 1:return a=d.sent(),c=a.as(rn).lastDeletedAt,[4,ue((function(){return r(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(m.APNS),t.setDeviceTokenDeletedAt(c),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},t.prototype.markPushNotificationAsDelivered=function(e,t){var n;return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var r,s,o,a,c,u,d,l,h,f,p,v,g,_,b,m,y,w,C;return i(this,(function(i){switch(i.label){case 0:if(r=V.of(this._iid),s=r.logger,o=r.sessionManager,a=r.requestQueue,c=r.pushNotificationAckManager,s.debug("markPushNotificationAsDelivered:",e),u=Kn.DELIVERED,d=c.parseData(e),l=d.pushTrackingId,h=d.sessionTopics,f=d.sessionKey,p=d.messageId,v=d.channelKey,g=d.templateKey,_=d.notificationEventDeadline,!f)throw s.info("Can't use markPushNotificationAsDelivered() feature."),j.malformedDataError;if(!h.includes(Pe.PUSH_ACKNOWLEDGEMENT))throw s.info("Can't use markPushNotificationAsDelivered() feature."),j.malformedDataError;if(c.isAcked(l,u))return s.info("already delivered push notification:",l),[2];b=Boolean(v),m=t&&b,y=null===(n=o.deviceTokens[0])||void 0===n?void 0:n.token,w=new ir({deviceToken:null!=y?y:"",pushTrackingId:l,eventType:u,messageId:p,channelKey:v,templateKey:g,notificationEventDeadline:_,allowedPushNotification:m}),f&&(w.headers["Session-Key"]=f),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,a.send(w)];case 2:return i.sent(),c.markAsAcked(l,u),[3,4];case 3:throw C=i.sent(),s.debug("failed to mark push notification as delivered. push tracking id: ".concat(l,". error: ").concat(C)),C;case 4:return[2]}}))}))},t.prototype.markPushNotificationAsClicked=function(e){var t;return r(this,void 0,void 0,(function(){var n,r,s,o,a,c,u,d,l,h,f,p,v,g,_,b,m;return i(this,(function(i){switch(i.label){case 0:if(n=V.of(this._iid),r=n.logger,s=n.sessionManager,o=n.requestQueue,a=n.pushNotificationAckManager,r.debug("markPushNotificationAsClicked:",e),c=Kn.CLICKED,u=a.parseData(e),d=u.pushTrackingId,l=u.sessionTopics,h=u.sessionKey,f=u.messageId,p=u.channelKey,v=u.templateKey,g=u.notificationEventDeadline,!h)throw r.info("Can't use markPushNotificationAsClicked() feature."),j.malformedDataError;if(!l.includes(Pe.PUSH_ACKNOWLEDGEMENT))throw r.info("Can't use markPushNotificationAsClicked() feature."),j.malformedDataError;if(a.isAcked(d,c))return r.info("already clicked push notification:",d),[2];_=null===(t=s.deviceTokens[0])||void 0===t?void 0:t.token,b=new ir({deviceToken:null!=_?_:"",pushTrackingId:d,eventType:c,messageId:f,channelKey:p,templateKey:v,notificationEventDeadline:g}),h&&(b.headers["Session-Key"]=h),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.send(b)];case 2:return i.sent(),a.markAsAcked(d,c),[3,4];case 3:throw m=i.sent(),r.debug("failed to mark push notification as clicked. push tracking id: ".concat(d,". error: ").concat(m)),m;case 4:return[2]}}))}))},t.prototype.getChannelInvitationPreference=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new dn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,{autoAccept:s.as(ln).autoAccept}]}}))}))},t.prototype.setChannelInvitationPreference=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return Q(n("boolean",e)).throw(j.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new hn({userId:r.userId,willAutoAccept:e}),[4,s.send(o)];case 1:return a=i.sent(),[2,{autoAccept:a.as(fn).autoAccept}]}}))}))},t.prototype.getDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new pn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(vn).preference]}}))}))},t.prototype.setDoNotDisturb=function(e,t,s,o,a,c){return void 0===t&&(t=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===c&&(c=""),r(this,void 0,void 0,(function(){var r,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return Q(n("boolean",e)&&n("number",t)&&n("number",s)&&n("number",o)&&n("number",a)&&n("string",c)).throw(j.invalidParameters),r=V.of(this._iid),u=r.sdkState,d=r.requestQueue,l=new gn({userId:u.userId,doNotDisturbOn:e,startHour:t,startMin:s,endHour:o,endMin:a,timezone:c}),[4,d.send(l)];case 1:return h=i.sent(),[2,h.as(_n).preference]}}))}))},t.prototype.setWeeklyDoNotDisturb=function(e,t){return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,s,o,a,c;return i(this,(function(i){switch(i.label){case 0:return Q(e instanceof $e&&e.isValid()&&n("string",t)).throw(j.invalidParameters),r=V.of(this._iid),s=r.sdkState,o=r.requestQueue,a=new Vn({userId:s.userId,weeklyDndSchedules:e,timezone:t}),[4,o.send(a)];case 1:return c=i.sent(),[2,c.as(Hn).preference]}}))}))},t.prototype.getWeeklyDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Bn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(Wn).preference]}}))}))},t.prototype.clearWeeklyDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Gn({userId:t.userId}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},t.prototype.getSnoozePeriod=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new bn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(mn).snoozePeriod]}}))}))},t.prototype.setSnoozePeriod=function(e,t,s){return void 0===t&&(t=0),void 0===s&&(s=0),r(this,void 0,void 0,(function(){var r,o,a,c,u;return i(this,(function(i){switch(i.label){case 0:return Q(n("boolean",e)&&n("number",t)&&n("number",s)).throw(j.invalidParameters),r=V.of(this._iid),o=r.sdkState,a=r.requestQueue,c=new yn({userId:o.userId,snoozeOn:e,startTs:t,endTs:s}),[4,a.send(c)];case 1:return u=i.sent(),[2,u.as(wn).snoozePeriod]}}))}))},t.prototype.getMyPushTokensByToken=function(e,t){return r(this,void 0,void 0,(function(){var r,s,o,a,c,u,d,l,h,f,p,v;return i(this,(function(i){switch(i.label){case 0:return Q(n("string",e)&&Te(m,t)).throw(j.invalidParameters),r=V.of(this._iid),s=r.sdkState,o=r.requestQueue,a=r.sessionManager,c=new cn({userId:s.userId,type:t,token:e}),[4,o.send(c)];case 1:u=i.sent(),d=u.as(un).pushTokens;try{for(l=$(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 i.sent(),[2,d]}}))}))},t.prototype.getPushTriggerOption=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Sn({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(In).pushTriggerOption]}}))}))},t.prototype.setPushTriggerOption=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return Q(Te(Ae,e)).throw(j.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new En({userId:n.userId,pushTriggerOption:e}),[4,r.send(s)];case 1:return[2,i.sent().as(Tn).pushTriggerOption]}}))}))},t.prototype.getPushTemplate=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Dn({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(Pn).name]}}))}))},t.prototype.setPushTemplate=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return Q(Te(Ue,e)).throw(j.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new An({userId:n.userId,templateName:e}),[4,r.send(s)];case 1:return[2,i.sent().as(Un).name]}}))}))},t.prototype.blockUser=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return Q(e instanceof b||n("string",e)).throw(j.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new Cn({userId:r.userId,blockedUserId:e instanceof b?e.userId:e}),[4,s.send(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.blockUserWithUserId=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.blockUser(e)]}))}))},t.prototype.unblockUser=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return Q(e instanceof b||n("string",e)).throw(j.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new kn({userId:r.userId,unblockedUserId:e instanceof b?e.userId:e}),[4,s.send(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.unblockUserWithUserId=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.unblockUser(e)]}))}))},t.prototype.getFriendChangeLogsByToken=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return Q(n("string",e)).throw(j.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new On({userId:r.userId,token:e}),[4,s.send(o)];case 1:return a=i.sent(),[2,a.as(Nn).changelogs]}}))}))},t.prototype.getAllowFriendDiscovery=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Qn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(jn).allowFriendDiscovery]}}))}))},t.prototype.setAllowFriendDiscovery=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return Q(n("boolean",e)).throw(j.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new xn({userId:r.userId,allowFriendDiscovery:e}),[4,s.send(o)];case 1:return i.sent(),[2,e]}}))}))},t.prototype.uploadFriendDiscoveries=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Mn({userId:n.userId,discoveries:e}),[4,r.send(s)];case 1:return o=i.sent(),[2,o.as(Rn).friendDiscoveryRequestId]}}))}))},t.prototype.deleteFriendDiscovery=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.deleteFriendDiscoveries([e])]}))}))},t.prototype.deleteFriendDiscoveries=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return Q(Se("string",e)).throw(j.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Ln({userId:n.userId,discoveryKeys:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},t.prototype.addFriends=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return Q(Se("string",e)).throw(j.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new qn({userId:n.userId,userIds:e}),[4,r.send(s)];case 1:return o=i.sent(),[2,o.as(Fn).users]}}))}))},t.prototype.deleteFriend=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.deleteFriends([e])]}))}))},t.prototype.deleteFriends=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return Q(Se("string",e)).throw(j.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new zn({userId:n.userId,userIds:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},t.prototype.getAllEmoji=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=V.of(this._iid).requestQueue,t=new Jn,[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(Xn).emojiContainer]}}))}))},t.prototype.getEmojiCategory=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid).requestQueue,n=new Yn({categoryId:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Zn).emojiCategory]}}))}))},t.prototype.getEmoji=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid).requestQueue,n=new $n({key:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(er).emoji]}}))}))},t.prototype.getUIKitConfiguration=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),Q(e.hasExtension("sb_uikit")).throw(j.notSupportedError),t=e.requestQueue,n=new tr,[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(nr).uikitConfiguration]}}))}))},t.prototype.getReportCategoryInfoList=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,V.of(this._iid).reportCategoryManager.categories()];case 1:return[2,e.sent()]}}))}))},t}();export{Ut as Emoji,Ot as EmojiCategory,Nt as EmojiContainer,sr as default};