isdata-customer-sdk 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.common.995.js","mappings":";;;;;;;;;;AAAA,qCAAqC,QAAQ,qBAAqB,uBAAuB,SAAS,sDAAsD,WAAW,qCAAqC,oCAAoC,eAAe,iBAAiB,KAAK,EAAE,aAAa,YAAY,OAAO,MAAM,OAAO,mCAAmC,UAAU,mCAAmC,YAAY,yCAAyC,QAAQ,wCAAwC,UAAU,yCAAyC,MAAM,yCAAyC,MAAM,yCAAyC,MAAM,yCAAyC,YAAY,0CAA0C,aAAa,OAAO,6OAA6O,UAAU,iNAAiN,YAAY,2PAA2P,QAAQ,uPAAuP,UAAU,yPAAyP,MAAM,0PAA0P,MAAM,6NAA6N,MAAM,0PAA0P,YAAY,6PAA6P,IAAI,2JAA2J,cAAc,MAAM,SAAS,sEAAsE,iBAAiB,8BAA8B,OAAO,sjCAAsjC,o+CAAo+C,qBAAM,WAAW,qBAAM,2CAA2C,qBAAM,YAAY,qBAAM,6BAA6B,qBAAM,2OAA2O,YAAY,2KAA2K,kBAAkB,4BAA4B,cAAc,cAAc,4DAA4D,uFAAuF,wFAAwF,sDAAsD,+CAA+C,6DAA6D,qBAAM,EAAE,qBAAM,SAAS,qBAAM,qEAAqE,aAAa,qMAAqM,KAAK,IAAI,6BAA6B,QAAQ,8DAA8D,6BAA6B,cAAc,eAAe,wBAAwB,cAAc,2BAA2B,mCAAmC,cAAc,oBAAoB,gCAAgC,mCAAmC,0CAA0C,4CAA4C,wCAAwC,2CAA2C,SAAS,uCAAuC,SAAS,uCAAuC,kBAAkB,mBAAmB,eAAe,mBAAmB,eAAe,oBAAoB,eAAe,yCAAyC,2BAA2B,qBAAqB,QAAQ,KAAK,gCAAgC,4BAA4B,aAAa,eAAe,kBAAkB,eAAe,4GAA4G;AAAA,UAAK,CAAC,eAAe,sFAAsF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6CAA6C,kBAAkB,sDAAsD,qBAAqB,IAAI,oBAAoB,MAAM,sDAAsD,wBAAwB,sCAAsC,sDAAsD,oBAAoB,SAAS,QAAQ,6BAA6B,8BAA8B,WAAW,iGAAiG,cAAc,6BAA6B,yCAAyC,4BAA4B,sBAAsB,GAAG,YAAY,GAAG,sBAAsB,qCAAqC,oCAAoC,8EAA8E,OAAO,yBAAyB,SAAS,qBAAqB,GAAG,4HAA4H,GAAG,cAAc,GAAG,4EAA4E,kBAAkB,IAAI,kCAAkC,GAAG,sBAAsB,wBAAwB,qDAAqD,6CAA6C,GAAG,KAAK,GAAG,eAAe,2DAA2D,iBAAiB,8BAA8B,wCAAwC,kBAAkB,IAAI,yCAAyC,GAAG,mBAAmB,+EAA+E,uDAAuD,EAAE,QAAQ","sources":["webpack://isdata-customer-sdk/./node_modules/@tencentcloud/chat/modules/signaling-module.js"],"sourcesContent":["let t=2,e=6,i=11,n=12,s=20,o=23,a=27;class r{constructor(t=0,e=0){this.high=t,this.low=e}equal(t){return null!==t&&this.low===t.low&&this.high===t.high}toString(){var t=Number(this.high).toString(16);let e=Number(this.low).toString(16);if(e.length<8){let t=8-e.length;for(;t;)e=\"0\"+e,t--}return t+e}}let c={TEST:{CHINA:{DEFAULT:\"wss://wss-dev.tim.qq.com\"},OVERSEA:{DEFAULT:\"wss://wss-dev.tim.qq.com\"},SINGAPORE:{DEFAULT:\"wss://wsssgp-dev.im.qcloud.com\"},KOREA:{DEFAULT:\"wss://wsskr-dev.im.qcloud.com\"},GERMANY:{DEFAULT:\"wss://wssger-dev.im.qcloud.com\"},IND:{DEFAULT:\"wss://wssind-dev.im.qcloud.com\"},JPN:{DEFAULT:\"wss://wssjpn-dev.im.qcloud.com\"},USA:{DEFAULT:\"wss://wssusa-dev.im.qcloud.com\"},INDONESIA:{DEFAULT:\"wss://wssidn-dev.im.qcloud.com\"}},PRODUCTION:{CHINA:{DEFAULT0:\"wss://*w4c.my-imcloud.com\",DEFAULT:\"wss://wss.im.qcloud.com\",IPV6:\"wss://wssv6.im.qcloud.com\",BACKUP:\"wss://wss.tim.qq.com\",BACKUP_WEB:\"wss://*w4c.my-cpaas.com\",STAT:\"https://events.im.qcloud.com\",ANYCAST:\"wss://162.14.13.203\"},OVERSEA:{DEFAULT0:\"wss://*w4c.my-imcloud.com\",DEFAULT:\"wss://wss.im.qcloud.com\",IPV6:\"wss://wssv6.im.qcloud.com\",BACKUP:\"wss://wss.my-imcloud.com\",BACKUP_WEB:\"wss://*w4c.my-cpaas.com\",STAT:\"https://api.my-imcloud.com\"},SINGAPORE:{DEFAULT0:\"wss://*w4s.my-imcloud.com\",DEFAULT:\"wss://wsssgp.im.qcloud.com\",IPV6:\"wss://wsssgpv6.im.qcloud.com\",BACKUP:\"wss://wsssgp.my-imcloud.com\",BACKUP_WEB:\"wss://*w4s.my-cpaas.com\",STAT:\"https://apisgp.my-imcloud.com\",ANYCAST:\"wss://162.14.19.159\"},KOREA:{DEFAULT0:\"wss://*w4k.my-imcloud.com\",DEFAULT:\"wss://wsskr.im.qcloud.com\",IPV6:\"wss://wsskrv6.im.qcloud.com\",BACKUP:\"wss://wsskr.my-imcloud.com\",BACKUP_WEB:\"wss://*w4k.my-cpaas.com\",STAT:\"https://apikr.my-imcloud.com\",ANYCAST:\"wss://162.14.13.104\"},GERMANY:{DEFAULT0:\"wss://*w4g.my-imcloud.com\",DEFAULT:\"wss://wssger.im.qcloud.com\",IPV6:\"wss://wssgerv6.im.qcloud.com\",BACKUP:\"wss://wssger.my-imcloud.com\",BACKUP_WEB:\"wss://*w4g.my-cpaas.com\",STAT:\"https://apiger.my-imcloud.com\",ANYCAST:\"wss://162.14.3.17\"},IND:{DEFAULT0:\"wss://*w4i.my-imcloud.com\",DEFAULT:\"wss://wssind.my-imcloud.com\",IPV6:\"wss://wssindv6.im.qcloud.com\",BACKUP:\"wss://wssind.im.qcloud.com\",BACKUP_WEB:\"wss://*w4i.my-cpaas.com\",STAT:\"https://apiind.my-imcloud.com\",ANYCAST:\"wss://162.14.19.46\"},JPN:{DEFAULT0:\"wss://*w4j.my-imcloud.com\",DEFAULT:\"wss://wssjpn.im.qcloud.com\",IPV6:\"wss://wssjpnv6.im.qcloud.com\",BACKUP:\"wss://wssjpn.my-imcloud.com\",BACKUP_WEB:\"wss://*w4j.my-cpaas.com\",STAT:\"https://apijpn.my-imcloud.com\"},USA:{DEFAULT0:\"wss://*w4u.my-imcloud.com\",DEFAULT:\"wss://wssusa.im.qcloud.com\",IPV6:\"wss://wssusav6.im.qcloud.com\",BACKUP:\"wss://wssusa.my-imcloud.com\",BACKUP_WEB:\"wss://*w4u.my-cpaas.com\",STAT:\"https://apiusa.my-imcloud.com\",ANYCAST:\"wss://162.14.10.42\"},INDONESIA:{DEFAULT0:\"wss://*w4y.my-imcloud.com\",DEFAULT:\"wss://wssidn.im.qcloud.com\",IPV6:\"wss://wssidnv6.im.qcloud.com\",BACKUP:\"wss://wssidn.my-imcloud.com\",BACKUP_WEB:\"wss://*w4y.my-cpaas.com\",STAT:\"https://apiidn.my-imcloud.com\",ANYCAST:\"wss://43.129.34.169\"}}},g={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},l=\"CHINA\",h={HOST:{CURRENT:{DEFAULT:\"wss://wss.im.qcloud.com\",STAT:\"https://events.im.qcloud.com\"},setCurrent(t=l){this.CURRENT=c.PRODUCTION[t]}},NAME:{OPEN_IM:\"openim\",OPEN_IM_MSG_EXT:\"openim_msg_ext_http_svc\",GRP:\"group_open_http_svc\",GRP_AV:\"group_open_avchatroom_http_svc\",GRP_COMMUNITY:\"million_group_open_http_svc\",GRP_ATTR:\"group_open_attr_http_svc\",FD:\"sns\",PROFILE:\"profile\",RECENT_CONTACT:\"recentcontact\",PIC:\"openpic\",BIG_GRP_NO_AUTH:\"group_open_http_noauth_svc\",BIG_GRP_POLLING:\"group_open_long_polling_http_svc\",BIG_GRP_POLLING_NO_AUTH:\"group_open_long_polling_http_noauth_svc\",IM_OPEN_STAT:\"imopenstat\",WEB_IM:\"webim\",IM_COS_SIGN:\"im_cos_sign_svr\",CUSTOM_UPLOAD:\"im_cos_msg\",HEARTBEAT:\"heartbeat\",IM_OPEN_PUSH:\"im_open_push\",IM_OPEN_STATUS:\"im_open_status\",IM_LONG_MSG:\"im_long_msg\",IM_CONFIG_MANAGER:\"im_sdk_config_mgr\",STAT_SERVICE:\"StatSvc\",OVERLOAD_PUSH:\"OverLoadPush\",IM_MSG_AUDIT_MGR:\"im_msg_audit_mgr\",TUIROOM_SVR:\"tui_room_svr\",IM_OPEN_TRANSLATE:\"im_open_translate\",IM_OPEN_SPEECH:\"im_open_speech\",MSG_SEARCH:\"message_search\",GRP_SEARCH:\"group_search\",GRP_MEMBER_SEARCH:\"group_member_search\",USER_SEARCH:\"user_search\",FOLLOW:\"follow\",OFFLINE_PUSH_REPORT:\"offline_push_report\",IM_MSG_LOGIC:\"im_msg_db_logic\"}},u=(new r(0,Math.pow(2,1)).toString(),new r(0,Math.pow(2,2)).toString(),new r(0,Math.pow(2,3)).toString(),new r(0,Math.pow(2,4)).toString(),new r(0,Math.pow(2,6)).toString(),new r(0,Math.pow(2,7)).toString(),new r(0,Math.pow(2,9)).toString(),new r(0,Math.pow(2,10)).toString(),new r(0,Math.pow(2,11)).toString(),new r(0,Math.pow(2,13)).toString(),new r(0,Math.pow(2,15)).toString(),new r(Math.pow(2,6)).toString(),new r(Math.pow(2,7)).toString(),new r(Math.pow(2,8)).toString(),new r(Math.pow(2,9)).toString(),new r(Math.pow(2,10)).toString(),new r(Math.pow(2,16)).toString(),new r(Math.pow(2,20)).toString(),h.HOST.setCurrent(l),\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting)),m=(u&&wx.createGamePortal,\"undefined\"!=typeof qq&&\"function\"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting)),_=\"undefined\"!=typeof tt&&\"function\"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),d=\"undefined\"!=typeof swan&&\"function\"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),I=\"undefined\"!=typeof my&&\"function\"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),v=\"undefined\"!=typeof jd&&\"function\"==typeof jd.getSystemInfoSync,f=\"undefined\"!=typeof uni&&\"undefined\"==typeof window&&\"function\"==typeof uni.requireNativePlugin,p=u&&\"object\"==typeof wx.miniapp,D=u||m||_||d||I||f||v,w=\"undefined\"==typeof window&&!D&&\"undefined\"!=typeof global&&void 0!==global.NativeScriptGlobals,y=\"undefined\"!=typeof global&&(void 0!==global.nativeModuleProxy||void 0!==global.ReactNative),S=\"undefined\"!=typeof uni?!D:\"undefined\"!=typeof window&&!D&&!y,M=(m?qq:_?tt:d?swan:I?my:u?wx:f?uni:v&&jd,S&&window&&window.navigator&&window.navigator.userAgent||\"\"),C=/(micromessenger|webbrowser)/i.test(M),T=function(){let t=\"WEB\";return C?t=\"WEB\":m?t=\"QQ_MP\":_?t=\"TT_MP\":d?t=\"BAIDU_MP\":I?t=\"ALI_MP\":u?t=p?\"DONUT_NATIVE_APP\":\"WX_MP\":f?t=\"UNI_NATIVE_APP\":w?t=\"NS_NATIVE_APP\":y&&(t=\"RN_NATIVE_APP\"),g[t]}(),E=(!function(){var t=M.match(/OS (\\d+)_/i);t&&t[1]&&t[1]}(),function(){var t,e,i=M.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);i&&(t=i[1]&&parseFloat(i[1]),e=i[2]&&parseFloat(i[2]),t)&&e&&parseFloat(i[1]+\".\"+i[2])}(),/MSIE/.test(M)||-1<M.indexOf(\"Trident\")&&-1<M.indexOf(\"rv:11.0\")),A,L,P=(!function(){var t=/MSIE\\s(\\d+)\\.\\d/.exec(M),t=t&&parseFloat(t[1]);!t&&/Trident\\/7.0/i.test(M)&&/rv:11.0/.test(M)}(),A=\"undefined\"!=typeof console?console:\"undefined\"!=typeof global&&global.console?global.console:\"undefined\"!=typeof window&&window.console?window.console:{},function(){}),U=[\"assert\",\"clear\",\"count\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"profile\",\"profileEnd\",\"table\",\"time\",\"timeEnd\",\"timeStamp\",\"trace\",\"warn\"],N=U.length;for(;N--;)L=U[N],console[L]||(A[L]=P);var O=A;let $=\"TIMCustomElem\",R=\"High\",H=\"C2C\",F=\"GROUP\",B=function(){return(new Date).getTime()+0},b=function(){var t=new Date;return t.setTime(B()),t},x=function(){return Math.floor(B()/1e3)},q=Object.prototype.hasOwnProperty;function G(t){if(null==t)return!0;if(\"boolean\"==typeof t)return!1;if(\"number\"==typeof t)return 0===t;if(\"string\"==typeof t)return 0===t.length;if(\"function\"==typeof t)return 0===t.length;if(Array.isArray(t))return 0===t.length;if(t instanceof Error)return\"\"===t.message;if(k(t)){for(var e in t)if(q.call(t,e))return!1;return!0}return!!(j(t)||V(t)||K(t))&&0===t.size}let j=function(t){return\"map\"===Y(t)},V=function(t){return\"set\"===Y(t)},K=function(t){return\"file\"===Y(t)},k=function(t){if(\"object\"!=typeof t||null===t)return!1;t=Object.getPrototypeOf(t);if(null===t)return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return t===e},W=function(t){return void 0===t},J=function(t){return e=t,(\"function\"==typeof Array.isArray?Array.isArray(e):\"array\"===Y(e))||null!==t&&\"object\"==typeof t;var e},Y=function(t){return Object.prototype.toString.call(t).match(/^\\[object (.*)\\]$/)[1].toLowerCase()};function z(){return!E&&!D}Date.now||(Date.now=function(){return(new Date).getTime()});let X=0;function Q(){return z()?\"%c Chat %c\":\"Chat\"}function Z(){var t=b();return t.toLocaleTimeString(\"en-US\",{hour12:!1})+\".\"+function(t){let e;switch(t.toString().length){case 1:e=\"00\"+t;break;case 2:e=\"0\"+t;break;default:e=t}return e}(t.getMilliseconds())}let et={arguments2String(i){let n=\"\";if(1===i.length)n=i[0];else for(let t=0,e=i.length;t<e;t++){if(J(i[t]))try{n+=i[t]instanceof Error?JSON.stringify(i[t],[\"message\",\"code\"]):JSON.stringify(i[t])}catch(t){n+=t?t.message:\"\";break}else n+=i[t];n+=\" \"}return n},_exec(t,e){z()?O[t](Q(),\"background:#0abf5b; padding:1px; border-radius:3px; color: #fff\",\"background:transparent\",Z(),e):O[t](`${Q()} ${Z()} `+e)},d:function(){var t;X<=-1&&(t=this.arguments2String(arguments),this._exec(\"debug\",t))},l:function(){var t;X<=0&&(t=this.arguments2String(arguments),this._exec(\"log\",t))},log:function(){var t;X<=0&&(t=this.arguments2String(arguments),this._exec(\"log\",t))},i:function(){var t;X<=1&&(t=this.arguments2String(arguments),this._exec(\"info\",t))},w:function(){var t;X<=2&&(t=this.arguments2String(arguments),this._exec(\"warn\",t))},e:function(){var t;X<=3&&(t=this.arguments2String(arguments),this._exec(\"error\",t))},setLevel:function(t){t<4&&this._exec(\"log\",\"set level from \"+X+\" to \"+t),X=t},getLevel:function(){return X}};class it extends Error{constructor(t){super();var{code:t,message:e,data:i}=t;this.code=t,e?this.message=e:this._getErrMsg&&(this.message=this._getErrMsg(this.code)),this.data=i||{}}}let nt=2903,st=3122,ot=8010,at=8011,rt=8020,ct=\"error\",gt=null,lt=function(t,e=!1){if(t instanceof it)return e&&null!==gt&&gt.emit(ct,t),Promise.reject(t);if(t instanceof Error){let t=new it({code:nt});return e&&null!==gt&&gt.emit(ct,t),Promise.reject(t)}return W(t)||W(t.code)?Promise.reject(new it({code:nt})):(t=new it(t),e&&null!==gt&&gt.emit(ct,t),Promise.reject(t))},ht=\"newInvitationReceived\",ut=\"ts_invitee_accepted\",mt=\"ts_invitee_rejected\",_t=\"ts_invitation_cancelled\",dt=\"ts_invitation_timeout\",It=\"ts_invitation_modified\",vt=1,ft=2,pt=3,Dt=4,wt=5;class yt{constructor(t){this._n=\"RemoteSignalingHandler\",this._sigM=t}onNewMessageList(t){t.forEach(t=>{var e=this.getPayloadData(t);e&&this._handleActionType(e,t)})}onMessageModified(t){t.forEach(t=>{var e=this.getPayloadData(t);e&&this._onInvitationModified(e,t)})}getPayloadData(e){var i=this._n+\".getPayloadData\",e=e.payload[\"data\"];try{return JSON.parse(e)}catch(t){return et.e(i+\" JSON parse error. signalingData:\"+e),null}}_handleActionType(t,e){var i=t[\"actionType\"];switch(i){case vt:this._onNewInvitationReceived(t,e);break;case Dt:this._onInviteeRejected(t);break;case pt:this._onInviteeAccepted(t);break;case ft:this._onInvitationCancelled(t);break;case wt:this._onInvitationTimeout(t)}}_genBaseEmitData(t){var{inviteID:t,inviter:e,groupID:i,data:n}=t;return{inviteID:t,inviter:e,groupID:i,data:n||\"\"}}_onNewInvitationReceived(e,i){let t=this._n+\"._onNewInvitationReceived\",{inviteID:n,inviteeList:s,groupID:o,inviter:a}=e,r=this._sigM.getMyUserID(),l=s.includes(r),g=e.timeout;var c=(b().getTime()-1e3*i.time)/1e3,h=(0<g&&0<c&&g>c&&(g-=c),t+` myselfIncluded:${l} groupID:${o} signalObj:`+JSON.stringify(e));if(et.l(h+` timeout:${g}s delta:${c}s`),o&&l||!o){let t=this._sigM.getInviteInfo(n);t&&t===e||(t||this._sigM.setInviteInfo(n,{...e,message:i}),this._sigM.emitEvent(ht,{...this._genBaseEmitData(e),inviteeList:s}),a!==r&&this._sigM.startTimer({...e,timeout:g}))}}_onInviteeRejected(t){var e=this._n+\"._onInviteeRejected\",{inviteID:i,inviter:n,groupID:s}=t,o=this._sigM.hasInviteInfo(i);et.l(e+` inviteID:${i} hasInviteID:${o} inviter:${n} groupID:`+s),o&&(this._sigM.updateInviteInfo(t),this._sigM.emitEvent(mt,{...this._genBaseEmitData(t),invitee:t.inviteeList[0]}))}_onInviteeAccepted(t){var e=this._n+\"._onInviteeAccepted\",{inviteID:i,inviter:n,groupID:s}=t,o=this._sigM.hasInviteInfo(i);et.l(e+` inviteID:${i} hasInviteID:${o} inviter:${n} groupID:`+s),o&&(this._sigM.updateInviteInfo(t),this._sigM.emitEvent(ut,{...this._genBaseEmitData(t),invitee:t.inviteeList[0]}))}_onInvitationCancelled(t){var e=this._n+\"._onInvitationCancelled\",{inviteID:i,inviter:n,groupID:s}=t,o=this._sigM.hasInviteInfo(i);et.l(e+` inviteID:${i} hasInviteID:${o} inviter:${n} groupID:`+s),o&&(this._sigM.deleteInviteInfo(i),this._sigM.emitEvent(_t,this._genBaseEmitData(t)))}_onInvitationTimeout(t){var e=this._n+\"._onInvitationTimeout\",{inviteID:i,inviter:n,groupID:s,inviteeList:o}=t,a=this._sigM.hasInviteInfo(i);et.l(e+` inviteID:${i} hasInviteID:${a} inviter:${n} groupID:${s} data:`+t.data),a&&(this._sigM.updateInviteInfo(t),this._sigM.emitEvent(dt,{...this._genBaseEmitData(t),inviteeList:o,isSelfTimeout:!1}))}_onInvitationModified(t,e){var i=this._n+\"._onInvitationModified\",{inviteID:n,data:s}=t,o=this._sigM.hasInviteInfo(n);et.l(i+` inviteID:${n} hasInviteID:${o} data:`+s),o&&(this._sigM.setInviteInfo(n,{...t,message:e}),this._sigM.emitEvent(It,{inviteID:n,data:s}))}}let St=function(t){var e;return t<0||53<t?NaN:(e=0|1073741824*Math.random(),30<t?e+1073741824*(0|Math.random()*(1<<t-30)):e>>>30-t)},Mt=function(t,e){let i=t.toString(16),n=e-i.length,s=\"0\";for(;0<n;n>>>=1,s+=s)1&n&&(i=s+i);return i};class Ct{constructor(t){this._n=\"LocalSignalingHandler\",this._sigM=t}generateInviteID(){t=St;var t,e=(e=Mt)(t(32),8)+\"-\"+e(t(16),4)+\"-\"+e(16384|t(12),4)+\"-\"+e(32768|t(14),4)+\"-\"+e(t(48),12);return et.l(this._n+\".generateInviteID inviteID:\"+e),e}createInviteInfo(t){var e=this.generateInviteID(),t=this.createInviteCustomData({...t,inviteID:e}),{groupID:i,inviteeList:n}=t,i=i||n[0];return{customData:t,message:this._sigM.createSignaling(t,i),inviteID:e}}_genBaseCustomData(t){var{data:t=\"\",inviteID:e=\"\",groupID:i=\"\"}=t;return{businessID:1,timeout:0,data:t,inviteID:e,groupID:i}}createInviteCustomData(t){var{userID:e,timeout:i=0,groupID:n=\"\"}=t,s=this._sigM.getMyUserID(),s={...this._genBaseCustomData(t),actionType:vt,inviter:s,inviteeList:n?t.inviteeList:[e],timeout:i};return et.l(this._n+\".createInviteCustomData customData:\",s),s}createCancelCustomData(t){var e=this._n+\".createCancelCustomData\",i=t[\"inviteID\"];let n;var s=this._sigM.getMyUserID(),{inviteeList:i,groupID:o,inviter:a}=this._sigM.getInviteInfo(i);return a===s?n={...this._genBaseCustomData(t),actionType:ft,groupID:o,inviter:s,inviteeList:i}:et.e(e+` unmatched inviter:${a} and my userID:`+s),et.l(e+\" customData:\",n),n}createAcceptCustomData(t){var e=this._n+\".createAcceptCustomData\",i=t[\"inviteID\"];let n;var s=this._sigM.getMyUserID(),{inviter:o,groupID:a,inviteeList:r}=this._sigM.getInviteInfo(i);return r.includes(s)?n={...this._genBaseCustomData(t),actionType:pt,groupID:a,inviter:o,inviteeList:[s]}:et.e(e+` userID:${s} not in inviteeList. inviteID:${i} groupID:`+a),et.l(e+\" customData:\",n),n}createRejectCustomData(t){var e=this._n+\".createRejectCustomData\",i=t[\"inviteID\"];let n;var s=this._sigM.getMyUserID(),{inviter:o,groupID:a,inviteeList:r}=this._sigM.getInviteInfo(i);return r.includes(s)?n={...this._genBaseCustomData(t),actionType:Dt,groupID:a,inviter:o,inviteeList:[s]}:et.e(e+` userID:${s} not in inviteeList. inviteID:${i} groupID:`+a),et.l(e+\" customData:\",n),n}createTimeoutCustomData(t){var e=this._n+\".createTimeoutCustomData\",{inviteeList:i,inviter:n,isInviter:s=!1}=t,o=this._sigM.getMyUserID(),t={...this._genBaseCustomData(t),actionType:wt,inviter:n,inviteeList:s?i:[o]};return et.l(e+\" customData:\",t),t}}class Tt{constructor(t){this._n=\"HistorySignalingHandler\",this._sigM=t,this.COUNT=20,this.EXPIRED_TIME=300,this._map=new Map,this._relatedToMeMap=new Map}setCloudConfig(t=20,e=300){this.COUNT=t,this.EXPIRED_TIME=e,et.l(this._n+`.setCloudConfig count:${t}, time:`+e)}getHistorySignaling(){var t=this._sigM.get(i).getLocalConvList();G(t)||(this._getC2CSignalingList(),t=this._getValidGroupConvList(t),this._getGroupSignalingList(t).then(t=>{this._handleSignalingList(t)}))}_getC2CSignalingList(){var t=this._sigM.get(e).getMessageListFromUnreadDB(),t=this._sigM.filterMessageList(t);this._getRelatedToMeMap(t)}_getGroupSignalingList(t){t=this._createPromiseList(t);return 0===t.length?Promise.resolve(this._sortSignaling(this._relatedToMeMap)):this._concurrentGetMessageList(t).then(t=>{let e=new Map;return t.forEach(t=>{t=t.list,t=this._getRelatedToMeMap(t);e=new Map([...e,...t])}),this._sortSignaling(e)})}_handleSignalingList(t){G(t)||this._sigM.onNewMessageList(t)}_getValidGroupConvList(i){var n=[];for(let t=0,e=i.length;t<e;t++){var{type:s,unreadCount:o,lastMessage:a}=i[t],s=s===F,a=this._isNotExpired(a);s&&o&&a&&n.push(i[t])}return n}_isNotExpired(t){return!(!t||!t.lastTime)&&t.lastTime>x()-this.EXPIRED_TIME}_createPromiseList(e){var n=[];for(let t=0;t<e.length;t++){var{conversationID:s,unreadCount:o}=e[t],o=o<this.COUNT?o:this.COUNT,o=(this._map.set(s,{msgCount:o,list:[]}),this._sigM.get(i).getMessageList({conversationID:s}));n.push(o)}return n}_concurrentGetMessageList(t){let s=[];return Promise.all(t).then(e=>{for(let t=0;t<e.length;t++){var{code:i,data:n}=e[t];0===i&&0!==n.messageList.length&&(this._handleMessageList(n.messageList),i=this._relayGetMessageList(n))&&s.push(i)}return 0<s.length?this._concurrentGetMessageList(s):this._map})}_relayGetMessageList(t){var e,{messageList:t,nextReqMessageID:n,isCompleted:s}=t;return 0===t.length||(t=t[0].conversationID,e=this._map.get(t).msgCount,0===e)||s?null:this._sigM.get(i).getMessageList({conversationID:t,nextReqMessageID:n,count:e})}_handleMessageList(t){var e=t.length,i=t[0][\"conversationID\"],{msgCount:n,list:s}=this._map.get(i);this._map.set(i,{msgCount:0<n-e?n-e:0,list:s.concat(this._sigM.filterMessageList(t))})}_getRelatedToMeMap(e){for(let t=0;t<e.length;t++){var i=e[t];this._saveRelatedToMe(i)}return this._relatedToMeMap}_saveRelatedToMe(t){var{actionType:e=\"\",inviteID:i=\"\"}=this._sigM.getPayloadData(t)||{};switch(e){case vt:this._setHistoryInvite(t);break;case Dt:case pt:this._updateHistoryInvite(t);break;case ft:this._delHistoryInvite(i);break;case wt:this._updateHistoryInvite(t)}}_setHistoryInvite(t){var e=this._sigM.getPayloadData(t)||{},{inviteID:i=\"\",inviteeList:n=[],timeout:s=0}=e,o=this._sigM.getMyUserID();n.includes(o)&&(n=x()-t.time,0<s&&s<n&&0!==s||this._relatedToMeMap.set(i,{...e,messageList:[t]}))}_delHistoryInvite(t){this._relatedToMeMap.has(t)&&this._relatedToMeMap.delete(t)}_updateHistoryInvite(e){let t=this._sigM.getPayloadData(e)||{},{inviteID:n=\"\",inviteeList:s=[]}=t;if(this._relatedToMeMap.has(n)){let{inviteeList:i,messageList:t}=this._relatedToMeMap.get(n);for(let e=0;e<s.length;e++){let t=s[e];i.includes(t)&&i.splice(i.indexOf(t),1)}0===i.length?this._delHistoryInvite(n):t.push(e)}else this._delHistoryInvite(n)}_sortSignaling(t){let e=[];return t.forEach(t=>{e=[...e,...t.messageList]}),e.sort((t,e)=>t.time-e.time)}reset(){this._map.clear(),this._relatedToMeMap.clear()}}class Et{constructor(t,e){this.businessID=t.businessID||1,this.inviteID=t.inviteID,this.groupID=t.groupID||\"\",this.inviter=t.inviter||\"\",this.inviteeList=t.inviteeList||[],this.data=t.data||\"\",this.actionType=t.actionType||vt,this.timeout=t.timeout||0}}let At={A2KEY_AND_TINYID_UPDATED:\"_inner1\",CLOUD_CONFIG:\"_inner2\",PROFILE_UPDATED:\"_inner3\",CONV_SYNC_COMPLETED:\"_inner4\",C2C_UNREAD_HANDLE_COMPLETED:\"_inner5\"};class Lt extends class{constructor(t){this._m=t,this._n=\"\"}isLoggedIn(){return this._m.get(n).isLoggedIn()}isOversea(){return this._m.get(n).isOversea()}isPrivateNetWork(){var t=this._m.get(n);return t.isPrivateNetWork()&&!t.getFileDownloadProxy()}getFileDownloadProxy(){return this._m.get(n).getFileDownloadProxy()}getDownloadFileAuthKey(){return this._m.get(n).getDownloadFileAuthKey()}getMyUserID(){return this._m.get(n).getUserID()}getMyTinyID(){return this._m.get(n).getTinyID()}getSDKAppID(){return this._m.get(n).getSDKAppID()}isIntl(){return this._m.get(n).isIntl()}isUsingChatCore(){return this._m.get(n).isUsingChatCore()}isDevMode(){return this._m.get(n).isDevMode()}get(t){return this._m.get(t)}getPlatform(){return T}getCloudConfig(t){return this._m.get(o).getCloudConfig(t)}emitOEvt(t,e){this._m.getOEmitInst().emit(t,e)}emitIEvt(t,e){this._m.getIEmitInst().emit(t,e)}getIEmitInst(){return this._m.getIEmitInst()}req(t){return this._m.get(s).req(t)}canIUse(t){return this._m.get(a).canIUse(t)}getErrMsg(t,e,i){return this._m.getErrMsg(t,e,i)}warn(t,e,i){t=this.getErrMsg(t,e,i);t&&et.w(t)}noUse(t){var e=st;return lt({code:e,message:this.getErrMsg(e,t)})}}{constructor(t){super(t),this._n=\"SignalingModule\",this._inviteInfoMap=new Map,this._canIUseSignaling=!1,this._isHandling=!1,this._remoteSignalingHandler=new yt(this),this._localSignalingHandler=new Ct(this),this._historySignalingHandler=new Tt(this),this._isC2CUnreadHandleCompleted=!1,this._isConvSyncCompleted=!1,this._isSyncCompleted=!1,this._isCloudConfigCompleted=!1;t=this.getIEmitInst();t.on(At.C2C_UNREAD_HANDLE_COMPLETED,this.onC2CUnreadHandleCompleted,this),t.on(At.CONV_SYNC_COMPLETED,this.onConvSyncCompleted,this),t.on(At.CLOUD_CONFIG,this.onCloudConfig,this)}onC2CUnreadHandleCompleted(){this._isC2CUnreadHandleCompleted=!0,this._isCloudConfigCompleted&&this._isConvSyncCompleted&&!this._isSyncCompleted&&this.onReady()}onConvSyncCompleted(){this._isConvSyncCompleted=!0,this._isC2CUnreadHandleCompleted&&this._isCloudConfigCompleted&&!this._isSyncCompleted&&this.onReady()}onCloudConfig(){this._isCloudConfigCompleted=!0;let t=this.getCloudConfig(\"history_s_count\"),e=this.getCloudConfig(\"history_s_time\");W(t)||(t=Number(t)),W(e)||(e=Number(e)),this._historySignalingHandler.setCloudConfig(t,e),this._isC2CUnreadHandleCompleted&&this._isConvSyncCompleted&&!this._isSyncCompleted&&this.onReady()}_isListenerExisted(){return-1<this._m.getOEmitInst().eventNames().indexOf(ht)}onReady(){this._isSyncCompleted=!0;var t=this._isListenerExisted();et.l(this._n+\".onReady. isListenerExisted: \"+t),t&&this._historySignalingHandler.getHistorySignaling()}onNewMessageList(t){t=this.filterMessageList(t);if(0<t.length)return this._remoteSignalingHandler.onNewMessageList(t)}onMessageModified(t){t=this.filterMessageList(t);if(0<t.length)return this._remoteSignalingHandler.onMessageModified(t)}hasInviteInfo(t){return this._inviteInfoMap.has(t)}getInviteInfo(t){return this._inviteInfoMap.get(t)}setInviteInfo(t,e){let{message:i,...n}=e;et.l(this._n+`.setInviteInfo inviteID:${t} data:`,n),this._inviteInfoMap.set(t,{...n,message:i})}deleteInviteInfo(t){this.hasInviteInfo(t)&&(et.l(this._n+`.deleteInviteInfo inviteID:${t}.`),this._inviteInfoMap.delete(t))}updateInviteInfo(t){let i=this._n+\".updateInviteInfo\",{inviteID:n,inviter:e,inviteeList:s,groupID:o}=t;if(et.l(i+` inviteID:${n} inviter:${e} groupID:`+o),o&&this.hasInviteInfo(n)){let t=s[0],e=this.getInviteInfo(n)[\"inviteeList\"];e.includes(t)&&(e.splice(e.indexOf(t),1),et.l(i+` remove ${t}. localInviteeList.length:`+e.length)),0===e.length&&this.deleteInviteInfo(n)}else this.deleteInviteInfo(n)}canIUseSignaling(){return this._canIUseSignaling}emitEvent(t,e){this.emitOEvt(t,e)}addSignalingListener(t,e,i){this._canIUseSignaling||(this._canIUseSignaling=!0),this._m.getOEmitInst().on(t,e,i)}removeSignalingListener(t,e,i){this._m.getOEmitInst().off(t,e,i),this._isListenerExisted()||(this._canIUseSignaling=!1)}invite(t){let e=this._n+\".invite\",{message:i,customData:n,inviteID:s}=this._localSignalingHandler.createInviteInfo(t);return et.l(e+` options:${JSON.stringify(t)} inviteID:`+s),this.sendSignaling(i,t).then(t=>t&&0===t.code?(this.setInviteInfo(s,{...n,message:i}),this.startTimer({...n,inviteID:s}),{...t,inviteID:s}):t).catch(t=>lt(t))}inviteSync(t,e,i){let n=this._n+\".inviteSync\",{message:s,customData:o,inviteID:a}=this._localSignalingHandler.createInviteInfo(t);return et.l(n+` options:${JSON.stringify(t)} inviteID:`+a),this.sendSignaling(s,t).then(t=>{if(t&&0===t.code)return this.setInviteInfo(a,{...o,message:s}),this.startTimer({...o,inviteID:a}),e&&e({inviteID:a}),{inviteID:a};i&&i(0===t.code,t.message||\"\")}).catch(t=>(i&&i(t.code,t.message),lt(t))),a}_handleImResponse(t,e,i){e&&0===e.code&&(this._isHandling=!1,i?this.deleteInviteInfo(t.inviteID):this.updateInviteInfo(t))}cancel(e){var t,i=this._n+\".cancel\";if(et.l(i+\" options:\"+JSON.stringify(e)),!this.hasInviteInfo(e.inviteID)||this._isHandling)return lt({code:rt});this._isHandling=!0;let n=this._localSignalingHandler.createCancelCustomData(e);return n?({groupID:i,inviteeList:t}=n,i=i||t[0],t=this.createSignaling(n,i),this.sendSignaling(t,e).then(t=>(this._handleImResponse(n,t,!0),0===t.code?{...t,inviteID:e.inviteID}:t)).catch(t=>lt(t))):(this._isHandling=!1,lt({code:at}))}accept(e){var t=this._n+\".accept\";if(et.l(t+\" options:\"+JSON.stringify(e)),!this.hasInviteInfo(e.inviteID)||this._isHandling)return lt({code:ot});this._isHandling=!0;let i=this._localSignalingHandler.createAcceptCustomData(e);return i?(t=this.createSignaling(i),this.sendSignaling(t,e).then(t=>(this._handleImResponse(i,t),0===t.code?{...t,inviteID:e.inviteID}:t)).catch(t=>lt(t))):(this._isHandling=!1,lt({code:at}))}reject(e){var t=this._n+\".reject\";if(et.l(t+\" options:\"+JSON.stringify(e)),!this.hasInviteInfo(e.inviteID)||this._isHandling)return lt({code:ot});this._isHandling=!0;let i=this._localSignalingHandler.createRejectCustomData(e);return i?(t=this.createSignaling(i),this.sendSignaling(t,e).then(t=>(this._handleImResponse(i,t,!0),0===t.code?{...t,inviteID:e.inviteID}:t)).catch(t=>lt(t))):(this._isHandling=!1,lt({code:at}))}getSignalingInfo(e){let t=this._n+\".getSignalingInfo\",{ID:i,from:n,to:s}=e,o=this._filterSignaling(e),a=null;if(o){let t=this.getPayloadData(e);a=new Et(t)}e=o?\"actionType:\"+a.actionType:\"\";return et.l(t+` messageID:${i} from:${n} to:${s} ${e} isSignaling:`+o),a}modifyInvitation(e){let{inviteID:i,data:n}=e;if(!this.hasInviteInfo(i))return lt({code:ot});let{message:s,...o}=this.getInviteInfo(i),a=s.payload.data;return o.data=n,s.payload.data=JSON.stringify(o),this.get(t).modifyRemoteMessage(s).then(t=>(this.hasInviteInfo(i)&&this.setInviteInfo(i,{...o,message:s}),t)).catch(t=>(s.payload.data=a,lt(t)))}_genMsgCtrlInfo(t={}){var{data:e=\"\",onlineUserOnly:t,inviteID:i=\"\",offlinePushInfo:n,actionType:s}=t;let o={_onlineOnlyFlag:!1};i={onlineUserOnly:(o=i&&this.getInviteInfo(i)?this.getInviteInfo(i).message:o)._onlineOnlyFlag||t||!1,offlinePushInfo:n,messageControlInfo:{excludedFromContentModeration:!0,excludedFromUnreadCount:!1,excludedFromLastMessage:!1}};if(s===wt){let t=!!e.match(/excludeTimeoutSignalingFromHistoryMessage/);i.messageControlInfo.excludedFromUnreadCount=t,i.messageControlInfo.excludedFromLastMessage=t}else{t=!!e.match(/excludeFromHistoryMessage/),n=!!e.match(/excludeOriginalSignalingFromHistoryMessage/);i.messageControlInfo.excludedFromUnreadCount=t||n,i.messageControlInfo.excludedFromLastMessage=t||n}return i}sendSignaling(e,i){return this.get(t).sendMessageInstance(e,this._genMsgCtrlInfo(i)).catch(t=>(this._isHandling=!1,lt(t)))}filterMessageList(t){return t.filter(t=>this._filterSignaling(t))}getPayloadData(t){return this._remoteSignalingHandler.getPayloadData(t)}createSignaling(e,i){var{groupID:n,inviter:s}=e,i={to:i||n||s,conversationType:n?F:H,priority:R,payload:{data:JSON.stringify(e)}},s=this.get(t).createCustomMessage(i);return et.l(this._n+\".createSignaling. message:\",s),s}_filterSignaling(t){let e=!1;var i,n;return t.type&&t.type===$&&({cloudCustomData:t=\"\",payload:{data:n=\"\"}}=t,t=t.match(/\"type\":\"tsignaling\"/),i=n.match(/inviteID/),n=n.match(/actionType/),e=t||i&&n),!!e}startTimer(s){let o=this._n+\".startTimer\",{timeout:t,inviteID:a,inviter:e,groupID:i}=s,r=e===this.getMyUserID();if(et.l(o+` timeout:${t} isInviter:${r} groupID:`+i),!(t<=0)){let e=r?t+5:t,i=1,n=setInterval(()=>{var t=this._hasLocalInviteInfo(s,r);i<e&&t?++i:(t&&this._sendTimeoutNotice(a,r),et.l(o+\" end.\"),clearInterval(n))},1e3)}}_hasLocalInviteInfo(t,e){var i,n,{inviteID:t,groupID:s}=t;return!!this.hasInviteInfo(t)&&(i=this._n+\"._hasLocalInviteInfo\",n=this.getInviteInfo(t)[\"inviteeList\"],et.l(i+` inviteID:${t} inviteeList:${n} groupID:`+s),!s||(e?0<n.length:0<n.length&&n.includes(this.getMyUserID())))}_getReceiver(t,e){var{groupID:e,inviteeList:i,inviter:n}=e;return t?e||i[0]:e||n}_sendTimeoutNotice(s,o){var t=this.getInviteInfo(s),e=this._getReceiver(o,t);et.l(this._n+`._sendTimeoutNotice inviteID:${s} to:${e} isInviter:`+o);let a=this._localSignalingHandler.createTimeoutCustomData({...t,isInviter:o}),r=this.createSignaling(a,e);return this.sendSignaling(r,a).then(t=>{if(t&&0===t.code){let{data:t,groupID:e,inviteeList:i,inviter:n}=a;this.emitEvent(dt,{data:t,groupID:e,inviteID:s,inviteeList:i,inviter:n,isSelfTimeout:!0,message:r}),o?this.deleteInviteInfo(s):this.updateInviteInfo(a)}})}reset(){et.l(this._n+\".reset\"),this._inviteInfoMap.clear(),this._canIUseSignaling=!1,this._isHandling=!1,this._historySignalingHandler.reset(),this._isC2CUnreadHandleCompleted=!1,this._isConvSyncCompleted=!1,this._isSyncCompleted=!1,this._isCloudConfigCompleted=!1}}export{Lt as default};"],"names":[],"sourceRoot":""}