"use strict"; /** * @vue/shared v3.4.21 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ function e(e,t){const n=new Set(e.split(","));return t?e=>n.has(e.toLowerCase()):e=>n.has(e)}const t={},n=[],o=()=>{},i=()=>!1,s=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),r=e=>e.startsWith("onUpdate:"),a=Object.assign,c=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,l=(e,t)=>u.call(e,t),p=Array.isArray,d=e=>"[object Map]"===I(e),h=e=>"[object Set]"===I(e),g=e=>"function"==typeof e,f=e=>"string"==typeof e,m=e=>"symbol"==typeof e,_=e=>null!==e&&"object"==typeof e,v=e=>(_(e)||g(e))&&g(e.then)&&g(e.catch),y=Object.prototype.toString,I=e=>y.call(e),M=e=>"[object Object]"===I(e),C=e=>f(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,T=e(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),S=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},E=/-(\w)/g,k=S((e=>e.replace(E,((e,t)=>t?t.toUpperCase():"")))),D=/\B([A-Z])/g,L=S((e=>e.replace(D,"-$1").toLowerCase())),R=S((e=>e.charAt(0).toUpperCase()+e.slice(1))),O=S((e=>e?`on${R(e)}`:"")),A=(e,t)=>!Object.is(e,t),b=(e,t)=>{for(let n=0;n{const t=parseFloat(e);return isNaN(t)?e:t},N=e=>{const t=f(e)?Number(e):NaN;return isNaN(t)?e:t};function x(e){if(p(e)){const t={};for(let n=0;n{if(e){const n=e.split(U);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function B(e){let t="";if(f(e))t=e;else if(p(e))for(let n=0;nf(e)?e:null==e?"":p(e)||_(e)&&(e.toString===y||!g(e.toString))?JSON.stringify(e,j,2):String(e),j=(e,t)=>t&&t.__v_isRef?j(e,t.value):d(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[H(t,o)+" =>"]=n,e)),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>H(e)))}:m(t)?H(t):!_(t)||p(t)||M(t)?t:String(t),H=(e,t="")=>{var n;return m(e)?`Symbol(${null!=(n=e.description)?n:t})`:e},K="onShow",$="onHide",z="onLaunch",Y="onError",W="onThemeChange",J="onPageNotFound",X="onUnhandledRejection",Z="onLoad",Q="onReady",ee="onUnload",te="onInit",ne="onSaveExitState",oe="onResize",ie="onBackPress",se="onPageScroll",re="onTabItemTap",ae="onReachBottom",ce="onPullDownRefresh",ue="onShareTimeline",le="onShareChat",pe="onAddToFavorites",de="onShareAppMessage",he="onNavigationBarButtonTap",ge="onNavigationBarSearchInputClicked",fe="onNavigationBarSearchInputChanged",me="onNavigationBarSearchInputConfirmed",_e="onNavigationBarSearchInputFocusChanged",ve="virtualHostId";function ye(e,t=null){let n;return(...o)=>(e&&(n=e.apply(t,o),e=null),n)}function Ie(e,t){if(!f(t))return;const n=(t=t.replace(/\[(\d+)\]/g,".$1")).split(".");let o=n[0];return e||(e={}),1===n.length?e[o]:Ie(e[o],n.slice(1).join("."))}function Me(e){let t={};return M(e)&&Object.keys(e).sort().forEach((n=>{const o=n;t[o]=e[o]})),Object.keys(t)?t:e}function Ce(e){return"default"===e?"d":e}const Te=/:/g;const Se=encodeURIComponent;function Ee(e,t=Se){const n=e?Object.keys(e).map((n=>{let o=e[n];return void 0===typeof o||null===o?o="":M(o)&&(o=JSON.stringify(o)),t(n)+"="+t(o)})).filter((e=>e.length>0)).join("&"):null;return n?`?${n}`:""}const ke=[te,Z,K,$,ee,ie,se,re,ae,ce,ue,de,le,pe,ne,he,ge,fe,me,_e];const De=[K,$,z,Y,W,J,X,"onExit",te,Z,Q,ee,oe,ie,se,re,ae,ce,ue,pe,de,le,ne,he,ge,fe,me,_e],Le=(()=>({onPageScroll:1,onShareAppMessage:2,onShareTimeline:4}))();function Re(e,t,n=!0){return!(n&&!g(t))&&(De.indexOf(e)>-1||0===e.indexOf("on"))}let Oe;const Ae=[];const be=ye(((e,t)=>t(e))),Pe=function(){};Pe.prototype={_id:1,on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n,_id:this._id}),this._id++},once:function(e,t,n){var o=this;function i(){o.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;o=0;s--)if(o[s].fn===t||o[s].fn._===t||o[s]._id===t){o.splice(s,1);break}i=o}return i.length?n[e]=i:delete n[e],this}};var Ne=Pe;const xe=["{","}"];const we=/^(?:\d)+/,Ue=/^(?:\w)+/;const Ge="zh-Hans",Fe="zh-Hant",Be="en",qe=Object.prototype.hasOwnProperty,Ve=(e,t)=>qe.call(e,t),je=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,n=xe){if(!t)return[e];let o=this._caches[e];return o||(o=function(e,[t,n]){const o=[];let i=0,s="";for(;i-1?Ge:e.indexOf("-hant")>-1?Fe:(n=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==n.indexOf(e)))?Fe:Ge);var n;let o=[Be,"fr","es"];t&&Object.keys(t).length>0&&(o=Object.keys(t));const i=function(e,t){return t.find((t=>0===e.indexOf(t)))}(e,o);return i||void 0}class Ke{constructor({locale:e,fallbackLocale:t,messages:n,watcher:o,formater:i}){this.locale=Be,this.fallbackLocale=Be,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=i||je,this.messages=n||{},this.setLocale(e||Be),o&&this.watchLocale(o)}setLocale(e){const t=this.locale;this.locale=He(e,this.messages)||this.fallbackLocale,this.messages[this.locale]||(this.messages[this.locale]={}),this.message=this.messages[this.locale],t!==this.locale&&this.watchers.forEach((e=>{e(this.locale,t)}))}getLocale(){return this.locale}watchLocale(e){const t=this.watchers.push(e)-1;return()=>{this.watchers.splice(t,1)}}add(e,t,n=!0){const o=this.messages[e];o?n?Object.assign(o,t):Object.keys(t).forEach((e=>{Ve(o,e)||(o[e]=t[e])})):this.messages[e]=t}f(e,t,n){return this.formater.interpolate(e,t,n).join("")}t(e,t,n){let o=this.message;return"string"==typeof t?(t=He(t,this.messages))&&(o=this.messages[t]):n=t,Ve(o,e)?this.formater.interpolate(o[e],n).join(""):(console.warn(`Cannot translate the value of keypath ${e}. Use the value of keypath as default.`),e)}}function $e(e){return function(){try{return e.apply(e,arguments)}catch(yl){console.error(yl)}}}let ze=1;const Ye={};function We(e,t,n){if("number"==typeof e){const o=Ye[e];if(o)return o.keepAlive||delete Ye[e],o.callback(t,n)}return t}const Je="success",Xe="fail",Ze="complete";function Qe(e,t={},{beforeAll:n,beforeSuccess:o}={}){M(t)||(t={});const{success:i,fail:s,complete:r}=function(e){const t={};for(const n in e){const o=e[n];g(o)&&(t[n]=$e(o),delete e[n])}return t}(t),a=g(i),c=g(s),u=g(r),l=ze++;return function(e,t,n,o=!1){Ye[e]={name:t,keepAlive:o,callback:n}}(l,e,(l=>{(l=l||{}).errMsg=function(e,t){return e&&-1!==e.indexOf(":fail")?t+e.substring(e.indexOf(":fail")):t+":ok"}(l.errMsg,e),g(n)&&n(l),l.errMsg===e+":ok"?(g(o)&&o(l,t),a&&i(l)):c&&s(l),u&&r(l)})),l}const et="success",nt="fail",ot="complete",it={},st={};function rt(e,t){return function(n){return e(n,t)||n}}function at(e,t,n){let o=!1;for(let i=0;ie(t),catch(){}}}function ct(e,t={}){return[et,nt,ot].forEach((n=>{const o=e[n];if(!p(o))return;const i=t[n];t[n]=function(e){at(o,e,t).then((e=>g(i)&&i(e)||e))}})),t}function ut(e,t){const n=[];p(it.returnValue)&&n.push(...it.returnValue);const o=st[e];return o&&p(o.returnValue)&&n.push(...o.returnValue),n.forEach((e=>{t=e(t)||t})),t}function lt(e){const t=Object.create(null);Object.keys(it).forEach((e=>{"returnValue"!==e&&(t[e]=it[e].slice())}));const n=st[e];return n&&Object.keys(n).forEach((e=>{"returnValue"!==e&&(t[e]=(t[e]||[]).concat(n[e]))})),t}function pt(e,t,n,o){const i=lt(e);if(i&&Object.keys(i).length){if(p(i.invoke)){return at(i.invoke,n).then((n=>t(ct(lt(e),n),...o)))}return t(ct(i,n),...o)}return t(n,...o)}function dt(e,t){return(n={},...o)=>function(e){return!(!M(e)||![Je,Xe,Ze].find((t=>g(e[t]))))}(n)?ut(e,pt(e,t,n,o)):ut(e,new Promise(((i,s)=>{pt(e,t,a(n,{success:i,fail:s}),o)})))}function ht(e,t,n,o={}){const i=t+":fail";let s="";return s=n?0===n.indexOf(i)?n:i+" "+n:i,delete o.errCode,We(e,a({errMsg:s},o))}function gt(e,t,n,o){const i=function(e){e[0]}(t);if(i)return i}function ft(e,t,n,o){return n=>{const i=Qe(e,n,o),s=gt(0,[n]);return s?ht(i,e,s):t(n,{resolve:t=>function(e,t,n){return We(e,a(n||{},{errMsg:t+":ok"}))}(i,e,t),reject:(t,n)=>ht(i,e,function(e){return!e||f(e)?e:e.stack?("undefined"!=typeof globalThis&&globalThis.harmonyChannel||console.error(e.message+"\n"+e.stack),e.message):e}(t),n)})}}function mt(e,t,n,o){return function(e,t){return(...e)=>{const n=gt(0,e);if(n)throw new Error(n);return t.apply(null,e)}}(0,t)}let _t=!1,vt=0,yt=0;const It=mt(0,((e,t)=>{if(0===vt&&function(){var e,t;let n,o,i;{const s=(null===(e=wx.getWindowInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync(),r=(null===(t=wx.getDeviceInfo)||void 0===t?void 0:t.call(wx))||wx.getSystemInfoSync();n=s.windowWidth,o=s.pixelRatio,i=r.platform}vt=n,yt=o,_t="ios"===i}(),0===(e=Number(e)))return 0;let n=e/750*(t||vt);return n<0&&(n=-n),n=Math.floor(n+1e-4),0===n&&(n=1!==yt&&_t?.5:1),e<0?-n:n}));function Mt(e,t){Object.keys(t).forEach((n=>{g(t[n])&&(e[n]=function(e,t){const n=t?e?e.concat(t):p(t)?t:[t]:e;return n?function(e){const t=[];for(let n=0;n{const o=e[n],i=t[n];p(o)&&g(i)&&c(o,i)}))}const Tt=mt(0,((e,t)=>{f(e)&&M(t)?Mt(st[e]||(st[e]={}),t):M(e)&&Mt(it,e)})),St=mt(0,((e,t)=>{f(e)?M(t)?Ct(st[e],t):delete st[e]:M(e)&&Ct(it,e)}));const Et=new class{constructor(){this.$emitter=new Ne}on(e,t){return this.$emitter.on(e,t)}once(e,t){return this.$emitter.once(e,t)}off(e,t){e?this.$emitter.off(e,t):this.$emitter.e={}}emit(e,...t){this.$emitter.emit(e,...t)}},kt=mt(0,((e,t)=>(Et.on(e,t),()=>Et.off(e,t)))),Dt=mt(0,((e,t)=>(Et.once(e,t),()=>Et.off(e,t)))),Lt=mt(0,((e,t)=>{p(e)||(e=e?[e]:[]),e.forEach((e=>{Et.off(e,t)}))})),Rt=mt(0,((e,...t)=>{Et.emit(e,...t)}));let Ot,At,bt;function Pt(e){try{return JSON.parse(e)}catch(yl){}return e}const Nt=[];function xt(e,t){Nt.forEach((n=>{n(e,t)})),Nt.length=0}const wt=dt(Ut="getPushClientId",function(e,t,n,o){return ft(e,t,0,o)}(Ut,((e,{resolve:t,reject:n})=>{Promise.resolve().then((()=>{void 0===bt&&(bt=!1,Ot="",At="uniPush is not enabled"),Nt.push(((e,o)=>{e?t({cid:e}):n(o)})),void 0!==Ot&&xt(Ot,At)}))}),0,Gt));var Ut,Gt;const Ft=[],Bt=/^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/,qt=/^create|Manager$/,Vt=["createBLEConnection"],jt=["request","downloadFile","uploadFile","connectSocket"],Ht=["createBLEConnection"],Kt=/^on|^off/;function $t(e){return qt.test(e)&&-1===Vt.indexOf(e)}function zt(e){return Bt.test(e)&&-1===Ht.indexOf(e)}function Yt(e){return-1!==jt.indexOf(e)}function Wt(e){return!($t(e)||zt(e)||function(e){return Kt.test(e)&&"onPush"!==e}(e))}function Jt(e,t){return Wt(e)&&g(t)?function(n={},...o){return g(n.success)||g(n.fail)||g(n.complete)?ut(e,pt(e,t,n,o)):ut(e,new Promise(((i,s)=>{pt(e,t,a({},n,{success:i,fail:s}),o)})))}:t}Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((n=>t.resolve(e&&e()).then((()=>n))),(n=>t.resolve(e&&e()).then((()=>{throw n}))))});const Xt=["success","fail","cancel","complete"];const Zt=()=>{const e=g(getApp)&&getApp({allowDefault:!0});return e&&e.$vm?e.$vm.$locale:function(){var e;let t="";{const n=(null===(e=wx.getAppBaseInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync();t=He(n&&n.language?n.language:Be)||Be}return t}()},Qt=[];"undefined"!=typeof global&&(global.getLocale=Zt);const en="__DC_STAT_UUID";let tn;function nn(e=wx){return function(t,n){tn=tn||e.getStorageSync(en),tn||(tn=Date.now()+""+Math.floor(1e7*Math.random()),wx.setStorage({key:en,data:tn})),n.deviceId=tn}}function on(e,t){if(e.safeArea){const n=e.safeArea;t.safeAreaInsets={top:n.top,left:n.left,right:e.windowWidth-n.right,bottom:e.screenHeight-n.bottom}}}function sn(e,t){let n="",o="";switch(n=e.split(" ")[0]||t,o=e.split(" ")[1]||"",n=n.toLocaleLowerCase(),n){case"harmony":case"ohos":case"openharmony":n="harmonyos";break;case"iphone os":n="ios";break;case"mac":case"darwin":n="macos";break;case"windows_nt":n="windows"}return{osName:n,osVersion:o}}function rn(e,t){let n=e.deviceType||"phone";{const e={ipad:"pad",windows:"pc",mac:"pc"},o=Object.keys(e),i=t.toLocaleLowerCase();for(let t=0;t{on(e,t),nn()(e,t),function(e,t){const{brand:n="",model:o="",system:i="",language:s="",theme:r,version:c,platform:u,fontSizeSetting:l,SDKVersion:p,pixelRatio:d,deviceOrientation:h}=e,{osName:g,osVersion:f}=sn(i,u);let m=c,_=rn(e,o),v=an(n),y=un(e),I=h,M=d,C=p;const T=(s||"").replace(/_/g,"-"),S={appId:"__UNI__A6CDB98",appName:"tk-mini-program",appVersion:"1.0.0",appVersionCode:"100",appLanguage:cn(T),uniCompileVersion:"4.66",uniCompilerVersion:"4.66",uniRuntimeVersion:"4.66",uniPlatform:"mp-weixin",deviceBrand:v,deviceModel:o,deviceType:_,devicePixelRatio:M,deviceOrientation:I,osName:g,osVersion:f,hostTheme:r,hostVersion:m,hostLanguage:T,hostName:y,hostSDKVersion:C,hostFontSizeSetting:l,windowTop:0,windowBottom:0,osLanguage:void 0,osTheme:void 0,ua:void 0,hostPackageName:void 0,browserName:void 0,browserVersion:void 0,isUniAppX:!1};a(t,S)}(e,t)}},pn=ln,dn={args(e,t){let n=parseInt(e.current);if(isNaN(n))return;const o=e.urls;if(!p(o))return;const i=o.length;return i?(n<0?n=0:n>=i&&(n=i-1),n>0?(t.current=o[n],t.urls=o.filter(((e,t)=>!(t{const{brand:n,model:o,system:i="",platform:s=""}=e;let r=rn(e,o),c=an(n);nn()(e,t);const{osName:u,osVersion:l}=sn(i,s);t=Me(a(t,{deviceType:r,deviceBrand:c,deviceModel:o,osName:u,osVersion:l}))}},fn={returnValue:(e,t)=>{const{version:n,language:o,SDKVersion:i,theme:s}=e;let r=un(e),c=(o||"").replace(/_/g,"-");const u={hostVersion:n,hostLanguage:c,hostName:r,hostSDKVersion:i,hostTheme:s,appId:"__UNI__A6CDB98",appName:"tk-mini-program",appVersion:"1.0.0",appVersionCode:"100",appLanguage:cn(c),isUniAppX:!1,uniPlatform:"mp-weixin",uniCompileVersion:"4.66",uniCompilerVersion:"4.66",uniRuntimeVersion:"4.66"};a(t,u)}},mn={returnValue:(e,t)=>{on(e,t),t=Me(a(t,{windowTop:0,windowBottom:0}))}},_n={args(e){const t=getApp({allowDefault:!0})||{};t.$vm?qs(Y,e,t.$vm.$):(wx.$onErrorHandlers||(wx.$onErrorHandlers=[]),wx.$onErrorHandlers.push(e))}},vn={args(e){const t=getApp({allowDefault:!0})||{};if(t.$vm){if(e.__weh){const n=t.$vm.$[Y];if(n){const t=n.indexOf(e.__weh);t>-1&&n.splice(t,1)}}}else{if(!wx.$onErrorHandlers)return;const t=wx.$onErrorHandlers.findIndex((t=>t===e));-1!==t&&wx.$onErrorHandlers.splice(t,1)}}},yn={args(){if(wx.__uni_console__){if(wx.__uni_console_warned__)return;wx.__uni_console_warned__=!0,console.warn("开发模式下小程序日志回显会使用 socket 连接,为了避免冲突,建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)")}}},In=yn,Mn={$on:kt,$off:Lt,$once:Dt,$emit:Rt,upx2px:It,rpx2px:It,interceptors:{},addInterceptor:Tt,removeInterceptor:St,onCreateVueApp:function(e){if(Oe)return e(Oe);Ae.push(e)},invokeCreateVueAppHook:function(e){Oe=e,Ae.forEach((t=>t(e)))},getLocale:Zt,setLocale:e=>{const t=g(getApp)&&getApp();if(!t)return!1;return t.$vm.$locale!==e&&(t.$vm.$locale=e,Qt.forEach((t=>t({locale:e}))),!0)},onLocaleChange:e=>{-1===Qt.indexOf(e)&&Qt.push(e)},getPushClientId:wt,onPushMessage:e=>{-1===Ft.indexOf(e)&&Ft.push(e)},offPushMessage:e=>{if(e){const t=Ft.indexOf(e);t>-1&&Ft.splice(t,1)}else Ft.length=0},invokePushCallback:function(e){if("enabled"===e.type)bt=!0;else if("clientId"===e.type)Ot=e.cid,At=e.errMsg,xt(Ot,e.errMsg);else if("pushMsg"===e.type){const t={type:"receive",data:Pt(e.message)};for(let e=0;e{t({type:"click",data:Pt(e.message)})}))},__f__:function(e,t,...n){t&&n.push(t),console[e].apply(console,n)}};const Cn=["qy","env","error","version","lanDebug","cloud","serviceMarket","router","worklet","__webpack_require_UNI_MP_PLUGIN__"],Tn=["lanDebug","router","worklet"],Sn=wx.getLaunchOptionsSync?wx.getLaunchOptionsSync():null;function En(e){return(!Sn||1154!==Sn.scene||!Tn.includes(e))&&(Cn.indexOf(e)>-1||"function"==typeof wx[e])}function kn(){const e={};for(const t in wx)En(t)&&(e[t]=wx[t]);return"undefined"!=typeof globalThis&&"undefined"==typeof requireMiniProgram&&(globalThis.wx=e),e}const Dn=["__route__","__wxExparserNodeId__","__wxWebviewId__"],Ln=(Rn={oauth:["weixin"],share:["weixin"],payment:["wxpay"],push:["weixin"]},function({service:e,success:t,fail:n,complete:o}){let i;Rn[e]?(i={errMsg:"getProvider:ok",service:e,provider:Rn[e]},g(t)&&t(i)):(i={errMsg:"getProvider:fail:服务["+e+"]不存在"},g(n)&&n(i)),g(o)&&o(i)});var Rn;const On=kn();On.canIUse("getAppBaseInfo")||(On.getAppBaseInfo=On.getSystemInfoSync),On.canIUse("getWindowInfo")||(On.getWindowInfo=On.getSystemInfoSync),On.canIUse("getDeviceInfo")||(On.getDeviceInfo=On.getSystemInfoSync);let An=On.getAppBaseInfo&&On.getAppBaseInfo();An||(An=On.getSystemInfoSync());const bn=An?An.host:null,Pn=bn&&"SAAASDK"===bn.env?On.miniapp.shareVideoMessage:On.shareVideoMessage;var Nn=Object.freeze({__proto__:null,createSelectorQuery:function(){const e=On.createSelectorQuery(),t=e.in;return e.in=function(e){return e.$scope?t.call(this,e.$scope):t.call(this,function(e){const t=Object.create(null);return Dn.forEach((n=>{t[n]=e[n]})),t}(e))},e},getProvider:Ln,shareVideoMessage:Pn});const xn={args(e,t){e.compressedHeight&&!t.compressHeight&&(t.compressHeight=e.compressedHeight),e.compressedWidth&&!t.compressWidth&&(t.compressWidth=e.compressedWidth)}};var wn=Object.freeze({__proto__:null,compressImage:xn,getAppAuthorizeSetting:{returnValue:function(e,t){const{locationReducedAccuracy:n}=e;t.locationAccuracy="unsupported",!0===n?t.locationAccuracy="reduced":!1===n&&(t.locationAccuracy="full")}},getAppBaseInfo:fn,getDeviceInfo:gn,getSystemInfo:ln,getSystemInfoSync:pn,getWindowInfo:mn,offError:vn,onError:_n,onSocketMessage:In,onSocketOpen:yn,previewImage:dn,redirectTo:{},showActionSheet:hn});const Un=kn();var Gn=function(e,t,n=wx){const o=function(e){function t(e,t,n){return function(i){return t(o(e,i,n))}}function n(e,n,o={},i={},s=!1){if(M(n)){const r=!0===s?n:{};g(o)&&(o=o(n,r)||{});for(const a in n)if(l(o,a)){let t=o[a];g(t)&&(t=t(n[a],n,r)),t?f(t)?r[t]=n[a]:M(t)&&(r[t.name?t.name:a]=t.value):console.warn(`微信小程序 ${e} 暂不支持 ${a}`)}else if(-1!==Xt.indexOf(a)){const o=n[a];g(o)&&(r[a]=t(e,o,i))}else s||l(r,a)||(r[a]=n[a]);return r}return g(n)&&(g(o)&&o(n,{}),n=t(e,n,i)),n}function o(t,o,i,s=!1){return g(e.returnValue)&&(o=e.returnValue(t,o)),n(t,o,i,{},s||!1)}return function(t,i){const s=l(e,t);if(!s&&"function"!=typeof wx[t])return i;const r=s||g(e.returnValue)||$t(t)||Yt(t),a=s||g(i);if(!s&&!i)return function(){console.error(`微信小程序 暂不支持${t}`)};if(!r||!a)return i;const c=e[t];return function(e,i){let s=c||{};g(c)&&(s=c(e));const r=[e=n(t,e,s.args,s.returnValue)];void 0!==i&&r.push(i);const a=wx[s.name||t].apply(wx,r);return($t(t)||Yt(t))&&a&&!a.__v_skip&&(a.__v_skip=!0),zt(t)?o(t,a,s.returnValue,$t(t)):a}}}(t);return new Proxy({},{get:(t,i)=>l(t,i)?t[i]:l(e,i)?Jt(i,e[i]):l(Mn,i)?Jt(i,Mn[i]):Jt(i,o(i,n[i]))})}(Nn,wn,Un);let Fn,Bn,qn=class{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Fn,!e&&Fn&&(this.index=(Fn.scopes||(Fn.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Fn;try{return Fn=this,e()}finally{Fn=t}}}on(){Fn=this}off(){Fn=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),no()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Zn,t=Bn;try{return Zn=!0,Bn=this,this._runnings++,zn(this),this.fn()}finally{Yn(this),this._runnings--,Bn=t,Zn=e}}stop(){var e;this.active&&(zn(this),Yn(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function zn(e){e._trackId++,e._depsLength=0}function Yn(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{n.dirty&&n.run()}));t&&(a(n,t),t.scope&&jn(n,t.scope)),t&&t.lazy||n.run();const i=n.run.bind(n);return i.effect=n,i}function Xn(e){e.effect.stop()}let Zn=!0,Qn=0;const eo=[];function to(){eo.push(Zn),Zn=!1}function no(){const e=eo.pop();Zn=void 0===e||e}function oo(){Qn++}function io(){for(Qn--;!Qn&&ro.length;)ro.shift()()}function so(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&Wn(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const ro=[];function ao(e,t,n){oo();for(const o of e.keys()){let n;o._dirtyLevel{const n=new Map;return n.cleanup=e,n.computed=t,n},uo=new WeakMap,lo=Symbol(""),po=Symbol("");function ho(e,t,n){if(Zn&&Bn){let t=uo.get(e);t||uo.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=co((()=>t.delete(n)))),so(Bn,o)}}function go(e,t,n,o,i,s){const r=uo.get(e);if(!r)return;let a=[];if("clear"===t)a=[...r.values()];else if("length"===n&&p(e)){const e=Number(o);r.forEach(((t,n)=>{("length"===n||!m(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(r.get(n)),t){case"add":p(e)?C(n)&&a.push(r.get("length")):(a.push(r.get(lo)),d(e)&&a.push(r.get(po)));break;case"delete":p(e)||(a.push(r.get(lo)),d(e)&&a.push(r.get(po)));break;case"set":d(e)&&a.push(r.get(lo))}oo();for(const c of a)c&&ao(c,4);io()}const fo=e("__proto__,__v_isRef,__isVue"),mo=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(m)),_o=vo();function vo(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=ui(this);for(let t=0,i=this.length;t{e[t]=function(...e){to(),oo();const n=ui(this)[t].apply(this,e);return io(),no(),n}})),e}function yo(e){const t=ui(this);return ho(t,0,e),t.hasOwnProperty(e)}class Io{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const o=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(o?i?Zo:Xo:i?Jo:Wo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=p(e);if(!o){if(s&&l(_o,t))return Reflect.get(_o,t,n);if("hasOwnProperty"===t)return yo}const r=Reflect.get(e,t,n);return(m(t)?mo.has(t):fo(t))?r:(o||ho(e,0,t),i?r:mi(r)?s&&C(t)?r:r.value:_(r)?o?ni(r):ei(r):r)}}class Mo extends Io{constructor(e=!1){super(!1,e)}set(e,t,n,o){let i=e[t];if(!this._isShallow){const t=ri(i);if(ai(n)||ri(n)||(i=ui(i),n=ui(n)),!p(e)&&mi(i)&&!mi(n))return!t&&(i.value=n,!0)}const s=p(e)&&C(t)?Number(t)e,Lo=e=>Reflect.getPrototypeOf(e);function Ro(e,t,n=!1,o=!1){const i=ui(e=e.__v_raw),s=ui(t);n||(A(t,s)&&ho(i,0,t),ho(i,0,s));const{has:r}=Lo(i),a=o?Do:n?di:pi;return r.call(i,t)?a(e.get(t)):r.call(i,s)?a(e.get(s)):void(e!==i&&e.get(t))}function Oo(e,t=!1){const n=this.__v_raw,o=ui(n),i=ui(e);return t||(A(e,i)&&ho(o,0,e),ho(o,0,i)),e===i?n.has(e):n.has(e)||n.has(i)}function Ao(e,t=!1){return e=e.__v_raw,!t&&ho(ui(e),0,lo),Reflect.get(e,"size",e)}function bo(e){e=ui(e);const t=ui(this);return Lo(t).has.call(t,e)||(t.add(e),go(t,"add",e,e)),this}function Po(e,t){t=ui(t);const n=ui(this),{has:o,get:i}=Lo(n);let s=o.call(n,e);s||(e=ui(e),s=o.call(n,e));const r=i.call(n,e);return n.set(e,t),s?A(t,r)&&go(n,"set",e,t):go(n,"add",e,t),this}function No(e){const t=ui(this),{has:n,get:o}=Lo(t);let i=n.call(t,e);i||(e=ui(e),i=n.call(t,e)),o&&o.call(t,e);const s=t.delete(e);return i&&go(t,"delete",e,void 0),s}function xo(){const e=ui(this),t=0!==e.size,n=e.clear();return t&&go(e,"clear",void 0,void 0),n}function wo(e,t){return function(n,o){const i=this,s=i.__v_raw,r=ui(s),a=t?Do:e?di:pi;return!e&&ho(r,0,lo),s.forEach(((e,t)=>n.call(o,a(e),a(t),i)))}}function Uo(e,t,n){return function(...o){const i=this.__v_raw,s=ui(i),r=d(s),a="entries"===e||e===Symbol.iterator&&r,c="keys"===e&&r,u=i[e](...o),l=n?Do:t?di:pi;return!t&&ho(s,0,c?po:lo),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[l(e[0]),l(e[1])]:l(e),done:t}},[Symbol.iterator](){return this}}}}function Go(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Fo(){const e={get(e){return Ro(this,e)},get size(){return Ao(this)},has:Oo,add:bo,set:Po,delete:No,clear:xo,forEach:wo(!1,!1)},t={get(e){return Ro(this,e,!1,!0)},get size(){return Ao(this)},has:Oo,add:bo,set:Po,delete:No,clear:xo,forEach:wo(!1,!0)},n={get(e){return Ro(this,e,!0)},get size(){return Ao(this,!0)},has(e){return Oo.call(this,e,!0)},add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear"),forEach:wo(!0,!1)},o={get(e){return Ro(this,e,!0,!0)},get size(){return Ao(this,!0)},has(e){return Oo.call(this,e,!0)},add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear"),forEach:wo(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{e[i]=Uo(i,!1,!1),n[i]=Uo(i,!0,!1),t[i]=Uo(i,!1,!0),o[i]=Uo(i,!0,!0)})),[e,n,t,o]}const[Bo,qo,Vo,jo]=Fo();function Ho(e,t){const n=t?e?jo:Vo:e?qo:Bo;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(l(n,o)&&o in t?n:t,o,i)}const Ko={get:Ho(!1,!1)},$o={get:Ho(!1,!0)},zo={get:Ho(!0,!1)},Yo={get:Ho(!0,!0)},Wo=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,Zo=new WeakMap;function Qo(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>I(e).slice(8,-1))(e))}function ei(e){return ri(e)?e:ii(e,!1,To,Ko,Wo)}function ti(e){return ii(e,!1,Eo,$o,Jo)}function ni(e){return ii(e,!0,So,zo,Xo)}function oi(e){return ii(e,!0,ko,Yo,Zo)}function ii(e,t,n,o,i){if(!_(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=i.get(e);if(s)return s;const r=Qo(e);if(0===r)return e;const a=new Proxy(e,2===r?o:n);return i.set(e,a),a}function si(e){return ri(e)?si(e.__v_raw):!(!e||!e.__v_isReactive)}function ri(e){return!(!e||!e.__v_isReadonly)}function ai(e){return!(!e||!e.__v_isShallow)}function ci(e){return si(e)||ri(e)}function ui(e){const t=e&&e.__v_raw;return t?ui(t):e}function li(e){return Object.isExtensible(e)&&((e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})})(e,"__v_skip",!0),e}const pi=e=>_(e)?ei(e):e,di=e=>_(e)?ni(e):e;class hi{constructor(e,t,n,o){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new $n((()=>e(this._value)),(()=>fi(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=ui(this);return e._cacheable&&!e.effect.dirty||!A(e._value,e._value=e.effect.run())||fi(e,4),gi(e),e.effect._dirtyLevel>=2&&fi(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function gi(e){var t;Zn&&Bn&&(e=ui(e),so(Bn,null!=(t=e.dep)?t:e.dep=co((()=>e.dep=void 0),e instanceof hi?e:void 0)))}function fi(e,t=4,n){const o=(e=ui(e)).dep;o&&ao(o,t)}function mi(e){return!(!e||!0!==e.__v_isRef)}function _i(e){return yi(e,!1)}function vi(e){return yi(e,!0)}function yi(e,t){return mi(e)?e:new Ii(e,t)}let Ii=class{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:ui(e),this._value=t?e:pi(e)}get value(){return gi(this),this._value}set value(e){const t=this.__v_isShallow||ai(e)||ri(e);e=t?e:ui(e),A(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:pi(e),fi(this,4))}};function Mi(e){fi(e,4)}function Ci(e){return mi(e)?e.value:e}function Ti(e){return g(e)?e():Ci(e)}const Si={get:(e,t,n)=>Ci(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return mi(i)&&!mi(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function Ei(e){return si(e)?e:new Proxy(e,Si)}class ki{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>gi(this)),(()=>fi(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Di(e){return new ki(e)}function Li(e){const t=p(e)?new Array(e.length):{};for(const n in e)t[n]=bi(e,n);return t}class Ri{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=ui(this._object),t=this._key,null==(n=uo.get(e))?void 0:n.get(t);var e,t,n}}class Oi{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Ai(e,t,n){return mi(e)?e:g(e)?new Oi(e):_(e)&&arguments.length>1?bi(e,t,n):_i(e)}function bi(e,t,n){const o=e[t];return mi(o)?o:new Ri(e,t,n)}function Pi(e,t,n,o){try{return o?e(...o):e()}catch(i){xi(i,t,n)}}function Ni(e,t,n,o){if(g(e)){const i=Pi(e,t,n,o);return i&&v(i)&&i.catch((e=>{xi(e,t,n)})),i}const i=[];for(let s=0;s>>1,i=Fi[o],s=Qi(i);s-1}function Ji(e){const t=Fi.indexOf(e);t>Bi&&Fi.splice(t,1)}function Xi(e){p(e)?qi.push(...e):Vi&&Vi.includes(e,e.allowRecurse?ji+1:ji)||qi.push(e),Yi()}function Zi(e,t,n=(Ui?Bi+1:0)){for(;nnull==e.id?1/0:e.id,es=(e,t)=>{const n=Qi(e)-Qi(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ts(e){Gi=!1,Ui=!0,Fi.sort(es);try{for(Bi=0;BiQi(e)-Qi(t)));if(qi.length=0,Vi)return void Vi.push(...e);for(Vi=e,ji=0;ji{}; /*! #__NO_SIDE_EFFECTS__ */ function ss(e){return e=>{e.appContext.app,e.uid,0===e.uid||e.parent&&e.parent.uid}}function rs(e,n,...o){if(e.isUnmounted)return;const i=e.vnode.props||t;let s=o;const r=n.startsWith("update:"),a=r&&n.slice(7);if(a&&a in i){const e=`${"modelValue"===a?"model":a}Modifiers`,{number:n,trim:r}=i[e]||t;r&&(s=o.map((e=>f(e)?e.trim():e))),n&&(s=o.map(P))}let c,u=i[c=O(n)]||i[c=O(k(n))];!u&&r&&(u=i[c=O(L(n))]),u&&Ni(u,e,6,s);const l=i[c+"Once"];if(l){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,Ni(l,e,6,s)}}function as(e,t,n=!1){const o=t.emitsCache,i=o.get(e);if(void 0!==i)return i;const s=e.emits;let r={},c=!1;if(!g(e)){const o=e=>{const n=as(e,t,!0);n&&(c=!0,a(r,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return s||c?(p(s)?s.forEach((e=>r[e]=null)):a(r,s),_(e)&&o.set(e,r),r):(_(e)&&o.set(e,null),null)}function cs(e,t){return!(!e||!s(t))&&(t=t.slice(2).replace(/Once$/,""),l(e,t[0].toLowerCase()+t.slice(1))||l(e,L(t))||l(e,t))}let us=null;function ls(e){const t=us;return us=e,e&&e.type.__scopeId,t}const ps=e=>ds;function ds(e,t=us,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d;const i=ls(t);let s;try{s=e(...n)}finally{ls(i),o._d}return s};return o._n=!0,o._c=!0,o._d=!0,o}const hs="components";function gs(e,t){return ms(hs,e,!0,t)||e}function fs(e){return ms("directives",e)}function ms(e,t,n=!0,o=!1){const i=us||Hr;if(i){const n=i.type;if(e===hs){const e=function(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===k(t)||e===R(k(t))))return n}const s=_s(i[e]||n[e],t)||_s(i.appContext[e],t);return!s&&o?n:s}}function _s(e,t){return e&&(e[t]||e[k(t)]||e[R(k(t))])}const vs=Symbol.for("v-scx"),ys=()=>Ns(vs);function Is(e,t){return Es(e,null,t)}function Ms(e,t){return Es(e,null,{flush:"post"})}function Cs(e,t){return Es(e,null,{flush:"sync"})}const Ts={};function Ss(e,t,n){return Es(e,t,n)}function Es(e,n,{immediate:i,deep:s,flush:r,once:a,onTrack:u,onTrigger:l}=t){if(n&&a){const e=n;n=(...t)=>{e(...t),E()}}const d=Hr,h=e=>!0===s?e:Ls(e,!1===s?1:void 0);let f,m,_=!1,v=!1;if(mi(e)?(f=()=>e.value,_=ai(e)):si(e)?(f=()=>h(e),_=!0):p(e)?(v=!0,_=e.some((e=>si(e)||ai(e))),f=()=>e.map((e=>mi(e)?e.value:si(e)?h(e):g(e)?Pi(e,d,2):void 0))):f=g(e)?n?()=>Pi(e,d,2):()=>(m&&m(),Ni(e,d,3,[y])):o,n&&s){const e=f;f=()=>Ls(e())}let y=e=>{m=T.onStop=()=>{Pi(e,d,4),m=T.onStop=void 0}},I=v?new Array(e.length).fill(Ts):Ts;const M=()=>{if(T.active&&T.dirty)if(n){const e=T.run();(s||_||(v?e.some(((e,t)=>A(e,I[t]))):A(e,I)))&&(m&&m(),Ni(n,d,3,[e,I===Ts?void 0:v&&I[0]===Ts?[]:I,y]),I=e)}else T.run()};let C;M.allowRecurse=!!n,"sync"===r?C=M:"post"===r?C=()=>wr(M,d&&d.suspense):(M.pre=!0,d&&(M.id=d.uid),C=()=>zi(M));const T=new $n(f,o,C),S=Hn(),E=()=>{T.stop(),S&&c(S.effects,T)};return n?i?M():I=T.run():"post"===r?wr(T.run.bind(T),d&&d.suspense):T.run(),E}function ks(e,t,n){const o=this.proxy,i=f(e)?e.includes(".")?Ds(o,e):()=>o[e]:e.bind(o,o);let s;g(t)?s=t:(s=t.handler,n=t);const r=Yr(this),a=Es(i,s.bind(o),n);return r(),a}function Ds(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e0){if(n>=t)return e;n++}if((o=o||new Set).has(e))return e;if(o.add(e),mi(e))Ls(e.value,t,n,o);else if(p(e))for(let i=0;i{Ls(e,t,n,o)}));else if(M(e))for(const i in e)Ls(e[i],t,n,o);return e}function Rs(e,n){if(null===us)return e;const o=ea(us)||us.proxy,i=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&g(t)?t.call(o&&o.proxy):t}}function xs(){return!!(Hr||us||bs)} /*! #__NO_SIDE_EFFECTS__ */function ws(e,t){return g(e)?(()=>a({name:e.name},t,{setup:e}))():e}function Us(e,t){Fs(e,"a",t)}function Gs(e,t){Fs(e,"da",t)}function Fs(e,t,n=Hr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(qs(t,o,n),n){let e=n.parent;for(;e&&e.parent;)e.parent.vnode.type.__isKeepAlive&&Bs(o,t,n,e),e=e.parent}}function Bs(e,t,n,o){const i=qs(t,e,o,!0);Ys((()=>{c(o[t],i)}),n)}function qs(e,t,n=Hr,o=!1){if(n){(function(e){return ke.indexOf(e)>-1})(e)&&(n=n.root);const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;to();const i=Yr(n),s=Ni(t,n,e,o);return i(),no(),s});return o?i.unshift(s):i.push(s),s}}const Vs=e=>(t,n=Hr)=>(!exports.isInSSRComponentSetup||"sp"===e)&&qs(e,((...e)=>t(...e)),n),js=Vs("bm"),Hs=Vs("m"),Ks=Vs("bu"),$s=Vs("u"),zs=Vs("bum"),Ys=Vs("um"),Ws=Vs("sp"),Js=Vs("rtg"),Xs=Vs("rtc");function Zs(e,t=Hr){qs("ec",e,t)}function Qs(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:O(o)]=e[o];return n}const er=e=>e?Jr(e)?ea(e)||e.proxy:er(e.parent):null,tr=a(Object.create(null),{$:e=>e,$el:e=>e.__$el||(e.__$el={}),$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>er(e.parent),$root:e=>er(e.root),$emit:e=>e.emit,$options:e=>Ir(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,zi(e.update)}),$watch:e=>ks.bind(e)}),nr=(e,n)=>e!==t&&!e.__isScriptSetup&&l(e,n),or={get({_:e},n){const{ctx:o,setupState:i,data:s,props:r,accessCache:a,type:c,appContext:u}=e;let p;if("$"!==n[0]){const c=a[n];if(void 0!==c)switch(c){case 1:return i[n];case 2:return s[n];case 4:return o[n];case 3:return r[n]}else{if(nr(i,n))return a[n]=1,i[n];if(s!==t&&l(s,n))return a[n]=2,s[n];if((p=e.propsOptions[0])&&l(p,n))return a[n]=3,r[n];if(o!==t&&l(o,n))return a[n]=4,o[n];mr&&(a[n]=0)}}const d=tr[n];let h,g;return d?("$attrs"===n&&ho(e,0,n),d(e)):(h=c.__cssModules)&&(h=h[n])?h:o!==t&&l(o,n)?(a[n]=4,o[n]):(g=u.config.globalProperties,l(g,n)?g[n]:void 0)},set({_:e},n,o){const{data:i,setupState:s,ctx:r}=e;return nr(s,n)?(s[n]=o,!0):i!==t&&l(i,n)?(i[n]=o,!0):!l(e.props,n)&&(("$"!==n[0]||!(n.slice(1)in e))&&(r[n]=o,!0))},has({_:{data:e,setupState:n,accessCache:o,ctx:i,appContext:s,propsOptions:r}},a){let c;return!!o[a]||e!==t&&l(e,a)||nr(n,a)||(c=r[0])&&l(c,a)||l(i,a)||l(tr,a)||l(s.config.globalProperties,a)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:l(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ir(){return null}function sr(){return null}function rr(e){}function ar(e,t){return null}function cr(){return lr().slots}function ur(){return lr().attrs}function lr(){const e=Kr();return e.setupContext||(e.setupContext=Qr(e))}function pr(e){return p(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function dr(e,t){const n=pr(e);for(const o in t){if(o.startsWith("__skip"))continue;let e=n[o];e?p(e)||g(e)?e=n[o]={type:e,default:t[o]}:e.default=t[o]:null===e&&(e=n[o]={default:t[o]}),e&&t[`__skip_${o}`]&&(e.skipFactory=!0)}return n}function hr(e,t){return e&&t?p(e)&&p(t)?e.concat(t):a({},pr(e),pr(t)):e||t}function gr(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function fr(e){const t=Kr();let n=e();return Wr(),v(n)&&(n=n.catch((e=>{throw Yr(t),e}))),[n,()=>Yr(t)]}let mr=!0;function _r(e){const t=Ir(e),n=e.proxy,i=e.ctx;mr=!1,t.beforeCreate&&vr(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:a,watch:c,provide:u,inject:l,created:d,beforeMount:h,mounted:f,beforeUpdate:m,updated:v,activated:y,deactivated:I,beforeDestroy:M,beforeUnmount:C,destroyed:T,unmounted:S,render:E,renderTracked:k,renderTriggered:D,errorCaptured:L,serverPrefetch:R,expose:O,inheritAttrs:A,components:b,directives:P,filters:N}=t;if(l&&function(e,t){p(e)&&(e=Sr(e));for(const n in e){const o=e[n];let i;i=_(o)?"default"in o?Ns(o.from||n,o.default,!0):Ns(o.from||n):Ns(o),mi(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}(l,i),a)for(const o in a){const e=a[o];g(e)&&(i[o]=e.bind(n))}if(s){const t=s.call(n,n);_(t)&&(e.data=ei(t))}if(mr=!0,r)for(const p in r){const e=r[p],t=g(e)?e.bind(n,n):g(e.get)?e.get.bind(n,n):o,s=!g(e)&&g(e.set)?e.set.bind(n):o,a=ta({get:t,set:s});Object.defineProperty(i,p,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(const o in c)yr(c[o],i,n,o);function x(e,t){p(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(function(){if(u){const e=g(u)?u.call(n):u;Reflect.ownKeys(e).forEach((t=>{Ps(t,e[t])}))}}(),d&&vr(d,e,"c"),x(js,h),x(Hs,f),x(Ks,m),x($s,v),x(Us,y),x(Gs,I),x(Zs,L),x(Xs,k),x(Js,D),x(zs,C),x(Ys,S),x(Ws,R),p(O))if(O.length){const t=e.exposed||(e.exposed={});O.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});E&&e.render===o&&(e.render=E),null!=A&&(e.inheritAttrs=A),b&&(e.components=b),P&&(e.directives=P),e.ctx.$onApplyOptions&&e.ctx.$onApplyOptions(t,e,n)}function vr(e,t,n){Ni(p(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function yr(e,t,n,o){const i=o.includes(".")?Ds(n,o):()=>n[o];if(f(e)){const n=t[e];g(n)&&Ss(i,n)}else if(g(e))Ss(i,e.bind(n));else if(_(e))if(p(e))e.forEach((e=>yr(e,t,n,o)));else{const o=g(e.handler)?e.handler.bind(n):t[e.handler];g(o)&&Ss(i,o,e)}}function Ir(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:r}}=e.appContext,a=s.get(t);let c;return a?c=a:i.length||n||o?(c={},i.length&&i.forEach((e=>Mr(c,e,r,!0))),Mr(c,t,r)):c=t,_(t)&&s.set(t,c),c}function Mr(e,t,n,o=!1){const{mixins:i,extends:s}=t;s&&Mr(e,s,n,!0),i&&i.forEach((t=>Mr(e,t,n,!0)));for(const r in t)if(o&&"expose"===r);else{const o=Cr[r]||n&&n[r];e[r]=o?o(e[r],t[r]):t[r]}return e}const Cr={data:Tr,props:Dr,emits:Dr,methods:kr,computed:kr,beforeCreate:Er,created:Er,beforeMount:Er,mounted:Er,beforeUpdate:Er,updated:Er,beforeDestroy:Er,beforeUnmount:Er,destroyed:Er,unmounted:Er,activated:Er,deactivated:Er,errorCaptured:Er,serverPrefetch:Er,components:kr,directives:kr,watch:function(e,t){if(!e)return t;if(!t)return e;const n=a(Object.create(null),e);for(const o in t)n[o]=Er(e[o],t[o]);return n},provide:Tr,inject:function(e,t){return kr(Sr(e),Sr(t))}};function Tr(e,t){return t?e?function(){return a(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function Sr(e){if(p(e)){const t={};for(let n=0;n0)||16&r){let o;Rr(e,t,i,s)&&(u=!0);for(const s in a)t&&(l(t,s)||(o=L(s))!==s&&l(t,o))||(c?!n||void 0===n[s]&&void 0===n[o]||(i[s]=Or(c,a,s,void 0,e,!0)):delete i[s]);if(s!==a)for(const e in s)t&&l(t,e)||(delete s[e],u=!0)}else if(8&r){const n=e.vnode.dynamicProps;for(let o=0;o{h=!0;const[t,n]=Ar(e,o,!0);a(u,t),n&&d.push(...n)};!i&&o.mixins.length&&o.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!h)return _(e)&&s.set(e,n),n;if(p(c))for(let n=0;n-1,o[1]=n<0||t-1||l(o,"default"))&&d.push(e)}}}const f=[u,d];return _(e)&&s.set(e,f),f}function br(e){return"$"!==e[0]&&!T(e)}function Pr(e){if(null===e)return"null";if("function"==typeof e)return e.name||"";if("object"==typeof e){return e.constructor&&e.constructor.name||""}return""}function Nr(e,t){return Pr(e)===Pr(t)}function xr(e,t){return p(t)?t.findIndex((t=>Nr(t,e))):g(t)&&Nr(t,e)?0:-1}const wr=Xi,Ur=Symbol.for("v-fgt"),Gr=Symbol.for("v-txt");function Fr(e){return e?ci(e)||"__vInternal"in e?a({},e):e:null}function Br(...e){const t={};for(let n=0;nHr||us;let $r,zr;$r=e=>{Hr=e},zr=e=>{exports.isInSSRComponentSetup=e};const Yr=e=>{const t=Hr;return $r(e),e.scope.on(),()=>{e.scope.off(),$r(t)}},Wr=()=>{Hr&&Hr.scope.off(),$r(null)};function Jr(e){return 4&e.vnode.shapeFlag}function Xr(e,t=!1){t&&zr(t);const{props:n}=e.vnode,o=Jr(e);!function(e,t,n,o=!1){const i={},s={};e.propsDefaults=Object.create(null),Rr(e,t,i,s);for(const r in e.propsOptions[0])r in i||(i[r]=void 0);n?e.props=o?i:ti(i):e.type.props?e.props=i:e.props=s,e.attrs=s}(e,n,o,t);const i=o?function(e){const t=e.type;e.accessCache=Object.create(null),e.proxy=li(new Proxy(e.ctx,or));const{setup:n}=t;if(n){const t=e.setupContext=n.length>1?Qr(e):null,o=Yr(e);to();const i=Pi(n,e,0,[e.props,t]);no(),o(),v(i)?i.then(Wr,Wr):function(e,t){g(t)?e.render=t:_(t)&&(e.setupState=Ei(t));Zr(e)}(e,i)}else Zr(e)}(e):void 0;return t&&zr(!1),i}function Zr(e,t,n){const i=e.type;e.render||(e.render=i.render||o);{const t=Yr(e);to();try{_r(e)}finally{no(),t()}}}function Qr(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(ho(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function ea(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Ei(li(e.exposed)),{get:(t,n)=>n in t?t[n]:e.proxy[n],has:(e,t)=>t in e||t in tr}))}exports.isInSSRComponentSetup=!1;const ta=(e,t)=>{const n=function(e,t,n=!1){let i,s;const r=g(e);return r?(i=e,s=o):(i=e.get,s=e.set),new hi(i,s,r||!s,n)}(e,0,exports.isInSSRComponentSetup);return n};function na(e,n,o=t){const i=Kr(),s=k(n),r=L(n),a=Di(((t,a)=>{let c;return Cs((()=>{const t=e[n];A(c,t)&&(c=t,a())})),{get:()=>(t(),o.get?o.get(c):c),set(e){const t=i.vnode.props;t&&(n in t||s in t||r in t)&&(`onUpdate:${n}`in t||`onUpdate:${s}`in t||`onUpdate:${r}`in t)||!A(e,c)||(c=e,a()),i.emit(`update:${n}`,o.set?o.set(e):e)}}})),c="modelValue"===n?"modelModifiers":`${n}Modifiers`;return a[Symbol.iterator]=()=>{let t=0;return{next:()=>t<2?{value:t++?e[c]||{}:a,done:!1}:{done:!0}}},a}const oa="3.4.21",ia=o;function sa(e){return Ci(e)}function ra(e){console.error("defineAsyncComponent is unsupported")}const aa="[object Array]",ca="[object Object]";function ua(e,t){const n={};return la(e,t),pa(e,t,"",n),n}function la(e,t){if((e=sa(e))===t)return;const n=I(e),o=I(t);if(n==ca&&o==ca)for(let i in t){const n=e[i];void 0===n?e[i]=null:la(n,t[i])}else n==aa&&o==aa&&e.length>=t.length&&t.forEach(((t,n)=>{la(e[n],t)}))}function pa(e,t,n,o){if((e=sa(e))===t)return;const i=I(e),s=I(t);if(i==ca)if(s!=ca||Object.keys(e).length{pa(e,s[t],(""==n?"":n+".")+r+"["+t+"]",o)}));else if(a==ca)if(c!=ca||Object.keys(i).length{pa(e,t[i],n+"["+i+"]",o)})):da(o,n,e)}function da(e,t,n){e[t]=n}function ha(e){const t=e.ctx.__next_tick_callbacks;if(t&&t.length){const e=t.slice(0);t.length=0;for(let t=0;t{t?Pi(t.bind(e.proxy),e,14):o&&o(e.proxy)})),new Promise((e=>{o=e}))}function fa(e,t){const n=typeof(e=sa(e));if("object"===n&&null!==e){let n=t.get(e);if(void 0!==n)return n;if(p(e)){const o=e.length;n=new Array(o),t.set(e,n);for(let i=0;i{o[e]=n[e]})),o}(i,s));Object.keys(r).length?(o.__next_tick_pending=!0,i.setData(r,(()=>{o.__next_tick_pending=!1,ha(e)})),Zi()):ha(e)}}function va(e,t,n){t.appContext.config.globalProperties.$applyOptions(e,t,n);const o=e.computed;if(o){const e=Object.keys(o);if(e.length){const n=t.ctx;n.$computedKeys||(n.$computedKeys=[]),n.$computedKeys.push(...e)}}delete t.ctx.$onApplyOptions}function ya(e,t=!1){const{setupState:n,$templateRefs:o,$templateUniElementRefs:i,ctx:{$scope:s,$mpPlatform:r}}=e;if("mp-alipay"===r)return;if(!s||!o&&!i)return;if(t)return o&&o.forEach((e=>Ia(e,null,n))),void(i&&i.forEach((e=>Ia(e,null,n))));const a="mp-baidu"===r||"mp-toutiao"===r,c=e=>{if(0===e.length)return[];const t=(s.selectAllComponents(".r")||[]).concat(s.selectAllComponents(".r-i-f")||[]);return e.filter((e=>{const o=function(e,t){const n=e.find((e=>e&&(e.properties||e.props).uI===t));if(n){const e=n.$vm;return e?ea(e.$)||e:function(e){_(e)&&li(e);return e}(n)}return null}(t,e.i);return!(!a||null!==o)||(Ia(e,o,n),!1)}))},u=()=>{if(o){const t=c(o);t.length&&e.proxy&&e.proxy.$scope&&e.proxy.$scope.setData({r1:1},(()=>{c(t)}))}};i&&i.length&&ga(e,(()=>{i.forEach((e=>{p(e.v)?e.v.forEach((t=>{Ia(e,t,n)})):Ia(e,e.v,n)}))})),s._$setRef?s._$setRef(u):ga(e,u)}function Ia({r:e,f:t},n,o){if(g(e))e(n,{});else{const i=f(e),s=mi(e);if(i||s)if(t){if(!s)return;p(e.value)||(e.value=[]);const t=e.value;if(-1===t.indexOf(n)){if(t.push(n),!n)return;n.$&&zs((()=>c(t,n)),n.$)}}else i?l(o,e)&&(o[e]=n):mi(e)&&(e.value=n)}}const Ma=Xi;function Ca(e,t){const n=e.component=jr(e,t.parentComponent,null);return n.ctx.$onApplyOptions=va,n.ctx.$children=[],"app"===t.mpType&&(n.render=o),t.onBeforeSetup&&t.onBeforeSetup(n,t),Xr(n),t.parentComponent&&n.proxy&&t.parentComponent.ctx.$children.push(ea(n)||n.proxy),function(e){const t=Da.bind(e);e.$updateScopedSlots=()=>$i((()=>zi(t)));const n=()=>{if(e.isMounted){const{next:t,bu:n,u:o}=e;La(e,!1),ka(),n&&b(n),La(e,!0),_a(e,Sa(e)),o&&Ma(o)}else zs((()=>{ya(e,!0)}),e),_a(e,Sa(e))},i=e.effect=new $n(n,o,(()=>zi(s)),e.scope),s=e.update=()=>{i.dirty&&i.run()};s.id=e.uid,La(e,!0),s()}(n),n.proxy}const Ta=e=>{let t;for(const n in e)("class"===n||"style"===n||s(n))&&((t||(t={}))[n]=e[n]);return t};function Sa(e){const{type:t,vnode:n,proxy:o,withProxy:i,props:s,propsOptions:[r],slots:a,attrs:c,emit:u,render:l,renderCache:p,data:d,setupState:h,ctx:g,uid:f,appContext:{app:{config:{globalProperties:{pruneComponentPropsCache:m}}}},inheritAttrs:_}=e;let v;e.$uniElementIds=new Map,e.$templateRefs=[],e.$templateUniElementRefs=[],e.$templateUniElementStyles={},e.$ei=0,m(f),e.__counter=0===e.__counter?1:0;const y=ls(e);try{if(4&n.shapeFlag){Ea(_,s,r,c);const e=i||o;v=l.call(e,e,p,s,h,d,g)}else{Ea(_,s,r,t.props?c:Ta(c));const e=t;v=e.length>1?e(s,{attrs:c,slots:a,emit:u}):e(s,null)}}catch(I){xi(I,e,1),v=!1}return ya(e),ls(y),v}function Ea(e,t,n,o){if(t&&o&&!1!==e){const e=Object.keys(o).filter((e=>"class"!==e&&"style"!==e));if(!e.length)return;n&&e.some(r)?e.forEach((e=>{r(e)&&e.slice(9)in n||(t[e]=o[e])})):e.forEach((e=>t[e]=o[e]))}}const ka=e=>{to(),Zi(),no()};function Da(){const e=this.$scopedSlotsData;if(!e||0===e.length)return;const t=this.ctx.$scope,n=t.data,o=Object.create(null);e.forEach((({path:e,index:t,data:i})=>{const s=Ie(n,e),r=f(t)?`${e}.${t}`:`${e}[${t}]`;if(void 0===s||void 0===s[t])o[r]=i;else{const e=ua(i,s[t]);Object.keys(e).forEach((t=>{o[r+"."+t]=e[t]}))}})),e.length=0,Object.keys(o).length&&t.setData(o)}function La({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}const Ra=function(e,t=null){g(e)||(e=a({},e)),null==t||_(t)||(t=null);const n=Os(),o=new WeakSet,i=n.app={_uid:As++,_component:e,_props:t,_container:null,_context:n,_instance:null,version:oa,get config(){return n.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&g(e.install)?(o.add(e),e.install(i,...t)):g(e)&&(o.add(e),e(i,...t))),i),mixin:e=>(n.mixins.includes(e)||n.mixins.push(e),i),component:(e,t)=>t?(n.components[e]=t,i):n.components[e],directive:(e,t)=>t?(n.directives[e]=t,i):n.directives[e],mount(){},unmount(){},provide:(e,t)=>(n.provides[e]=t,i),runWithContext(e){const t=bs;bs=i;try{return e()}finally{bs=t}}};return i};function Oa(e,t=null){("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof my?my:void 0).__VUE__=!0;const n=Ra(e,t),i=n._context;i.config.globalProperties.$nextTick=function(e){return ga(this.$,e)};const s=e=>(e.appContext=i,e.shapeFlag=6,e),r=function(e,t){return Ca(s(e),t)},a=function(e){return e&&function(e){const{bum:t,scope:n,update:o,um:i}=e;t&&b(t);{const t=e.parent;if(t){const n=t.ctx.$children,o=ea(e)||e.proxy,i=n.indexOf(o);i>-1&&n.splice(i,1)}}n.stop(),o&&(o.active=!1),i&&Ma(i),Ma((()=>{e.isUnmounted=!0}))}(e.$)};return n.mount=function(){e.render=o;const t=Ca(s({type:e}),{mpType:"app",mpInstance:null,parentComponent:null,slots:[],props:null});return n._instance=t.$,t.$app=n,t.$createComponent=r,t.$destroyComponent=a,i.$appInstance=t,t},n.unmount=function(){},n}function Aa(e="$style"){{const n=Kr();if(!n)return t;const o=n.type.__cssModules;if(!o)return t;const i=o[e];return i||t}}function ba(e){const t=Kr();t&&function(e,t){e.ctx.__cssVars=()=>{const n=t(e.proxy),o={};for(const e in n)o[`--${e}`]=n[e];return o}}(t,e)}function Pa(){}function Na(){}function xa(e,t,n,o){g(t)&&qs(e,t.bind(n),o)}function wa(e,t,n){!function(e,t,n){const o=e.mpType||n.$mpType;o&&"component"!==o&&Object.keys(e).forEach((o=>{if(Re(o,e[o],!1)){const i=e[o];p(i)?i.forEach((e=>xa(o,e,n,t))):xa(o,i,n,t)}}))}(e,t,n)}function Ua(e,t,n){return e[t]=n}function Ga(e,...t){const n=this[e];return n?n(...t):(console.error(`method ${e} not found`),null)}function Fa(e){const t=e.config.errorHandler;return function(n,o,i){t&&t(n,o,i);const s=e._instance;if(!s||!s.proxy)throw n;s[Y]?s.proxy.$callHook(Y,n):wi(n,0,o&&o.$.vnode,!1)}}function Ba(e,t){return e?[...new Set([].concat(e,t))]:t}let qa;const Va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ja=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Ha(){const e=Gn.getStorageSync("uni_id_token")||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let n;try{n=JSON.parse((o=t[1],decodeURIComponent(qa(o).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(i){throw new Error("获取当前用户信息出错,详细错误信息为:"+i.message)}var o;return n.tokenExpired=1e3*n.exp,delete n.exp,delete n.iat,n}function Ka(e){const t=e.config;var n;t.errorHandler=be(e,Fa),n=t.optionMergeStrategies,De.forEach((e=>{n[e]=Ba}));const o=t.globalProperties;!function(e){e.uniIDHasRole=function(e){const{role:t}=Ha();return t.indexOf(e)>-1},e.uniIDHasPermission=function(e){const{permission:t}=Ha();return this.uniIDHasRole("admin")||t.indexOf(e)>-1},e.uniIDTokenValid=function(){const{tokenExpired:e}=Ha();return e>Date.now()}}(o),o.$set=Ua,o.$applyOptions=wa,o.$callMethod=Ga,Gn.invokeCreateVueAppHook(e)}qa="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!ja.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,o,i="",s=0;s>16&255):64===o?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}:atob;const $a=Object.create(null);function za(e){delete $a[e]}function Ya(e){if(!e)return;const[t,n]=e.split(",");return $a[t]?$a[t][parseInt(n)]:void 0}var Wa={install(e){Ka(e),e.config.globalProperties.pruneComponentPropsCache=za;const t=e.mount;e.mount=function(n){const o=t.call(e,n),i=function(){const e="createApp";if("undefined"!=typeof global&&void 0!==global[e])return global[e];if("undefined"!=typeof my)return my[e]}();return i?i(o):"undefined"!=typeof createMiniProgramApp&&createMiniProgramApp(o),o}}};function Ja(e){return f(e)?e:function(e){let t="";if(!e||f(e))return t;for(const n in e)t+=`${n.startsWith("--")?n:L(n)}:${e[n]};`;return t}(x(e))}function Xa(e,t){const n=Kr(),i=n.ctx,s=void 0===t||"mp-weixin"!==i.$mpPlatform&&"mp-qq"!==i.$mpPlatform&&"mp-xhs"!==i.$mpPlatform||!f(t)&&"number"!=typeof t?"":"_"+t,r="e"+n.$ei+++s,c=i.$scope;if(!e)return delete c[r],r;const u=c[r];return u?u.value=e:c[r]=function(e,t){const n=e=>{var i;(i=e).type&&i.target&&(i.preventDefault=o,i.stopPropagation=o,i.stopImmediatePropagation=o,l(i,"detail")||(i.detail={}),l(i,"markerId")&&(i.detail="object"==typeof i.detail?i.detail:{},i.detail.markerId=i.markerId),M(i.detail)&&l(i.detail,"checked")&&!l(i.detail,"value")&&(i.detail.value=i.detail.checked),M(i.detail)&&(i.target=a({},i.target,i.detail)));let s=[e];t&&t.ctx.$getTriggerEventDetail&&"number"==typeof e.detail&&(e.detail=t.ctx.$getTriggerEventDetail(e.detail)),e.detail&&e.detail.__args__&&(s=e.detail.__args__);const r=n.value,c=()=>Ni(function(e,t){if(p(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n&&n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e(t)))}return t}(e,r),t,5,s),u=e.target,d=!!u&&(!!u.dataset&&"true"===String(u.dataset.eventsync));if(!Za.includes(e.type)||d){const t=c();if("input"===e.type&&(p(t)||v(t)))return;return t}setTimeout(c)};return n.value=e,n}(e,n),r}const Za=["tap","longpress","longtap","transitionend","animationstart","animationiteration","animationend","touchforcechange"];function Qa(e,t={},n){const o=Kr(),{parent:i,isMounted:s,ctx:{$scope:r}}=o,a=(r.properties||r.props).uI;if(!a)return;if(!i&&!s)return void Hs((()=>{Qa(e,t,n)}),o);const c=function(e,t){let n=t.parent;for(;n;){const t=n.$ssi;if(t&&t[e])return t[e];n=n.parent}}(a,o);c&&c(e,t,n)}function ec(e,{name:t,path:n,vueId:o}){const i=Kr();e.path=n;const s=i.$ssi||(i.$ssi={}),r=s[o]||(s[o]=function(e){const t=(n,o,i)=>{const s=t.slots[n];if(!s)return;const r=void 0!==i;i=i||0;const a=ls(e),c=s.fn(o,n+(r?"-"+i:""),i),u=s.fn.path;ls(a),(e.$scopedSlotsData||(e.$scopedSlotsData=[])).push({path:u,index:i,data:c}),e.$updateScopedSlots()};return t.slots={},t}(i));return r.slots[t]?r.slots[t].fn=e:r.slots[t]={fn:e},Ie(i.ctx.$scope.data,n)}function tc(e){return e.$scope.virtualHostId}function nc(e,t){return!function(e){return!!tc(e)}(e)||function(e){return e.$.propsOptions&&e.$.propsOptions[0]&&"id"in e.$.propsOptions[0]}(e)?t:tc(e)}function oc(){}const ic=(e,t)=>Xa(e,t),sc=(e,t)=>function(e,t){let n;if(p(e)||f(e)){n=new Array(e.length);for(let o=0,i=e.length;ot(e,n,n)));else{const o=Object.keys(e);n=new Array(o.length);for(let i=0,s=o.length;ifunction(e){return f(e)?Ce(e):e.map((e=>Ce(e)))}(e),ac=(e,t,n)=>Qa(e,t,n),cc=(e,t)=>ec(e,t),uc=e=>Ja(e),lc=e=>k(e),pc=(e,...t)=>a(e,...t),dc=e=>L(e),hc=e=>B(e),gc=e=>V(e),fc=e=>function(e){const{uid:t,__counter:n}=Kr();return t+","+(($a[t]||($a[t]=[])).push(Fr(e))-1)+","+n}(e),mc=(e,t,n)=>function(e,t,n={}){const{$templateRefs:o}=Kr();o.push({i:t,r:e,k:n.k,f:n.f})}(e,t,n),_c=(e,t,n=!1)=>function(e,{number:t,trim:n},o=!1){return o?(...o)=>(n?o=o.map((e=>e.trim())):t&&(o=o.map(N)),e(...o)):o=>{const i=o.detail.value;return n?o.detail.value=i.trim():t&&(o.detail.value=N(i)),e(o)}}(e,t,n),vc=e=>JSON.stringify(e),yc=function(e,t,n){return nc(e,t)||n||""};function Ic(e,t=null){return e&&(e.mpType="app"),Oa(e,t).use(Wa)}const Mc=Ic,Cc=Object.freeze(Object.defineProperty({__proto__:null,EMPTY_OBJ:t,EffectScope:qn,Fragment:Ur,ReactiveEffect:$n,Text:Gr,c:lc,callWithAsyncErrorHandling:Ni,callWithErrorHandling:Pi,camelize:k,computed:ta,createApp:Ic,createPropsRestProxy:gr,createSSRApp:Mc,createVNode:Na,createVueApp:Oa,customRef:Di,d:rc,defineAsyncComponent:ra,defineComponent:ws,defineEmits:sr,defineExpose:rr,defineProps:ir,devtoolsComponentAdded:ns,devtoolsComponentRemoved:is,devtoolsComponentUpdated:os,diff:ua,e:pc,effect:Jn,effectScope:Vn,f:sc,findComponentPropsData:Ya,gei:yc,getCurrentInstance:Kr,getCurrentScope:Hn,getExposeProxy:ea,guardReactiveProps:Fr,h:dc,hasInjectionContext:xs,hasQueueJob:Wi,inject:Ns,injectHook:qs,invalidateJob:Ji,get isInSSRComponentSetup(){return exports.isInSSRComponentSetup},isProxy:ci,isReactive:si,isReadonly:ri,isRef:mi,isShallow:ai,j:vc,logError:wi,m:_c,markRaw:li,mergeDefaults:dr,mergeModels:hr,mergeProps:Br,n:hc,nextTick:$i,normalizeClass:B,normalizeProps:q,normalizeStyle:x,o:ic,onActivated:Us,onBeforeMount:js,onBeforeUnmount:zs,onBeforeUpdate:Ks,onDeactivated:Gs,onErrorCaptured:Zs,onMounted:Hs,onRenderTracked:Xs,onRenderTriggered:Js,onScopeDispose:Kn,onServerPrefetch:Ws,onUnmounted:Ys,onUpdated:$s,p:fc,patch:_a,provide:Ps,proxyRefs:Ei,pruneComponentPropsCache:za,queuePostFlushCb:Xi,r:ac,reactive:ei,readonly:ni,ref:_i,resolveComponent:gs,resolveDirective:fs,resolveFilter:null,s:uc,setCurrentRenderingInstance:ls,setTemplateRef:Ia,setupDevtoolsPlugin:oc,shallowReactive:ti,shallowReadonly:oi,shallowRef:vi,sr:mc,stop:Xn,t:gc,toDisplayString:V,toHandlerKey:O,toHandlers:Qs,toRaw:ui,toRef:Ai,toRefs:Li,toValue:Ti,triggerRef:Mi,unref:Ci,updateProps:Lr,useAttrs:ur,useCssModule:Aa,useCssVars:ba,useModel:na,useSSRContext:ys,useSlots:cr,version:oa,w:cc,warn:ia,watch:Ss,watchEffect:Is,watchPostEffect:Ms,watchSyncEffect:Cs,withAsyncContext:fr,withCtx:ds,withDefaults:ar,withDirectives:Rs,withModifiers:Pa,withScopeId:ps},Symbol.toStringTag,{value:"Module"}));const Tc=["externalClasses"];const Sc=/_(.*)_worklet_factory_/;function Ec(e,t){const n=e.$children;for(let i=n.length-1;i>=0;i--){const e=n[i];if(e.$scope._$vueId===t)return e}let o;for(let i=n.length-1;i>=0;i--)if(o=Ec(n[i],t),o)return o}const kc=["createSelectorQuery","createIntersectionObserver","selectAllComponents","selectComponent"];function Dc(e,t){const n=e.ctx;n.mpType=t.mpType,n.$mpType=t.mpType,n.$mpPlatform="mp-weixin",n.$scope=t.mpInstance,Object.defineProperties(n,{[ve]:{get(){const e=this.$scope.data[ve];return void 0===e?"":e}}}),n.$mp={},n._self={},e.slots={},p(t.slots)&&t.slots.length&&(t.slots.forEach((t=>{e.slots[t]=!0})),e.slots.d&&(e.slots.default=!0)),n.getOpenerEventChannel=function(){return t.mpInstance.getOpenerEventChannel()},n.$hasHook=Lc,n.$callHook=Rc,e.emit=function(e,t){return function(n,...o){const i=t.$scope;if(i&&n){const e={__args__:o};i.triggerEvent(n,e)}return e.apply(this,[n,...o])}}(e.emit,n)}function Lc(e){const t=this.$[e];return!(!t||!t.length)}function Rc(e,t){"mounted"===e&&(Rc.call(this,"bm"),this.$.isMounted=!0,e="m");const n=this.$[e];return n&&((e,t)=>{let n;for(let o=0;o{Re(n,e[n])&&t.add(n)}));{const{extends:n,mixins:o}=e;o&&o.forEach((e=>Ac(e,t))),n&&Ac(n,t)}}return t}function bc(e,t,n){-1!==n.indexOf(t)||l(e,t)||(e[t]=function(e){return this.$vm&&this.$vm.$callHook(t,e)})}const Pc=[Q];function Nc(e,t,n=Pc){t.forEach((t=>bc(e,t,n)))}function xc(e,t,n=Pc){Ac(t).forEach((t=>bc(e,t,n)))}const wc=ye((()=>{const e=[],t=g(getApp)&&getApp({allowDefault:!0});if(t&&t.$vm&&t.$vm.$){const n=t.$vm.$.appContext.mixins;if(p(n)){const t=Object.keys(Le);n.forEach((n=>{t.forEach((t=>{l(n,t)&&!e.includes(t)&&e.push(t)}))}))}}return e}));const Uc=[K,$,Y,W,J,X];function Gc(e,t){const n=e.$,o={globalData:e.$options&&e.$options.globalData||{},$vm:e,onLaunch(t){this.$vm=e;const o=n.ctx;this.$vm&&o.$scope&&o.$callHook||(Dc(n,{mpType:"app",mpInstance:this,slots:[]}),o.globalData=this.globalData,e.$callHook(z,t))}},i=wx.$onErrorHandlers;i&&(i.forEach((e=>{qs(Y,e,n)})),i.length=0),function(e){const t=_i(function(){var e;let t="";{const n=(null===(e=wx.getAppBaseInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync();t=He(n&&n.language?n.language:Be)||Be}return t}());Object.defineProperty(e,"$locale",{get:()=>t.value,set(e){t.value=e}})}(e);const s=e.$.type;Nc(o,Uc),xc(o,s);{const e=s.methods;e&&a(o,e)}return o}function Fc(e,t){if(g(e.onLaunch)){const t=wx.getLaunchOptionsSync&&wx.getLaunchOptionsSync();e.onLaunch(t)}g(e.onShow)&&wx.onAppShow&&wx.onAppShow((e=>{t.$callHook("onShow",e)})),g(e.onHide)&&wx.onAppHide&&wx.onAppHide((e=>{t.$callHook("onHide",e)}))}const Bc=["eO","uR","uRIF","uI","uT","uP","uS"];function qc(e){e.properties||(e.properties={}),a(e.properties,function(e,t=!1){const n={};if(!t){let e=function(e){const t=Object.create(null);e&&e.forEach((e=>{t[e]=!0})),this.setData({$slots:t})};Bc.forEach((e=>{n[e]={type:null,value:""}})),n.uS={type:null,value:[]},n.uS.observer=e}return e.behaviors&&e.behaviors.includes("wx://form-field")&&(e.properties&&e.properties.name||(n.name={type:null,value:""}),e.properties&&e.properties.value||(n.value={type:null,value:""})),n}(e),function(e){const t={};return e&&e.virtualHost&&(t.virtualHostStyle={type:null,value:""},t.virtualHostClass={type:null,value:""},t.virtualHostHidden={type:null,value:""},t[ve]={type:null,value:""}),t}(e.options))}const Vc=[String,Number,Boolean,Object,Array,null];function jc(e,t){const n=function(e){return p(e)&&1===e.length?e[0]:e}(e);return-1!==Vc.indexOf(n)?n:null}function Hc(e,t){return(t?function(e){const t={};M(e)&&Object.keys(e).forEach((n=>{-1===Bc.indexOf(n)&&(t[n]=e[n])}));return t}(e):Ya(e.uP))||{}}function Kc(e){const t=function(){const e=this.properties.uP;e&&(this.$vm?function(e,t){const n=ui(t.props),o=Ya(e)||{};$c(n,o)&&(Lr(t,o,n,!1),Wi(t.update)&&Ji(t.update),t.update())}(e,this.$vm.$):"m"===this.properties.uT&&function(e,t){const n=t.properties,o=Ya(e)||{};$c(n,o,!1)&&t.setData(o)}(e,this))};e.observers||(e.observers={}),e.observers.uP=t}function $c(e,t,n=!0){const o=Object.keys(t);if(n&&o.length!==Object.keys(e).length)return!0;for(let i=0;i{o.push(e.replace("uni://","wx://")),"uni://form-field"===e&&(p(n)?(n.push("name"),n.push("modelValue")):(n.name={type:String,default:""},n.modelValue={type:[String,Number,Boolean,Array,Object,Date],default:""}))})),o}(t)}function Yc(e,{parse:t,mocks:n,isPage:o,isPageInProject:i,initRelation:s,handleLink:r,initLifetimes:c}){e=e.default||e;const u={multipleSlots:!0,addGlobalClass:!0,pureDataPattern:/^uP$/};p(e.mixins)&&e.mixins.forEach((e=>{_(e.options)&&a(u,e.options)})),e.options&&a(u,e.options);const d={options:u,lifetimes:c({mocks:n,isPage:o,initRelation:s,vueOptions:e}),pageLifetimes:{show(){this.$vm&&this.$vm.$callHook("onPageShow")},hide(){this.$vm&&this.$vm.$callHook("onPageHide")},resize(e){this.$vm&&this.$vm.$callHook("onPageResize",e)}},methods:{__l:r}};var h,g,f,m;return zc(d,e),qc(d),Kc(d),function(e,t){Tc.forEach((n=>{l(t,n)&&(e[n]=t[n])}))}(d,e),h=d.methods,g=e.wxsCallMethods,p(g)&&g.forEach((e=>{h[e]=function(t){return this.$vm[e](t)}})),f=d.methods,(m=e.methods)&&Object.keys(m).forEach((e=>{const t=e.match(Sc);if(t){const n=t[1];f[e]=m[e],f[n]=m[n]}})),t&&t(d,{handleLink:r}),d}let Wc,Jc;function Xc(){return getApp().$vm}function Zc(e,t){const{parse:n,mocks:o,isPage:i,initRelation:s,handleLink:r,initLifetimes:a}=t,c=Yc(e,{mocks:o,isPage:i,isPageInProject:!0,initRelation:s,handleLink:r,initLifetimes:a});!function({properties:e},t){p(t)?t.forEach((t=>{e[t]={type:String,value:""}})):M(t)&&Object.keys(t).forEach((n=>{const o=t[n];if(M(o)){let t=o.default;g(t)&&(t=t());const i=o.type;o.type=jc(i),e[n]={type:o.type,value:t}}else e[n]={type:jc(o)}}))}(c,(e.default||e).props);const u=c.methods;return u.onLoad=function(e){var t;return this.options=e,this.$page={fullPath:(t=this.route+Ee(e),function(e){return 0===e.indexOf("/")}(t)?t:"/"+t)},this.$vm&&this.$vm.$callHook(Z,e)},Nc(u,Oc),xc(u,e),function(e,t){if(!t)return;Object.keys(Le).forEach((n=>{t&Le[n]&&bc(e,n,[])}))}(u,e.__runtimeHooks),Nc(u,wc()),n&&n(c,{handleLink:r}),c}const Qc=Page,eu=Component;function tu(e){const t=e.triggerEvent,n=function(n,...o){return t.apply(e,[(i=n,k(i.replace(Te,"-"))),...o]);var i};try{e.triggerEvent=n}catch(o){e._triggerEvent=n}}function nu(e,t,n){const o=t[e];t[e]=o?function(...e){return tu(this),o.apply(this,e)}:function(){tu(this)}}Page=function(e){return nu(Z,e),Qc(e)},Component=function(e){nu("created",e);return e.properties&&e.properties.uP||(qc(e),Kc(e)),eu(e)};var ou=Object.freeze({__proto__:null,handleLink:function(e){const t=e.detail||e.value,n=t.vuePid;let o;n&&(o=Ec(this.$vm,n)),o||(o=this.$vm),t.parent=o},initLifetimes:function({mocks:e,isPage:t,initRelation:n,vueOptions:o}){return{attached(){let i=this.properties;!function(e,t){if(!e)return;const n=e.split(","),o=n.length;1===o?t._$vueId=n[0]:2===o&&(t._$vueId=n[0],t._$vuePid=n[1])}(i.uI,this);const s={vuePid:this._$vuePid};n(this,s);const r=this,a=t(r);let c=i;this.$vm=function(e,t){Wc||(Wc=Xc().$createComponent);const n=Wc(e,t);return ea(n.$)||n}({type:o,props:Hc(c,a)},{mpType:a?"page":"component",mpInstance:r,slots:i.uS||{},parentComponent:s.parent&&s.parent.$,onBeforeSetup(t,n){!function(e,t){Object.defineProperty(e,"refs",{get(){const e={};return function(e,t,n){e.selectAllComponents(t).forEach((e=>{const t=e.properties.uR;n[t]=e.$vm||e}))}(t,".r",e),t.selectAllComponents(".r-i-f").forEach((t=>{const n=t.properties.uR;n&&(e[n]||(e[n]=[]),e[n].push(t.$vm||t))})),e}})}(t,r),function(e,t,n){const o=e.ctx;n.forEach((n=>{l(t,n)&&(e[n]=o[n]=t[n])}))}(t,r,e),function(e,t){Dc(e,t);const n=e.ctx;kc.forEach((e=>{n[e]=function(...t){const o=n.$scope;if(o&&o[e])return o[e].apply(o,t)}}))}(t,n)}}),a||function(e){const t=e.$options;p(t.behaviors)&&t.behaviors.includes("uni://form-field")&&e.$watch("modelValue",(()=>{e.$scope&&e.$scope.setData({name:e.name,value:e.modelValue})}),{immediate:!0})}(this.$vm)},ready(){this.$vm&&(this.$vm.$callHook("mounted"),this.$vm.$callHook(Q))},detached(){var e;this.$vm&&(za(this.$vm.$.uid),e=this.$vm,Jc||(Jc=Xc().$destroyComponent),Jc(e))}}},initRelation:function(e,t){e.triggerEvent("__l",t)},isPage:function(e){return!!e.route},mocks:["__route__","__wxExparserNodeId__","__wxWebviewId__"]});const iu=function(e){return App(Gc(e))},su=(ru=ou,function(e){return Component(Zc(e,ru))});var ru;const au=function(e){return function(t){return Component(Yc(t,e))}}(ou),cu=function(e){Fc(Gc(e),e)},uu=function(e){const t=Gc(e),n=g(getApp)&&getApp({allowDefault:!0});if(!n)return;e.$.ctx.$scope=n;const o=n.globalData;o&&Object.keys(t.globalData).forEach((e=>{l(o,e)||(o[e]=t.globalData[e])})),Object.keys(t).forEach((e=>{l(n,e)||(n[e]=t[e])})),Fc(t,e)};wx.createApp=global.createApp=iu,wx.createPage=su,wx.createComponent=au,wx.createPluginApp=global.createPluginApp=cu,wx.createSubpackageApp=global.createSubpackageApp=uu; /*! * pinia v2.1.7 * (c) 2023 Eduardo San Martin Morote * @license MIT */ let lu;const pu=e=>lu=e,du=Symbol();function hu(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var gu,fu;(fu=gu||(gu={})).direct="direct",fu.patchObject="patch object",fu.patchFunction="patch function";const mu="undefined"!=typeof window;function _u(){const e=Vn(!0),t=e.run((()=>_i({})));let n=[],o=[];const i=li({install(e){pu(i),i._a=e,e.provide(du,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const vu=()=>{};function yu(e,t,n,o=vu){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};return!n&&Hn()&&Kn(i),i}function Iu(e,...t){e.slice().forEach((e=>{e(...t)}))}const Mu=e=>e();function Cu(e,t){e instanceof Map&&t instanceof Map&&t.forEach(((t,n)=>e.set(n,t))),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];hu(i)&&hu(o)&&e.hasOwnProperty(n)&&!mi(o)&&!si(o)?e[n]=Cu(i,o):e[n]=o}return e}const Tu=Symbol();const{assign:Su}=Object;function Eu(e,t,n={},o,i,s){let r;const a=Su({actions:{}},n),c={deep:!0};let u,l,p,d=[],h=[];const g=o.state.value[e];let f;function m(t){let n;u=l=!1,"function"==typeof t?(t(o.state.value[e]),n={type:gu.patchFunction,storeId:e,events:p}):(Cu(o.state.value[e],t),n={type:gu.patchObject,payload:t,storeId:e,events:p});const i=f=Symbol();$i().then((()=>{f===i&&(u=!0)})),l=!0,Iu(d,n,o.state.value[e])}s||g||(o.state.value[e]={}),_i({});const _=s?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{Su(e,t)}))}:vu;function v(t,n){return function(){pu(o);const i=Array.from(arguments),s=[],r=[];let a;Iu(h,{args:i,name:t,store:y,after:function(e){s.push(e)},onError:function(e){r.push(e)}});try{a=n.apply(this&&this.$id===e?this:y,i)}catch(c){throw Iu(r,c),c}return a instanceof Promise?a.then((e=>(Iu(s,e),e))).catch((e=>(Iu(r,e),Promise.reject(e)))):(Iu(s,a),a)}}const y=ei({_p:o,$id:e,$onAction:yu.bind(null,h),$patch:m,$reset:_,$subscribe(t,n={}){const i=yu(d,t,n.detached,(()=>s())),s=r.run((()=>Ss((()=>o.state.value[e]),(o=>{("sync"===n.flush?l:u)&&t({storeId:e,type:gu.direct,events:p},o)}),Su({},c,n))));return i},$dispose:function(){r.stop(),d=[],h=[],o._s.delete(e)}});o._s.set(e,y);const I=(o._a&&o._a.runWithContext||Mu)((()=>o._e.run((()=>(r=Vn()).run(t)))));for(const T in I){const t=I[T];if(mi(t)&&(!mi(C=t)||!C.effect)||si(t))s||(!g||hu(M=t)&&M.hasOwnProperty(Tu)||(mi(t)?t.value=g[T]:Cu(t,g[T])),o.state.value[e][T]=t);else if("function"==typeof t){const e=v(T,t);I[T]=e,a.actions[T]=t}}var M,C;return Su(y,I),Su(ui(y),I),Object.defineProperty(y,"$state",{get:()=>o.state.value[e],set:e=>{m((t=>{Su(t,e)}))}}),o._p.forEach((e=>{Su(y,r.run((()=>e({store:y,app:o._a,pinia:o,options:a}))))})),g&&s&&n.hydrate&&n.hydrate(y.$state,g),u=!0,l=!0,y}function ku(e,t,n){let o,i;const s="function"==typeof t;function r(e,n){const r=xs();(e=e||(r?Ns(du,null):null))&&pu(e),(e=lu)._s.has(o)||(s?Eu(o,t,i,e):function(e,t,n){const{state:o,actions:i,getters:s}=t,r=n.state.value[e];let a;a=Eu(e,(function(){r||(n.state.value[e]=o?o():{});const t=Li(n.state.value[e]);return Su(t,i,Object.keys(s||{}).reduce(((t,o)=>(t[o]=li(ta((()=>{pu(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,0,!0)}(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=s?n:t):(i=e,o=e.id),r.$id=o,r}let Du="Store";function Lu(e,t){return Array.isArray(t)?t.reduce(((t,n)=>(t[n]=function(){return e(this.$pinia)[n]},t)),{}):Object.keys(t).reduce(((n,o)=>(n[o]=function(){const n=e(this.$pinia),i=t[o];return"function"==typeof i?i.call(this,n):n[i]},n)),{})}const Ru=Lu;const Ou=Object.freeze(Object.defineProperty({__proto__:null,get MutationType(){return gu},PiniaVuePlugin:function(e){e.mixin({beforeCreate(){const e=this.$options;if(e.pinia){const t=e.pinia;if(!this._provided){const e={};Object.defineProperty(this,"_provided",{get:()=>e,set:t=>Object.assign(e,t)})}this._provided[du]=t,this.$pinia||(this.$pinia=t),t._a=this,mu&&pu(t)}else!this.$pinia&&e.parent&&e.parent.$pinia&&(this.$pinia=e.parent.$pinia)},destroyed(){delete this._pStores}})},acceptHMRUpdate:function(e,t){return()=>{}},createPinia:_u,defineStore:ku,getActivePinia:()=>xs()&&Ns(du)||lu,mapActions:function(e,t){return Array.isArray(t)?t.reduce(((t,n)=>(t[n]=function(...t){return e(this.$pinia)[n](...t)},t)),{}):Object.keys(t).reduce(((n,o)=>(n[o]=function(...n){return e(this.$pinia)[t[o]](...n)},n)),{})},mapGetters:Ru,mapState:Lu,mapStores:function(...e){return e.reduce(((e,t)=>(e[t.$id+Du]=function(){return t(this.$pinia)},e)),{})},mapWritableState:function(e,t){return Array.isArray(t)?t.reduce(((t,n)=>(t[n]={get(){return e(this.$pinia)[n]},set(t){return e(this.$pinia)[n]=t}},t)),{}):Object.keys(t).reduce(((n,o)=>(n[o]={get(){return e(this.$pinia)[t[o]]},set(n){return e(this.$pinia)[t[o]]=n}},n)),{})},setActivePinia:pu,setMapStoreSuffix:function(e){Du=e},skipHydrate:function(e){return Object.defineProperty(e,Tu,{})},storeToRefs:function(e){{e=ui(e);const t={};for(const n in e){const o=e[n];(mi(o)||si(o))&&(t[n]=Ai(e,n))}return t}}},Symbol.toStringTag,{value:"Module"}));var Au="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function bu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pu={exports:{}};Pu.exports=function(){function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(l=function(){return!!e})()}function p(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)),o}function g(e){for(var t=1;to&&(Jt({api:t,paramName:n,desc:xn("MaximumArrayLengthLog",n,o)}),1)):(Jt({api:t,paramName:n,desc:on()}),!1)}function Mn(e,t,n,o){var i=o.allowUndefined,s=o.min;return o=o.max,lt(e)?!!i||(Jt({api:t,paramName:n,desc:en()}),!1):Ke(e)?Ke(s)&&e=Math.pow(2,64)&&(Jt({api:t,paramName:n,desc:xn("NumberLessThanLog",n,"Math.pow(2,64)")}),1)):(Jt({api:t,paramName:n,desc:Qt()}),!1)}},enableMark:g({},bn)},createConversationGroup:{conversationIDList:g({},Q),groupName:g(g({},Y),{},{validator:function(e,t,n){return!(!e||32=this.TOPIC_MSG_LIMIT&&this._convM.clearMemMsg(i,!0)}}catch(a){n.e(a)}finally{n.f()}}}},{key:"pushIn",value:function(e){var t=1>(-2*s&6))))i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);try{return decodeURIComponent(escape(n))}catch(a){return""}}Go.mixin=function(e){(e=e.prototype||e)._isReady=!1,e.ready=function(e){if(e)return this._isReady?void(1=this.MAX_LENGTH&&(t=this.map.entries().next().value[0],this.map.delete(t)),this.map.set(e,1)}},{key:"has",value:function(e){return this.map.has(e)}},{key:"delete",value:function(e){this.has(e)&&this.map.delete(e)}},{key:"reset",value:function(){this.map.clear()}}]),$o=["groupID","name","avatar","type","introduction","notification","ownerID","selfInfo","createTime","infoSequence","lastInfoTime","lastMessage","nextMessageSeq","memberNum","maxMemberNum","memberList","joinOption","groupCustomField","muteAllMembers","isSupportTopic","inviteOption","_lastRevokedTime"],zo=s((function e(t){o(this,e),this.groupID="",this.name="",this.avatar="",this.type="",this.introduction="",this.notification="",this.ownerID="",this.createTime="",this.infoSequence="",this.lastInfoTime="",this.selfInfo={messageRemindType:"",joinTime:"",nameCard:"",role:"",userID:"",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:"",lastSequence:"",fromAccount:"",messageForShow:""},this.nextMessageSeq="",this.memberNum="",this.memberCount="",this.maxMemberNum="",this.maxMemberCount="",this.joinOption="",this.inviteOption="",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._lastRevokedTime=0,this._initGroup(t)}),[{key:"memberNum",get:function(){return this.memberCount},set:function(e){}},{key:"maxMemberNum",get:function(){return this.maxMemberCount},set:function(e){}},{key:"_initGroup",value:function(e){for(var t in e)$o.indexOf(t)<0||("selfInfo"!==t?("memberNum"===t&&(this.memberCount=e[t]),"maxMemberNum"===t&&(this.maxMemberCount=e[t]),"isSupportTopic"!==t?this[t]=e[t]:this.isSupportTopic=1===e[t]):this.updateSelfInfo(e[t]))}},{key:"updateGroup",value:function(e){var t=this;(e.appid=void 0,e.grossTopicNextMsgSeq=void 0,e.selfInfo&&(e.selfInfo.grossTopicReadSeq=void 0),e=JSON.parse(JSON.stringify(e))).lastMsgTime&&(this.lastMessage.lastTime=e.lastMsgTime),lt(e.muteAllMembers)||("On"===e.muteAllMembers?e.muteAllMembers=!0:e.muteAllMembers=!1),e.groupCustomField&&_t(this.groupCustomField,e.groupCustomField),lt(e.memberNum)||(this.memberCount=e.memberNum),lt(e.maxMemberNum)||(this.maxMemberCount=e.maxMemberNum),lt(e.isSupportTopic)||(this.isSupportTopic=Ke(e.isSupportTopic)?1===e.isSupportTopic:e.isSupportTopic),Qe(this,e,["members","errorCode","lastMsgTime","groupCustomField","memberNum","maxMemberNum","isSupportTopic"]),Ye(e.members)&&0e?(c.messageList=i.slice(a-e,a),c.nextReqMessageID=r?i[a-e].ID:i[a-e].sequence+""):(c.messageList=i.slice(0,a),c.isCompleted=!0):eo||n&&s.sequence>n)){if("in"===s.flow&&s.isRead)break;s.setIsRead(!0)}}},{key:"updateUnreadCount",value:function(e){var t,n=!(1i&&e.sequence<=o:e.sequence>i&&e.sequencei&&e.length<60?r._recursiveGetMsgList(e,t,n,o,i,s):r._emitMsgReceived(t,e)}))}},{key:"_emitMsgReceived",value:function(e,t){var n,o,i=this;0=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):e._checkCountMap.set(n,++o)}))}},{key:"onNewGroupTips",value:function(e){Oe.l("".concat(this._n,".onNewGroupTips options:").concat(JSON.stringify(e.dataList)));var t=(e=this._assembly(e)).eventDataList,n=e.result;0<(e=e.AVChatRoomMessageList).length&&this._grpM.onAVChatRoomMessage(e),0=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):e._checkCountMap.set(n,++o)}))}},{key:"updateLastMsg",value:function(e){var t="".concat(this._n,".updateLastMsg");if(0!==this._grpM.getGroupMap().size){for(var n,o,i,s,r=!1,a=e.length,c=0;c=this.CACHE_EXPIRE_TIME||r=this.EXPIRE_TIME?this._getRemoteGroupCounters({groupID:o,avChatRoomKey:s}).then((function(e){return r.setMoreMessage("from remote. count:".concat(e.length)).end(),Oe.l("".concat(n," from remote. groupID:").concat(o)),Cn({counters:e=t._getLocalCounters(o,i)})})).catch((function(e){return r.setError(e).end(),Sn(e)})):(r.setMoreMessage("from cache").end(),Oe.l("".concat(n," from cache. groupID:").concat(o)),Tn({counters:e=this._getLocalCounters(o,i)}))}},{key:"_getRemoteGroupCounters",value:function(e){var t=this;return this._grpM.req({P:jn.GET_GRP_COUNTER,data:g({},e)}).then((function(n){var o=void 0===(o=(n=n.data).counterList)?[]:o;return n=n.groupCounterSeq,t._updateLocalGroupCounters({groupID:e.groupID,counterList:o,groupCounterSeq:n}),Oe.l("".concat(t._n,"._getRemoteGroupCounters ok. groupID:").concat(e.groupID)),o})).catch((function(e){return Sn(e)}))}},{key:"_convertObjectToList",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_updateGroupCounters",value:function(e){var t="".concat(this._n,"._updateGroupCounters"),n=e.groupID,o=e.avChatRoomKey,i=e.mode;return Oe.l("".concat(t,". groupID:").concat(n," avChatRoomKey:").concat(o," mode:").concat(i)),this._grpM.req({P:jn.UPDATE_GRP_COUNTER,data:g({},e)}).then((function(e){Oe.l("".concat(t," ok.")),e=e.data.counterList;var n={};return(void 0===e?[]:e).forEach((function(e){var t=e.key;e=e.value,n[t]=e})),n})).catch((function(e){return Sn(e)}))}},{key:"_hasLocalGroupCounters",value:function(e){return this._groupCountersMap.has(e)}},{key:"_getLocalGroupCounters",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:"_updateLocalGroupCounters",value:function(e){var t,n,o,i=e.groupID,s=void 0===(s=e.counterList)?[]:s;e=e.groupCounterSeq,this._hasLocalGroupCounters(i)&&(o=this._getLocalGroupCounters(i),t=o.counters,n=o.avChatRoomKey,o=o.groupCounterSeq,0this._startBroadcastSeq&&(this._startBroadcastSeq=a),Ye(s)&&01e3*t.expireTime&&1e4=i&&t.messageList.push(e)})),(Ct({groupID:n})||Tt(n))&&0===t.messageList.length&&s[0].sequencei.nextMessageSeq&&(i.updateNextMessageSeq(n),i.updateLastMessage(e),i.updateSelfInfo({readedSequence:t}),i.updateUnreadCount(0),this.emitOEvt(T.TOPIC_UPDATED,{groupID:o,topic:i}))}},{key:"onMessageModified",value:function(e){var t,n=e.to,o=e.time,i=e.sequence,s=e.elements,r=e.cloudCustomData,a=e.messageVersion,c=Gt(n),u=this.getLocalTopic(c,n);u&&(t=u.lastMessage,Oe.d("".concat(this._n,".onMessageModified topicID:").concat(n," lastMessage:"),JSON.stringify(t),"options:",JSON.stringify(e)),t)&&(null===t.payload||t.lastTime===o&&t.lastSequence===i&&t.version!==a)&&(t.type=s[0].type,t.payload=s[0].content,t.messageForShow=Ft(t.type,t.payload,this.isIntl()),t.cloudCustomData=r,t.version=a,t.lastSequence=i,t.lastTime=o,this.emitOEvt(T.TOPIC_UPDATED,{groupID:c,topic:u}))}},{key:"onMessageRevoked",value:function(e){var t,n,o,i=this;0!==e.length&&(n=t=null,o=!1,e.forEach((function(e){var s=e.to;n=Gt(s),(t=i.getLocalTopic(n,s))&&(t.reduceUnreadCount()&&(o=!0),t.isLastMessageRevoked(e)&&(t.setLastMessageRevoked(!0),t.setLastMessageRevoker(e.revoker),o=!0),(s=t.selfInfo.excludedUnreadSequenceList||[]).push(e.sequence),t.updateSelfInfo({excludedUnreadSequenceList:s}))})),o)&&this.emitOEvt(T.TOPIC_UPDATED,{groupID:n,topic:t})}},{key:"isLastMessageRevoked",value:function(e){var t=e.topicID,n=(e=e.sequence,Gt(t));return n=this.getLocalTopic(n,t),t=!1,n?n.isLastMessageRevoked({sequence:e}):t}},{key:"updateUnreadCountAndLastMsg",value:function(e,t,n){var o,i=Gt(e),s=this.getLocalTopic(i,e);s&&(o=s.selfInfo.excludedUnreadSequenceList||[],lt(n)||(o=n),t._isExcludedFromUnreadCount&&o.push(t.sequence),s.updateSelfInfo({excludedUnreadSequenceList:o}),Oe.l("".concat(this._n,".updateUnreadCountAndLastMsg seq:").concat(t.sequence," lastSeq:").concat(s.lastMessage.lastSequence)),t.sequence>s.lastMessage.lastSequence)&&(s.updateLastMessage(t),n=t.sequence+1,s.updateNextMessageSeq(n),o=this._computeUnreadCount(s),s.updateUnreadCount(o),(t=this.get(11).getLocalConversation("".concat(S.CONV_GROUP).concat(e)))&&t.updateUnreadCount({nextUnreadCount:o,isFromGetConversations:!0}),this.emitOEvt(T.TOPIC_UPDATED,{groupID:i,topic:s}))}},{key:"getJoinedCommunityList",value:function(){return this.get(7).syncCommunityWithTopic()}},{key:"createTopicInCommunity",value:function(e){var t,n=this,o="".concat(this._n,".").concat("createTopicInCommunity"),i=e.topicID;return lt(i)||Tt(i)?e.topicName&&!1===this._filterProfanity("topicName",e)||e.introduction&&!1===this._filterProfanity("introduction",e)||e.notification&&!1===this._filterProfanity("notification",e)?Sn({code:qn.PROFANITY_FOUND}):(t=new io("createTopicInCommunity"),this.req({P:jn.CREATE_TOPIC,data:g({},e)}).then((function(i){return i=i.data.topicID,t.setMessage("topicID:".concat(i)).end(),Oe.l("".concat(o," ok. topicID:").concat(i)),n._updateTopicMap([g(g({},e),{},{topicID:i})]),Cn({topicID:i})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)}))):Sn({code:qn.ILLEGAL_TOPIC_ID})}},{key:"deleteTopicFromCommunity",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteTopicFromCommunity"),o=e.groupID,i=(e=void 0===(e=e.topicIDList)?[]:e,new io("deleteTopicFromCommunity"));return i.setMessage("groupID:".concat(o," topicIDList:").concat(e)),this.req({P:jn.DEL_TOPIC,data:{groupID:o,topicIDList:e}}).then((function(e){e=e.data.resultList;var s=[],r=[];return(void 0===e?[]:e).forEach((function(e){var t=e.topicID,n=e.errorCode;e=e.errorInfo,0===n?s.push({topicID:t}):r.push({topicID:t,code:n,message:e})})),e="success count:".concat(s.length,", fail count:").concat(r.length),i.setMoreMessage(e).end(),Oe.l("".concat(n," ok. ").concat(e)),s.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),Cn({successTopicList:s,failureTopicList:r})})).catch((function(e){return i.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"updateTopicProfile",value:function(e){var t,n=this,o="".concat(this._n,".").concat("updateTopicProfile");return Oe.l("".concat(o," options:"),e),e.topicName&&!1===this._filterProfanity("topicName",e)||e.introduction&&!1===this._filterProfanity("introduction",e)||e.notification&&!1===this._filterProfanity("notification",e)?Sn({code:qn.PROFANITY_FOUND}):((t=new io("updateTopicProfile")).setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),lt(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?"On":"Off"),this.req({P:jn.UPDATE_TOPIC_PROFILE,data:g({},e)}).then((function(){return t.end(),Oe.l("".concat(o," ok")),n._updateTopicMap([e]),Cn({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)})))}},{key:"getTopicList",value:function(e){var t=this,n="".concat(this._n,".").concat("getTopicList"),o=e.groupID,i=0===(e=void 0===(e=e.topicIDList)?[]:e).length,s=new io("getTopicList");if(s.setMessage("groupID:".concat(o)),this._getTopicTimeMap.has(o)){var r=(a=this._getTopicTimeMap.get(o)).isGetAll,a=a.time;if((r||!r&&!i)&&Date.now()-a<1e3*this.TOPIC_CACHE_TIME&&(r=this._getLocalTopicList(o,e),i||r.length===e.length))return s.setMoreMessage("from cache, topic count:".concat(r.length)).end(),Oe.l("".concat(n," groupID:").concat(o," from cache, topic count:").concat(r.length)),Tn({successTopicList:r,failureTopicList:[]})}return this.req({P:jn.GET_TOPIC_LIST,data:{groupID:o,topicIDList:e}}).then((function(e){e=e.data.topicInfoList;var r=[],a=[],c=[];return(void 0===e?[]:e).forEach((function(e){var t=e.topic,n=e.selfInfo,o=e.errorCode,i=(e=e.errorInfo,t.topicID);0===o?(r.push(g(g({},t),{},{selfInfo:n})),a.push(i)):c.push({topicID:i,code:o,message:e})})),t._updateTopicMap(r),t._handleTopicAtInfo(r),e="success count:".concat(a.length,", fail count:").concat(c.length),s.setMoreMessage(e).end(),Oe.l("".concat(n," groupID:").concat(o," from remote, ").concat(e)),e=[],qe(a)||(t._getTopicTimeMap.set(o,{time:Date.now(),isGetAll:i}),e=t._getLocalTopicList(o,a)),Cn({successTopicList:e,failureTopicList:c})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"hasLocalTopic",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:"getLocalTopic",value:function(e,t){var n=null;return this._topicMap.has(e)?this._topicMap.get(e).get(t):n}},{key:"_getLocalTopicList",value:function(e){var t=1this.MAX_QUERY_USER_COUNT&&(Oe.w("".concat(t," ").concat(jt(this.MAX_QUERY_USER_COUNT))),o=n.slice(0,this.MAX_QUERY_USER_COUNT));var r=new io("getUserStatus");return this._userM.req({P:jn.GET_USER_STATUS,data:{userIDList:o}}).then((function(e){var o=void 0===(o=(e=e.data).successUserList)?[]:o,s=(e=void 0===(e=e.failureUserList)?[]:e,o=o.map((function(e){return{userID:e.userID,statusType:e.statusType,customStatus:qo(e=e.customStatus)}})),e=e.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode;return e=e.errorInfo,{userID:qe(n)?t:n,code:o,message:e}})),lt(i)||o.unshift(i),"userID count:".concat(n.length,", success count:").concat(o.length,", fail count:").concat(e.length));return r.setMessage("".concat(s)).end(),Oe.l("".concat(t," ok. ").concat(s,".")),Cn({successUserList:o,failureUserList:e})})).catch((function(e){return r.setMessage("userID count:".concat(n.length)).setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"subscribeUserStatus",value:function(e){var t,n,o,i,s="subscribeUserStatus";return this._userM.canIUse(N.USER_STATUS)?(t="".concat(this._n,".").concat(s),(n=v(e=void 0===(e=e.userIDList)?[]:e)).length>this.MAX_SUBSCRIBE_USER_COUNT&&(Oe.w("".concat(t," ").concat(jt(this.MAX_SUBSCRIBE_USER_COUNT))),n=e.slice(0,this.MAX_SUBSCRIBE_USER_COUNT)),o=new io(s),i="userID count:".concat(e.length),Oe.l("".concat(t," ").concat(i)),this._userM.req({P:jn.SUB_USER_STATUS,data:{userIDList:n}}).then((function(e){return e=(void 0===(e=e.data.failureUserList)?[]:e).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode;return e=e.errorInfo,{userID:qe(n)?t:n,code:o,message:e}})),o.setMessage("".concat(i," fail count:").concat(e.length)).end(),Oe.l("".concat(t," ok. fail count:").concat(e.length,".")),Cn({failureUserList:e})})).catch((function(e){return o.setMessage(i).setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._userM.noUse(s)}},{key:"unsubscribeUserStatus",value:function(e){var t,n,o,i,s="unsubscribeUserStatus";return this._userM.canIUse(N.USER_STATUS)?(t="".concat(this._n,".").concat(s),n=v(e=void 0===(e=(e||{}).userIDList)?[]:e),e.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(Oe.w("".concat(t," ").concat(jt(this.MAX_UNSUBSCRIBE_USER_COUNT))),n=e.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT)),o=new io(s),i="userID count:".concat(e.length),Oe.l("".concat(t," ").concat(i)),e={userIDList:n},0===n.length&&(e.userIDList=void 0,e.unsubscribeAll=1),this._userM.req({P:jn.UNSUB_USER_STATUS,data:e}).then((function(e){return e=(void 0===(e=e.data.failureUserList)?[]:e).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode;return e=e.errorInfo,{userID:qe(n)?t:n,code:o,message:e}})),o.setMessage("".concat(i," fail count:").concat(e.length)).end(),Oe.l("".concat(t," ok. fail count:").concat(e.length,".")),Cn({failureUserList:e})})).catch((function(e){return o.setMessage("".concat(i)).setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._userM.noUse(s)}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),yi=(u(Si,Pn),s(Si,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"mockOnNickAvatarModified",value:function(e,t){Oe.l("".concat(this._n,"._mockOnNickAvatarModified nick:").concat(e," avatar:").concat(t)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:be.NICK,value:e},{tag:be.AVATAR,value:t}]}]})}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(e){var t,n;qe(e=e.dataList)||(t=[],e.forEach((function(e){e.blackListDelAccount&&t.push.apply(t,v(e.blackListDelAccount))})),0=this.MIN_THRESHOLD)&&this._report()}},{key:"onCheckTimer",value:function(){Date.now()n.MAX_THRESHOLD&&n._flushAtOnce()}))):this._lastReportTime=Date.now())}},{key:"_flushAtOnce",value:function(){var e=this.get(13),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o="".concat(this._n,"._flushAtOnce");qe(t)?(Oe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1)):((n=n.concat(t)).length>this.MAX_THRESHOLD&&(n=n.slice(0,this.MAX_THRESHOLD)),Oe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1))}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}])),Pi="none",Ni="online",xi=s((function e(t){o(this,e),this._m=t,this._networkType=Ni,this._n="NetMonitorModule",this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null,this._removeListener=null,this._m.getIEmitInst().on(xo.A2KEY_AND_TINYID_UPDATED,this._startRN,this)}),[{key:"_startRN",value:function(){var e,t=this;ee&&(e=this._m.get(18).getPlugin("chat-network-monitor"))&&(this._removeListener=e.addEventListener((function(e){var n=e.isConnected;e=e.type,t._networkType!==e&&t._onNetworkStatusChange({isConnected:void 0!==n&&n,networkType:e})})))}},{key:"start",value:function(){var e=this,t="".concat(this._n,".start");Z?(ne.getNetworkType({success:function(n){e._networkType=n.networkType||n.subtype||"",n.networkType===Pi?Oe.w("".concat(t," no network, please check!")):Oe.i("".concat(t," networkType:").concat(n.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),ne.onNetworkStatusChange(this._mpNetworkStatusCallback)):te&&(this._networkType=Ni,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:Ni})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:Pi})}},{key:"_onNetworkStatusChange",value:function(e){var t=e.isConnected,n=(e=e.networkType,"".concat(this._n,"._onNetworkStatusChange")),o=!1,i="previous:".concat(this._networkType," current:").concat(e);t?(Oe.i("".concat(n," ").concat(i)),this._networkType!==e&&(o=!0,this._networkType=e,this._m.get(21).reConnect(!0))):this._networkType!==e&&(o=!0,this._networkType=e,Oe.w("".concat(n," no network, please check!")),this._m.get(21).offline()),o&&new io("networkChange").setMessage("isConnected:".concat(t," ").concat(i)).end()}},{key:"isOnline",value:function(){return this._networkType!==Pi}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),Z?null!==this._mpNetworkStatusCallback&&(ne.offNetworkStatusChange&&ne.offNetworkStatusChange(this._mpNetworkStatusCallback),this._mpNetworkStatusCallback=null):te?(null!==this._webOnlineCallback&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null)):ee&&this._removeListener&&(this._removeListener(),this._removeListener=null)}}]);function wi(e){o(this,wi),(e=n(this,wi,[e]))._n="EventStatModule",e.TAG="im-ssolog-event",e._reportBody=new Ai,e.MIN_THRESHOLD=20,e.MAX_THRESHOLD=100,e.WAITING_TIME=6e4,e.REPORT_LEVEL=[4,5,6],e.REPORT_SDKAPPID_BLACKLIST=[],e.REPORT_TINYID_WHITELIST=[],e._lastReportTime=Date.now();var t=e.getIEmitInst();return t.on(xo.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,e),t.on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function Ui(e,t){return e(t={exports:{}},t.exports),t.exports}var Gi=Ui((function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,o,s,r){if("function"!=typeof o)throw new TypeError("The listener must be a function");return o=new i(o,s||e,r),s=n?n+t:t,e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function a(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,o,i=[];if(0===this._eventsCount)return i;for(o in e=this._events)t.call(e,o)&&i.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){e=n?n+e:e;var t=this._events[e];if(!t)return[];if(t.fn)return[t.fn];for(var o=0,i=t.length,s=new Array(i);o=this.cosOptions.expiredTime-120&&this._getAuthorizationKey()}},{key:"getFileDNList",value:function(){return this._fileDNList}},{key:"_getAuthorization",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(!0===e._relayFlag)return Promise.resolve();var t=this.get(26);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(Jn),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(Jn),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(Jn),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(Jn),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var t=this,n=this.get(2),o=e.getElements()[0],i=n.getMessageOption(e.clientSequence);return this.doUploadImage({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(o.updatePercent(e),Je(i.onProgress))try{i.onProgress(e)}catch(t){return Sn({code:qn.MSG_ONPROGRESS_ERR})}}}).then((function(n){var i=n.location,s=n.fileType,r=n.fileSize,a=n.width,c=n.height,u=n.smallImageUrl,l=n.smallImageWidth,p=n.smallImageHeight,d=n.largeImageUrl,h=n.largeImageWidth,f=n.largeImageHeight,m=n.imageInfoArray;n=t.isPrivateNetWork()?i:rt(i),o.updateImageFormat(s);var _,v,y={size:r,url:n,width:a,height:c};if(m&&0this.UPLOAD_SIZE_LIMIT.F?this._checkSizeError("F"):0===e.file.files[0].size?Sn({code:qn.MSG_F_IS_EMPTY}):(this._setUploadFileType(255),this.uploadByCOS(e))}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError("V"):0===e.file.videoFile.size?Sn({code:qn.MSG_F_IS_EMPTY}):-1===jo.indexOf(e.file.videoFile.type)?Sn({code:qn.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(2),Z||ee?this.handleVideoUpload(g(g({},e),{},{file:e.file.videoFile})):te?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new Bn({code:qn.MSG_V_UPLOAD_FAIL}))}))}))}))}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError("A"):0===e.file.size?Sn({code:qn.MSG_F_IS_EMPTY}):(this._setUploadFileType(3),this.uploadByCOS(e)):Sn({code:qn.MSG_A_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(e){var t,n,o,i,s=this;return Je(this._cosUploadMethod)?this.timUploadPlugin?this._uploadWithPreSigUrl(e):(t=new io("upload"),n="".concat(this._n,".uploadByCOS"),o=Date.now(),i=this._getFile(e),new Promise((function(r,a){var c=Z?s._createCosOptionsWXMiniApp(e):s._createCosOptionsWeb(e),u=s;s._cosUploadMethod(c,(function(e,c){var l,p,d=Object.create(null);c?e||Ye(c.files)&&c.files[0].error?(l=new Bn({code:qn.MSG_F_UPLOAD_FAIL}),t.setError(l).end(),Oe.l("".concat(n," failed. error:"),c.files[0].error),403===c.files[0].error.statusCode&&s._getAuthorizationKey(),a(l)):(d.fileName=i.name,d.fileSize=i.size,d.fileType=i.type.slice(i.type.indexOf("/")+1).toLowerCase(),d.location=(Z?c:c.files[0].data).Location,l=Date.now()-o,c=u._formatFileSize(i.size),p=u._formatSpeed(1e3*i.size/l),c="size:".concat(c," time:").concat(l,"ms speed:").concat(p),Oe.l("".concat(n," success. name:").concat(i.name," ").concat(c)),r(d),(p=s.get(26)).addCost(Jn,l),p.addFileSize(Jn,i.size),t.setMessage(c).end()):(d=new Bn({code:qn.MSG_F_UPLOAD_FAIL}),t.setError(d).end(),Oe.w("".concat(n," failed. error:"),e),403===e.statusCode&&s._getAuthorizationKey(),a(d))}))}))):(this.warn("PluginUndetected"),Sn({code:qn.COS_UNDETECTED}))}},{key:"_uploadWithPreSigUrl",value:function(e){var t=this,n="".concat(this._n,"._uploadWithPreSigUrl"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(i,s){var r=new io("upload"),a=e.requestSnapshotUrl,c=void 0===a?void 0:a,u=f(e,Bi),l=Date.now();t._cosUploadMethod(u,(function(a,p){if(a||403===p.statusCode)r.setError(new Bn(a)).end(),h={HttpStatusCode:9999,CostTime:$t(l,!1),error:a,url:e.url},p.data&&p.data.uploadIP&&(h.uploadIP=p.data.uploadIP),t._uploadSSOLog(h),Oe.l("".concat(n," failed, error:"),a),s(new Bn({code:qn.MSG_F_UPLOAD_FAIL}));else{var d=Object.create(null),h=p.data.location||"",g=(t.isPrivateNetWork()||0!==h.indexOf("https://")&&0!==h.indexOf("http://")||(h=h.split("//")[1]),d.fileName=o.name,d.fileSize=o.size,d.fileType=o.type.slice(o.type.indexOf("/")+1).toLowerCase(),d.location=h,a=$t(l,!1),h=t._formatFileSize(o.size),t._formatSpeed(1e3*o.size/a));if(h="size:".concat(h," time:").concat(a,"ms speed:").concat(g," res:").concat(JSON.stringify(p.data)),Oe.l("".concat(n," ok. name:").concat(o.name," ").concat(h)),r.setMessage(h).end(),g={HttpStatusCode:p.statusCode,FileSize:o.size,CostTime:a,url:e.url},(p.data&&p.data.uploadIP&&(g.uploadIP=p.data.uploadIP),t._uploadSSOLog(g),h=t.get(26)).addCost(Jn,a),h.addFileSize(Jn,o.size),g=[],u.thumbUrl&&u.largeUrl&&g.push.apply(g,[t._getSmallImageInfoByUrl(u.thumbUrl,d),t._getLargeImageInfoByUrl(u.largeUrl,d)]),1===t.uploadFileType&&t.isSimpleCos&&!t.isPrivateNetWork()&&(g.push(t._getImageInfoArray(u.downloadUrl,d)),p.data.uploadIP)&&g.push(t._getDownloadIP(u.downloadUrl.split("//")[1].split("/")[0],d)),c&&g.push(t._getSnapshotInfoByUrl(c,d)),0>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533;else t<=57343&&(t=65533);return t<=2047?ls(192|t>>>6,128|63&t):ls(224|t>>>12,128|t>>>6&63,128|63&t)},ds=function(e){for(var t=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,ps),n=0|t.length,o=new Uint8Array(n),i=0;i=s&&(Oe.l("".concat(e._n,"._checkPromiseMap request timeout, delete requestID:").concat(n)),e._promiseMap.delete(n),o(new Bn({code:qn.NETWORK_TIMEOUT,data:{headSeq:t}})),e._chM.onRequestTimeout())}))}},{key:"_checkNativeAppWS",value:function(){W&&!this.isConnected()&&this._reConnect()}},{key:"onOpen",value:function(e){var t,n;this._readyState!==vs&&(this._onOpenTs=Date.now(),n=e.id,e=e.res,this._socketID=n,t=$t(this._startTs,!1),n="socketID:".concat(n," res:").concat(e),Oe.l("".concat(this._n,"._onOpen cost:").concat(t," ms. ").concat(n)),new io("wsOnOpen").setMessage(t).setCostTime(t).setMoreMessage(n).end(),this._readyState=ms,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._chM.onReconnected(),this._reConnectFlag=!1),this._chM.onOpen())}},{key:"onClose",value:function(e){var t=new io("wsOnClose"),n=e.id,o=(e=e.e,"sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID," code:").concat(e.code," reason:").concat(e.reason)),i=0;0!==this._onOpenTs&&(i=Date.now()-this._onOpenTs),t.setMessage(i).setCostTime(i).setMoreMessage(o).setCode(e.code).end(!0),Oe.l("".concat(this._n,"._onClose ").concat(o," onlineTime:").concat(i)),n===this._socketID&&(this._readyState=vs,i<1e3?this._chM.onReconnectFailed():this._chM.onClose())}},{key:"onError",value:function(e){var t=e.id,n=(e=e.e,"sourceSocketID:".concat(t," currentSocketID:").concat(this._socketID));new io("wsOnError").setMessage(e.errMsg||JSON.stringify(e,["message","code"])).setMoreMessage(n).setLevel("error").end(!0),Oe.w("".concat(this._n,"._onError"),e,n),t===this._socketID&&(this._readyState=vs,this._chM.onError())}},{key:"onMessage",value:function(e){var t,n,o,i,s,r;try{t=JSON.parse(e.data)}catch(a){new io("jsonParseError").setMessage(e.data).end()}t&&t.head&&(e=this._getRequestIDFromHead(t.head),n=t.body,this._chM.get(30).isTRTCCommand(e)||(r=Nt(t.head),n=function e(t,n){var o,i,s;return Ye(t)?t.map((function(t){return $e(t)?e(t,n):t})):$e(t)?(o=t,i=function(e,t){return lt(n[t])?as(t):n[t]},s={},Object.keys(o).forEach((function(e){s[i(o[e],e)]=o[e]})),Dt(s,(function(t){return Ye(t)||$e(t)?e(t,n):t}))):void 0}(t.body,this._getResKeyMap(r))),Oe.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(n)," requestID:").concat(e," has:").concat(this._promiseMap.has(e))),this._setNextPingTs(),this._promiseMap.has(e)?(o=(r=this._promiseMap.get(e)).resolve,i=r.reject,s=r.timestamp,r=r.headSeq,this._promiseMap.delete(e),this._calcRTT(s),n.errorCode&&0!==n.errorCode?(this._chM.onErrorCodeNotZero(n),i(new Bn({code:n.errorCode,message:n.errorInfo||"",data:e.includes(jn.MODIFY_C2C_MSG)||e.includes(jn.MODIFY_GRP_MSG)?{elements:n.elements,messageVersion:n.messageVersion,cloudCustomData:n.cloudCustomData,headSeq:r}:{headSeq:r}}))):o(Cn(n))):this._chM.onMessage({head:t.head,body:n}))}},{key:"_calcRTT",value:function(e){e=Date.now()-e,this._chM.get(26).addRTT(e)}},{key:"_connect",value:function(){this._readyState!==_s&&this._readyState!==ms&&(this._startTs=Date.now(),this._onOpenTs=0,this._readyState=_s,this._socket=new hs(this),this._socketID=this._socket.getID(),Oe.l("".concat(this._n,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new io("wsConnect").setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end())}},{key:"getURL",value:function(){this._chM.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=Ot(),t=((z||V&&"windows"===e||W)&&(this._canIUseBinaryFrame=!1),-1),n=("ios"===e?t=re||-1:"android"===e&&(t=ce||-1),this._chM.get(12)),o=this._chM.getPlatform(),i=n.getSDKAppID();return n=n.getInstanceID(),i="sdkappid=".concat(i,"&instanceid=").concat(n,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(e)+"&version=".concat(t,"&sdkversion=").concat("3.5.5"),j&&(i+="&isminigame=1"),this._chM.canIUseInflate()&&(i+="&compress=gzip"),(this._canIUseBinaryFrame?"".concat(this._url,"/binfo?"):"".concat(this._url,"/info?")).concat(i)}},{key:"_closeConnection",value:function(e){Oe.l("".concat(this._n,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=vs)}},{key:"_resend",value:function(){var e=this;if(Oe.l("".concat(this._n,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),0>>=1:o=o>>>1^3988292384}return(4294967295^o)>>>0}},{key:"close",value:function(){Oe.l("".concat(this._n,".close")),this._closeConnection(4e3),this._promiseMap.clear(),this._startSequence=ot(),this._readyState=vs,this._simpleRequestMap.clear(),this._reConnectFlag=!1,this._reConnectCount=0,this._onOpenTs=0,this._url="",this._random=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0}}]),Is=function(e,t,n){return new Promise((function(o,i){var s,r,a="application/x-www-form-urlencoded;charset=UTF-8";Z?ne.request({url:t,data:n,method:e,timeout:3e3,header:{"content-type":a},success:function(e){e&&e.data&&e.data.NetCheckInfo&&Oe.l("".concat("getconninfo ok in"," miniapp. ret:"),e.data),o()},fail:function(){i(new Bn({code:qn.NETWORK_ERROR}))}}):(s=new XMLHttpRequest,r=setTimeout((function(){s.abort(),i(new Bn({code:qn.NETWORK_TIMEOUT}))}),3e3),s.onreadystatechange=function(){4===s.readyState&&(r&&clearTimeout(r),200===s.status||304===s.status?(s.responseText&&-1=this._socketHandler.getNextPingTs()&&this._ping()}},{key:"dealloc",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),-1>>30-e)}function xs(e,t){for(var n=e.toString(16),o=t-n.length,i="0";0>>=1,i+=i)1&o&&(n=i+n);return n}u(Dr,Pn);var ws=s(Dr,[{key:"_init",value:function(){this._updateCmdFreqLimitMap(Ds)}},{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("cmd_frequency_limit");lt(e)||(e=JSON.parse(e),this._updateCmdFreqLimitMap(e))}},{key:"_updateCmdFreqLimitMap",value:function(e){var t=this;e.forEach((function(e){t._cmdFreqLimitMap.set(e.cmd,{interval:e.interval,count:e.count})}))}},{key:"updateProtocolConfig",value:function(){this._pHandler.update()}},{key:"req",value:function(e){Oe.d("".concat(this._n,".req options:"),e);var t,n,o=e.P;return this._pHandler.has(o)?(t=(e=this.getProtocolData(e)).head.servcmd,this._isFreqOverLimit(t)?Sn({code:n=qn.OVER_FREQUENCY_LIMIT,message:this.getErrMsg(n,this._getCmd(t))}):this._isServerOverload(t)?Sn({code:n=qn.OPEN_SERVICE_OVERLOAD_ERROR,message:this.getErrMsg(n,this._getCmd(t))}):(n=this.get(21),Es.includes(o)?n.simplySend(e):n.send(e))):(Oe.w("".concat(this._n,".req unknown P:").concat(o)),Sn({code:qn.NO_PROTOCOL}))}},{key:"getKeyMap",value:function(e){return this._pHandler.getKeyMap(e)}},{key:"genCommonHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:A,websdkversion:O,a2:e.getA2Key()||void 0,tinyid:e.getTinyID()||void 0,status_instid:e.getStatusInstanceID(),sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getA2Key()?void 0:e.getUserID(),usersig:e.getA2Key()?void 0:e.getUserSig(),sdkability:75689843,sdkability_ext:Ps(""),cappid:e.getApplicationID(),cs:0}}},{key:"genCosSpecifiedHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:A,websdkversion:O,sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getUserID(),usersig:e.getUserSig(),status_instid:e.getStatusInstanceID(),sdkability:75689843,sdkability_ext:Ps(""),cappid:e.getApplicationID(),cs:0}}},{key:"genSSOReportHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:A,websdkversion:O,sdkappid:e.getSDKAppID(),contenttype:"",reqtime:0,identifier:"",usersig:"",status_instid:e.getStatusInstanceID(),sdkability:75689843,sdkability_ext:Ps(""),cappid:e.getApplicationID(),cs:0}}},{key:"getProtocolData",value:function(e){return this._pHandler.getProtocolData(e)}},{key:"trans",value:function(e){var t=e.servcmd;return e=e.data,t={head:g(g({},this.genCommonHead()),{},{servcmd:t}),body:e},this.get(21).send(t)}},{key:"sendComboMessage",value:function(e){var t=e.servcmd;return e=e.data,t={head:g(g({},this.genCommonHead()),{},{servcmd:t}),body:e},this.get(21).send(t)}},{key:"onErrorCodeNotZero",value:function(e){var t,n=e.errorCode;n===qn.HELLO_ANSWER_KICKED_OUT&&(t=e.kickType,e=void 0===(e=e.newInstanceInfo)?{}:e,1===t?this.onMultipleAccountKickedOut(e):2===t?this.onMultipleDeviceKickedOut(e):3===t&&this.onRestApiKickedOut(e)),n!==qn.MSG_A2KEY_EXPIRED&&n!==qn.ACCOUNT_A2KEY_EXPIRED||(this._onUserSigExpired(),this.get(21).reConnect())}},{key:"onMessage",value:function(e){var t=(n=e.body).needAck,n=n.sessionData;1===(void 0===t?0:t)&&this._sendACK(n),this._msgDispatcher.onMessage(e)}},{key:"onReconnected",value:function(e){this._incrementalPullContactFlag=e<=300,this._reLoginOnReconnected()}},{key:"reLoginOnKickOther",value:function(){Oe.l("".concat(this._n,".reLoginOnKickOther")),this._reLogin()}},{key:"_reLoginOnReconnected",value:function(){Oe.l("".concat(this._n,"._reLoginOnReconnected")),this._reLogin()}},{key:"_reLogin",value:function(){var e,t,n,o=this,i="".concat(this._n,"._reLogin");this.isLoggedIn()&&(e=0,(t=this.get(1).getPushModule())&&(e=t.getUniAppPlatform()),n=new io("reLogin"),this.req({P:jn.LOGIN,data:{isWebUniapp:e,customInfo:this.get(12).getCustomLoginInfo()}}).then((function(e){var t=(e=e.data).instanceID,s=(e=e.customStatus,o.get(12)),r=qo(e),a=(s.setStatusInstanceID(t),o.get(21)),c=a.getSocketID();c="socketID:".concat(c," instanceID:").concat(t," customStatus:").concat(r),n.setMessage(c).end(!0),Oe.l("".concat(i," ok. ").concat(c)),s.getCustomStatus()!==r&&o.get(4).onUserStatusUpdated({dataList:[{to:o.getMyUserID(),statusType:S.USER_STATUS_ONLINE,customStatus:e}]}),a.diagnose(),o.get(11).syncConvList(o._incrementalPullContactFlag).then((function(){Oe.l("".concat(i,", sync conv list ok.")),o.get(25).start()})),((t=o.get(7))&&t.updateLocalMainSequenceOnReconnected(),c=o.get(10)).resetGetTopicTime(),c.getTopicListOnReconnected(),(s=o.get(35))&&s.clearCacheOnReconnected(),(r=o.get(8))&&r.updateCacheOnReconnected()})))}},{key:"onMultipleAccountKickedOut",value:function(e){this.get(1).onMultipleAccountKickedOut(e)}},{key:"onMultipleDeviceKickedOut",value:function(e){this.get(1).onMultipleDeviceKickedOut(e)}},{key:"_onUserSigExpired",value:function(){this.get(1).onUserSigExpired()}},{key:"onRestApiKickedOut",value:function(e){this.get(1).onRestApiKickedOut(e)}},{key:"_sendACK",value:function(e){this.req({P:jn.MSG_PUSH_ACK,data:{sessionData:e}})}},{key:"_isFreqOverLimit",value:function(e){var t,n,o,i;return e=e.split(".")[1],!!this._cmdFreqLimitMap.has(e)&&(!this._cmdReqInfoMap.has(e)||(t=(n=this._cmdFreqLimitMap.get(e)).count,n=n.interval,o=(i=this._cmdReqInfoMap.get(e)).startTime,i=i.requestCount,Date.now()-o>1e3*n)?(this._cmdReqInfoMap.set(e,{startTime:Date.now(),requestCount:1}),!1):(this._cmdReqInfoMap.set(e,{startTime:o,requestCount:i+=1}),t=this._expiredTime}},{key:"fetchConfig",value:function(){var e,t=this,n="".concat(this._n,".fetchConfig"),o=this._canFetch();Oe.l("".concat(n," canFetch:").concat(o)),o&&(e=new io("fetchCloudCtrlConfig"),o=this.get(12).getSDKAppID(),this._isFetching=!0,this.req({P:jn.FETCH_CLOUD_CTRL_CONFIG,data:{SDKAppID:o,version:this._version}}).then((function(o){t._isFetching=!1;var i=(s=o.data).version,s=s.cloudControlConfig;e.setMessage("version:".concat(t._version," newVersion:").concat(i," config:").concat(s)).end(),Oe.l("".concat(n," ok")),t._parse(o.data)})).catch((function(o){t._isFetching=!1,e.setError(o).end(),Oe.l("".concat(n," failed. error:"),o),t._setExpiredTime(12e4)})))}},{key:"onPushedConfig",value:function(e){Oe.l("".concat(this._n,".onPushedConfig config:"),e),new io("pushedCloudCtrlConfig").setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parse(e)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"_parse",value:function(e){var t=this,n="".concat(this._n,"._parse"),o=e.errorCode,i=e.errorMessage,s=e.cloudControlConfig,r=e.version,a=e.expiredTime;if(0===o){if(this._version!==r){var c=null;try{c=JSON.parse(s)}catch(u){this.isPrivateNetWork()||Oe.e("".concat(n," failed. config:"),s)}c&&(this._cloudConfig.clear(),Object.keys(c).forEach((function(e){t._cloudConfig.set(e,c[e])})),this._version=r,this.emitIEvt(xo.CLOUD_CONFIG),this.emitOEvt(T.SERVER_CONFIG_UPDATED,{config:c}))}this._setExpiredTime(1e3*a)}else lt(o)?(Oe.l("".concat(n," failed. Invalid message format:"),e),this._setExpiredTime(36e5)):(Oe.e("".concat(n," errorCode:").concat(o," errorMessage:").concat(i)),this._setExpiredTime(12e4))}},{key:"_setExpiredTime",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}])),Gs=(u(Er,Pn),s(Er,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var e,t,n,o,i=this,s=this._getLocalConvList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),r=this.get(11),a=[];s.forEach((function(s){var c=s.conversationID;s=s.lastMessage,e=c.replace(S.CONV_GROUP,""),t=r.getLocalLastMessage(c),s&&0!==s.lastSequence&&t&&(n=s.lastSequence,t=t.sequence,o=n-t,0n[0])&&s",n[c].tag)}this.profile=new Ho(g(g({},i),{},{profileCustomField:s}))}),[{key:"validate",value:function(e){var t,n=!0,o="";if(qe(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var i=e.profileCustomField.length,s=null,r=0;r",e[s].tag)}}();this.timestamp=Date.now(),i.length=0}},{key:"updateProfile",value:function(e){this.profile=JSON.parse(JSON.stringify(e)),this.timestamp=Date.now()}},{key:"addToGroupList",value:function(e){-1===this.groupList.indexOf(e)&&(this.groupList.push(e),this.count=this.groupList.length)}},{key:"removeFromGroupList",value:function(e){-1<(e=this.groupList.indexOf(e))&&(this.groupList.splice(e,1),this.count=this.groupList.length)}}]),zs=s((function e(t){o(this,e),this._snsM=t,this._n="FriendHandler",this._map=new Map,this._startIdx=0,this._standardSeq=0,this._customSeq=0,this._expirationTime=18e4}),[{key:"updateCacheOnReconnected",value:function(){this._startIdx=0,this._standardSeq=0,this._customSeq=0,this.pagingGetFriendList()}},{key:"getLocalFriendList",value:function(){return v(this._map.values())}},{key:"getFriendRemark",value:function(e){return this._map.has(e)?this._map.get(e).remark:""}},{key:"onFriendProfileModified",value:function(e){var t,n=this;qe(e=e.dataList)||(t=this._snsM.get(11),e.forEach((function(e){var o,i=e.userID;e=e.profileList,n.isMyFriend(i)&&(Oe.l("".concat(n._n,".onFriendProfileModified. friend account:").concat(i,", profileList:").concat(JSON.stringify(e))),(o=n._map.get(i)).update(e),t.modifyMessageSentByPeer({conversationID:"".concat(S.CONV_C2C).concat(i),latestNick:o.profile.nick,latestAvatar:o.profile.avatar}))})),this._onFriendListUpdated())}},{key:"onFriendAdded",value:function(e){var t=this;0!==e.length&&(Oe.l("".concat(this._n,".onFriendAdded userIDList:").concat(e)),e.forEach((function(e){t._map.set(e,new $s(e))})),this.getFriendProfile({userIDList:e}).then((function(n){e.forEach((function(e){var n=t._map.get(e);0 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000); postMessage(interval); } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'],{type:"application/javascript; charset=utf-8"})),this._workerTimer=new Worker(e),(t=this)._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,Oe.l("".concat(t._n,"._init seed:").concat(t._timerID))):t._m.onCheckTimer()})}},{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("enable_worker");Oe.l("".concat(this._n,"._onCloudConfig enableWorker:").concat(e)),lt(e)||"1"===e?!this._isWorkerEnabled&&he&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&he&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){Oe.l("".concat(this._n,".terminate")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null,this._timerID=-1)}},{key:"getTimerID",value:function(){return this._timerID}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}])),Zs=s((function e(t){o(this,e),this._commercialConfigM=t,this._n="PurchasedFeatureHandler",this._isCSPluginReported=!1,this._featureMap=new Map}),[{key:"isValidPurchaseBits",value:function(e){return e&&"string"==typeof e&&1<=e.length&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){if(this.isValidPurchaseBits(e)){this._featureMap.clear();for(var t,n=e.length-1,o=0;0<=n;n--,o++)t=(o<32?new D(0,Math.pow(2,o)):new D(Math.pow(2,o-32),0)).toString(),"1"===e[n]?this._featureMap.set(t,!0):this._featureMap.set(t,!1)}else Oe.w("".concat(this._n,".parsePurchaseBits invalid purchasebits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._featureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,i=t.length-1,s=0;0<=i;i--,s++)if("1"===t.charAt(i)&&(n=(s<32?new D(0,Math.pow(2,s)):new D(Math.pow(2,s-32),0)).toString(),!this._featureMap.get(n))){o=!1;break}return Oe.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(e," key:").concat(n," ret:").concat(o)),Tn({enabled:o})}},{key:"isFeatureEnabledForStat",value:function(e){for(var t=parseInt(e).toString(2),n=t.length-1,o=0;0<=n;n--,o++)if("1"===t.charAt(n)){if(i=(o<32?new D(0,Math.pow(2,o)):new D(Math.pow(2,o-32),0)).toString(),!this._featureMap.get(i))break;var i,s="",r=0;i===N.PLUGIN_TRANSLATE?(s="plugin_translate",r=16):i===N.PLUGIN_VOICE_TO_TEXT?(s="plugin_voice_to_text",r=17):i===N.PLUGIN_CS?(s="plugin_cs",r=14):i===N.PLUGIN_PUSH?(s="plugin_push",r=13):i===N.PLUGIN_BOT?(s="plugin_bot",r=15):i===N.MSG_REACTION&&(s="plugin_emoji_reaction",r=18),""!==s&&(i=this._commercialConfigM.get(12).getUIPlatform(),new io(s).setCode(r).setUIPlatform(i).end(),Oe.l("".concat(this._n,".isFeatureEnabledForStat ").concat(s," code:").concat(r," uiPlatform:").concat(i)))}}},{key:"isCSPluginEnabled",value:function(){var e;this._isCSPluginReported||(e=this._commercialConfigM.get(12).getUIPlatform(),new io("plugin_search").setCode(6).setUIPlatform(e).end(),this._isCSPluginReported=!0)}},{key:"clear",value:function(){this._featureMap.clear(),this._isCSPluginReported=!1}}]),Qs=s((function e(t){o(this,e),this._m=t,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new Zs(this)}),[{key:"_canFetch",value:function(){return this.get(12).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e,t,n=this,o=this._canFetch(),i="".concat(this._n,".fetchConfig");Oe.l("".concat(i," canFetch:").concat(o)),o&&(e=new io("fetchCommercialConfig"),o=this.get(12).getSDKAppID(),t=this.get(20),this._isFetching=!0,t.req({P:jn.FETCH_COMMERCIAL_CONFIG,data:{SDKAppID:o}}).then((function(t){e.setMessage("purchaseBits:".concat(t.data.purchaseBits)).end(),Oe.l("".concat(i," ok.")),n._parseConfig(t.data),n._isFetching=!1})).catch((function(t){e.setError(t).end(),n._isFetching=!1})))}},{key:"onPushedConfig",value:function(e){var t="".concat(this._n,".onPushedConfig data:").concat(JSON.stringify(e));Oe.l("".concat(t)),new io("pushedCommercialConfig").setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var t="".concat(this._n,"._parseConfig"),n=e.errorCode,o=e.errorMessage,i=e.purchaseBits,s=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(i),this._expiredTime=Date.now()+1e3*s):lt(n)?(Oe.l("".concat(t," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(Oe.e("".concat(t," errorCode:").concat(n," errorMessage:").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"isFeatureEnabledForStat",value:function(e){this._purchasedFeatureHandler.isFeatureEnabledForStat(e)}},{key:"isCSPluginEnabled",value:function(){this._purchasedFeatureHandler.isCSPluginEnabled()}},{key:"get",value:function(e){return this._m.get(e)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),er=(u(Mr,Pn),s(Mr,[{key:"registerPlugin",value:function(e){var t,n,o,i,s,r,a,c,u,l,p,d,h;W?(this._offlinePushPlugin=e["tim-offline-push-plugin"],t=(h=e.offlinePushConfig||{}).huaweiBusinessID,n=h.xiaomiBusinessID,o=h.xiaomiAppID,i=h.xiaomiAppKey,s=h.meizuBusinessID,r=h.meizuAppID,a=h.meizuAppKey,c=h.vivoBusinessID,u=h.oppoBusinessID,l=h.oppoAppKey,p=h.oppoAppSecret,d=h.honorBusinessID,h=h.iosBusinessID,this._androidPushConfig.huaweiPushBussinessId=t,this._androidPushConfig.xiaomiPushBussinessId=n,this._androidPushConfig.xiaomiPushAppId=o,this._androidPushConfig.xiaomiPushAppKey=i,this._androidPushConfig.meizuPushBussinessId=s,this._androidPushConfig.meizuPushAppId=r,this._androidPushConfig.meizuPushAppKey=a,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=u,this._androidPushConfig.oppoPushAppKey=l,this._androidPushConfig.oppoPushAppSecret=p,this._androidPushConfig.honorPushBussinessId=d,new io("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!lt(this._offlinePushPlugin))).end(!0),Oe.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=h,this._setAppShowListener()):this.warn("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e,t=this,n="".concat(this._n,".").concat("_getDeviceToken");Je(this._offlinePushPlugin.getDeviceToken)?(e="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID),Oe.l("".concat(n," start. ").concat(e)),new io("_getDeviceToken").setMessage("".concat(e)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var i,s,r,a,c=new io("getDeviceTokenRes"),u=o.code,l=o.msg;0===u?(i=(a=o.data).deviceToken,s=a.deviceBrand,r=a.deviceType,a=a.bussinessId,t._deviceToken=i,t._businessID=a||t._iosBusinessID,e="deviceToken:".concat(i,", deviceBrand:").concat(s||r,", businessID:").concat(t._businessID),Oe.l("".concat(n," ok. ").concat(e)),c.setMessage(e).end(!0),t._setToken()):(c.setMessage("code:".concat(u,", msg:").concat(l)).end(!0),Oe.e("".concat(n," failed. error:"),o))}))):Oe.e("".concat(n," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return W&&!lt(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setAppShowListener");lt(this._offlinePushPlugin)?Oe.e("".concat(t," offlinePushPlugin is undefined")):Je(this._offlinePushPlugin.setAppShowListener)?(new io("_setAppShowListener").end(!0),Oe.l("".concat(t," start")),this._offlinePushPlugin.setAppShowListener((function(n){n=(n||{}).appShow,new io("setAppShowListenerRes").setMessage("appShow:".concat(n)).end(!0),Oe.l("".concat(t," ok. appShow:").concat(n)),e._m.isReady()&&(0===n?(e._getConvUnreadCount(),e._onBackground()):1===n&&e._onForeground())}))):Oe.e("".concat(t," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){var e;if(!lt(this._offlinePushPlugin)&&Je(this._offlinePushPlugin.getDeviceType))return e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType,Oe.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}},{key:"_setToken",value:function(){var e="".concat(this._n,"._setToken"),t=this.get(12),n=1,o="",i="",s=(qe(this._deviceToken)&&(n=0),this.getUniAppPlatform()),r=this.getDeviceBrand(),a=(s===R.IOS||s===R.IPAD||s===R.MAC?i=this._deviceToken:s===R.ANDROID&&(o=this._deviceToken),new io("offlinePushSetToken"));return s="deviceToken:".concat(i||o,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(r,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(n,", platform:").concat(s),a.setMessage("".concat(s)),Oe.l("".concat(e," ").concat(s)),this.req({P:jn.SET_TOKEN,data:{tokenID:o,pushMsg:n,sdkAppID:t.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:r,deviceToken:i,isWebUniapp:this._isWebUniapp}}).then((function(t){return a.end(),Oe.l("".concat(e," ok")),t})).catch((function(t){return a.setError(t).end(),Oe.e("".concat(e," failed. error:"),t),Sn(t)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.get(11).getLocalConvList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this,t="".concat(this._n,".").concat("_onBackground"),n=new io("_onBackground");this.req({P:jn.STAT_BACKGROUND,data:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage("c2cUnreadCount: ".concat(e._c2cUnreadCount,", groupUnreadCount: ").concat(e._groupUnreadCount)).end(),Oe.l("".concat(t," ok")),o})).catch((function(e){n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e)}))}},{key:"_onForeground",value:function(){var e="".concat(this._n,".").concat("_onForeground"),t=new io("_onForeground");this.req({P:jn.STAT_FOREGROUND,data:{isWebUniapp:this._isWebUniapp}}).then((function(n){return t.end(),Oe.l("".concat(e," ok")),n})).catch((function(n){t.setError(n).end(),Oe.e("".concat(e," failed. error:"),n)}))}},{key:"getUniAppPlatform",value:function(){var e=Gn.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?R.IOS:"android"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,Oe.l("".concat(this._n,".reset"))}}])),tr=(u(Ir,Pn),s(Ir,[{key:"registerPlugin",value:function(e){var t,n,o;W?(t="".concat(this._n,".").concat("registerPlugin"),this._pushPlugin=e["tim-push"],this._getDeviceInfo(),n=(o=e.pushConfig||{}).androidConfig,o=o.iOSConfig,$e(n)&&(this._androidPushConfig=n[this._deviceInfo.packageName]),n=(o||{}).iOSBusinessID,this._iOSBusinessID=n,o=!lt(this._pushPlugin),new io("registerPlugin").setMessage(this._pluginName).setMoreMessage("isExisted:".concat(o)).end(!0),Oe.l("".concat(t," ok. pushConfig:").concat(JSON.stringify(e.pushConfig))),o?(this._setAppShowListener(),this._setPushEventReportListener()):Oe.e("".concat(t," ").concat(this._pluginName," is undefined"))):this.warn("TIMPushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._reportEventCacheList(),this._getDeviceToken(),this.get(27).isFeatureEnabledForStat(Math.pow(2,41))}},{key:"_reportEventCacheList",value:function(){var e=this,t="".concat(this._n,".").concat("_reportEventCacheList");Je(this._pushPlugin.getPushEventCacheList)?(new io("_reportEventCacheList").end(!0),this._pushPlugin.getPushEventCacheList((function(n){var o=n.code,i=n.data.eventList,s=new io("getPushEventCacheListRes");if(s.setCode(o),0!==o)s.setMessage("res:".concat(JSON.stringify(n))).end(!0),Oe.e("".concat(t," failed. error:").concat(JSON.stringify(n)));else{o=i.length<10?"eventList:".concat(JSON.stringify(i)):"eventList.length:".concat(i.length),Oe.l("".concat(t," ok. ").concat(o)),s.setMessage(o).end(!0);for(var r=g(g({},n.data),{},{eventList:[]});0=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(e,t){var n=!0;if(this._plugin&&this._canIUseLexicon&&(!t||!t.messageControlInfo||!0!==t.messageControlInfo.excludedFromContentModeration)){t=e.type;var o=e.conversationType;if(t===S.MSG_TEXT||t===S.MSG_CUSTOM){var i,s="".concat(this._n,".filterMessage");if(Oe.l("".concat(s)),t===S.MSG_TEXT){if(o===S.CONV_C2C?i="c2c_text_message":o===S.CONV_GROUP&&(i="group_text_message"),!this._isConfigOn(i))return n;var r=(a=this._plugin.filter(e.payload.text)).type,a=a.modifiedText;1===r?n=!1:2===r&&(e.payload.text=a)}else if(t===S.MSG_CUSTOM){if(o===S.CONV_C2C?i="c2c_custom_message":o===S.CONV_GROUP&&(i="group_custom_message"),!this._isConfigOn(i))return n;r=this._plugin.filter(e.payload.data),a=this._plugin.filter(e.payload.description),t=this._plugin.filter(e.payload.extension),1===r.type||1===a.type||1===t.type?n=!1:(2===r.type&&(e.payload.data=r.modifiedText),2===a.type&&(e.payload.description=a.modifiedText),2===t.type&&(e.payload.extension=t.modifiedText))}Oe.l("".concat(s," done. isAllowedToSend:").concat(n))}}return n}},{key:"filterText",value:function(e,t){var n="".concat(this._n,".filterText"),o={isAllowedToSend:!0,modifiedText:e};return this._plugin&&this._canIUseLexicon&&this._isConfigOn(t)&&(Oe.l("".concat(n)),e=(t=this._plugin.filter(e)).type,t=t.modifiedText,1===e?o.isAllowedToSend=!1:2===e&&(o.modifiedText=t),Oe.l("".concat(n," done. ret:"),o)),o}},{key:"_getLexicon",value:function(){var e=this,t=new io("profanityFilter"),n="".concat(this._n,"._getLexicon");this._isFetching=!0,this.req({P:jn.GET_PROFANITY_LIST,data:{startIndex:this._startIndex,version:this._version}}).then((function(o){var i=(o=o.data).errorInfo,s=o.filterConfig,r=o.lexicon,a=o.strToken,c=o.completeFlag,u=o.nextStartIndex,l=o.version,p=(o=o.expiredTime,i.errorCode),d=i.errorMessage;return 0!==p?(e._isFetching=!1,Oe.w("".concat(n," failed. error:"),i),void t.setCode(p).setMessage(d).end()):(e._onFilterConfig(s),e._getToken(a),1===c?(Oe.l("".concat(n," done. version:").concat(l," expiredTime:").concat(o)),e._version=l,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*o,void e._plugin.onLexiconCompleted(r)):(e._startIndex=u,e._plugin.onLexiconSliced(r),void e._getLexicon()))})).catch((function(o){t.setError(o).end(),e._isFetching=!1,Oe.l("".concat(n," failed. error:"),o)}))}},{key:"_onFilterConfig",value:function(e){var t=this;qe(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),Oe.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:"_getToken",value:function(e){if(ut(e)){var t=e.length,n="";if(t%2==0)for(var o=0;o<=t-1;o+=2)n=(n+=e[o+1])+e[o];else{for(var i=0;i=this.STORAGE_EXPIRES_TIME,e=!e||"3.5.5"!==e,Oe.l("".concat(this._n,"._needToUpdate isTimeout:").concat(t," isDifferentVersion:").concat(e)),t||e}},{key:"_fetch",value:function(){this._m.get(12).isPrivateNetWork()||this._fetchWithRetry()}},{key:"_fetchWithRetry",value:function(){var e=this;this._fetchAdapter().catch((function(){e.CURRENT_DOMAIN!==B&&(e._generateCurrentDomain(),e._fetchWithRetry())}))}},{key:"_generateCurrentDomain",value:function(){this.CURRENT_DOMAIN===G?this.CURRENT_DOMAIN=F:this.CURRENT_DOMAIN===F&&(this.CURRENT_DOMAIN=B)}},{key:"_fetchAdapter",value:function(){var e="https://".concat(this.CURRENT_DOMAIN,"/im/download/error-message/v3/0.0.7/tim-error-message.txt"),t="application/x-www-form-urlencoded;charset=UTF-8",n="".concat(this._n,"._fetchAdapter ok in"),o=this;return new Promise((function(i,s){var r,a;Z?ne.request({url:e,method:"GET",timeout:3e3,header:{"content-type":t},dataType:"text",success:function(e){o._fillAndSave(e.data),Oe.l("".concat(n," mini program.")),i()},fail:function(e){s(e)}}):(r=new XMLHttpRequest,a=setTimeout((function(){r.abort()}),3e3),r.onreadystatechange=function(){4===r.readyState&&(a&&clearTimeout(a),200===r.status||304===r.status?(Oe.l("".concat(n," browser.")),o._fillAndSave(r.responseText),i()):s(r.status))},r.onerror=function(e){s(e)},r.open("GET",e,!0),r.setRequestHeader("Content-type",t),r.send())}))}},{key:"_fillAndSave",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:"3.5.5"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.get(13)}},{key:"_fillMap",value:function(e){this._map.clear();for(var t,n,o=e.split(";\n"),i=o.length,s=new RegExp(/'/g),r=0;rTe()-this.EXPIRED_TIME}},{key:"_createPromiseList",value:function(e){for(var t=[],n=0;nthis.MAX_COUNT?this.MAX_COUNT:e,this._clearFollowList())}},{key:"clearCacheOnReconnected",value:function(){this._clearFollowList()}},{key:"onFollowNotify",value:function(e){var t=this;e=e.dataList||[],Oe.l("".concat(this._n,".onFollowNotify followChangeList:").concat(e.length)),e.forEach((function(e){var n=void 0===(n=e.followDiffList)?[]:n,o=(e=f(e,dr)).from,i=f(e,hr);n.forEach((function(e){var n=e.isAdd,s=(e=void 0===(e=e.followType)?0:e,t._initFollowInfo());1===n?(i.userID=o,s[e].userInfoList.push(i),s[e].isAdd=!0):(s[e].userInfoList.push(o),s[e].isAdd=!1),t._emitEvent(s)}))}))}},{key:"_initFollowInfo",value:function(){var e={};return Object.values(gr).forEach((function(t){t!==gr.NONE&&(e[t]={userInfoList:[],isAdd:!1})})),e}},{key:"_emitEvent",value:function(e){var t=this;Object.keys(e).forEach((function(n){n=Number(n);var o=e[n];0>>16&65535,r=0;0!==n;){for(n-=r=2e3>>8^i[255&(e^t[r])];return~e}function Or(e,t,n,o,i,s,r,a){var c,u,l,p,d,h,g,f,m,_=a.bits,v=0,y=0,I=0,M=0,C=0,T=0,S=0,E=0,k=0,D=0,L=null,R=0,O=new mr.Buf16(16),A=new mr.Buf16(16),b=null,P=0;for(v=0;v<=15;v++)O[v]=0;for(y=0;yh?(f=b[P+r[y]],L[R+r[y]]):(f=96,0),c=1<<(g=v-S),I=u=1<>S)+(u-=c)]=g<<24|f<<16|m,0!==u;);for(c=1<>=1;if(D=0!==c?(D&c-1)+c:0,y++,0==--O[v]){if(v===M)break;v=t[n+r[y]]}if(C>>1:n>>>1;e[t]=n}return e}(),br=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Pr=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Nr=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],xr=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function wr(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Ur(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new mr.Buf16(320),this.work=new mr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Gr(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new mr.Buf32(852),t.distcode=t.distdyn=new mr.Buf32(592),t.sane=1,t.back=-1,0):-2}function Fr(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,Gr(e)):-2}function Br(e,t){var n,o;return!e||!e.state||(o=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(mr.arraySet(e.window,t,n-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>o&&(i=o),mr.arraySet(e.window,t,n-o,i,e.wnext),(o-=i)?(mr.arraySet(e.window,t,n-o,o,0),e.wnext=o,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,n.check=Rr(n.check,D,2,0),l=u=0,n.mode=2;else if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31)e.msg="incorrect header check",n.mode=30;else if(8!=(15&u))e.msg="unknown compression method",n.mode=30;else{if(l-=4,C=8+(15&(u>>>=4)),0===n.wbits)n.wbits=C;else if(C>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(D[0]=255&u,D[1]=u>>>8&255,n.check=Rr(n.check,D,2,0)),l=u=0,n.mode=3;case 3:for(;l<32;){if(0===a)break e;a--,u+=o[s++]<>>8&255,D[2]=u>>>16&255,D[3]=u>>>24&255,n.check=Rr(n.check,D,4,0)),l=u=0,n.mode=4;case 4:for(;l<16;){if(0===a)break e;a--,u+=o[s++]<>8),512&n.flags&&(D[0]=255&u,D[1]=u>>>8&255,n.check=Rr(n.check,D,2,0)),l=u=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===a)break e;a--,u+=o[s++]<>>8&255,n.check=Rr(n.check,D,2,0)),l=u=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((h=(h=n.length)>a?a:h)&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),mr.arraySet(n.head.extra,o,s,h,C)),512&n.flags&&(n.check=Rr(n.check,o,h,s)),a-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===a)break e;for(h=0;C=o[s+h++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C)),C&&h>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;l<32;){if(0===a)break e;a--,u+=o[s++]<>>=7&l,l-=7&l,n.mode=27;else{for(;l<3;){if(0===a)break e;a--,u+=o[s++]<>>=1)){case 0:n.mode=14;break;case 1:R=O=void 0;var R,O=n;if(Hr){for(Vr=new mr.Buf32(512),jr=new mr.Buf32(32),R=0;R<144;)O.lens[R++]=8;for(;R<256;)O.lens[R++]=9;for(;R<280;)O.lens[R++]=7;for(;R<288;)O.lens[R++]=8;for(Or(1,O.lens,0,288,Vr,0,O.work,{bits:9}),R=0;R<32;)O.lens[R++]=5;Or(2,O.lens,0,32,jr,0,O.work,{bits:5}),Hr=!1}if(O.lencode=Vr,O.lenbits=9,O.distcode=jr,O.distbits=5,n.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}u>>>=2,l-=2}break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,u+=o[s++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&u,l=u=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(h=n.length){if(0===(h=c<(h=a>>=5,l-=5,n.ndist=1+(31&u),u>>>=5,l-=5,n.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},T=Or(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,v=65535&k,!((m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<>>=m,l-=m,n.lens[n.have++]=v;else{if(16===v){for(E=m+2;l>>=m,l-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}C=n.lens[n.have-1],h=3+(3&u),u>>>=2,l-=2}else if(17===v){for(E=m+3;l>>=m)),u>>>=3,l=l-m-3}else{for(E=m+7;l>>=m)),u>>>=7,l=l-m-7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;h--;)n.lens[n.have++]=C}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,S={bits:n.lenbits},T=Or(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},T=Or(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,T){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=a&&258<=c){e.next_out=r,e.avail_out=c,e.next_in=s,e.avail_in=a,n.hold=u,n.bits=l,H=q=w=x=N=P=b=A=oe=ne=te=ee=Q=Z=X=J=W=Y=z=$=K=j=V=B=F=void 0;var A,b,P,N,x,w,U=e,G=d,F=U.state,B=U.next_in,q=U.input,V=B+(U.avail_in-5),j=U.next_out,H=U.output,K=j-(G-U.avail_out),$=j+(U.avail_out-257),z=F.dmax,Y=F.wsize,W=F.whave,J=F.wnext,X=F.window,Z=F.hold,Q=F.bits,ee=F.lencode,te=F.distcode,ne=(1<>>=b=A>>>24,Q-=b,0==(b=A>>>16&255))H[j++]=65535&A;else{if(!(16&b)){if(!(64&b)){A=ee[(65535&A)+(Z&(1<>>=b,Q-=b),Q<15&&(Z+=q[B++]<>>=b=A>>>24,Q-=b,!(16&(b=A>>>16&255))){if(!(64&b)){A=te[(65535&A)+(Z&(1<z){U.msg="invalid distance too far back",F.mode=30;break t}if(Z>>>=b,Q-=b,N>(b=j-K)){if((b=N-b)>W&&F.sane){U.msg="invalid distance too far back",F.mode=30;break t}if(w=X,(x=0)===J){if(x+=Y-b,b>3,Z&=(1<<(Q-=P<<3))-1,U.next_in=B,U.next_out=j,U.avail_in=B>>16&255,v=65535&k,!((m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<>y)])>>>16&255,v=65535&k,!(y+(m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<>>=y,l-=y,n.back+=y}if(u>>>=m,l-=m,n.back+=m,n.length=v,0===_){n.mode=26;break}if(32&_){n.back=-1,n.mode=12;break}if(64&_){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&_,n.mode=22;case 22:if(n.extra){for(E=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;_=(k=n.distcode[u&(1<>>16&255,v=65535&k,!((m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<>y)])>>>16&255,v=65535&k,!(y+(m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<>>=y,l-=y,n.back+=y}if(u>>>=m,l-=m,n.back+=m,64&_){e.msg="invalid distance code",n.mode=30;break}n.offset=v,n.extra=15&_,n.mode=24;case 24:if(n.extra){for(E=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===c)break e;if(n.offset>(h=d-c)){if((h=n.offset-h)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}g=h>n.wnext?(h-=n.wnext,n.wsize-h):n.wnext-h,h>n.length&&(h=n.length),f=n.window}else f=i,g=r-n.offset,h=n.length;for(c-=h=c>10&1023,s[r++]=56320|1023&n)}var c=s,u=r;if(u<65534&&(c.subarray&&Yr||!c.subarray&&zr))return String.fromCharCode.apply(null,mr.shrinkBuf(c,u));for(var l="",p=0;p>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}(t.dictionary):"[object ArrayBuffer]"===na.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(e=$r.inflateSetDictionary(this.strm,t.dictionary))!==ea.Z_OK)throw new Error(ta[e])}function ia(e,t){if((t=new oa(t)).push(e,!0),t.err)throw t.msg||ta[t.err];return t.result}oa.prototype.push=function(e,t){var n,o,i,s,r,a=this.strm,c=this.options.chunkSize,u=this.options.dictionary,l=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?ea.Z_FINISH:ea.Z_NO_FLUSH,"string"==typeof e?a.input=function(e){for(var t=new mr.Buf8(e.length),n=0,o=t.length;ne.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+Wr[e[n]]>t?n:t}(a.output,a.next_out),s=a.next_out-i,r=Xr(a.output,i),a.next_out=s,a.avail_out=c-s,s&&mr.arraySet(a.output,a.output,i,s,0),this.onData(r)):this.onData(mr.shrinkBuf(a.output,a.next_out))),0===a.avail_in&&0===a.avail_out&&(l=!0)}while((0"," %c"),"background:#ff9d00; padding:1px; border-radius:3px; color: #fff","background:transparent",t):console.log("IM SDK API ->",t)),(t=this.getErrMsg("DOCS_GUIDE"))&&console.log(t),t=this.getErrMsg("IOS_WEBVIEW_WARNING"),me)&&t&&console.warn(t),Oe.setLevel(e)}},{key:"createTextMessage",value:function(e){return this._get(2).createTextMessage(e)}},{key:"createTextAtMessage",value:function(e){return this._get(2).createTextMessage(e)}},{key:"createImageMessage",value:function(e){return this._get(2).createImageMessage(e)}},{key:"createAudioMessage",value:function(e){return this._get(2).createAudioMessage(e)}},{key:"createVideoMessage",value:function(e){return this._get(2).createVideoMessage(e)}},{key:"createCustomMessage",value:function(e){return this._get(2).createCustomMessage(e)}},{key:"createFaceMessage",value:function(e){return this._get(2).createFaceMessage(e)}},{key:"createFileMessage",value:function(e){return this._get(2).createFileMessage(e)}},{key:"createLocationMessage",value:function(e){return this._get(2).createLocationMessage(e)}},{key:"createMergerMessage",value:function(e){return this._get(2).createMergerMessage(e)}},{key:"downloadMergerMessage",value:function(e){return e.type!==S.MSG_MERGER?Sn({code:qn.MSG_MERGER_TYPE_INVALID}):qe(e.payload.downloadKey)?Sn({code:qn.MSG_MERGER_KEY_INVALID}):this._get(2).downloadMergerMessage(e).catch((function(e){return Sn({code:qn.MSG_MERGER_DOWNLOAD_FAIL})}))}},{key:"createForwardMessage",value:function(e){return this._get(2).createForwardMessage(e)}},{key:"sendMessage",value:function(e,t){return e instanceof Do?this._get(2).sendMessageInstance(e,t):Sn({code:qn.MSG_INSTANCE_REQUIRED})}},{key:"callExperimentalAPI",value:function(e,t){return"sendComboMessage"===e?this._get(31).sendMessage(t):"handleGroupInvitation"===e?this._get(7).handleGroupInvitation(t):"isCommercialAbilityEnabled"===e?this._get(27).isFeatureEnabled(t):"isFeatureEnabledForStat"===e?this._get(27).isFeatureEnabledForStat(t):"isIntl"===e?this.isIntl():"sendTRTCCustomData"===e||"sendRoomCustomData"===e?this._get(30).sendTRTCCustomData(t):"getTimerID"===e?this._m.getTimerID():"getPollingTimerID"===e?this._m.getPollingTimerID(t):"setApplicationID"===e?(this._get(12).setApplicationID(t),void this._get(20).updateProtocolConfig()):"getServerConfig"===e?this._get(23).getServerConfig(t):"canIUseModule"===e?this._m.canIUseModule(t):"startMessageLongPolling"===e?this._get(7).startMessageLongPolling(t):"stopMessageLongPolling"===e?this._get(7).stopMessageLongPolling(t):"disableMessagePullOnInvite"===e?this._get(11).disableMsgPullOnInvite(t):"clearLocalMessage"===e?this._get(11).clearMemMsg(t,!1):"setCustomLoginInfo"===e?this._get(12).setCustomLoginInfo(t):"statTUIKeyFeatures"===e?this._m.statTUIKeyFeatures(t):"getGroupReceiptsByUsers"===e?this._get(7).getGroupReceiptsByUsers(t):Sn({code:qn.INVALID_OPERATION})}},{key:"revokeMessage",value:function(e){return this._get(2).revokeMessage(e)}},{key:"resendMessage",value:function(e,t){return e instanceof Do?this._get(2).resendMessage(e,t):Sn({code:qn.MSG_INSTANCE_REQUIRED})}},{key:"deleteMessage",value:function(e){return this._get(2).deleteMessage(e)}},{key:"translateText",value:function(e){return this._get(2).translateText(e)}},{key:"convertVoiceToText",value:function(e){return this._get(2).convertVoiceToText(e)}},{key:"setMessageExtensions",value:function(e,t){return this._get(3).setMessageExtensions(e,t)}},{key:"getMessageExtensions",value:function(e){return this._get(3).getMessageExtensions(e)}},{key:"deleteMessageExtensions",value:function(e,t){return this._get(3).deleteMessageExtensions(e,t)}},{key:"addMessageReaction",value:function(e,t){return this._get(34).addMessageReaction(e,t)}},{key:"removeMessageReaction",value:function(e,t){return this._get(34).removeMessageReaction(e,t)}},{key:"getMessageReactions",value:function(e){return this._get(34).getMessageReactions(e)}},{key:"getAllUserListOfMessageReaction",value:function(e){return this._get(34).getAllUserListOfMessageReaction(e)}},{key:"modifyMessage",value:function(e){return this._get(2).modifyRemoteMessage(e)}},{key:"getMessageList",value:function(e){return this._get(11).getMessageList(e)}},{key:"getMessageListHopping",value:function(e){return this._get(11).getMessageListHopping(e)}},{key:"sendMessageReadReceipt",value:function(e){return this._get(11).sendReadReceipt(e)}},{key:"getMessageReadReceiptList",value:function(e){return this._get(11).getReadReceiptList(e)}},{key:"getGroupMessageReadMemberList",value:function(e){var t=this._get(7);return t?t.getReadReceiptDetail(e):Sn({code:qn.NO_MODULE})}},{key:"findMessage",value:function(e){return this._get(11).findMessage(e)}},{key:"setMessageRead",value:function(e){return this._get(11).setMessageRead(e)}},{key:"getConversationList",value:function(e){return this._get(11).getConvList(e)}},{key:"getConversationProfile",value:function(e){return this._get(11).getConversationProfile(e)}},{key:"deleteConversation",value:function(e){return this._get(11).deleteConversation(e)}},{key:"setConversationDraft",value:function(e){return this._get(11).setConvDraft(e)}},{key:"clearHistoryMessage",value:function(e){return this._get(11).clearHistoryMessage(e)}},{key:"pinConversation",value:function(e){return this._get(11).pinConversation(e)}},{key:"setAllMessageRead",value:function(e){return this._get(11).setAllMessageRead(e)}},{key:"setMessageRemindType",value:function(e){return this._get(11).setMessageRemindType(e)}},{key:"setAllReceiveMessageOpt",value:function(e){return this._get(11).setAllRcvMsgOpt(e)}},{key:"getAllReceiveMessageOpt",value:function(){return this._get(11).getAllRcvMsgOpt()}},{key:"getTotalUnreadMessageCount",value:function(){return this._get(11).getTotalUnreadCount()}},{key:"setConversationCustomData",value:function(e){return this._get(11).setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._get(11).markConv(e)}},{key:"getConversationGroupList",value:function(){return this._get(11).getConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._get(11).createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._get(11).deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._get(11).renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._get(11).addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._get(11).deleteConvsFromGroup(e)}},{key:"searchCloudMessages",value:function(e){var t=this._get(38);return t?t.searchCloudMessages(e):Sn({code:qn.NO_MODULE})}},{key:"searchCloudUsers",value:function(e){var t=this._get(38);return t?t.searchCloudUsers(e):Sn({code:qn.NO_MODULE})}},{key:"searchCloudGroups",value:function(e){var t=this._get(38);return t?t.searchCloudGroups(e):Sn({code:qn.NO_MODULE})}},{key:"searchCloudGroupMembers",value:function(e){var t=this._get(38);return t?t.searchCloudGroupMembers(e):Sn({code:qn.NO_MODULE})}},{key:"getMyProfile",value:function(){return this._get(4).getMyProfile()}},{key:"getUserProfile",value:function(e){return this._get(4).getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._get(4).updateMyProfile(e)}},{key:"getBlacklist",value:function(){return this._get(4).getLocalBlacklist()}},{key:"addToBlacklist",value:function(e){return this._get(4).addBlacklist(e)}},{key:"removeFromBlacklist",value:function(e){return this._get(4).deleteBlacklist(e)}},{key:"setSelfStatus",value:function(e){return this._get(4).setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._get(4).getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._get(4).subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._get(4).unsubscribeUserStatus(e)}},{key:"getFriendList",value:function(){var e=this._get(8);return e?e.getLocalFriendList():Sn({code:qn.NO_MODULE})}},{key:"addFriend",value:function(e){var t=this._get(8);return t?t.addFriend(e):Sn({code:qn.NO_MODULE})}},{key:"deleteFriend",value:function(e){var t=this._get(8);return t?t.deleteFriend(e):Sn({code:qn.NO_MODULE})}},{key:"checkFriend",value:function(e){var t=this._get(8);return t?t.checkFriend(e):Sn({code:qn.NO_MODULE})}},{key:"getFriendProfile",value:function(e){var t=this._get(8);return t?t.getFriendProfile(e):Sn({code:qn.NO_MODULE})}},{key:"updateFriend",value:function(e){var t=this._get(8);return t?t.updateFriend(e):Sn({code:qn.NO_MODULE})}},{key:"getFriendApplicationList",value:function(){var e=this._get(8);return e?e.getLocalFriendApplicationList():Sn({code:qn.NO_MODULE})}},{key:"acceptFriendApplication",value:function(e){var t=this._get(8);return t?t.acceptFriendApplication(e):Sn({code:qn.NO_MODULE})}},{key:"refuseFriendApplication",value:function(e){var t=this._get(8);return t?t.refuseFriendApplication(e):Sn({code:qn.NO_MODULE})}},{key:"deleteFriendApplication",value:function(e){var t=this._get(8);return t?t.deleteFriendApplication(e):Sn({code:qn.NO_MODULE})}},{key:"setFriendApplicationRead",value:function(){var e=this._get(8);return e?e.setFriendApplicationRead():Sn({code:qn.NO_MODULE})}},{key:"getFriendGroupList",value:function(){var e=this._get(8);return e?e.getLocalFriendGroupList():Sn({code:qn.NO_MODULE})}},{key:"createFriendGroup",value:function(e){var t=this._get(8);return t?t.createFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"deleteFriendGroup",value:function(e){var t=this._get(8);return t?t.deleteFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"addToFriendGroup",value:function(e){var t=this._get(8);return t?t.addToFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"removeFromFriendGroup",value:function(e){var t=this._get(8);return t?t.removeFromFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"renameFriendGroup",value:function(e){var t=this._get(8);return t?t.renameFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"followUser",value:function(e){var t=this._get(35);return t?t.followUser(e):Sn({code:qn.NO_MODULE})}},{key:"unfollowUser",value:function(e){var t=this._get(35);return t?t.unfollowUser(e):Sn({code:qn.NO_MODULE})}},{key:"getMyFollowersList",value:function(e){var t=this._get(35);return t?t.getMyFollowersList(e):Sn({code:qn.NO_MODULE})}},{key:"getMyFollowingList",value:function(e){var t=this._get(35);return t?t.getMyFollowingList(e):Sn({code:qn.NO_MODULE})}},{key:"getMutualFollowersList",value:function(e){var t=this._get(35);return t?t.getMutualFollowersList(e):Sn({code:qn.NO_MODULE})}},{key:"getUserFollowInfo",value:function(e){var t=this._get(35);return t?t.getUserFollowInfo(e):Sn({code:qn.NO_MODULE})}},{key:"checkFollowType",value:function(e){var t=this._get(35);return t?t.checkFollowType(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupList",value:function(){var e=this._get(7);return e?e.getGroupList():Sn({code:qn.NO_MODULE})}},{key:"getGroupProfile",value:function(e){var t=this._get(7);return t?t.getGroupProfile(e):Sn({code:qn.NO_MODULE})}},{key:"createGroup",value:function(e){var t=this._get(7);return t?t.createGroup(e):Sn({code:qn.NO_MODULE})}},{key:"dismissGroup",value:function(e){var t=this._get(7);return t?t.dismissGroup(e):Sn({code:qn.NO_MODULE})}},{key:"updateGroupProfile",value:function(e){var t=this._get(7);return t?t.updateGroupProfile(e):Sn({code:qn.NO_MODULE})}},{key:"joinGroup",value:function(e){var t=this._get(7);return t?t.joinGroup(e):Sn({code:qn.NO_MODULE})}},{key:"quitGroup",value:function(e){var t=this._get(7);return t?t.quitGroup(e):Sn({code:qn.NO_MODULE})}},{key:"searchGroupByID",value:function(e){var t=this._get(7);return t?t.searchGroupByID(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._get(7);return t?t.getGroupOnlineMemberCount(e):Sn({code:qn.NO_MODULE})}},{key:"changeGroupOwner",value:function(e){var t=this._get(7);return t?t.changeGroupOwner(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupApplicationList",value:function(){var e=this._get(7);return e?e.getGroupApplicationList():Sn({code:qn.NO_MODULE})}},{key:"handleGroupApplication",value:function(e){var t=this._get(7);return t?t.handleGroupApplication(e):Sn({code:qn.NO_MODULE})}},{key:"initGroupAttributes",value:function(e){var t=this._get(7);return t?t.initGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupAttributes",value:function(e){var t=this._get(7);return t?t.setGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"deleteGroupAttributes",value:function(e){var t=this._get(7);return t?t.deleteGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupAttributes",value:function(e){var t=this._get(7);return t?t.getGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupCounters",value:function(e){var t=this._get(7);return t?t.setGroupCounters(e):Sn({code:qn.NO_MODULE})}},{key:"increaseGroupCounter",value:function(e){var t=this._get(7);return t?t.increaseGroupCounter(e):Sn({code:qn.NO_MODULE})}},{key:"decreaseGroupCounter",value:function(e){var t=this._get(7);return t?t.decreaseGroupCounter(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupCounters",value:function(e){var t=this._get(7);return t?t.getGroupCounters(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupMemberList",value:function(e){var t=this._get(7);return t?t.getGroupMemberList(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupMemberProfile",value:function(e){var t=this._get(7);return t?t.getGroupMemberProfile(e):Sn({code:qn.NO_MODULE})}},{key:"addGroupMember",value:function(e){var t=this._get(7);return t?t.addGroupMember(e):Sn({code:qn.NO_MODULE})}},{key:"deleteGroupMember",value:function(e){var t=this._get(7);return t?t.deleteGroupMember(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberMuteTime",value:function(e){var t=this._get(7);return t?t.setGroupMemberMuteTime(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberRole",value:function(e){var t=this._get(7);return t?t.setGroupMemberRole(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberNameCard",value:function(e){var t=this._get(7);return t?t.setGroupMemberNameCard(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberCustomField",value:function(e){var t=this._get(7);return t?t.setGroupMemberCustomField(e):Sn({code:qn.NO_MODULE})}},{key:"markGroupMemberList",value:function(e){var t=this._get(7);return t?t.markGroupMemberList(e):Sn({code:qn.NO_MODULE})}},{key:"getJoinedCommunityList",value:function(){return this._get(10).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(e){return this._get(10).createTopicInCommunity(e)}},{key:"deleteTopicFromCommunity",value:function(e){return this._get(10).deleteTopicFromCommunity(e)}},{key:"updateTopicProfile",value:function(e){return this._get(10).updateTopicProfile(e)}},{key:"getTopicList",value:function(e){return this._get(10).getTopicList(e)}},{key:"addSignalingListener",value:function(e,t,n){var o=this._get(33);o&&o.addSignalingListener(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"removeSignalingListener",value:function(e,t,n){var o,i=this._safetyCallbackFactory.find(e,t);null!==i&&(o=this._get(33))&&(o.removeSignalingListener(e,i,n),this._safetyCallbackFactory.delete(e,t))}},{key:"invite",value:function(e){var t=this._get(33);return t?t.invite(e):Sn({code:qn.NO_MODULE})}},{key:"inviteSync",value:function(e,t,n){var o=this._get(33);return o?o.inviteSync(e,t,n):""}},{key:"inviteInGroup",value:function(e){var t=this._get(33);return t?t.invite(e):Sn({code:qn.NO_MODULE})}},{key:"inviteInGroupSync",value:function(e,t,n){var o=this._get(33);return o?o.inviteSync(e,t,n):""}},{key:"cancel",value:function(e){var t=this._get(33);return t?t.cancel(e):Sn({code:qn.NO_MODULE})}},{key:"accept",value:function(e){var t=this._get(33);return t?t.accept(e):Sn({code:qn.NO_MODULE})}},{key:"reject",value:function(e){var t=this._get(33);return t?t.reject(e):Sn({code:qn.NO_MODULE})}},{key:"getSignalingInfo",value:function(e){var t=this._get(33);return t?t.getSignalingInfo(e):null}},{key:"modifyInvitation",value:function(e){var t=this._get(33);return t?t.modifyInvitation(e):Sn({code:qn.NO_MODULE})}}]),ya={login:1,logout:1,getLoginUser:1,destroy:1,on:1,off:1,ready:1,setLogLevel:1,joinGroup:1,quitGroup:1,registerPlugin:1,getGroupOnlineMemberCount:1,isReady:1,addSignalingListener:1,removeSignalingListener:1,callExperimentalAPI:1};function Ia(e){return o(this,Ia),(e=n(this,Ia,[e]))._n="CSModule",e}var Ma={};return(Nn={}).create=function(e){var t,n,o,i="TencentCloudChat.create",s=0;if(Ke(o=e.SDKAppID))s=o;else if(s=parseInt(o),isNaN(o))return Oe.e("".concat(i," failed. Failed to parse the SDKAppID, please check the arguments")),null;return s&&Ma[s]?Ma[s]:(Oe.l("".concat(i)),(o=new va(g(g({},e),{},{SDKAppID:s}))).on(T.SDK_DESTROY,(function(e){Ma[e.data.SDKAppID]=null,delete Ma[e.data.SDKAppID]})),t=o,n=Object.create(null),Object.keys(Fn).forEach((function(e){var o;t[e]&&(o=new k,n[e]=function(){var n=Array.from(arguments);return o.use((function(n,o){r=e;var i,s,r=!(!(i=t).isReady()&&1!==ya[r])||(s={code:s=i.getNotReadyReason(),message:"".concat(i.getErrMsg(s)," | ").concat(r," | ").concat(i.getErrMsg(qn.SDK_IS_NOT_READY))},i.onError(s),s);return!0===r?o():Sn(r)})).use((function(t,n){if(!0===function(e,t,n){if(void 0===t)return!0;var o=!0;if(ze(t))Object.keys(t).forEach((function(i){var s=1===e.length?e[0][i]:void 0;o=!!Yt(s,t[i],n,i)&&o}));else if(Ye(t))for(var i=0;i=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=void 0!==Au?Au:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),l="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),p="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),d="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),h="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),g=void 0!==Gn&&"undefined"==typeof window&&"function"==typeof Gn.requireNativePlugin,f=g&&"ios"===Gn.getDeviceInfo().platform.toLocaleLowerCase(),m=(g&&Gn.getDeviceInfo().platform.toLocaleLowerCase(),u||l||p||d||h||g),_=void 0!==c&&(void 0!==c.nativeModuleProxy||void 0!==c.ReactNative),v=l?qq:p?tt:d?swan:h?my:u?Un:g?Gn:{},y=function(e){if("object"!==n(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o};function I(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(y(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var M=function(){function e(){o(this,e),this._n="WebRequest"}return s(e,[{key:"request",value:function(e,n){var o=this,i="".concat(this._n,".request"),s=e.downloadUrl||"",r=(e.method||"PUT").toUpperCase(),a=e.url;if(console.log("%c tim-upload-plugin %c","background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent","".concat(i," URL:").concat(a)),e.qs){var c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return I(e)?"":y(e)?Object.keys(e).map((function(o){var i=encodeURIComponent(o)+n;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(e)})).join(t):i+encodeURIComponent(e[o])})).filter(Boolean).join(t):void 0}(e.qs);c&&(a+="".concat(-1===a.indexOf("?")?"?":"&").concat(c))}var u=new XMLHttpRequest;u.open(r,a,!0),u.responseType=e.dataType||"text";var l=e.headers||{};if(e.uploadByIP&&(l=t(t({},l),{},{host:e.uploadIP})),!I(l))for(var p in l)l.hasOwnProperty(p)&&"content-length"!==p.toLowerCase()&&"user-agent"!==p.toLowerCase()&&"origin"!==p.toLowerCase()&&"host"!==p.toLowerCase()&&u.setRequestHeader(p,l[p]);return u.onload=function(){if(200===u.status)n(null,o._xhrRes(u,o._xhrBody(u,s,e.uploadByIP&&e.uploadIP),l));else{if(e.uploadIP&&-1===e.url.indexOf(e.uploadIP))return e.url=(i=e.url,r=e.uploadIP,i.replace(/^http(s)?:\/\/(.*?)\//,"https://".concat(r,"/"))),e.uploadByIP=!0,o.request(e,n);var t={code:u.status,message:JSON.stringify(u.responseText)};n(t,o._xhrRes(u,o._xhrBody(u,s,e.uploadByIP&&e.uploadIP),l))}var i,r},u.onerror=function(t){var i=o._xhrBody(u,s,e.uploadByIP&&e.uploadIP),r={code:u.status,message:JSON.stringify(u.responseText)};i||u.statusText||0!==u.status||(t.message="CORS blocked or network error"),n(r,o._xhrRes(u,i)),r=null},e.onProgress&&u.upload&&(u.upload.onprogress=function(t){var n=t.total,o=t.loaded,i=Math.floor(100*o/n);e.onProgress({total:n,loaded:o,percent:(i>=100?100:i)/100})}),u.send(e.resources),u}},{key:"_xhrRes",value:function(e,t){var n={};return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),o=e.substr(0,t).trim().toLowerCase(),i=e.substr(t+1).trim();n[o]=i}})),{statusCode:e.status,statusMessage:e.statusText,headers:n,data:t}}},{key:"_xhrBody",value:function(e,t,n){return 200===e.status&&t?{location:t,uploadIP:n}:{response:e.responseText,uploadIP:n}}}]),e}(),C=["unknown","image","video","audio","log"],T=["name"],S=function(){function e(){o(this,e)}return s(e,[{key:"request",value:function(e,n){var o=this,i=e.resources,s=void 0===i?"":i,r=e.headers,c=void 0===r?{}:r,u=e.url,l=e.downloadUrl,p=void 0===l?"":l,d=u,g=null,m=p.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/),_=decodeURIComponent(m[3]),y=_.indexOf("?")>-1?_.split("?")[0]:_,I={key:e.fileKey?e.fileKey:y,success_action_status:200,"Content-Type":""},M={};if(f){var S=u.split("?sign=");if(S.length>1){var E=S[1];d="".concat(S[0],"?sign=").concat(encodeURIComponent("".concat(E))),M.sign=decodeURIComponent(E),M.signature=decodeURIComponent(E)}}var k={url:d,header:c,name:"file",filePath:s,formData:t(t({},I),M),timeout:e.timeout||3e5};if(h){var D=k;D.name,k=t(t({},a(D,T)),{},{fileName:"file",fileType:C[e.fileType]})}return(g=v.uploadFile(t(t({},k),{},{success:function(e){o._handleResponse({response:e,downloadUrl:p,callback:n})},fail:function(e){o._handleResponse({response:e,downloadUrl:p,callback:n})}}))).onProgressUpdate&&g.onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),g}},{key:"_handleResponse",value:function(e){var n=e.downloadUrl,o=e.response,i=e.callback,s=o.header,r={};if(s)for(var a in s)s.hasOwnProperty(a)&&(r[a.toLowerCase()]=s[a]);var c=+o.statusCode;200===c?i(null,{statusCode:c,headers:r,data:t(t({},o.data),{},{location:n})}):i({code:c,message:JSON.stringify(o.data)},{statusCode:c,headers:r,data:void 0})}}]),e}(),E=function(){function e(){o(this,e)}return s(e,[{key:"request",value:function(e,t){var n=this,o=e.resources,i=void 0===o?"":o,s=e.fileKey,r=void 0===s?"":s,a=e.url,c=e.downloadUrl,u=void 0===c?"":c,l=new FormData;l.append("key",r),l.append("success_action_status",200),l.append("file",{uri:i,type:"application/octet-stream",name:"uploaded_file"}),fetch(a,{method:"POST",headers:{"Content-Type":"multipart/form-data"},body:l}).then((function(e){n._handleResponse({response:e,downloadUrl:u,callback:t})})).catch((function(e){n._handleResponse({response:e,downloadUrl:u,callback:t})}))}},{key:"_handleResponse",value:function(e){var t=e.downloadUrl,n=e.response,o=e.callback,i=n.headers,s=n.status,r=i&&i.map||{};200===s?o(null,{statusCode:200,headers:r,data:{location:t}}):o({code:s,message:JSON.stringify(n)},{statusCode:s,headers:r,data:void 0})}}]),e}();return function(){function e(){o(this,e),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=m?new S:_?new E:new M,console.log("TIMUploadPlugin.VERSION: ".concat("1.4.2"))}return s(e,[{key:"uploadFile",value:function(e,t){var n=this;return this.httpRequest.request(e,(function(o,i){o&&n.tryCount=3e4&&(this.systemClockOffset=a-r,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}],[{key:"getVersion",value:function(){return"1.4.2"}}]),e}()}();const wu=bu(xu.exports);var Uu={exports:{}};Uu.exports=function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw r}}}}var c,u,l=function(){for(var e=" \t\r\n~!@#$%^&*()_+-=【】、{}|;':\",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄",t=new Map,n=0,o=e.length;n1&&(c+=u),d){if(r=!0,!n)break;var g=this._map.get(p)||"*";s=t.replace(new RegExp(p,"gi"),g)}}return{isMatched:r,modifiedText:s}}},{key:"reset",value:function(){this._trieTree={},this._map=null}}]),t}(),d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Au?Au:"undefined"!=typeof self?self:{},h={},g=(c=function(e,t){var n,o,i,s,r,a,c,u,l,p,g,f,m;e.exports=(a=a||function(e){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&void 0!==d&&d.crypto&&(t=d.crypto),!t)try{t=h}catch(m){}var n=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(m){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(m){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},s=i.lib={},r=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=s.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,o=this.sigBytes,i=e.sigBytes;if(this.clamp(),o%4)for(var s=0;s>>2]>>>24-s%4*8&255;t[o+s>>>2]|=r<<24-(o+s)%4*8}else for(s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],o=0;o>>2]>>>24-i%4*8&255;o.push((s>>>4).toString(16)),o.push((15&s).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new a.init(n,t/2)}},l=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i>>2]>>>24-i%4*8&255;o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new a.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},g=s.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,o=this._data,i=o.words,s=o.sigBytes,r=this.blockSize,c=s/(4*r),u=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*r,l=e.min(4*u,s);if(u){for(var p=0;p>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a>>6*(3-a)&63));var c=o.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i>>6-s%4*2;o[i>>>2]|=a<<24-i%4*8,i++}return r.create(o,i)}(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(e){var t=a,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,r=[];!function(){for(var t=0;t<64;t++)r[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var o=t+n,i=e[o];e[o]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s=this._hash.words,a=e[t+0],c=e[t+1],h=e[t+2],g=e[t+3],f=e[t+4],m=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],I=e[t+9],M=e[t+10],C=e[t+11],T=e[t+12],S=e[t+13],E=e[t+14],k=e[t+15],D=s[0],L=s[1],R=s[2],O=s[3];D=u(D,L,R,O,a,7,r[0]),O=u(O,D,L,R,c,12,r[1]),R=u(R,O,D,L,h,17,r[2]),L=u(L,R,O,D,g,22,r[3]),D=u(D,L,R,O,f,7,r[4]),O=u(O,D,L,R,m,12,r[5]),R=u(R,O,D,L,_,17,r[6]),L=u(L,R,O,D,v,22,r[7]),D=u(D,L,R,O,y,7,r[8]),O=u(O,D,L,R,I,12,r[9]),R=u(R,O,D,L,M,17,r[10]),L=u(L,R,O,D,C,22,r[11]),D=u(D,L,R,O,T,7,r[12]),O=u(O,D,L,R,S,12,r[13]),R=u(R,O,D,L,E,17,r[14]),D=l(D,L=u(L,R,O,D,k,22,r[15]),R,O,c,5,r[16]),O=l(O,D,L,R,_,9,r[17]),R=l(R,O,D,L,C,14,r[18]),L=l(L,R,O,D,a,20,r[19]),D=l(D,L,R,O,m,5,r[20]),O=l(O,D,L,R,M,9,r[21]),R=l(R,O,D,L,k,14,r[22]),L=l(L,R,O,D,f,20,r[23]),D=l(D,L,R,O,I,5,r[24]),O=l(O,D,L,R,E,9,r[25]),R=l(R,O,D,L,g,14,r[26]),L=l(L,R,O,D,y,20,r[27]),D=l(D,L,R,O,S,5,r[28]),O=l(O,D,L,R,h,9,r[29]),R=l(R,O,D,L,v,14,r[30]),D=p(D,L=l(L,R,O,D,T,20,r[31]),R,O,m,4,r[32]),O=p(O,D,L,R,y,11,r[33]),R=p(R,O,D,L,C,16,r[34]),L=p(L,R,O,D,E,23,r[35]),D=p(D,L,R,O,c,4,r[36]),O=p(O,D,L,R,f,11,r[37]),R=p(R,O,D,L,v,16,r[38]),L=p(L,R,O,D,M,23,r[39]),D=p(D,L,R,O,S,4,r[40]),O=p(O,D,L,R,a,11,r[41]),R=p(R,O,D,L,g,16,r[42]),L=p(L,R,O,D,_,23,r[43]),D=p(D,L,R,O,I,4,r[44]),O=p(O,D,L,R,T,11,r[45]),R=p(R,O,D,L,k,16,r[46]),D=d(D,L=p(L,R,O,D,h,23,r[47]),R,O,a,6,r[48]),O=d(O,D,L,R,v,10,r[49]),R=d(R,O,D,L,E,15,r[50]),L=d(L,R,O,D,m,21,r[51]),D=d(D,L,R,O,T,6,r[52]),O=d(O,D,L,R,g,10,r[53]),R=d(R,O,D,L,M,15,r[54]),L=d(L,R,O,D,c,21,r[55]),D=d(D,L,R,O,y,6,r[56]),O=d(O,D,L,R,k,10,r[57]),R=d(R,O,D,L,_,15,r[58]),L=d(L,R,O,D,S,21,r[59]),D=d(D,L,R,O,f,6,r[60]),O=d(O,D,L,R,C,10,r[61]),R=d(R,O,D,L,h,15,r[62]),L=d(L,R,O,D,I,21,r[63]),s[0]=s[0]+D|0,s[1]=s[1]+L|0,s[2]=s[2]+R|0,s[3]=s[3]+O|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var s=e.floor(o/4294967296),r=o;n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,o,i,s,r){var a=e+(t&n|~t&o)+i+r;return(a<>>32-s)+t}function l(e,t,n,o,i,s,r){var a=e+(t&o|n&~o)+i+r;return(a<>>32-s)+t}function p(e,t,n,o,i,s,r){var a=e+(t^n^o)+i+r;return(a<>>32-s)+t}function d(e,t,n,o,i,s,r){var a=e+(n^(t|~o))+i+r;return(a<>>32-s)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),u=(c=a).lib,l=u.WordArray,p=u.Hasher,g=c.algo,f=[],m=g.SHA1=p.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],s=n[2],r=n[3],a=n[4],c=0;c<80;c++){if(c<16)f[c]=0|e[t+c];else{var u=f[c-3]^f[c-8]^f[c-14]^f[c-16];f[c]=u<<1|u>>>31}var l=(o<<5|o>>>27)+a+f[c];l+=c<20?1518500249+(i&s|~i&r):c<40?1859775393+(i^s^r):c<60?(i&s|i&r|s&r)-1894007588:(i^s^r)-899497514,a=r,r=s,s=i<<30|i>>>2,i=o,o=l}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+r|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(o+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=p.clone.call(this);return e._hash=this._hash.clone(),e}}),c.SHA1=p._createHelper(m),c.HmacSHA1=p._createHmacHelper(m),function(e){var t=a,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,r=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),o=2;o<=n;o++)if(!(t%o))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var o=2,i=0;i<64;)t(o)&&(i<8&&(r[i]=n(e.pow(o,.5))),c[i]=n(e.pow(o,1/3)),i++),o++}();var u=[],l=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(r.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],s=n[2],r=n[3],a=n[4],l=n[5],p=n[6],d=n[7],h=0;h<64;h++){if(h<16)u[h]=0|e[t+h];else{var g=u[h-15],f=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=u[h-2],_=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[h]=f+u[h-7]+_+u[h-16]}var v=o&i^o&s^i&s,y=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),I=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&p)+c[h]+u[h];d=p,p=l,l=a,a=r+I|0,r=s,s=i,i=o,o=I+(y+v)|0}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+r|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+p|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(o/4294967296),n[15+(i+64>>>9<<4)]=o,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),function(){var e=a,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i>>2]>>>16-i%4*8&65535;o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var n=e.length,o=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(o,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s>>2]>>>16-s%4*8&65535);i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var n=e.length,i=[],s=0;s>>1]|=o(e.charCodeAt(s)<<16-s%2*16);return t.create(i,2*n)}}}(),function(){if("function"==typeof ArrayBuffer){var e=a.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,o=[],i=0;i>>2]|=e[i]<<24-i%4*8;t.call(this,o,n)}else t.apply(this,arguments)}).prototype=e}}(), /** @preserve (c) 2012 by C��dric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function(){var e=a,t=e.lib,n=t.WordArray,o=t.Hasher,i=e.algo,s=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),r=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),p=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=i.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var o=t+n,i=e[o];e[o]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a,d,y,I,M,C,T,S,E,k,D,L=this._hash.words,R=l.words,O=p.words,A=s.words,b=r.words,P=c.words,N=u.words;for(C=a=L[0],T=d=L[1],S=y=L[2],E=I=L[3],k=M=L[4],n=0;n<80;n+=1)D=a+e[t+A[n]]|0,D+=n<16?h(d,y,I)+R[0]:n<32?g(d,y,I)+R[1]:n<48?f(d,y,I)+R[2]:n<64?m(d,y,I)+R[3]:_(d,y,I)+R[4],D=(D=v(D|=0,P[n]))+M|0,a=M,M=I,I=v(y,10),y=d,d=D,D=C+e[t+b[n]]|0,D+=n<16?_(T,S,E)+O[0]:n<32?m(T,S,E)+O[1]:n<48?f(T,S,E)+O[2]:n<64?g(T,S,E)+O[3]:h(T,S,E)+O[4],D=(D=v(D|=0,N[n]))+k|0,C=k,k=E,E=v(S,10),S=T,T=D;D=L[1]+y+E|0,L[1]=L[2]+I+k|0,L[2]=L[3]+M+C|0,L[3]=L[4]+a+T|0,L[4]=L[0]+d+S|0,L[0]=D},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,s=i.words,r=0;r<5;r++){var a=s[r];s[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,n){return e^t^n}function g(e,t,n){return e&t|~e&n}function f(e,t,n){return(e|~t)^n}function m(e,t,n){return e&n|t&~n}function _(e,t,n){return e^(t|~n)}function v(e,t){return e<>>32-t}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(),function(){var e=a,t=e.lib.Base,n=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var o=e.blockSize,i=4*o;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),r=this._iKey=t.clone(),a=s.words,c=r.words,u=0;u>>24)|4278255360&(s<<24|s>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(L=n[i]).high^=r,L.low^=s}for(var a=0;a<24;a++){for(var d=0;d<5;d++){for(var h=0,g=0,f=0;f<5;f++)h^=(L=n[d+5*f]).high,g^=L.low;var m=p[d];m.high=h,m.low=g}for(d=0;d<5;d++){var _=p[(d+4)%5],v=p[(d+1)%5],y=v.high,I=v.low;for(h=_.high^(y<<1|I>>>31),g=_.low^(I<<1|y>>>31),f=0;f<5;f++)(L=n[d+5*f]).high^=h,L.low^=g}for(var M=1;M<25;M++){var C=(L=n[M]).high,T=L.low,S=c[M];S<32?(h=C<>>32-S,g=T<>>32-S):(h=T<>>64-S,g=C<>>64-S);var E=p[u[M]];E.high=h,E.low=g}var k=p[0],D=n[0];for(k.high=D.high,k.low=D.low,d=0;d<5;d++)for(f=0;f<5;f++){var L=n[M=d+5*f],R=p[M],O=p[(d+1)%5+5*f],A=p[(d+2)%5+5*f];L.high=R.high^~O.high&A.high,L.low=R.low^~O.low&A.low}L=n[0];var b=l[a];L.high^=b.high,L.low^=b.low}},_doFinalize:function(){var t=this._data,n=t.words,i=(this._nDataBytes,8*t.sigBytes),s=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(e.ceil((i+1)/s)*s>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var r=this._state,a=this.cfg.outputLength/8,c=a/8,u=[],l=0;l>>24)|4278255360&(d<<24|d>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),u.push(h),u.push(d)}return new o.init(u,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(d),t.HmacSHA3=i._createHmacHelper(d)}(Math),function(){var e=a,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function r(){return o.create.apply(o,arguments)}var c=[r(1116352408,3609767458),r(1899447441,602891725),r(3049323471,3964484399),r(3921009573,2173295548),r(961987163,4081628472),r(1508970993,3053834265),r(2453635748,2937671579),r(2870763221,3664609560),r(3624381080,2734883394),r(310598401,1164996542),r(607225278,1323610764),r(1426881987,3590304994),r(1925078388,4068182383),r(2162078206,991336113),r(2614888103,633803317),r(3248222580,3479774868),r(3835390401,2666613458),r(4022224774,944711139),r(264347078,2341262773),r(604807628,2007800933),r(770255983,1495990901),r(1249150122,1856431235),r(1555081692,3175218132),r(1996064986,2198950837),r(2554220882,3999719339),r(2821834349,766784016),r(2952996808,2566594879),r(3210313671,3203337956),r(3336571891,1034457026),r(3584528711,2466948901),r(113926993,3758326383),r(338241895,168717936),r(666307205,1188179964),r(773529912,1546045734),r(1294757372,1522805485),r(1396182291,2643833823),r(1695183700,2343527390),r(1986661051,1014477480),r(2177026350,1206759142),r(2456956037,344077627),r(2730485921,1290863460),r(2820302411,3158454273),r(3259730800,3505952657),r(3345764771,106217008),r(3516065817,3606008344),r(3600352804,1432725776),r(4094571909,1467031594),r(275423344,851169720),r(430227734,3100823752),r(506948616,1363258195),r(659060556,3750685593),r(883997877,3785050280),r(958139571,3318307427),r(1322822218,3812723403),r(1537002063,2003034995),r(1747873779,3602036899),r(1955562222,1575990012),r(2024104815,1125592928),r(2227730452,2716904306),r(2361852424,442776044),r(2428436474,593698344),r(2756734187,3733110249),r(3204031479,2999351573),r(3329325298,3815920427),r(3391569614,3928383900),r(3515267271,566280711),r(3940187606,3454069534),r(4118630271,4000239992),r(116418474,1914138554),r(174292421,2731055270),r(289380356,3203993006),r(460393269,320620315),r(685471733,587496836),r(852142971,1086792851),r(1017036298,365543100),r(1126000580,2618297676),r(1288033470,3409855158),r(1501505948,4234509866),r(1607167915,987167468),r(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=r()}();var l=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],s=n[2],r=n[3],a=n[4],l=n[5],p=n[6],d=n[7],h=o.high,g=o.low,f=i.high,m=i.low,_=s.high,v=s.low,y=r.high,I=r.low,M=a.high,C=a.low,T=l.high,S=l.low,E=p.high,k=p.low,D=d.high,L=d.low,R=h,O=g,A=f,b=m,P=_,N=v,x=y,w=I,U=M,G=C,F=T,B=S,q=E,V=k,j=D,H=L,K=0;K<80;K++){var $,z,Y=u[K];if(K<16)z=Y.high=0|e[t+2*K],$=Y.low=0|e[t+2*K+1];else{var W=u[K-15],J=W.high,X=W.low,Z=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=u[K-2],te=ee.high,ne=ee.low,oe=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),se=u[K-7],re=se.high,ae=se.low,ce=u[K-16],ue=ce.high,le=ce.low;z=(z=(z=Z+re+(($=Q+ae)>>>0>>0?1:0))+oe+(($+=ie)>>>0>>0?1:0))+ue+(($+=le)>>>0>>0?1:0),Y.high=z,Y.low=$}var pe,de=U&F^~U&q,he=G&B^~G&V,ge=R&A^R&P^A&P,fe=O&b^O&N^b&N,me=(R>>>28|O<<4)^(R<<30|O>>>2)^(R<<25|O>>>7),_e=(O>>>28|R<<4)^(O<<30|R>>>2)^(O<<25|R>>>7),ve=(U>>>14|G<<18)^(U>>>18|G<<14)^(U<<23|G>>>9),ye=(G>>>14|U<<18)^(G>>>18|U<<14)^(G<<23|U>>>9),Ie=c[K],Me=Ie.high,Ce=Ie.low,Te=j+ve+((pe=H+ye)>>>0>>0?1:0),Se=_e+fe;j=q,H=V,q=F,V=B,F=U,B=G,U=x+(Te=(Te=(Te=Te+de+((pe+=he)>>>0>>0?1:0))+Me+((pe+=Ce)>>>0>>0?1:0))+z+((pe+=$)>>>0<$>>>0?1:0))+((G=w+pe|0)>>>0>>0?1:0)|0,x=P,w=N,P=A,N=b,A=R,b=O,R=Te+(me+ge+(Se>>>0<_e>>>0?1:0))+((O=pe+Se|0)>>>0>>0?1:0)|0}g=o.low=g+O,o.high=h+R+(g>>>0>>0?1:0),m=i.low=m+b,i.high=f+A+(m>>>0>>0?1:0),v=s.low=v+N,s.high=_+P+(v>>>0>>0?1:0),I=r.low=I+w,r.high=y+x+(I>>>0>>0?1:0),C=a.low=C+G,a.high=M+U+(C>>>0>>0?1:0),S=l.low=S+B,l.high=T+F+(S>>>0>>0?1:0),k=p.low=k+V,p.high=E+q+(k>>>0>>0?1:0),L=d.low=L+H,d.high=D+j+(L>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[30+(o+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(o+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),function(){var e=a,t=e.x64,n=t.Word,o=t.WordArray,i=e.algo,s=i.SHA512,r=i.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=s._createHelper(r),e.HmacSHA384=s._createHmacHelper(r)}(),a.lib.Cipher||function(){var e=a,t=e.lib,n=t.Base,o=t.WordArray,i=t.BufferedBlockAlgorithm,s=e.enc,r=(s.Utf8,s.Base64),c=e.algo.EvpKDF,u=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:m}return function(t){return{encrypt:function(n,o,i){return e(o).encrypt(t,n,o,i)},decrypt:function(n,o,i){return e(o).decrypt(t,n,o,i)}}}}()}),l=(t.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),p=t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=l.CBC=function(){var e=p.extend();function t(e,t,n){var o,i=this._iv;i?(o=i,this._iv=void 0):o=this._prevBlock;for(var s=0;s>>2];e.sigBytes-=t}},g=(t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:d,padding:h}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,o=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=o.createEncryptor:(e=o.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(o,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),f=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(r)},parse:function(e){var t,n=r.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=o.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},m=t.SerializableCipher=n.extend({cfg:n.extend({format:f}),encrypt:function(e,t,n,o){o=this.cfg.extend(o);var i=e.createEncryptor(n,o),s=i.finalize(t),r=i.cfg;return g.create({ciphertext:s,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:o.format})},decrypt:function(e,t,n,o){return o=this.cfg.extend(o),t=this._parse(t,o.format),e.createDecryptor(n,o).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(e.kdf={}).OpenSSL={execute:function(e,t,n,i){i||(i=o.random(8));var s=c.create({keySize:t+n}).compute(e,i),r=o.create(s.words.slice(t),4*n);return s.sigBytes=4*t,g.create({key:s,iv:r,salt:i})}},v=t.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:_}),encrypt:function(e,t,n,o){var i=(o=this.cfg.extend(o)).kdf.execute(n,e.keySize,e.ivSize);o.iv=i.iv;var s=m.encrypt.call(this,e,t,i.key,o);return s.mixIn(i),s},decrypt:function(e,t,n,o){o=this.cfg.extend(o),t=this._parse(t,o.format);var i=o.kdf.execute(n,e.keySize,e.ivSize,t.salt);return o.iv=i.iv,m.decrypt.call(this,e,t,i.key,o)}})}(),a.mode.CFB=function(){var e=a.lib.BlockCipherMode.extend();function t(e,t,n,o){var i,s=this._iv;s?(i=s.slice(0),this._iv=void 0):i=this._prevBlock,o.encryptBlock(i,0);for(var r=0;r>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(a.lib.WordArray.random(o-1)).concat(a.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.pad.Iso97971={pad:function(e,t){e.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(e,t)},unpad:function(e){a.pad.ZeroPadding.unpad(e),e.sigBytes--}},a.mode.OFB=(o=(n=a.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,o=n.blockSize,i=this._iv,s=this._keystream;i&&(s=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(s,0);for(var r=0;r>>8^255&g^99,o[n]=g,i[g]=n;var f=e[n],m=e[f],_=e[m],v=257*e[g]^16843008*g;s[n]=v<<24|v>>>8,r[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*_^65537*m^257*f^16843008*n,l[g]=v<<24|v>>>8,p[g]=v<<16|v>>>16,d[g]=v<<8|v>>>24,h[g]=v,n?(n=f^e[e[e[_^f]]],a^=e[e[a]]):n=a=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],f=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,i=4*((this._nRounds=n+6)+1),s=this._keySchedule=[],r=0;r6&&r%n==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=g[r/n|0]<<24),s[r]=s[r-n]^u);for(var a=this._invKeySchedule=[],c=0;c>>24]]^p[o[u>>>16&255]]^d[o[u>>>8&255]]^h[o[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,r,c,u,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,p,d,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,o,i,s,r,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],p=e[t+2]^n[2],d=e[t+3]^n[3],h=4,g=1;g>>24]^i[l>>>16&255]^s[p>>>8&255]^r[255&d]^n[h++],m=o[l>>>24]^i[p>>>16&255]^s[d>>>8&255]^r[255&u]^n[h++],_=o[p>>>24]^i[d>>>16&255]^s[u>>>8&255]^r[255&l]^n[h++],v=o[d>>>24]^i[u>>>16&255]^s[l>>>8&255]^r[255&p]^n[h++];u=f,l=m,p=_,d=v}f=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^n[h++],m=(a[l>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[h++],_=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[h++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&p])^n[h++],e[t]=f,e[t+1]=m,e[t+2]=_,e[t+3]=v},keySize:8});e.AES=t._createHelper(f)}(),function(){var e=a,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],r=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],p=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var o=s[n]-1;t[n]=e[o>>>5]>>>31-o%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var u=i[a]=[],l=c[a];for(n=0;n<24;n++)u[n/6|0]|=t[(r[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(r[n+24]-1+l)%28]<<31-n%6;for(u[0]=u[0]<<1|u[0]>>>31,n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var p=this._invSubKeys=[];for(n=0;n<16;n++)p[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),d.call(this,1,1431655765);for(var o=0;o<16;o++){for(var i=n[o],s=this._lBlock,r=this._rBlock,a=0,c=0;c<8;c++)a|=u[c][((r^i[c])&l[c])>>>0];this._lBlock=r,this._rBlock=s^a}var p=this._lBlock;this._lBlock=this._rBlock,this._rBlock=p,d.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),o=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=p.createEncryptor(n.create(t)),this._des2=p.createEncryptor(n.create(o)),this._des3=p.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(g)}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,o=this._S=[],i=0;i<256;i++)o[i]=i;i=0;for(var s=0;i<256;i++){var r=i%n,a=t[r>>>2]>>>24-r%4*8&255;s=(s+o[i]+a)%256;var c=o[i];o[i]=o[s],o[s]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,o=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var s=e[t];e[t]=e[n],e[n]=s,o|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,o}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(), /** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */ a.mode.CTRGladman=function(){var e=a.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,n=e>>8&255,o=255&e;255===t?(t=0,255===n?(n=0,255===o?o=0:++o):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=o}return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var o,i=this._cipher,s=i.blockSize,r=this._iv,a=this._counter;r&&(a=this._counter=r.slice(0),this._iv=void 0),0===((o=a)[0]=t(o[0]))&&(o[1]=t(o[1]));var c=a.slice(0);i.encryptBlock(c,0);for(var u=0;u>>24)|4278255360&(e[n]<<24|e[n]>>>8);var o=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=o[n+4&7];if(t){var s=t.words,r=s[0],a=s[1],u=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),p=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=p,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=p,i[6]^=l,i[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var o=e[n]+t[n],r=65535&o,a=o>>>16,c=((r*r>>>17)+r*a>>>15)+a*a,u=((4294901760&o)*o|0)+((65535&o)*o|0);s[n]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(r)}(),a.mode.CTR=function(){var e=a.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,o=n.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0);var r=s.slice(0);n.encryptBlock(r,0),s[o-1]=s[o-1]+1|0;for(var a=0;a>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)o[i]^=n[i+4&7];if(t){var s=t.words,r=s[0],a=s[1],u=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),p=u>>>16|4294901760&l,d=l<<16|65535&u;for(o[0]^=u,o[1]^=p,o[2]^=l,o[3]^=d,o[4]^=u,o[5]^=p,o[6]^=l,o[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var o=e[n]+t[n],r=65535&o,a=o>>>16,c=((r*r>>>17)+r*a>>>15)+a*a,u=((4294901760&o)*o|0)+((65535&o)*o|0);s[n]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(r)}(),a.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},a)},c(u={exports:{}},u.exports),u.exports);return function(){function t(n){e(this,t);var o=n.isArray,i=n.isMap,s=n.isDevMode;this._isArray=o,this._isMap=i,this._isDevMode=s,this._interceptProfanityList=[],this._interceptFilter=null,this._interceptRegExpList=[],this._replacingProfanityMap=new Map,this._replacingFilter=null,this._replacingRegExpMap=new Map,this._key="",this._iv="",this._decryptOptions=void 0,this._n="TIMProfanityFilterPlugin",!0===s&&console.log("".concat(this._n,".VERSION:").concat("1.1.0"))}return n(t,[{key:"onToken",value:function(e){this._key=g.enc.Utf8.parse(e.slice(0,32)),this._iv=this._key,this._decryptOptions={iv:this._iv,mode:g.mode.CBC,padding:g.pad.Pkcs7}}},{key:"onLexiconSliced",value:function(e){if(this._isArray(e)&&0!==e.length){var t,n,o,i=a(e);try{for(i.s();!(o=i.n()).done;){var s=o.value,r=s.filterType,c=s.profanityType,u=s.profanity,l=s.replacement;t=this._getDecryptedString(u),n=this._getDecryptedString(l),1===r?1===c?this._interceptProfanityList.push(t):2===c&&this._interceptRegExpList.push(t):2===r&&(1===c?this._replacingProfanityMap.set(t,n):2===c&&this._replacingRegExpMap.set(t,n))}}catch(p){i.e(p)}finally{i.f()}}}},{key:"_getDecryptedString",value:function(e){var t=g.AES.decrypt(e,this._key,this._decryptOptions);return g.enc.Utf8.stringify(t).toLowerCase()}},{key:"onLexiconCompleted",value:function(e){this.onLexiconSliced(e),this._interceptFilter=new p({input:this._interceptProfanityList,isArray:this._isArray,isMap:this._isMap}),this._replacingFilter=new p({input:this._replacingProfanityMap,isArray:this._isArray,isMap:this._isMap}),!0===this._isDevMode&&(console.log("".concat(this._n," _interceptProfanityList ->"),this._interceptProfanityList),console.log("".concat(this._n," _interceptRegExpList ->"),this._interceptRegExpList),console.log("".concat(this._n," _replacingProfanityMap ->"),this._replacingProfanityMap),console.log("".concat(this._n," _replacingRegExpMap ->"),this._replacingRegExpMap))}},{key:"filter",value:function(e){var t={type:0,modifiedText:e};if("string"!=typeof e)return!0===this._isDevMode&&console.warn("".concat(this._n,".filter invalid params, string required!")),t;if(!0===this._interceptFilter.filter({text:e,replacingEnabled:!1}).isMatched)return t.type=1,t;for(var n=!1,i=0,s=this._interceptRegExpList.length;i-1&&n.splice(o,1)}}getExtensionList(e,t){const n=t?`params:${JSON.stringify(t)}`:"";console.log(`TUIExtensionManager.getExtensionList extensionID:${e} ${n}`);let o=[],i=[];if(this.extensionMap.has(e)){o=this.extensionMap.get(e);for(let n=0;n(this.userID="",this.userSig="",this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}destroy(){return this.chat.destroy().then((e=>(this.userID="",this.userSig="",this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}setLogLevel(e){return this.chat.setLogLevel(e)}getContext(){return{chat:this.chat,SDKAppID:this.SDKAppID,userID:this.userID,userSig:this.userSig}}reportPlugin(){var e;for(const t in tl)this.TUICore.getService(t)&&(null===(e=this.chat.callExperimentalAPI("isFeatureEnabledForStat",tl[t]))||void 0===e||e.catch((e=>{})))}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,o)=>{this.chat.login({userID:t,userSig:n}).then((t=>{t.data.repeatLogin&&this.chat.isReady()&&e(t),this.reportPlugin(),this.loginStatusPromise.set("login",{resolve:e,reject:o,imResponse:t})})).catch((e=>{o(e)}))}))}onChatEvent(){this.chat.on(this.EVENT.SDK_READY,this.onSDKReady,this),this.chat.on(this.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.chat.on(this.EVENT.KICKED_OUT,this.onUserKicked,this),this.isOnChatEvent=!0}offChatEvent(){this.isOnChatEvent&&(this.chat.off(this.EVENT.SDK_READY,this.onSDKReady,this),this.chat.off(this.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.chat.off(this.EVENT.KICKED_OUT,this.onUserKicked,this),this.isOnChatEvent=!1)}onSDKReady(){if(this.loginStatusPromise.has("login")){this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS);const e=setTimeout((()=>{const t=this.loginStatusPromise.get("login");t.resolve(t.imResponse),clearTimeout(e),this.loginStatusPromise.delete("login")}),500)}}onSDKNotReady(){this.loginStatusPromise.has("login")&&this.loginStatusPromise.get("login").reject(new Error("sdk not ready")),this.loginStatusPromise.delete("login")}onUserKicked(e){e.data.type!==this.TYPES.KICKED_OUT_USERSIG_EXPIRED?this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_KICKED_OFFLINE):this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_SIG_EXPIRED)}registerPlugin(e){const{useUploadPlugin:t=!1,useProfanityFilterPlugin:n=!1,TUIOfflinePush:o,offlinePushConfig:i,TIMPush:s,pushConfig:r}=e;!0===t&&this.chat.registerPlugin({"tim-upload-plugin":wu}),!0===n&&this.chat.registerPlugin({"tim-profanity-filter-plugin":Gu}),el&&s&&r&&this.chat.registerPlugin({"tim-push":s,pushConfig:r}),el&&o&&i&&this.chat.registerPlugin({"tim-offline-push-plugin":o,offlinePushConfig:i})}getStatScene(e){let t;return e&&qu.indexOf(e)>-1&&(t=this.genStatScene(e)),t}genStatScene(e){if("rn"===e)return"k-rn";let t="";return Ku?(Qu&&(t=`k-${e}-pc-uni`),Zu&&(t=`k-${e}-h5-uni`),el&&(t=`k-${e}-app-uni`),ju&&(t=`k-${e}-mp-uni`),t):(Qu&&(t=`k-${e}-pc`),Zu&&(t=`k-${e}-h5`),t)}},ol=class{constructor(){this.eventMap=new Map}registerEvent(e,t,n){const o=this.getKey(e,t);if(console.log(`TUIEventManager.registerEvent eventName:${e} subKey:${t}`),!this.eventMap.has(o)){const e=[];this.eventMap.set(o,e)}const i=this.eventMap.get(o);-1===i.indexOf(n)&&(i.push(n),this.renotify(e,t,n))}unregisterEvent(e,t,n){console.log(`TUIEventManager.unregisterEvent eventName:${e} subKey:${t}`);const o=this.getKey(e,t);if(this.eventMap.has(o)){const e=this.eventMap.get(o),t=e.indexOf(n);t>-1&&e.splice(t,1)}}notifyEvent(e,t,n){const o=this.getKey(e,t),i=n?`params:${JSON.stringify(n)}`:"";console.log(`TUIEventManager.notifyEvent eventName:${e} subKey:${t} ${i}`),this.eventMap.has(o)&&this.eventMap.get(o).forEach((o=>{o.onNotifyEvent(e,t,n)}))}getKey(e,t){let n=e;return t&&(n=`${e}-${n}`),n}renotify(e,t,n){if(e===Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED&&t===Vu.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS){const{chat:e}=nl.getInstance().getContext();e&&e.isReady()&&(n.onNotifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS),console.log("TUIEventManager.renotify success."))}}};console.log("TUICore.VERSION:2.4.0");const il=class e{constructor(){this.serviceManager=new Fu,this.extensionManager=new Bu,this.eventManager=new ol}static getInstance(){return e.instance||(console.log("TUICore.getInstance ok."),e.instance=new e),e.instance}registerService(e,t){return this.serviceManager.registerService(e,t)}unregisterService(e){return this.serviceManager.unregisterService(e)}getService(e){return this.serviceManager.getService(e)}callService(e){return this.serviceManager.callService(e)}registerExtension(e,t){return this.extensionManager.registerExtension(e,t)}unregisterExtension(e,t){return this.extensionManager.unregisterExtension(e,t)}getExtensionList(e,t){return this.extensionManager.getExtensionList(e,t)}registerEvent(e,t,n){return this.eventManager.registerEvent(e,t,n)}unregisterEvent(e,t,n){return this.eventManager.unregisterEvent(e,t,n)}notifyEvent(e,t,n){return this.eventManager.notifyEvent(e,t,n)}}.getInstance(),sl=nl.getInstance(il);var rl={exports:{}};window,rl.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/Users/chrisftian/Documents/projects/cos-sdk/cos-wx-sdk-v5/dist",n(n.s=8)}([function(e,t,n){function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,s=function(){};return{s:s,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw r}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n=0;--s){var r=this.tryEntries[s],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=o.call(r,"catchLoc"),u=o.call(r,"finallyLoc");if(c&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:P(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function r(e,t,n,o,i,s,r){try{var a=e[s](r),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(o,i)}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=n(10),u=n(13),l=n(14),p=l.btoa,d=Un.getFileSystemManager(),h=n(2),g=n(15),f=g.XMLParser,m=g.XMLBuilder,_=new f({ignoreDeclaration:!0,ignoreAttributes:!0,parseTagValue:!1,trimValues:!1}),v=new m,y=function e(t){if(L(t))for(var n in t){var o=t[n];"string"==typeof o?"#text"===n&&delete t[n]:Array.isArray(o)?o.forEach((function(t){e(t)})):L(o)&&e(o)}};function I(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function M(e,t){var n=[];for(var o in e)e.hasOwnProperty(o)&&n.push(t?I(o).toLowerCase():o);return n.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}var C=["cache-control","content-disposition","content-encoding","content-length","content-md5","content-type","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],T=function(){},S=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t};function E(e){return O(e,(function(e){return"object"===a(e)&&null!==e?E(e):e}))}function k(e,t){return R(t,(function(n,o){e[o]=t[o]})),e}function D(e){return e instanceof Array}function L(e){return"[object Object]"===Object.prototype.toString.call(e)}function R(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)}function O(e,t){var n=D(e)?[]:{};for(var o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o],o));return n}var A,b,P=function(e,t){if(t=k({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};t&&"object"===a(t)&&(function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}(),F.each({"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-forbid-overwrite":"ForbidOverwrite","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"},(function(e,o){void 0!==t[e]&&(n[o]=t[e])})),t.Headers=S(n))}return t},N=function(e){return new Promise((function(t,n){d.readFile({filePath:e,success:function(e){t(e.data)},fail:function(e){n((null==e?void 0:e.errMsg)||"")}})}))},x=(A=s().mark((function e(t,n,o){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("postObject"!==t){e.next=4;break}o(),e.next=21;break;case 4:if("putObject"!==t){e.next=20;break}if(void 0!==n.Body||!n.FilePath){e.next=17;break}return e.prev=6,e.next=9,N(n.FilePath);case 9:n.Body=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),n.Body=void 0,o({error:"readFile error, ".concat(e.t0)}),e.abrupt("return");case 17:void 0!==n.Body?(n.ContentLength=n.Body.byteLength,o(null,n.ContentLength)):o({error:"missing param Body"}),e.next=21;break;case 20:n.FilePath?d.stat({path:n.FilePath,success:function(e){var t=e.stats;n.FileStat=t,n.FileStat.FilePath=n.FilePath;var i=t.isDirectory()?0:t.size;n.ContentLength=i=i||0,o(null,i)},fail:function(e){o(e)}}):o({error:"missing param FilePath"});case 21:case"end":return e.stop()}}),e,null,[[6,12]])})),b=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=A.apply(e,t);function s(e){r(i,n,o,s,a,"next",e)}function a(e){r(i,n,o,s,a,"throw",e)}s(void 0)}))},function(e,t,n){return b.apply(this,arguments)}),w=function(e){return Date.now()+(e||0)},U=function(e,t){if(!e||!t)return-1;e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengths)return 1;if(i=0);return function(){return o}}(),F={noop:T,formatParams:P,apiWrapper:function(e,t){return function(n,o){var i,s=this;if("function"==typeof n&&(o=n,n={}),n=P(e,n),s.options.EnableReporter)if("sliceUploadFile"===n.calledBySdk||"sliceCopyFile"===n.calledBySdk)i=n.tracker&&n.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))i=null;else{var r=0;n.Body&&(r="string"==typeof n.Body?n.Body.length:n.Body.size||n.Body.byteLength||0);var a=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate.");i=new h({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:n.Bucket,region:n.Region,apiName:e,realApi:e,accelerate:a,fileKey:n.Key,fileSize:r,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})}n.tracker=i;var c=function(e){return e&&e.headers&&(e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},u=function(e,t){i&&i.report(e,t),o&&o(c(e),c(t))},l=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=function(e,t){var n=t.Bucket,o=t.Region,i=t.Key;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!o)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(!n)return"Bucket";if(!o)return"Region";if(!i)return"Key"}return!1}(e,n);if(t)return"missing param "+t;if(n.Region){if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error.";!s.options.CompatibilityMode&&-1===n.Region.indexOf("-")&&"yfb"!==n.Region&&"default"!==n.Region&&n.Region}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else{if(!s.options.AppId)return'Bucket should format as "test-1250000000".';n.Bucket=n.Bucket+"-"+s.options.AppId}n.AppId&&delete n.AppId}n.Key&&"/"===n.Key.substr(0,1)&&(n.Key=n.Key.substr(1))}}(),p=["getAuth","getObjectUrl"].includes(e);if(!p&&!o)return new Promise((function(e,i){if(o=function(t,n){t?i(t):e(n)},l)return u({error:l});t.call(s,n,u)}));if(l)return u({error:l});var d=t.call(s,n,u);return p?d:void 0}},xml2json:function(e){var t=_.parse(e);return y(t),t},json2xml:function(e){return v.build(e)},md5:c,clearKey:S,fileSlice:function(e,t,n,o){e?d.readFile({filePath:e,position:t,length:n-t,success:function(e){o(e.data)},fail:function(){o(null)}}):o(null)},getBodyMd5:function(e,t,n){n=n||T,e&&t&&t instanceof ArrayBuffer?F.getFileMd5(t,(function(e,t){n(t)})):n()},getFileMd5:function(e,t){var n=c(e);return t&&t(n),n},binaryBase64:function(e){var t,n,o,i="";for(t=0,n=e.length/2;t-1||o.indexOf("x-ci-")>-1||C.indexOf(o)>-1)&&(t[n]=e[n])}return t}(E(e.Headers||e.headers||{})),c=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+c:0!==(t=e.Pathname||e.pathname||c).indexOf("/")&&(t="/"+t);var l=!1!==e.ForceSignHost;if(!a.Host&&!a.host&&e.Bucket&&e.Region&&l&&(a.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),n&&o){var p=Math.round(w(e.SystemClockOffset)/1e3)-1,d=p,h=e.Expires||e.expires;d+=void 0===h?900:1*h||0;var g=n,f=i||p+";"+d,m=i||p+";"+d,_=M(a,!0).join(";").toLowerCase(),v=M(r,!0).join(";").toLowerCase(),y=u.HmacSHA1(m,o).toString(),I=[s,t,F.obj2str(r,!0),F.obj2str(a,!0),""].join("\n"),T=["sha1",f,u.SHA1(I).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+g,"q-sign-time="+f,"q-key-time="+m,"q-header-list="+_,"q-url-param-list="+v,"q-signature="+u.HmacSHA1(T,y).toString()].join("&")}},compareVersion:U,canFileSlice:G,isCIHost:function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},error:function(e,t){var n=e;return e.message=e.message||null,"string"==typeof t?(e.error=t,e.message=t):"object"===a(t)&&null!==t&&(k(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"==typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=E(n)),e},getSourceParams:function(e){var t=this.options.CopySourceParser;if(t)return t(e);var n=e.match(/^([^.]+-\d+)\.cos(v6|-cdc|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return n?{Bucket:n[1],Region:n[3],Key:n[7]}:null},encodeBase64:function(e,t){var n=l.encode(e);return t&&(n=n.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),n},simplifyPath:function(e){var t,n=[],i=o(e.split("/"));try{for(i.s();!(t=i.n()).done;){var s=t.value;".."===s?n.length&&n.pop():s.length&&"."!==s&&n.push(s)}}catch(r){i.e(r)}finally{i.f()}return"/"+n.join("/")},arrayBufferToString:function(e){return new TextDecoder("utf-8").decode(e)},parseResBody:function(e){var t;if(e&&"string"==typeof e){var n=e.trim(),o=0===n.indexOf("<"),i=0===n.indexOf("{");if(o)t=F.xml2json(e)||{};else if(i)try{var s=e.replace(/\n/g," "),r=JSON.parse(s);t="[object Object]"===Object.prototype.toString.call(r)?r:e}catch(a){t=e}else t=e}else t=e||{};return t}};e.exports=F},function(e,t,n){const o=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+o+"]["+o+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+i+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const o=Object.keys(t),i=o.length;for(let s=0;s=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var c=s.call(r,"catchLoc"),u=s.call(r,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:P(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function s(e,t,n,o,i,s,r){try{var a=e[s](r),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(o,i)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function a(e){s(r,o,i,a,c,"next",e)}function c(e){s(r,o,i,a,c,"throw",e)}a(void 0)}))}}function a(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){for(var n=0;n5&&"xml"===o)return g("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},i,t);const n=[];let c=!1,u=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)v+=e[i];if(v=v.trim(),"/"===v[v.length-1]&&(v=v.substring(0,v.length-1),i--),p=v,!o.isName(p)){let t;return t=0===v.trim().length?"Invalid space after '<'.":"Tag '"+v+"' is an invalid name.",g("InvalidTag",t,m(e,i))}const y=l(e,i);if(!1===y)return g("InvalidAttr","Attributes for '"+v+"' have open quote.",m(e,i));let I=y.value;if(i=y.index,"/"===I[I.length-1]){const n=i-I.length;I=I.substring(0,I.length-1);const o=d(I,t);if(!0!==o)return g(o.err.code,o.err.msg,m(e,n+o.err.line));c=!0}else if(_){if(!y.tagClosed)return g("InvalidTag","Closing tag '"+v+"' doesn't have proper closing.",m(e,i));if(I.trim().length>0)return g("InvalidTag","Closing tag '"+v+"' can't have attributes or invalid starting.",m(e,f));if(0===n.length)return g("InvalidTag","Closing tag '"+v+"' has not been opened.",m(e,f));{const t=n.pop();if(v!==t.tagName){let n=m(e,t.tagStartPos);return g("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+v+"'.",m(e,f))}0==n.length&&(u=!0)}}else{const o=d(I,t);if(!0!==o)return g(o.err.code,o.err.msg,m(e,i-I.length+o.err.line));if(!0===u)return g("InvalidXml","Multiple possible root nodes found.",m(e,i));-1!==t.unpairedTags.indexOf(v)||n.push({tagName:v,tagStartPos:f}),c=!0}for(i++;i0)||g("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):g("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(e,t){let n="",o="",i=!1;for(;t"===e[t]&&""===o){i=!0;break}n+=e[t]}return""===o&&{value:n,index:t,tagClosed:i}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(e,t){const n=o.getAllMatches(e,p),i={};for(let o=0;o{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1}},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var o=n(e),i=o.length-1;i>=0;i--)t===o[i]&&o.splice(i,1)},e.emit=function(e,t){for(var o=n(e).map((function(e){return e})),i=0;i=0;n--){var i=o[n][2];(!i||i+2592e3=0;s--){var r=o[s];(r[0]===e&&r[1]===t||e!==r[0]&&0===r[0].indexOf(i))&&o.splice(s,1)}o.unshift([e,t,Math.round(Date.now()/1e3)]),o.length>n&&o.splice(n),u()}},removeUploadId:function(e){c(),delete l.using[e];for(var t=o.length-1;t>=0;t--)o[t][1]===e&&o.splice(t,1);u()}};e.exports=l},function(e,t,n){var o=n(9);e.exports=o},function(e,t,n){var o=n(0),i=n(6),s=n(25),r=n(26),a=n(32),c=n(3),u={SecretId:"",SecretKey:"",SecurityToken:"",StartTime:0,ExpiredTime:0,ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,HttpDNSServiceId:"",SimpleUploadMethod:"postObject",AutoSwitchHost:!1,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},l=function(e){if(this.options=o.extend(o.clone(u),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId,this.options.SecretId&&this.options.SecretId.indexOf(" "),this.options.SecretKey&&this.options.SecretKey.indexOf(" "),this.options.ForcePathStyle)throw new Error("ForcePathStyle is not supported");i.init(this),s.init(this)};r.init(l,s),a.init(l,s),l.util={md5:o.md5,xml2json:o.xml2json,json2xml:o.json2xml,encodeBase64:o.encodeBase64},l.getAuthorization=o.getAuth,l.version=c.version,e.exports=l},function(e,t,n){(function(e){var t;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){var i="input is invalid type",s="object"===("undefined"==typeof window?"undefined":o(window)),r=s?window:{};r.JS_MD5_NO_WINDOW&&(s=!1),!s&&"object"===("undefined"==typeof self?"undefined":o(self))&&(r=self);var a,c=!r.JS_MD5_NO_COMMON_JS&&"object"===o(e)&&e.exports,u=n(12),l=!r.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),d=[128,32768,8388608,-2147483648],h=[0,8,16,24],g=["hex","array","digest","buffer","arrayBuffer","base64"],f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),m=[];if(l){var _=new ArrayBuffer(68);a=new Uint8Array(_),m=new Uint32Array(_)}!r.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===o(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(e){return function(t){return new y(!0).update(t)[e]()}};function y(e){if(e)m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m,this.buffer8=a;else if(l){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}y.prototype.update=function(e){if(!this.finalized){var t,n=o(e);if("string"!==n){if("object"!==n)throw i;if(null===e)throw i;if(!l||e.constructor!==ArrayBuffer&&"ArrayBuffer"!==e.constructor.name){if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw i}else e=new Uint8Array(e);t=!0}for(var s,r,a=0,c=e.length,u=this.blocks,p=this.buffer8;a>2]|=e[a]<>6,p[r++]=128|63&s):s<55296||s>=57344?(p[r++]=224|s>>12,p[r++]=128|s>>6&63,p[r++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),p[r++]=240|s>>18,p[r++]=128|s>>12&63,p[r++]=128|s>>6&63,p[r++]=128|63&s);else for(r=this.start;a>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[r>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=d[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},y.prototype.hash=function(){var e,t,n,o,i,s,r=this.blocks;this.first?t=((t=((e=((e=r[0]-680876937)<<7|e>>>25)-271733879|0)^(n=((n=(-271733879^(o=((o=(-1732584194^2004318071&e)+r[1]-117830708)<<12|o>>>20)+e|0)&(-271733879^e))+r[2]-1126478375)<<17|n>>>15)+o|0)&(o^e))+r[3]-1316259209)<<22|t>>>10)+n|0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((o=this.h3)^t&(n^o))+r[0]-680876936)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[1]-389564586)<<12|o>>>20)+e|0)&(e^t))+r[2]+606105819)<<17|n>>>15)+o|0)&(o^e))+r[3]-1044525330)<<22|t>>>10)+n|0),t=((t+=((e=((e+=(o^t&(n^o))+r[4]-176418897)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[5]+1200080426)<<12|o>>>20)+e|0)&(e^t))+r[6]-1473231341)<<17|n>>>15)+o|0)&(o^e))+r[7]-45705983)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(o^t&(n^o))+r[8]+1770035416)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[9]-1958414417)<<12|o>>>20)+e|0)&(e^t))+r[10]-42063)<<17|n>>>15)+o|0)&(o^e))+r[11]-1990404162)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(o^t&(n^o))+r[12]+1804603682)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[13]-40341101)<<12|o>>>20)+e|0)&(e^t))+r[14]-1502002290)<<17|n>>>15)+o|0)&(o^e))+r[15]+1236535329)<<22|t>>>10)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[1]-165796510)<<5|e>>>27)+t|0)^t))+r[6]-1069501632)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[11]+643717713)<<14|n>>>18)+o|0)^o))+r[0]-373897302)<<20|t>>>12)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[5]-701558691)<<5|e>>>27)+t|0)^t))+r[10]+38016083)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[15]-660478335)<<14|n>>>18)+o|0)^o))+r[4]-405537848)<<20|t>>>12)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[9]+568446438)<<5|e>>>27)+t|0)^t))+r[14]-1019803690)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[3]-187363961)<<14|n>>>18)+o|0)^o))+r[8]+1163531501)<<20|t>>>12)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[13]-1444681467)<<5|e>>>27)+t|0)^t))+r[2]-51403784)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[7]+1735328473)<<14|n>>>18)+o|0)^o))+r[12]-1926607734)<<20|t>>>12)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[5]-378558)<<4|e>>>28)+t|0))+r[8]-2022574463)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[11]+1839030562)<<16|n>>>16)+o|0))+r[14]-35309556)<<23|t>>>9)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[1]-1530992060)<<4|e>>>28)+t|0))+r[4]+1272893353)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[7]-155497632)<<16|n>>>16)+o|0))+r[10]-1094730640)<<23|t>>>9)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[13]+681279174)<<4|e>>>28)+t|0))+r[0]-358537222)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[3]-722521979)<<16|n>>>16)+o|0))+r[6]+76029189)<<23|t>>>9)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[9]-640364487)<<4|e>>>28)+t|0))+r[12]-421815835)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[15]+530742520)<<16|n>>>16)+o|0))+r[2]-995338651)<<23|t>>>9)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[0]-198630844)<<6|e>>>26)+t|0)|~n))+r[7]+1126891415)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[14]-1416354905)<<15|n>>>17)+o|0)|~e))+r[5]-57434055)<<21|t>>>11)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[12]+1700485571)<<6|e>>>26)+t|0)|~n))+r[3]-1894986606)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[10]-1051523)<<15|n>>>17)+o|0)|~e))+r[1]-2054922799)<<21|t>>>11)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[8]+1873313359)<<6|e>>>26)+t|0)|~n))+r[15]-30611744)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[6]-1560198380)<<15|n>>>17)+o|0)|~e))+r[13]+1309151649)<<21|t>>>11)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[4]-145523070)<<6|e>>>26)+t|0)|~n))+r[11]-1120210379)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[2]+718787259)<<15|n>>>17)+o|0)|~e))+r[9]-343485551)<<21|t>>>11)+n|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=n-1732584194|0,this.h3=o+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+n|0,this.h3=this.h3+o|0)},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return p[e>>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15]+p[t>>4&15]+p[15&t]+p[t>>12&15]+p[t>>8&15]+p[t>>20&15]+p[t>>16&15]+p[t>>28&15]+p[t>>24&15]+p[n>>4&15]+p[15&n]+p[n>>12&15]+p[n>>8&15]+p[n>>20&15]+p[n>>16&15]+p[n>>28&15]+p[n>>24&15]+p[o>>4&15]+p[15&o]+p[o>>12&15]+p[o>>8&15]+p[o>>20&15]+p[o>>16&15]+p[o>>28&15]+p[o>>24&15]},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},y.prototype.buffer=y.prototype.arrayBuffer,y.prototype.base64=function(){for(var e,t,n,o="",i=this.array(),s=0;s<15;)e=i[s++],t=i[s++],n=i[s++],o+=f[e>>>2]+f[63&(e<<4|t>>>4)]+f[63&(t<<2|n>>>6)]+f[63&n];return e=i[s],o+(f[e>>>2]+f[e<<4&63]+"==")};var I=function(){var e=v("hex");e.getCtx=e.create=function(){return new y},e.update=function(t){return e.create().update(t)};for(var t=0;t>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(o+i)%4*8;else if(65535>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],o=0;o>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new s.init(n,t/2)}},c=r.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],o=0;o>>2]>>>24-o%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new s.init(n,t)}},u=r.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},l=n.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,o=n.words,i=n.sigBytes,r=this.blockSize,a=i/(4*r);if(t=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,i=e.min(4*t,i),t){for(var c=0;cu;u++){if(16>u)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}l=(o<<5|o>>>27)+c+s[u],l=20>u?l+(1518500249+(i&r|~i&a)):40>u?l+(1859775393+(i^r^a)):60>u?l+((i&r|i&a|r&a)-1894007588):l+((i^r^a)-899497514),c=a,a=r,r=i<<30|i>>>2,i=o,o=l}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(o+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=i._createHelper(r),n.HmacSHA1=i._createHmacHelper(r),l=(u=p).enc.Utf8,u.algo.HMAC=u.lib.Base.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=l.parse(t));var n=e.blockSize,o=4*n;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),r=i.words,a=s.words,c=0;c>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a>>6*(3-a)&63));var c=o.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,o=n.charAt(64);if(o){var i=e.indexOf(o);-1!=i&&(t=i)}for(var s=[],r=0,a=0;a>>6-a%4*2;s[r>>>2]|=(u|l)<<24-r%4*8,r++}return c.create(s,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.exports=p},function(e,t){var n,o,i,s,r,a,c,u,l,p,d,h,g,f,m,_,v,y,I,M=(o=(n=n||{}).Base64,s=function(e){for(var t={},n=0,o=e.length;n>>6)+r(128|63&t):r(224|t>>>12&15)+r(128|t>>>6&63)+r(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return r(240|t>>>18&7)+r(128|t>>>12&63)+r(128|t>>>6&63)+r(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(c,a)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=n.btoa?function(e){return n.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},d=function(e){return p(u(e))},h=function(e,t){return t?d(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):d(String(e))},g=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),f=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return r(55296+(t>>>10))+r(56320+(1023&t));case 3:return r((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return r((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},m=function(e){return e.replace(g,f)},_=function(e){var t=e.length,n=t%4,o=(t>0?s[e.charAt(0)]<<18:0)|(t>1?s[e.charAt(1)]<<12:0)|(t>2?s[e.charAt(2)]<<6:0)|(t>3?s[e.charAt(3)]:0),i=[r(o>>>16),r(o>>>8&255),r(255&o)];return i.length-=[0,0,2,1][n],i.join("")},v=n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/[\s\S]{1,4}/g,_)},y=function(e){return m(v(e))},{VERSION:"2.1.9",atob:v,btoa:p,fromBase64:I=function(e){return y(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},toBase64:h,utob:u,encode:h,encodeURI:function(e){return h(e,!0)},btou:m,decode:I,noConflict:function(){var e=n.Base64;return n.Base64=o,e}});e.exports=M},function(e,t,n){const o=n(4),i=n(16),s=n(23);e.exports={XMLParser:i,XMLValidator:o,XMLBuilder:s}},function(e,t,n){const{buildOptions:o}=n(17),i=n(18),{prettify:s}=n(22),r=n(4);e.exports=class{constructor(e){this.externalEntities={},this.options=o(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=r.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new i(this.options);n.addExternalEntities(this.externalEntities);const o=n.parseXml(e);return this.options.preserveOrder||void 0===o?o:s(o,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},function(e,t){const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},function(e,t,n){const o=n(1),i=n(19),s=n(20),r=n(21),a=n(5);function c(e){const t=Object.keys(e);for(let n=0;n0)){r||(e=this.replaceEntitiesValue(e));const o=this.options.tagValueProcessor(t,e,n,i,s);return null==o?e:typeof o!=typeof e||o!==e?o:this.options.trimValues||e.trim()===e?M(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function l(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const p=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function d(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=o.getAllMatches(e,p),i=n.length,s={};for(let e=0;e",a,"Closing Tag is not closed.");let i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){const e=i.indexOf(":");-1!==e&&(i=i.substr(e+1))}this.options.transformTagName&&(i=this.options.transformTagName(i)),n&&(o=this.saveTextToParentTag(o,n,r));const s=r.substring(r.lastIndexOf(".")+1);if(i&&-1!==this.options.unpairedTags.indexOf(i))throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;s&&-1!==this.options.unpairedTags.indexOf(s)?(c=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=r.lastIndexOf("."),r=r.substring(0,c),n=this.tagsNodeStack.pop(),o="",a=t}else if("?"===e[a+1]){let t=y(e,a,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(o=this.saveTextToParentTag(o,n,r),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new i(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,r,t.tagName)),this.addChild(n,e,r)}a=t.closeIndex+1}else if("!--"===e.substr(a+1,3)){const t=v(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const i=e.substring(a+4,t-2);o=this.saveTextToParentTag(o,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if("!D"===e.substr(a+1,2)){const t=s(e,a);this.docTypeEntities=t.entities,a=t.i}else if("!["===e.substr(a+1,2)){const t=v(e,"]]>",a,"CDATA is not closed.")-2,i=e.substring(a+9,t);o=this.saveTextToParentTag(o,n,r);let s=this.parseTextData(i,n.tagname,r,!0,!1,!0,!0);null==s&&(s=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,s),a=t+2}else{let s=y(e,a,this.options.removeNSPrefix),c=s.tagName;const u=s.rawTagName;let l=s.tagExp,p=s.attrExpPresent,d=s.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&o&&"!xml"!==n.tagname&&(o=this.saveTextToParentTag(o,n,r,!1));const h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),c!==t.tagname&&(r+=r?"."+c:c),this.isItStopNode(this.options.stopNodes,r,c)){let t="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)"/"===c[c.length-1]?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),l=c):l=l.substr(0,l.length-1),a=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))a=s.closeIndex;else{const n=this.readStopNodeData(e,u,d+1);if(!n)throw new Error(`Unexpected end of ${u}`);a=n.i,t=n.tagContent}const o=new i(c);c!==l&&p&&(o[":@"]=this.buildAttributesMap(l,r,c)),t&&(t=this.parseTextData(t,c,r,!0,p,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),o.add(this.options.textNodeName,t),this.addChild(n,o,r)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),l=c):l=l.substr(0,l.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new i(c);c!==l&&p&&(e[":@"]=this.buildAttributesMap(l,r,c)),this.addChild(n,e,r),r=r.substr(0,r.lastIndexOf("."))}else{const e=new i(c);this.tagsNodeStack.push(n),c!==l&&p&&(e[":@"]=this.buildAttributesMap(l,r,c)),this.addChild(n,e,r),n=e}o="",a=d}}else o+=e[a];return t.child};function g(e,t,n){const o=this.options.updateTag(t.tagname,n,t[":@"]);!1===o||("string"==typeof o?(t.tagname=o,e.addChild(t)):e.addChild(t))}const f=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function m(e,t,n,o){return e&&(void 0===o&&(o=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,o))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function _(e,t,n){const o="*."+n;for(const i in e){const n=e[i];if(o===n||t===n)return!0}return!1}function v(e,t,n,o){const i=e.indexOf(t,n);if(-1===i)throw new Error(o);return i+t.length-1}function y(e,t,n,o=">"){const i=function(e,t,n=">"){let o,i="";for(let s=t;s",n,`${t} is not closed`);if(e.substring(n+2,s).trim()===t&&(i--,0===i))return{tagContent:e.substring(o,n),i:s};n=s}else if("?"===e[n+1])n=v(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=v(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=v(e,"]]>",n,"StopNode is not closed.")-2;else{const o=y(e,n,">");o&&((o&&o.tagName)===t&&"/"!==o.tagExp[o.tagExp.length-1]&&i++,n=o.closeIndex)}}function M(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&r(e,n)}return o.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=c,this.parseXml=h,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=d,this.isItStopNode=_,this.replaceEntitiesValue=f,this.readStopNodeData=I,this.saveTextToParentTag=m,this.addChild=g,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},function(e,t,n){e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},function(e,t,n){const o=n(1);function i(e,t){let n="";for(;t"===e[t]){if(d?"-"===e[t-1]&&"-"===e[t-2]&&(d=!1,o--):o--,0===o)break}else"["===e[t]?p=!0:h+=e[t];else{if(p&&r(e,t))t+=7,[entityName,val,t]=i(e,t+1),-1===val.indexOf("&")&&(n[l(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(p&&a(e,t))t+=8;else if(p&&c(e,t))t+=8;else if(p&&u(e,t))t+=9;else{if(!s)throw new Error("Invalid DOCTYPE");d=!0}o++,h=""}if(0!==o)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}},function(e,t){const n=/^[-+]?0x[a-fA-F0-9]+$/,o=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,t={}){if(t=Object.assign({},i,t),!e||"string"!=typeof e)return e;let s=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(s))return e;if(t.hex&&n.test(s))return Number.parseInt(s,16);{const n=o.exec(s);if(n){const o=n[1],i=n[2];let a=(r=n[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substr(0,r.length-1)),r):r;const c=n[4]||n[6];if(!t.leadingZeros&&i.length>0&&o&&"."!==s[2])return e;if(!t.leadingZeros&&i.length>0&&!o&&"."!==s[1])return e;{const n=Number(s),r=""+n;return-1!==r.search(/[eE]/)||c?t.eNotation?n:e:-1!==s.indexOf(".")?"0"===r&&""===a||r===a||o&&r==="-"+a?n:e:i?a===r||o+a===r?n:e:s===r||s===o+r?n:e}}return e}var r}},function(e,t,n){function o(e,t,n){let a;const c={};for(let u=0;u0&&(c[t.textNodeName]=a):void 0!==a&&(c[t.textNodeName]=a),c}function i(e){const t=Object.keys(e);for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(e){this.options=Object.assign({},s,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,n,o){const i=this.j2x(e,n+1,o.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function c(e){return this.options.indentBy.repeat(e)}function u(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}r.prototype.build=function(e){return this.options.preserveOrder?o(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},r.prototype.j2x=function(e,t,n){let o="",i="";const s=n.join(".");for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))if(void 0===e[r])this.isAttribute(r)&&(i+="");else if(null===e[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(e[r]instanceof Date)i+=this.buildTextValNode(e[r],r,"",t);else if("object"!=typeof e[r]){const n=this.isAttribute(r);if(n&&!this.ignoreAttributesFn(n,s))o+=this.buildAttrPairStr(n,""+e[r]);else if(!n)if(r===this.options.textNodeName){let t=this.options.tagValueProcessor(r,""+e[r]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[r],r,"",t)}else if(Array.isArray(e[r])){const o=e[r].length;let s="",a="";for(let c=0;c"+e+i}},r.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(o)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(o)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(o)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(o)+"<"+t+n+">"+i+"0&&this.options.processEntities)for(let t=0;t`,l=!1;continue}if(h===t.commentPropName){u+=c+`\x3c!--${d[h][0][t.textNodeName]}--\x3e`,l=!0;continue}if("?"===h[0]){const e=i(d[":@"],t),n="?xml"===h?"":c;let o=d[h][0][t.textNodeName];o=0!==o.length?" "+o:"",u+=n+`<${h}${o}${e}?>`,l=!0;continue}let f=c;""!==f&&(f+=t.indentBy);const m=c+`<${h}${i(d[":@"],t)}`,_=n(d[h],t,g,f);-1!==t.unpairedTags.indexOf(h)?t.suppressUnpairedNode?u+=m+">":u+=m+"/>":_&&0!==_.length||!t.suppressEmptyNode?_&&_.endsWith(">")?u+=m+`>${_}${c}`:(u+=m+">",_&&""!==c&&(_.includes("/>")||_.includes("`):u+=m+"/>",l=!0}return u}function o(e){const t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n0&&(o="\n"),n(e,t,"",o)}},function(e,t,n){var o=n(7),i=n(0),s={};e.exports.transferToTaskMethod=function(e,t){s[t]=e[t],e[t]=function(e,n){e.SkipTask?s[t].call(this,e,n):this._addTask(t,e,n)}},e.exports.init=function(e){var t,n,r=[],a={},c=0,u=0,l=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},p=(n=function(){t=0,e.emit("task-list-update",{list:i.map(r,l)}),e.emit("list-update",{list:i.map(r,l)})},function(){t||(t=setTimeout(n))}),d=function(){if(!(r.length<=e.options.UploadQueueSize)){for(var t=0;te.options.UploadQueueSize;){var n="waiting"===r[t].state||"checking"===r[t].state||"uploading"===r[t].state;r[t]&&n?t++:(a[r[t].id]&&delete a[r[t].id],r.splice(t,1),u--)}p()}},h=function t(){if(!(c>=e.options.FileParallelLimit)){for(;r[u]&&"waiting"!==r[u].state;)u++;if(!(u>=r.length)){var n=r[u];u++,c++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(l(n)),!n.params.UploadData&&(n.params.UploadData={});var o=i.formatParams(n.api,n.params);s[n.api].call(e,o,(function(o,i){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=o?"error":"success",o&&(n.error=o),c--,p(),t(),n.callback&&n.callback(o,i),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),d())})),p(),setTimeout(t)}}},g=function(t,n){var i=a[t];if(i){var s=i&&"waiting"===i.state,r=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===n&&"canceled"!==i.state||"paused"===n&&s||"paused"===n&&r){if("paused"===n&&i.params.Body&&"function"==typeof i.params.Body.pipe)return;i.state=n,e.emit("inner-kill-task",{TaskId:t,toState:n});try{var u=i&&i.params&&i.params.UploadData.UploadId}catch(l){}"canceled"===n&&u&&o.removeUsing(u),p(),r&&(c--,h()),"canceled"===n&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}d()}};e._addTasks=function(t){i.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),p()},e._addTask=function(t,n,o,s){var c="postObject"===e.options.SimpleUploadMethod?"postObject":"putObject";"sliceUploadFile"!==t||i.canFileSlice()||(t=c),n=i.formatParams(t,n);var u=i.uuid();n.TaskId=u,n.onTaskReady&&n.onTaskReady(u);var l={params:n,callback:o,api:t,index:r.length,id:u,Bucket:n.Bucket,Region:n.Region,Key:n.Key,FilePath:n.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},g=n.onHashProgress;n.onHashProgress=function(t){e._isRunningTask(l.id)&&(l.hashPercent=t.percent,g&&g(t),p())};var f=n.onProgress;return n.onProgress=function(t){e._isRunningTask(l.id)&&("checking"===l.state&&(l.state="uploading"),l.loaded=t.loaded,l.size=t.total,l.speed=t.speed,l.percent=t.percent,f&&f(t),p())},i.getFileSize(t,n,(function(e,t){e?o(e):(a[u]=l,r.push(l),l.size=t,!s&&p(),h(),d())})),u},e._isRunningTask=function(e){var t=a[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return i.map(r,l)},e.cancelTask=function(e){g(e,"canceled")},e.pauseTask=function(e){g(e,"paused")},e.restartTask=function(e){var t=a[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",p(),u=Math.min(u,t.index),h())},e.isUploadRunning=function(){return c||u-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(s="{Bucket}."+s)),s=(s=s.replace(/\{\{AppId\}\}/gi,o).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,r).replace(/\{\{.*?\}\}/gi,"")).replace(/\{AppId\}/gi,o).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,r).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(s)||(s="https://"+s),"/"===s.slice(-1)&&(s=s.slice(0,-1));var c=s;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=i.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}var u=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate;return(e.Url||c({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region})).replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")};function l(e,t){var n=i.clone(e.Headers),o="";i.each(n,(function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(o=e)}));var s=!1!==e.ForceSignHost;!o&&e.SignHost&&s&&(n.Host=e.SignHost);var r=!1,a=function(e,n){r||(r=!0,n&&n.XCosSecurityToken&&!n.SecurityToken&&((n=i.clone(n)).SecurityToken=n.XCosSecurityToken,delete n.XCosSecurityToken),t&&t(e,n))},c=this,u=e.Bucket||"",l=e.Region||"",p="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";c.options.ForcePathStyle&&u&&(p=u+"/"+p);var d="/"+p,h={},g=e.Scope;if(!g){var f=e.Action||"",m=e.ResourceKey||e.Key||"";g=e.Scope||[{action:f,bucket:u,region:l,prefix:m}]}var _=i.md5(JSON.stringify(g));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var n=Math.round(i.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===_){h=t;break}}}();var v=function(){var t="";h.StartTime&&e.Expires?t=h.StartTime+";"+(h.StartTime+1*e.Expires):h.StartTime&&h.ExpiredTime&&(t=h.StartTime+";"+h.ExpiredTime);var o={Authorization:i.getAuth({SecretId:h.TmpSecretId,SecretKey:h.TmpSecretKey,Method:e.Method,Pathname:d,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:s}),SecurityToken:h.SecurityToken||h.XCosSecurityToken||"",Token:h.Token||"",ClientIP:h.ClientIP||"",ClientUA:h.ClientUA||"",SignFrom:"client"};a(null,o)},y=function(e){if(e.Authorization){var t=!1,n=e.Authorization;if(n)if(n.indexOf(" ")>-1)t=!1;else if(n.indexOf("q-sign-algorithm=")>-1&&n.indexOf("q-ak=")>-1&&n.indexOf("q-sign-time=")>-1&&n.indexOf("q-key-time=")>-1&&n.indexOf("q-url-param-list=")>-1)t=!0;else try{(n=atob(n)).indexOf("a=")>-1&&n.indexOf("k=")>-1&&n.indexOf("t=")>-1&&n.indexOf("r=")>-1&&n.indexOf("b=")>-1&&(t=!0)}catch(o){}if(!t)return i.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return i.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return i.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return i.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return i.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return i.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return i.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(h.ExpiredTime&&h.ExpiredTime-i.getSkewTime(c.options.SystemClockOffset)/1e3>60)v();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:u,Region:l,Method:e.Method,Key:p,Pathname:d,Query:e.Query,Headers:n,Scope:g,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:s},(function(e){"string"==typeof e&&(e={Authorization:e});var t=y(e);if(t)return a(t);e.Authorization?a(null,e):((h=e||{}).Scope=g,h.ScopeKey=_,c._StsCache.push(h),v())}));else{if(!c.options.getSTS)return function(){var t="";if(c.options.StartTime&&e.Expires){if(10!==c.options.StartTime.toString().length)return a(i.error(new Error('params "StartTime" should be 10 digits')));t=c.options.StartTime+";"+(c.options.StartTime+1*e.Expires)}else if(c.options.StartTime&&c.options.ExpiredTime){if(10!==c.options.StartTime.toString().length)return a(i.error(new Error('params "StartTime" should be 10 digits')));if(10!==c.options.ExpiredTime.toString().length)return a(i.error(new Error('params "ExpiredTime" should be 10 digits')));t=c.options.StartTime+";"+1*c.options.ExpiredTime}var o={Authorization:i.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:d,Query:e.Query,Headers:n,Expires:e.Expires,KeyTime:t,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:s}),SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken,SignFrom:"client"};return a(null,o),o}();c.options.getSTS.call(c,{Bucket:u,Region:l},(function(e){(h=e||{}).Scope=g,h.ScopeKey=_,h.TmpSecretId||(h.TmpSecretId=h.SecretId),h.TmpSecretKey||(h.TmpSecretKey=h.SecretKey);var t=y(h);if(t)return a(t);c._StsCache.push(h),v()}))}return""}function p(e){var t=this,n=!1,o=!1,s=!1,r=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,c=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===c)&&(s=!0)}catch(d){}if(e){if(s&&r){var u=Date.parse(r);this.options.CorrectClockSkew&&Math.abs(i.getSkewTime(this.options.SystemClockOffset)-u)>=3e4&&(this.options.SystemClockOffset=u-Date.now(),n=!0)}else{if(5===Math.floor(e.statusCode/100))return{canRetry:!0,networkError:!1};if("timeout"===e.message)return{canRetry:!0,networkError:t.options.AutoSwitchHost}}if(e.statusCode){var l=Math.floor(e.statusCode/100),p=(null==e?void 0:e.headers)&&(null==e?void 0:e.headers["x-cos-request-id"]);[3,4,5].includes(l)&&!p&&(n=t.options.AutoSwitchHost,o=!0)}else n=!0,o=t.options.AutoSwitchHost}return{canRetry:n,networkError:o}}function d(e){var t=e.requestUrl,n=e.clientCalcSign,o=e.networkError;return!!this.options.AutoSwitchHost&&!!t&&!!n&&!!o&&/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t)&&!/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t)}function h(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=i.clearKey(e.qs),e.headers&&(e.headers=i.clearKey(e.headers)),e.qs&&(e.qs=i.clearKey(e.qs));var o=i.clone(e.qs);e.action&&(o[e.action]="");var s=e.url||e.Url,r=e.SignHost||u.call(this,{Bucket:e.Bucket,Region:e.Region,Url:s}),a=e.tracker;!function i(s){var c=n.options.SystemClockOffset;e.SwitchHost&&(r=r.replace(/myqcloud.com/,"tencentcos.cn")),a&&a.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:s-1}),l.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:o,Headers:e.headers,SignHost:r,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},(function(o,r){o?t(o):(a&&a.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=r,g.call(n,e,(function(o,u){var l=!1,h=!1;if(o){var g=p.call(n,o);l=g.canRetry||c!==n.options.SystemClockOffset,h=g.networkError}if(a&&a.setParams({httpEndTime:(new Date).getTime()}),o&&s<4&&l){e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var f=d.call(n,{requestUrl:(null==o?void 0:o.url)||"",clientCalcSign:"client"===(null==r?void 0:r.SignFrom),networkError:h});e.SwitchHost=f,e.headers["x-cos-sdk-retry"]="true",i(s+1)}else t(o,u)})))}))}(1)}function g(e,t){var n=this,s=e.TaskId;if(!s||n._isRunningTask(s)){var r=e.Bucket,a=e.Region,u=e.Key,l=e.method||"GET",p=e.url||e.Url,d=e.body,h=e.json,g=e.rawBody,f=e.dataType,m=n.options.HttpDNSServiceId;n.options.UseAccelerate&&(a="accelerate"),p=p||c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:r,region:a,object:u}),e.SwitchHost&&(p=p.replace(/myqcloud.com/,"tencentcos.cn"));var _=u?p:"";e.action&&(p=p+"?"+e.action),e.qsStr&&(p=p.indexOf("?")>-1?p+"&"+e.qsStr:p+"?"+e.qsStr);var v={method:l,url:p,headers:e.headers,qs:e.qs,filePath:e.filePath,body:d,json:h,httpDNSServiceId:m,dataType:f},y="x-cos-security-token";i.isCIHost(p)&&(y="x-ci-security-token"),v.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(v.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(v.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(v.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(v.headers[y]=e.AuthData.SecurityToken),v.headers&&(v.headers=i.clearKey(v.headers)),v=i.clearKey(v),e.onProgress&&"function"==typeof e.onProgress&&(v.onProgress=function(t){if(!s||n._isRunningTask(s)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:t.total})}}),this.options.Timeout&&(v.timeout=this.options.Timeout),n.options.ForcePathStyle&&(v.pathStyle=n.options.ForcePathStyle),n.emit("before-send",v);var I,M=v.url.includes("accelerate."),C=v.qs?Object.keys(v.qs).map((function(e){return"".concat(e,"=").concat(v.qs[e])})).join("&"):"",T=C?v.url+"?"+C:v.url;e.tracker&&(e.tracker.setParams({url:T,httpMethod:v.method,accelerate:M,httpSize:(null===(I=v.body)||void 0===I?void 0:I.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:_,accelerate:M}));var S=o(v,(function(e,o,r){if("abort"!==e){var a,c=function(e,r){if(s&&n.off("inner-kill-task",E),!a){a=!0;var c={};o&&o.statusCode&&(c.statusCode=o.statusCode),o&&o.headers&&(c.headers=o.headers),e?(v.url&&(c.url=v.url),v.method&&(c.method=v.method),e=i.extend(e||{},c),t(e,null)):(r=i.extend(r||{},c),t(null,r)),S=null}};if(e)c({error:e});else{var u=o.statusCode,l=2===Math.floor(u/100);if(g){if(l)return c(null,{body:r});if(r instanceof ArrayBuffer){var p=i.arrayBufferToString(r),d=i.parseResBody(p);return c({error:d.Error||d})}}var h=i.parseResBody(r);l?h.Error?c({error:h.Error}):c(null,h):c({error:h.Error||h})}}})),E=function e(t){t.TaskId===s&&(S&&S.abort&&S.abort(),n.off("inner-kill-task",e))};s&&n.on("inner-kill-task",E)}}var f={getService:function(e,t){"function"==typeof e&&(t=e,e={});var n="https:",o=this.options.ServiceDomain,s=e.Region;o?(o=o.replace(/\{\{Region\}\}/gi,s||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(o)||(o=n+"//"+o),"/"===o.slice(-1)&&(o=o.slice(0,-1))):o=s?n+"//cos."+s+".myqcloud.com":n+"//service.cos.myqcloud.com",o.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),h.call(this,{Action:"name/cos:GetService",url:o,method:"GET",headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n&&n.ListAllMyBucketsResult&&n.ListAllMyBucketsResult.Buckets&&n.ListAllMyBucketsResult.Buckets.Bucket||[];o=i.isArray(o)?o:[o];var s=n&&n.ListAllMyBucketsResult&&n.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:o,Owner:s,statusCode:n.statusCode,headers:n.headers})}))},putBucket:function(e,t){var n=this,o="";if(e.BucketAZConfig){var s={BucketAZConfig:e.BucketAZConfig};o=i.json2xml({CreateBucketConfiguration:s})}h.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:o,tracker:e.tracker},(function(o,i){if(o)return t(o);var s=c({protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:s,statusCode:i.statusCode,headers:i.headers})}))},headBucket:function(e,t){h.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},(function(e,n){t(e,n)}))},getBucket:function(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n.marker=e.Marker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucket",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.ListBucketResult||{},s=o.Contents||[],r=o.CommonPrefixes||[];s=i.isArray(s)?s:[s],r=i.isArray(r)?r:[r];var a=i.clone(o);i.extend(a,{Contents:s,CommonPrefixes:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},deleteBucket:function(e,t){h.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketAcl:function(e,t){var n=e.Headers,o="";if(e.AccessControlPolicy){var s=i.clone(e.AccessControlPolicy||{}),r=s.Grants||s.Grant;r=i.isArray(r)?r:[r],delete s.Grant,delete s.Grants,s.AccessControlList={Grant:r},o=i.json2xml({AccessControlPolicy:s}),n["Content-Type"]="application/xml",n["Content-MD5"]=i.binaryBase64(i.md5(o))}i.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=a(n[t]))})),h.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:n,action:"acl",body:o,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketAcl:function(e,t){h.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.AccessControlPolicy||{},s=o.Owner||{},a=o.AccessControlList.Grant||[];a=i.isArray(a)?a:[a];var c=r(o);n.headers&&n.headers["x-cos-acl"]&&(c.ACL=n.headers["x-cos-acl"]),c=i.extend(c,{Owner:s,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,c)}))},putBucketCors:function(e,t){var n=(e.CORSConfiguration||{}).CORSRules||e.CORSRules||[];n=i.clone(i.isArray(n)?n:[n]),i.each(n,(function(e){i.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var n=t+"s",o=e[n]||e[t]||[];delete e[n],e[t]=i.isArray(o)?o:[o]}))}));var o={CORSRule:n};e.ResponseVary&&(o.ResponseVary=e.ResponseVary);var s=i.json2xml({CORSConfiguration:o}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"cors",headers:r,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketCors:function(e,t){h.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var o={CORSRules:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=n.CORSConfiguration||{},r=s.CORSRules||s.CORSRule||[];r=i.clone(i.isArray(r)?r:[r]);var a=s.ResponseVary;i.each(r,(function(e){i.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var n=t+"s",o=e[n]||e[t]||[];delete e[t],e[n]=i.isArray(o)?o:[o]}))})),t(null,{CORSRules:r,ResponseVary:a,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketCors:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode||e.statusCode,headers:n.headers})}))},getBucketLocation:function(e,t){h.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,n)}))},getBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},(function(e,n){if(e)return e.statusCode&&403===e.statusCode?t({ErrorStatus:"Access Denied"}):e.statusCode&&405===e.statusCode?t({ErrorStatus:"Method Not Allowed"}):e.statusCode&&404===e.statusCode?t({ErrorStatus:"Policy Not Found"}):t(e);var o={};try{o=JSON.parse(n.body)}catch(i){}t(null,{Policy:o,statusCode:n.statusCode,headers:n.headers})}))},putBucketPolicy:function(e,t){var n=e.Policy,o=n;try{"string"==typeof n?n=JSON.parse(o):o=JSON.stringify(n)}catch(r){t({error:"Policy format error"})}var s=e.Headers;s["Content-Type"]="application/json",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:o,headers:s,json:!0,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},deleteBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode||e.statusCode,headers:n.headers})}))},putBucketTagging:function(e,t){var n=e.Tagging||{},o=n.TagSet||n.Tags||e.Tags||[];o=i.clone(i.isArray(o)?o:[o]);var s=i.json2xml({Tagging:{TagSet:{Tag:o}}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"tagging",headers:r,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketTagging:function(e,t){h.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var o={Tags:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else{var s=[];try{s=n.Tagging.TagSet.Tag||[]}catch(r){}s=i.clone(i.isArray(s)?s:[s]),t(null,{Tags:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketLifecycle:function(e,t){var n=(e.LifecycleConfiguration||{}).Rules||e.Rules||[];n=i.clone(n);var o=i.json2xml({LifecycleConfiguration:{Rule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"lifecycle",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var o={Rules:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=[];try{s=n.LifecycleConfiguration.Rule||[]}catch(r){}s=i.clone(i.isArray(s)?s:[s]),t(null,{Rules:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketVersioning:function(e,t){if(e.VersioningConfiguration){var n=e.VersioningConfiguration||{},o=i.json2xml({VersioningConfiguration:n}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"versioning",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param VersioningConfiguration"})},getBucketVersioning:function(e,t){h.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},(function(e,n){e||!n.VersioningConfiguration&&(n.VersioningConfiguration={}),t(e,n)}))},putBucketReplication:function(e,t){var n=i.clone(e.ReplicationConfiguration),o=i.json2xml({ReplicationConfiguration:n});o=(o=o.replace(/<(\/?)Rules>/gi,"<$1Rule>")).replace(/<(\/?)Tags>/gi,"<$1Tag>");var s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"replication",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketReplication:function(e,t){h.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var o={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)}))},deleteBucketReplication:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketWebsite:function(e,t){if(e.WebsiteConfiguration){var n=i.clone(e.WebsiteConfiguration||{}),o=n.RoutingRules||n.RoutingRule||[];o=i.isArray(o)?o:[o],delete n.RoutingRule,delete n.RoutingRules,o.length&&(n.RoutingRules={RoutingRule:o});var s=i.json2xml({WebsiteConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"website",headers:r,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param WebsiteConfiguration"})},getBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=n.WebsiteConfiguration||{};if(s.RoutingRules){var r=i.clone(s.RoutingRules.RoutingRule||[]);r=i.makeArray(r),s.RoutingRules=r}t(null,{WebsiteConfiguration:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketReferer:function(e,t){if(e.RefererConfiguration){var n=i.clone(e.RefererConfiguration||{}),o=n.DomainList||{},s=o.Domains||o.Domain||[];(s=i.isArray(s)?s:[s]).length&&(n.DomainList={Domain:s});var r=i.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.binaryBase64(i.md5(r)),h.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"referer",headers:a,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param RefererConfiguration"})},getBucketReferer:function(e,t){h.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=n.RefererConfiguration||{};if(s.DomainList){var r=i.makeArray(s.DomainList.Domain||[]);s.DomainList={Domains:r}}t(null,{RefererConfiguration:s,statusCode:n.statusCode,headers:n.headers})}}))},putBucketDomain:function(e,t){var n=(e.DomainConfiguration||{}).DomainRule||e.DomainRule||[];n=i.clone(n);var o=i.json2xml({DomainConfiguration:{DomainRule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"domain",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketDomain:function(e,t){h.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=[];try{o=n.DomainConfiguration.DomainRule||[]}catch(s){}o=i.clone(i.isArray(o)?o:[o]),t(null,{DomainRule:o,statusCode:n.statusCode,headers:n.headers})}))},deleteBucketDomain:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketOrigin:function(e,t){var n=(e.OriginConfiguration||{}).OriginRule||e.OriginRule||[];n=i.clone(n);var o=i.json2xml({OriginConfiguration:{OriginRule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"origin",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=[];try{o=n.OriginConfiguration.OriginRule||[]}catch(s){}o=i.clone(i.isArray(o)?o:[o]),t(null,{OriginRule:o,statusCode:n.statusCode,headers:n.headers})}))},deleteBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketLogging:function(e,t){var n=i.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=i.binaryBase64(i.md5(n)),h.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:o,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketLogging:function(e,t){h.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},(function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})}))},putBucketInventory:function(e,t){var n=i.clone(e.InventoryConfiguration);if(n.OptionalFields){var o=n.OptionalFields||[];n.OptionalFields={Field:o}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var s=n.Destination.COSBucketDestination.Encryption;Object.keys(s).indexOf("SSECOS")>-1&&(s["SSE-COS"]=s.SSECOS,delete s.SSECOS)}var r=i.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.binaryBase64(i.md5(r)),h.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"inventory",qs:{id:e.Id},headers:a,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketInventory:function(e,t){h.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.InventoryConfiguration;if(o&&o.OptionalFields&&o.OptionalFields.Field){var s=o.OptionalFields.Field;i.isArray(s)||(s=[s]),o.OptionalFields=s}if(o.Destination&&o.Destination.COSBucketDestination&&o.Destination.COSBucketDestination.Encryption){var r=o.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSE-COS")>-1&&(r.SSECOS=r["SSE-COS"],delete r["SSE-COS"])}t(null,{InventoryConfiguration:o,statusCode:n.statusCode,headers:n.headers})}))},listBucketInventory:function(e,t){h.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.ListInventoryConfigurationResult,s=o.InventoryConfiguration||[];s=i.isArray(s)?s:[s],delete o.InventoryConfiguration,i.each(s,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;i.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}})),o.InventoryConfigurations=s,i.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)}))},deleteBucketInventory:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketAccelerate:function(e,t){if(e.AccelerateConfiguration){var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},o=i.json2xml(n),s={"Content-Type":"application/xml"};s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"accelerate",headers:s,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param AccelerateConfiguration"})},getBucketAccelerate:function(e,t){h.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},(function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)}))},getObject:function(e,t){if(this.options.ObjectKeySimplifyCheck&&"/"===i.simplifyPath(e.Key))t(i.error(new Error("The Getobject Key is illegal")));else{var n=e.Query||{},o=e.QueryString||"",s=e.tracker;s&&s.setParams({signStartTime:(new Date).getTime()}),n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,h.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:o,rawBody:!0,dataType:e.DataType,tracker:s},(function(n,o){if(n){var s=n.statusCode;return e.Headers["If-Modified-Since"]&&s&&304===s?t(null,{NotModified:!0}):t(n)}t(null,{Body:o.body,ETag:i.attr(o.headers,"etag",""),statusCode:o.statusCode,headers:o.headers})}))}},headObject:function(e,t){h.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(n,o){if(n){var s=n.statusCode;return e.Headers["If-Modified-Since"]&&s&&304===s?t(null,{NotModified:!0,statusCode:s}):t(n)}o.ETag=i.attr(o.headers,"etag",""),t(null,o)}))},listObjectVersions:function(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.ListVersionsResult||{},s=o.DeleteMarker||[];s=i.isArray(s)?s:[s];var r=o.Version||[];r=i.isArray(r)?r:[r];var a=i.clone(o);delete a.DeleteMarker,delete a.Version,i.extend(a,{DeleteMarkers:s,Versions:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},putObject:function(e,t){var n=this,o=e.ContentLength,r=i.throttleOnProgress.call(n,o,e.onProgress),a=e.Headers;a["Cache-Control"]||a["cache-control"]||(a["Cache-Control"]=""),a["Content-Type"]||a["content-type"]||(a["Content-Type"]=s.getType(e.Key)||"application/octet-stream");var u=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,l=e.tracker;u&&l&&l.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(u,e.Body,(function(s){s&&(l&&l.setParams({md5EndTime:(new Date).getTime()}),n.options.UploadCheckContentMd5&&(a["Content-MD5"]=i.binaryBase64(s)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(a["x-cos-meta-md5"]=s)),void 0!==e.ContentLength&&(a["Content-Length"]=e.ContentLength),r(null,!0),h.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:r,tracker:l},(function(s,a){if(s)return r(null,!0),t(s);r({loaded:o,total:o},!0);var u=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});u=u.substr(u.indexOf("://")+3),a.Location=u,a.ETag=i.attr(a.headers,"etag",""),t(null,a)}))}))},postObject:function(e,t){var n=this,o={},s=e.FilePath;if(s){for(var r in o["Cache-Control"]=e.CacheControl,o["Content-Disposition"]=e.ContentDisposition,o["Content-Encoding"]=e.ContentEncoding,o["Content-MD5"]=e.ContentMD5,o["Content-Length"]=e.ContentLength,o["Content-Type"]=e.ContentType,o.Expect=e.Expect,o.Expires=e.Expires,o["x-cos-acl"]=e.ACL,o["x-cos-grant-read"]=e.GrantRead,o["x-cos-grant-write"]=e.GrantWrite,o["x-cos-grant-full-control"]=e.GrantFullControl,o["x-cos-storage-class"]=e.StorageClass,o["x-cos-mime-limit"]=e.MimeLimit,o["x-cos-traffic-limit"]=e.TrafficLimit,o["x-cos-forbid-overwrite"]=e.ForbidOverwrite,o["x-cos-server-side-encryption-customer-algorithm"]=e.SSECustomerAlgorithm,o["x-cos-server-side-encryption-customer-key"]=e.SSECustomerKey,o["x-cos-server-side-encryption-customer-key-MD5"]=e.SSECustomerKeyMD5,o["x-cos-server-side-encryption"]=e.ServerSideEncryption,o["x-cos-server-side-encryption-cos-kms-key-id"]=e.SSEKMSKeyId,o["x-cos-server-side-encryption-context"]=e.SSEContext,delete o["Content-Length"],delete o["content-length"],e)r.indexOf("x-cos-meta-")>-1&&(o[r]=e[r]);var a=i.throttleOnProgress.call(n,o["Content-Length"],e.onProgress);h.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:o,qs:e.Query,filePath:s,TaskId:e.TaskId,onProgress:a,tracker:e.tracker},(function(o,i){if(a(null,!0),o)return t(o);if(i&&i.headers){var r=i.headers,u=r.etag||r.Etag||r.ETag||"",l=s.substr(s.lastIndexOf("/")+1),p=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,l),isLocation:!0});return t(null,{Location:p,statusCode:i.statusCode,headers:r,ETag:u})}t(null,i)}))}else t({error:"missing param FilePath"})},deleteObject:function(e,t){h.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,tracker:e.tracker},(function(e,n){if(e){var o=e.statusCode;return o&&204===o?t(null,{statusCode:o}):o&&404===o?t(null,{BucketNotFound:!0,statusCode:o}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})}))},getObjectAcl:function(e,t){var n={};e.VersionId&&(n.versionId=e.VersionId),h.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,action:"acl",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.AccessControlPolicy||{},s=o.Owner||{},a=o.AccessControlList&&o.AccessControlList.Grant||[];a=i.isArray(a)?a:[a];var c=r(o);n.headers&&n.headers["x-cos-acl"]&&(c.ACL=n.headers["x-cos-acl"]),c=i.extend(c,{Owner:s,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,c)}))},putObjectAcl:function(e,t){var n=e.Headers,o="";if(e.AccessControlPolicy){var s=i.clone(e.AccessControlPolicy||{}),r=s.Grants||s.Grant;r=i.isArray(r)?r:[r],delete s.Grant,delete s.Grants,s.AccessControlList={Grant:r},o=i.json2xml({AccessControlPolicy:s}),n["Content-Type"]="application/xml",n["Content-MD5"]=i.binaryBase64(i.md5(o))}i.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=a(n[t]))})),h.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:o,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},optionsObject:function(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,h.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n,tracker:e.tracker},(function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var o=n.headers||{};t(null,{AccessControlAllowOrigin:o["access-control-allow-origin"],AccessControlAllowMethods:o["access-control-allow-methods"],AccessControlAllowHeaders:o["access-control-allow-headers"],AccessControlExposeHeaders:o["access-control-expose-headers"],AccessControlMaxAge:o["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})}))},putObjectCopy:function(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var o=e.CopySource||"",s=i.getSourceParams.call(this,o);if(s){var r=s.Bucket,a=s.Region,c=decodeURIComponent(s.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:r,region:a,prefix:c},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=i.clone(n.CopyObjectResult||{});i.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)}))}else t({error:"CopySource format error"})},deleteMultipleObject:function(e,t){var n=e.Objects||[],o=e.Quiet;n=i.isArray(n)?n:[n];var s=i.json2xml({Delete:{Object:n,Quiet:o||!1}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s));var a=i.map(n,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));h.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:s,action:"delete",headers:r,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.DeleteResult||{},s=o.Deleted||[],r=o.Error||[];s=i.isArray(s)?s:[s],r=i.isArray(r)?r:[r];var a=i.clone(o);i.extend(a,{Error:r,Deleted:s,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},restoreObject:function(e,t){var n=e.Headers;if(e.RestoreRequest){var o=e.RestoreRequest||{},s=i.json2xml({RestoreRequest:o});n["Content-Type"]="application/xml",n["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:s,action:"restore",headers:n,tracker:e.tracker},(function(e,n){t(e,n)}))}else t({error:"missing param RestoreRequest"})},putObjectTagging:function(e,t){var n=e.Tagging||{},o=n.TagSet||n.Tags||e.Tags||[];o=i.clone(i.isArray(o)?o:[o]);var s=i.json2xml({Tagging:{TagSet:{Tag:o}}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:s,action:"tagging",headers:r,VersionId:e.VersionId,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getObjectTagging:function(e,t){h.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var o={Tags:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else{var s=[];try{s=n.Tagging.TagSet.Tag||[]}catch(r){}s=i.clone(i.isArray(s)?s:[s]),t(null,{Tags:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteObjectTagging:function(e,t){h.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},appendObject:function(e,t){h.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,n)}))},uploadPartCopy:function(e,t){var n=e.CopySource||"",o=i.getSourceParams.call(this,n);if(o){var s=o.Bucket,r=o.Region,a=decodeURIComponent(o.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:s,region:r,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=i.clone(n.CopyPartResult||{});i.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)}))}else t({error:"CopySource format error"})},multipartInit:function(e,t){var n=e.Headers,o=e.tracker;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]=""),n["Content-Type"]||n["content-type"]||(n["Content-Type"]=s.getType(e.Key)||"application/octet-stream"),h.call(this,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:o},(function(e,n){return e?(o&&o.parent&&o.parent.setParams({errorNode:"multipartInit"}),t(e)):(n=i.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,i.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)}))},multipartUpload:function(e,t){var n=this;i.getFileSize("multipartUpload",e,(function(){var o=e.tracker,s=n.options.UploadCheckContentMd5;s&&o&&o.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(s,e.Body,(function(r){r&&(e.Headers["Content-MD5"]=i.binaryBase64(r),s&&o&&o.setParams({md5EndTime:(new Date).getTime()})),o&&o.setParams({partNumber:e.PartNumber}),h.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:o},(function(e,n){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:i.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})}))}))}))},multipartComplete:function(e,t){for(var n=this,o=e.UploadId,s=e.Parts,r=e.tracker,a=0,u=s.length;a-1?(i=n.Authorization,a=i.match(/q-url-param-list.*?(?=&)/g)[0],c="q-url-param-list="+encodeURIComponent(a.replace(/q-url-param-list=/,"")).toLowerCase(),u=new RegExp(a,"g"),i.replace(u,c)):"sign="+encodeURIComponent(n.Authorization)),n.SecurityToken&&(o+="&x-cos-security-token="+n.SecurityToken),n.ClientIP&&(o+="&clientIP="+n.ClientIP),n.ClientUA&&(o+="&clientUA="+n.ClientUA),n.Token&&(o+="&token="+n.Token),r&&(o+="&"+r),setTimeout((function(){t(null,{Url:o})}))}var i,a,c,u}));return d?(a+="?"+d.Authorization+(d.SecurityToken?"&x-cos-security-token="+d.SecurityToken:""),r&&(a+="&"+r)):r&&(a+="?"+r),a},getAuth:function(e){return i.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,SystemClockOffset:this.options.SystemClockOffset})}};e.exports.init=function(e,t){t.transferToTaskMethod(f,"postObject"),t.transferToTaskMethod(f,"putObject"),i.each(f,(function(t,n){e.prototype[n]=i.apiWrapper(n,t)}))}},function(e,t){function n(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}var o=function(e,t){var o,i,s,r=[],a=function(e,t){var o=[];for(var i in e)e.hasOwnProperty(i)&&o.push(t?n(i).toLowerCase():i);return o.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}(e);for(o=0;o-1||g.indexOf(f)>-1)&&(h[f]=e.headers[f]);s["x-cos-acl"]&&(h.acl=s["x-cos-acl"]),!h["Content-Type"]&&(h["Content-Type"]=""),(n=Un.uploadFile({url:r,method:a,name:"file",header:s,filePath:i,formData:h,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})).onProgressUpdate((function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})}))}else{var m=e.qs&&o(e.qs)||"";m&&(r+=(r.indexOf("?")>-1?"&":"?")+m),s["Content-Length"]&&delete s["Content-Length"];var _={url:r,method:a,header:s,dataType:"text",data:e.body,responseType:e.dataType||"text",timeout:e.timeout,redirect:"manual",success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}};u&&Object.assign(_,{enableHttpDNS:!0,httpDNSServiceId:u}),n=Un.request(_)}return n}},function(e,t,n){let o=n(29);e.exports=new o(n(30),n(31))},function(e,t,n){function o(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var c=s.call(r,"catchLoc"),u=s.call(r,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:P(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,n,o,i,s,r){try{var a=e[s](r),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(o,i)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function a(e){s(r,o,i,a,c,"next",e)}function c(e){s(r,o,i,a,c,"throw",e)}a(void 0)}))}}var a=n(7),c=n(33),u=n(6).EventProxy,l=n(0),p=n(2);function d(e,t){var n=e.TaskId,o=e.Bucket,i=e.Region,s=e.Key,r=e.StorageClass,p=this,d={},f=e.FileSize,m=e.SliceSize,_=Math.ceil(f/m),v=0,y=l.throttleOnProgress.call(p,f,e.onHashProgress),I=function(t,n){var o=t.length;return 0===o?n(null,!0):o>_||o>1&&Math.max(t[0].Size,t[1].Size)!==m?n(null,!1):void function i(s){if(s=c.length)M.emit("has_and_check_upload_id",t);else{var d=c[u];if(!l.isInArray(t,d))return a.removeUploadId(d),void r(u+1);a.using[d]?r(u+1):g.call(p,{Bucket:o,Region:i,Key:s,UploadId:d,tracker:e.tracker},(function(e,t){p._isRunningTask(n)&&(e?(a.removeUploadId(d),r(u+1)):M.emit("upload_id_available",{UploadId:d,PartList:t.PartList}))}))}}(0):M.emit("has_and_check_upload_id",t)})),M.on("get_remote_upload_id_list",(function(){h.call(p,{Bucket:o,Region:i,Key:s,tracker:e.tracker},(function(t,i){if(p._isRunningTask(n)){if(t)return M.emit("error",t);var c=l.filter(i.UploadList,(function(e){return e.Key===s&&(!r||e.StorageClass.toUpperCase()===r.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(c.length)M.emit("seek_local_avail_upload_id",c);else{var u,d=a.getFileId(e.FileStat,e.ChunkSize,o,s);d&&(u=a.getUploadIdList(d))&&l.each(u,(function(e){a.removeUploadId(e)})),M.emit("no_available_upload_id")}}}))})),M.emit("get_remote_upload_id_list")}function h(e,t){var n=this,o=[],i={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker};!function e(){n.multipartList(i,(function(n,s){if(n)return t(n);o.push.apply(o,s.Upload||[]),"true"===s.IsTruncated?(i.KeyMarker=s.NextKeyMarker,i.UploadIdMarker=s.NextUploadIdMarker,e()):t(null,{UploadList:o})}))}()}function g(e,t){var n=this,o=[],i={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker};!function e(){n.multipartListPart(i,(function(n,s){if(n)return t(n);o.push.apply(o,s.Part||[]),"true"===s.IsTruncated?(i.PartNumberMarker=s.NextPartNumberMarker,e()):t(null,{PartList:o})}))}()}function f(e,t){var n=this,o=e.TaskId,i=e.Bucket,s=e.Region,r=e.Key,a=e.UploadData,u=e.FileSize,p=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),h=e.FilePath,g=Math.ceil(u/p),f=0,_=e.ServerSideEncryption,v=l.filter(a.PartList,(function(e){return e.Uploaded&&(f+=e.PartNumber>=g&&u%p||p),!e.Uploaded})),y=e.onProgress;c.eachLimit(v,d,(function(t,c){if(n._isRunningTask(o)){var l=t.PartNumber,d=Math.min(u,t.PartNumber*p)-(t.PartNumber-1)*p,g=0;m.call(n,{TaskId:o,Bucket:i,Region:s,Key:r,SliceSize:p,FileSize:u,PartNumber:l,ServerSideEncryption:_,FilePath:h,UploadData:a,onProgress:function(e){f+=e.loaded-g,g=e.loaded,y({loaded:f,total:u})},tracker:e.tracker},(function(e,i){n._isRunningTask(o)&&(e?f-=g:(f+=d-g,t.ETag=i.ETag),y({loaded:f,total:u}),c(e||null,i))}))}}),(function(e){if(n._isRunningTask(o))return e?t(e):void t(null,{UploadId:a.UploadId,SliceList:a.PartList})}))}function m(e,t){var n=this,o=e.TaskId,i=e.Bucket,s=e.Region,r=e.Key,a=e.FileSize,u=e.FilePath,p=1*e.PartNumber,d=e.SliceSize,h=e.ServerSideEncryption,g=e.UploadData,f=n.options.ChunkRetryTimes+1,m=e.Headers||{},_=d*(p-1),v=d,y=_+d;y>a&&(v=(y=a)-_);var I=["x-cos-traffic-limit","x-cos-mime-limit"],M={};l.each(m,(function(e,t){I.indexOf(t)>-1&&(M[t]=e)})),l.fileSlice(u,_,y,(function(a){var u=l.getFileMd5(a),d=u?l.binaryBase64(u):null,m=g.PartList[p-1];c.retry(f,(function(t){n._isRunningTask(o)&&n.multipartUpload({TaskId:o,Bucket:i,Region:s,Key:r,ContentLength:v,PartNumber:p,UploadId:g.UploadId,ServerSideEncryption:h,Body:a,Headers:M,onProgress:e.onProgress,ContentMD5:d,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,i){if(n._isRunningTask(o))return e?t(e):(m.Uploaded=!0,t(null,i))}))}),(function(e,i){if(n._isRunningTask(o))return t(e,i)}))}))}function _(e,t){var n=e.Bucket,o=e.Region,i=e.Key,s=e.UploadId,r=e.SliceList,a=this,u=this.options.ChunkRetryTimes+1,l=r.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));c.retry(u,(function(t){a.multipartComplete({Bucket:n,Region:o,Key:i,UploadId:s,Parts:l,calledBySdk:"sliceUploadFile",Headers:e.Headers||{},tracker:e.tracker},t)}),(function(e,n){t(e,n)}))}function v(e,t){var n=e.Bucket,o=e.Region,i=e.Key,s=e.AbortArray,r=e.AsyncLimit||1,a=this,u=0,l=new Array(s.length);c.eachLimit(s,r,(function(t,s){var r=u;if(i&&i!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void s(null);var c=t.UploadId||t.UploadID;a.multipartAbort({Bucket:n,Region:o,Key:t.Key,Headers:e.Headers,UploadId:c},(function(e){var i={Bucket:n,Region:o,Key:t.Key,UploadId:c};l[r]={error:e,task:i},s(null)})),u++}),(function(e){if(e)return t(e);for(var n=[],o=[],i=0,s=l.length;ir?"sliceUploadFile":"putObject",t.tracker=new p({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:t.Bucket,region:t.Region,apiName:"uploadFile",realApi:h,fileKey:t.Key,fileSize:c,accelerate:d,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})),l.each(t,(function(e,t){"object"!==i(e)&&"function"!=typeof e&&(u[t]=e)})),g=t.onTaskReady,t.onTaskReady=function(e){u.TaskId=e,g&&g(e)},f=t.onFileFinish,m=function(e,o){t.tracker&&t.tracker.report(e,o),f&&f(e,o,u),n&&n(e,o)},_="postObject"===s.options.SimpleUploadMethod?"postObject":"putObject",v=c>r?"sliceUploadFile":_,a.push({api:v,params:t,callback:m}),s._addTasks(a);case 24:case"end":return e.stop()}}),e,this,[[3,9]])})))).apply(this,arguments)}function I(){return I=r(o().mark((function e(t,n){var s,a,c,u,d,h,g,f,m,_,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this,a=void 0===t.SliceSize?s.options.SliceSize:t.SliceSize,c=0,u=0,d=l.throttleOnProgress.call(s,u,t.onProgress),h=t.files.length,g=t.onFileFinish,f=Array(h),m=function(e,t,o){d(null,!0),g&&g(e,t,o),f[o.Index]={options:o,error:e,data:t},--h<=0&&n&&n(null,{files:f})},_=[],v=function(){return t.files.map((function(e,t){return new Promise((n=r(o().mark((function n(r){var h,g,f,v,y,I,M,C,T,S,E;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return h=0,n.prev=1,n.next=4,l.getFileSizeByPath(e.FilePath);case 4:h=n.sent,n.next=9;break;case 7:n.prev=7,n.t0=n.catch(1);case 9:g={Index:t,TaskId:""},c+=h,s.options.EnableReporter&&(f=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate."),v=h>a?"sliceUploadFile":"putObject",e.tracker=new p({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:v,fileKey:e.Key,fileSize:h,accelerate:f,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})),l.each(e,(function(e,t){"object"!==i(e)&&"function"!=typeof e&&(g[t]=e)})),y=e.onTaskReady,e.onTaskReady=function(e){g.TaskId=e,y&&y(e)},I=0,M=e.onProgress,e.onProgress=function(e){u=u-I+e.loaded,I=e.loaded,M&&M(e),d({loaded:u,total:c})},C=e.onFileFinish,T=function(t,n){e.tracker&&e.tracker.report(t,n),C&&C(t,n),m&&m(t,n,g)},S="postObject"===s.options.SimpleUploadMethod?"postObject":"putObject",E=h>a?"sliceUploadFile":S,_.push({api:E,params:e,callback:T}),r(!0);case 24:case"end":return n.stop()}}),n,null,[[1,7]])}))),function(e){return n.apply(this,arguments)}));var n}))},e.next=13,Promise.all(v());case 13:s._addTasks(_);case 14:case"end":return e.stop()}}),e,this)}))),I.apply(this,arguments)}function M(e,t){var n=e.TaskId,o=e.Bucket,i=e.Region,s=e.Key,r=e.CopySource,a=e.UploadId,u=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,d=this;c.retry(p,(function(t){d.uploadPartCopy({TaskId:n,Bucket:o,Region:i,Key:s,CopySource:r,UploadId:a,PartNumber:u,CopySourceRange:l,onProgress:e.onProgress,tracker:e.tracker,calledBySdk:e.calledBySdk},(function(e,n){t(e||null,n)}))}),(function(e,n){return t(e,n)}))}var C={sliceUploadFile:function(e,t){var n=this;if(!l.canFileSlice())return e.SkipTask=!0,void("postObject"===n.options.SimpleUploadMethod?n.postObject(e,t):n.putObject(e,t));var o,i,s=new u,r=e.TaskId,c=e.Bucket,p=e.Region,h=e.Key,g=e.FilePath,m=e.ChunkSize||e.SliceSize||n.options.ChunkSize,v=e.AsyncLimit,y=e.StorageClass,I=e.ServerSideEncryption,M=e.onHashProgress,C=e.tracker;C&&C.setParams({chunkSize:m}),s.on("error",(function(o){if(n._isRunningTask(r)){var i={UploadId:e.UploadData.UploadId||"",err:o,error:o};return t(i)}})),s.on("upload_complete",(function(n){var o=l.extend({UploadId:e.UploadData.UploadId||""},n);t(null,o)})),s.on("upload_slice_complete",(function(t){var u={};l.each(e.Headers,(function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(u[t]=e)})),_.call(n,{Bucket:c,Region:p,Key:h,UploadId:t.UploadId,SliceList:t.SliceList,Headers:u,tracker:C},(function(e,c){if(n._isRunningTask(r)){if(a.removeUsing(t.UploadId),e)return i(null,!0),s.emit("error",e);a.removeUploadId(t.UploadId),i({loaded:o,total:o},!0),s.emit("upload_complete",c)}}))})),s.on("get_upload_data_finish",(function(t){var u=a.getFileId(e.FileStat,e.ChunkSize,c,h);u&&a.saveUploadId(u,t.UploadId,n.options.UploadIdCacheLimit),a.setUsing(t.UploadId),i(null,!0),f.call(n,{TaskId:r,Bucket:c,Region:p,Key:h,FilePath:g,FileSize:o,SliceSize:m,AsyncLimit:v,ServerSideEncryption:I,UploadData:t,onProgress:i,tracker:C},(function(e,t){if(n._isRunningTask(r))return e?(i(null,!0),s.emit("error",e)):void s.emit("upload_slice_complete",t)}))})),s.on("get_file_size_finish",(function(){if(i=l.throttleOnProgress.call(n,o,e.onProgress),e.UploadData.UploadId)s.emit("get_upload_data_finish",e.UploadData);else{var t=l.extend({TaskId:r,Bucket:c,Region:p,Key:h,Headers:e.Headers,StorageClass:y,FilePath:g,FileSize:o,SliceSize:m,onHashProgress:M,tracker:C},e);t.FileSize=o,d.call(n,t,(function(t,o){if(n._isRunningTask(r)){if(t)return s.emit("error",t);e.UploadData.UploadId=o.UploadId,e.UploadData.PartList=o.PartList,s.emit("get_upload_data_finish",e.UploadData)}}))}})),o=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),l.each(e.Headers,(function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]})),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],i=1048576,s=0;s=S&&v%I||I),!e.Uploaded}));c.eachLimit(h,C,(function(t,n){var a=t.PartNumber,l=t.CopySourceRange,d=t.end-t.start,h=0;c.retry(T,(function(t){M.call(o,{Bucket:i,Region:s,Key:r,CopySource:p,UploadId:u.UploadId,PartNumber:a,CopySourceRange:l,tracker:e.tracker,calledBySdk:"sliceCopyFile",onProgress:function(e){E+=e.loaded-h,h=e.loaded,y({loaded:E,total:v})}},t)}),(function(e,o){if(e)return n(e);y({loaded:E,total:v}),E+=d-h,t.ETag=o.ETag,n(e||null,o)}))}),(function(e){if(e)return a.removeUsing(u.UploadId),y(null,!0),t(e);n.emit("copy_slice_complete",u)}))})),n.on("get_chunk_size_finish",(function(){var c=function(){o.multipartInit({Bucket:i,Region:s,Key:r,Headers:L,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,i){if(o)return t(o);e.UploadId=i.UploadId,n.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},u=a.getCopyFileId(p,k,I,i,r),d=a.getUploadIdList(u);if(!u||!d)return c();!function t(u){if(u>=d.length)return c();var p=d[u];if(a.using[p])return t(u+1);g.call(o,{Bucket:i,Region:s,Key:r,UploadId:p,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,i){if(o)a.removeUploadId(p),t(u+1);else{if(a.using[p])return t(u+1);var s={},r=0;l.each(i.PartList,(function(e){var t=parseInt(e.Size),n=r+t-1;s[e.PartNumber+"|"+r+"|"+n]=e.ETag,r+=t})),l.each(e.PartList,(function(e){var t=s[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),n.emit("get_copy_data_finish",{UploadId:p,PartList:e.PartList})}}))}(0)})),n.on("get_file_size_finish",(function(){var i;if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,i=0;i11&&(D[t]=e)})),n.emit("get_file_size_finish")}else t({error:'get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.'})}))}else t({error:"CopySource format error"})}};e.exports.init=function(e,t){t.transferToTaskMethod(C,"sliceUploadFile"),l.each(C,(function(t,n){e.prototype[n]=l.apiWrapper(n,t)}))}},function(e,t){var n={eachLimit:function(e,t,n,o){if(o=o||function(){},!e.length||t<=0)return o();var i=0,s=0,r=0;!function a(){if(i>=e.length)return o();for(;r=e.length?o():a())}))}()},retry:function(e,t,n){e<1?n():function o(i){t((function(t,s){t&&i{this.events[e].clear()})),this.events={}}dispatch(e,t){if(this.events[e])for(const n of this.events[e].keys())n.call(this,t)}bindIMEvents(){this.engine.chat.on(this.engine.EVENT.SDK_READY,this.onSDKReady,this),this.engine.chat.on(this.engine.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.engine.chat.on(this.engine.EVENT.KICKED_OUT,this.onKickedOut,this),this.engine.chat.on(this.engine.EVENT.NET_STATE_CHANGE,this.onNetStateChange,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_RECEIVED,this.onReceiveMessage,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_MODIFIED,this.onMessageModified,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_REVOKED,this.onMessageRevoked,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_BY_PEER,this.onMessageReadByPeer,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.onMessageReadReceiptReceived,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED,this.onMessageReactionsUpdated,this),this.engine.chat.on(this.engine.EVENT.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated,this),this.engine.chat.on(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,this.onTotalMessageCountUpdated,this),this.engine.chat.on(this.engine.EVENT.PROFILE_UPDATED,this.onProfileUpdated,this),this.engine.chat.on(this.engine.EVENT.BLACKLIST_UPDATED,this.onBlacklistUpdated,this),this.engine.chat.on(this.engine.EVENT.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),this.engine.chat.on(this.engine.EVENT.GROUP_LIST_UPDATED,this.onGroupListUpdated,this),this.engine.chat.on(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED,this.onGroupAttributesUpdated,this),this.engine.chat.on(this.engine.EVENT.GROUP_COUNTER_UPDATED,this.onGroupCounterUpdated,this),this.engine.chat.on(this.engine.EVENT.FRIEND_LIST_UPDATED,this.onFriendListUpdated,this),this.engine.chat.on(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED,this.onFriendApplicationListUpdated,this)}unbindIMEvents(){this.engine.chat.off(this.engine.EVENT.SDK_READY,this.onSDKReady,this),this.engine.chat.off(this.engine.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.engine.chat.off(this.engine.EVENT.KICKED_OUT,this.onKickedOut,this),this.engine.chat.off(this.engine.EVENT.NET_STATE_CHANGE,this.onNetStateChange,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_RECEIVED,this.onReceiveMessage,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_MODIFIED,this.onMessageModified,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_REVOKED,this.onMessageRevoked,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_BY_PEER,this.onMessageReadByPeer,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.onMessageReadReceiptReceived,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED,this.onMessageReactionsUpdated,this),this.engine.chat.off(this.engine.EVENT.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated,this),this.engine.chat.off(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,this.onTotalMessageCountUpdated,this),this.engine.chat.off(this.engine.EVENT.PROFILE_UPDATED,this.onProfileUpdated,this),this.engine.chat.off(this.engine.EVENT.BLACKLIST_UPDATED,this.onBlacklistUpdated,this),this.engine.chat.off(this.engine.EVENT.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),this.engine.chat.off(this.engine.EVENT.GROUP_LIST_UPDATED,this.onGroupListUpdated,this),this.engine.chat.off(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED,this.onGroupAttributesUpdated,this),this.engine.chat.off(this.engine.EVENT.GROUP_COUNTER_UPDATED,this.onGroupCounterUpdated,this),this.engine.chat.off(this.engine.EVENT.FRIEND_LIST_UPDATED,this.onFriendListUpdated,this),this.engine.chat.off(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED,this.onFriendApplicationListUpdated,this),e.instance=null}onSDKReady(e){this.dispatch(this.engine.EVENT.SDK_READY,e.data)}onSDKNotReady(e){this.dispatch(this.engine.EVENT.SDK_NOT_READY,e.data)}onKickedOut(e){this.dispatch(this.engine.EVENT.KICKED_OUT,e.data)}onNetStateChange(e){this.dispatch(this.engine.EVENT.NET_STATE_CHANGE,e.data)}onReceiveMessage(e){this.dispatch(this.engine.EVENT.MESSAGE_RECEIVED,e.data)}onMessageModified(e){this.dispatch(this.engine.EVENT.MESSAGE_MODIFIED,e.data)}onMessageRevoked(e){this.dispatch(this.engine.EVENT.MESSAGE_REVOKED,e.data)}onMessageReadByPeer(e){this.dispatch(this.engine.EVENT.MESSAGE_READ_BY_PEER,e.data)}onMessageReadReceiptReceived(e){this.dispatch(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,e.data)}onMessageReactionsUpdated(e){this.dispatch(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED,e.data)}onConversationListUpdated(e){this.dispatch(this.engine.EVENT.CONVERSATION_LIST_UPDATED,e.data)}onTotalMessageCountUpdated(e){this.dispatch(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,e.data)}onProfileUpdated(e){this.dispatch(this.engine.EVENT.PROFILE_UPDATED,e.data)}onBlacklistUpdated(e){this.dispatch(this.engine.EVENT.BLACKLIST_UPDATED,e.data)}onUserStatusUpdated(e){this.dispatch(this.engine.EVENT.USER_STATUS_UPDATED,e.data)}onGroupListUpdated(e){this.dispatch(this.engine.EVENT.GROUP_LIST_UPDATED,e.data)}onGroupAttributesUpdated(e){this.dispatch(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED,e.data)}onGroupCounterUpdated(e){this.dispatch(this.engine.EVENT.GROUP_COUNTER_UPDATED,e.data)}onFriendListUpdated(e){this.dispatch(this.engine.EVENT.FRIEND_LIST_UPDATED,e.data)}onFriendApplicationListUpdated(e){this.dispatch(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED,e.data)}};var pl,dl,hl,gl,fl,ml,_l,vl,yl;exports.o=void 0,(yl=pl||(pl={})).TUIStore="TUIStore",yl.TUITranslate="TUITranslate",yl.TUIConversation="TUIConversation",yl.TUIChat="TUIChat",yl.TUIGroup="TUIGroup",yl.TUIUser="TUIUser",yl.TUIFriend="TUIFriend",yl.TUIReport="TUIReport",function(e){e.APP="application",e.CONV="conversation",e.CHAT="chat",e.GRP="group",e.USER="user",e.FRIEND="friend",e.SEARCH="search",e.CUSTOM="custom"}(exports.o||(exports.o={})),function(e){e[e.UNSUB_USER=-1]="UNSUB_USER"}(dl||(dl={})),function(e){e.BUSINESS_ID="user_typing_status",e[e.STATUS_START=1]="STATUS_START",e[e.STATUS_END=0]="STATUS_END",e[e.VERSION=1]="VERSION",e[e.ACTION_START_ID=14]="ACTION_START_ID",e[e.ACTION_END_ID=0]="ACTION_END_ID",e.ACTION_START="EIMAMSG_InputStatus_Ing",e.ACTION_END="EIMAMSG_InputStatus_End",e[e.NEED_TYPING=1]="NEED_TYPING"}(hl||(hl={})),function(e){e.ADD="add",e.REMOVE="remove"}(gl||(gl={})),function(e){e[e.MSG_MODIFY_CONFLICT=2480]="MSG_MODIFY_CONFLICT",e[e.MSG_MODIFY_DISABLED_IN_AVCHATROOM=2481]="MSG_MODIFY_DISABLED_IN_AVCHATROOM",e[e.MODIFY_MESSAGE_NOT_EXIST=20026]="MODIFY_MESSAGE_NOT_EXIST"}(fl||(fl={})),function(e){e[e.NOT_INIT=-1e5]="NOT_INIT",e[e.INVALID_CONV_ID=-100001]="INVALID_CONV_ID",e[e.CONV_ID_SAME=-100002]="CONV_ID_SAME",e[e.CONV_NOT_EXIST=-100003]="CONV_NOT_EXIST",e[e.GET_MSG_LIST_ERROR=-100004]="GET_MSG_LIST_ERROR",e[e.MISMATCH_TYPE_AND_PAYLOAD=-100005]="MISMATCH_TYPE_AND_PAYLOAD"}(ml||(ml={})),function(e){e.MSG_MODIFY_CONFLICT="MODIFY_MESSAGE_ERROR,修改消息发生冲突, data.message 是最新的消息",e.MSG_MODIFY_DISABLED_IN_AVCHATROOM="MODIFY_MESSAGE_ERROR,不支持修改直播群消息.",e.MODIFY_MESSAGE_NOT_EXIST="MODIFY_MESSAGE_ERROR,消息不存在."}(_l||(_l={})),function(e){e.NOT_INIT="TUIChatEngine 初始化未完成,请确认 TUIChatEngine.login 接口调用是否正常。",e.INVALID_CONV_ID="会话 ID 无效",e.CONV_ID_SAME="您切换的是同一个会话 ID",e.CONV_NOT_EXIST="会话不存在",e.GET_MSG_LIST_ERROR="Chat SDK is not ready.",e.MISMATCH_TYPE_AND_PAYLOAD="type 与 payload 不匹配."}(vl||(vl={}));const Il={logout:1,destroy:1},Ml=function(e){return void 0===e},Cl=function(e){return e.startsWith("_")},Tl=function(e){return/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)},Sl=function(e){return e&&function(e){if("string"==typeof e)try{return!!JSON.parse(e)}catch(t){return!1}return!1}(e)?JSON.parse(e):e},El=function(e){let t="";return t=e>=1048576?`${(e/1048576).toFixed(2)} Mb`:e>=1024?`${(e/1024).toFixed(2)} Kb`:`${e.toFixed(2)}B`,t},kl={"[TUIEmoji_Expect]":"emoji_0@2x.png","[TUIEmoji_Blink]":"emoji_1@2x.png","[TUIEmoji_Guffaw]":"emoji_2@2x.png","[TUIEmoji_KindSmile]":"emoji_3@2x.png","[TUIEmoji_Haha]":"emoji_4@2x.png","[TUIEmoji_Cheerful]":"emoji_5@2x.png","[TUIEmoji_Smile]":"emoji_6@2x.png","[TUIEmoji_Sorrow]":"emoji_7@2x.png","[TUIEmoji_Speechless]":"emoji_8@2x.png","[TUIEmoji_Amazed]":"emoji_9@2x.png","[TUIEmoji_Complacent]":"emoji_10@2x.png","[TUIEmoji_Lustful]":"emoji_11@2x.png","[TUIEmoji_Stareyes]":"emoji_12@2x.png","[TUIEmoji_Giggle]":"emoji_13@2x.png","[TUIEmoji_Daemon]":"emoji_14@2x.png","[TUIEmoji_Rage]":"emoji_15@2x.png","[TUIEmoji_Yawn]":"emoji_16@2x.png","[TUIEmoji_TearsLaugh]":"emoji_17@2x.png","[TUIEmoji_Silly]":"emoji_18@2x.png","[TUIEmoji_Wail]":"emoji_19@2x.png","[TUIEmoji_Kiss]":"emoji_20@2x.png","[TUIEmoji_Trapped]":"emoji_21@2x.png","[TUIEmoji_Fear]":"emoji_22@2x.png","[TUIEmoji_BareTeeth]":"emoji_23@2x.png","[TUIEmoji_FlareUp]":"emoji_24@2x.png","[TUIEmoji_Tact]":"emoji_25@2x.png","[TUIEmoji_Shit]":"emoji_26@2x.png","[TUIEmoji_ShutUp]":"emoji_27@2x.png","[TUIEmoji_Sigh]":"emoji_28@2x.png","[TUIEmoji_Hehe]":"emoji_29@2x.png","[TUIEmoji_Silent]":"emoji_30@2x.png","[TUIEmoji_Skull]":"emoji_31@2x.png","[TUIEmoji_Mask]":"emoji_32@2x.png","[TUIEmoji_Beer]":"emoji_33@2x.png","[TUIEmoji_Cake]":"emoji_34@2x.png","[TUIEmoji_RedPacket]":"emoji_35@2x.png","[TUIEmoji_Bombs]":"emoji_36@2x.png","[TUIEmoji_Ai]":"emoji_37@2x.png","[TUIEmoji_Celebrate]":"emoji_38@2x.png","[TUIEmoji_Bless]":"emoji_39@2x.png","[TUIEmoji_Flower]":"emoji_40@2x.png","[TUIEmoji_Watermelon]":"emoji_41@2x.png","[TUIEmoji_Cow]":"emoji_42@2x.png","[TUIEmoji_Fool]":"emoji_43@2x.png","[TUIEmoji_Surprised]":"emoji_44@2x.png","[TUIEmoji_Askance]":"emoji_45@2x.png","[TUIEmoji_Monster]":"emoji_46@2x.png","[TUIEmoji_Pig]":"emoji_47@2x.png","[TUIEmoji_Coffee]":"emoji_48@2x.png","[TUIEmoji_Ok]":"emoji_49@2x.png","[TUIEmoji_Heart]":"emoji_50@2x.png","[TUIEmoji_Sun]":"emoji_51@2x.png","[TUIEmoji_Moon]":"emoji_52@2x.png","[TUIEmoji_Star]":"emoji_53@2x.png","[TUIEmoji_Rich]":"emoji_54@2x.png","[TUIEmoji_Fortune]":"emoji_55@2x.png","[TUIEmoji_857]":"emoji_56@2x.png","[TUIEmoji_666]":"emoji_57@2x.png","[TUIEmoji_Prohibit]":"emoji_58@2x.png","[TUIEmoji_Convinced]":"emoji_59@2x.png","[TUIEmoji_Knife]":"emoji_60@2x.png","[TUIEmoji_Like]":"emoji_61@2x.png"},Dl={"[TUIEmoji_Smile]":"[微笑]","[TUIEmoji_Expect]":"[期待]","[TUIEmoji_Blink]":"[眨眼]","[TUIEmoji_Guffaw]":"[大笑]","[TUIEmoji_KindSmile]":"[姨母笑]","[TUIEmoji_Haha]":"[哈哈哈]","[TUIEmoji_Cheerful]":"[愉快]","[TUIEmoji_Speechless]":"[无语]","[TUIEmoji_Amazed]":"[惊讶]","[TUIEmoji_Sorrow]":"[悲伤]","[TUIEmoji_Complacent]":"[得意]","[TUIEmoji_Silly]":"[傻了]","[TUIEmoji_Lustful]":"[色]","[TUIEmoji_Giggle]":"[憨笑]","[TUIEmoji_Kiss]":"[亲亲]","[TUIEmoji_Wail]":"[大哭]","[TUIEmoji_TearsLaugh]":"[哭笑]","[TUIEmoji_Trapped]":"[困]","[TUIEmoji_Mask]":"[口罩]","[TUIEmoji_Fear]":"[恐惧]","[TUIEmoji_BareTeeth]":"[龇牙]","[TUIEmoji_FlareUp]":"[发怒]","[TUIEmoji_Yawn]":"[打哈欠]","[TUIEmoji_Tact]":"[机智]","[TUIEmoji_Stareyes]":"[星星眼]","[TUIEmoji_ShutUp]":"[闭嘴]","[TUIEmoji_Sigh]":"[叹气]","[TUIEmoji_Hehe]":"[呵呵]","[TUIEmoji_Silent]":"[收声]","[TUIEmoji_Surprised]":"[惊喜]","[TUIEmoji_Askance]":"[白眼]","[TUIEmoji_Ok]":"[OK]","[TUIEmoji_Shit]":"[便便]","[TUIEmoji_Monster]":"[怪兽]","[TUIEmoji_Daemon]":"[恶魔]","[TUIEmoji_Rage]":"[恶魔怒]","[TUIEmoji_Fool]":"[衰]","[TUIEmoji_Pig]":"[猪]","[TUIEmoji_Cow]":"[牛]","[TUIEmoji_Ai]":"[AI]","[TUIEmoji_Skull]":"[骷髅]","[TUIEmoji_Bombs]":"[炸弹]","[TUIEmoji_Coffee]":"[咖啡]","[TUIEmoji_Cake]":"[蛋糕]","[TUIEmoji_Beer]":"[啤酒]","[TUIEmoji_Flower]":"[花]","[TUIEmoji_Watermelon]":"[瓜]","[TUIEmoji_Rich]":"[壕]","[TUIEmoji_Heart]":"[爱心]","[TUIEmoji_Moon]":"[月亮]","[TUIEmoji_Sun]":"[太阳]","[TUIEmoji_Star]":"[星星]","[TUIEmoji_RedPacket]":"[红包]","[TUIEmoji_Celebrate]":"[庆祝]","[TUIEmoji_Bless]":"[福]","[TUIEmoji_Fortune]":"[发]","[TUIEmoji_Convinced]":"[服]","[TUIEmoji_Prohibit]":"[禁]","[TUIEmoji_666]":"[666]","[TUIEmoji_857]":"[857]","[TUIEmoji_Knife]":"[刀]","[TUIEmoji_Like]":"[赞]"},Ll={enabledMessageReadReceipt:Math.pow(2,5),enabledEmojiPlugin:Math.pow(2,48),enabledOnlineStatus:Math.pow(2,7),enabledCustomerServicePlugin:Math.pow(2,40),enabledTranslationPlugin:Math.pow(2,38),enabledVoiceToText:Math.pow(2,39)},Rl=["messageList","conversationList","newMessageList"],Ol=["translateTextInfo","voiceToTextInfo"],Al=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),bl=void 0!==Gn&&"undefined"==typeof window,Pl=Al||bl,Nl=(void 0!==Gn||"undefined"!=typeof window)&&!Pl,xl=Al?Un:void 0!==Gn?Gn:window,wl=Nl&&window&&window.navigator&&window.navigator.userAgent||"",Ul=/Android/i.test(wl),Gl=/(?:Windows Phone)/.test(wl),Fl=/(?:SymbianOS)/.test(wl),Bl=/iPad/i.test(wl)||/iPhone/i.test(wl)||/iPod/i.test(wl),ql=Ul||Gl||Fl||Bl,Vl=Nl&&!ql;class jl{constructor(){this.global=xl,this.isOfficial=!1}static getInstance(){return jl.instance||(jl.instance=new jl),jl.instance}initOfficial(e){this.isOfficial=e}getPlatform(){let e="";return Vl?e="pc":ql?e="h5":Al?e="wechat":bl&&!Al&&(e="app"),e}}class Hl{constructor(){this.EVENT=Nu.EVENT,this.TYPES=Nu.TYPES,this.loginStatusPromise=new Map,this.userID="",this.isInited=!1}static getInstance(){return Hl.instance||(Hl.instance=new Hl),Hl.instance}mount(e,t){this[e]=t}login(e){const{chat:t,SDKAppID:n,userID:o}=e,i=1400187352===n||1400188366===n;return this.createChat(e),this.userID=o,jl.getInstance().initOfficial(i),this.TUIStore.update(exports.o.APP,"isOfficial",i),this.TUIStore.update(exports.o.APP,"SDKVersion",Nu.VERSION),this.eventCenter=new ll(this),this.eventCenter.removeEvents(),this.resetStore(),this.initService(),t&&t.isReady()?(console.log("TUIChatEngine.login ok, from TUICore."),this.TUIUser.getUserProfile(),this.checkCommercialAbility(),Promise.resolve({})):(this.registerPlugin(e),this.eventCenter.addEvent(this.EVENT.SDK_READY,(()=>{this.onSDKReady()})),this.eventCenter.addEvent(this.EVENT.SDK_NOT_READY,(()=>{this.onSDKNotReady()})),this.loginChat(e))}logout(){return this.userID="",this.isInited=!1,this.resetStore(),this.chat.logout()}isReady(){var e;return(null===(e=this.chat)||void 0===e?void 0:e.isReady())||!1}setLogLevel(e){this.chat?this.chat.setLogLevel(e):console.warn("TUIChatEngine 初始化未完成,请确认 TUIChatEngine.login 接口调用是否正常。")}destroy(){return this.eventCenter.unbindIMEvents(),this.isInited=!1,this.resetStore(),this.chat.destroy()}getMyUserID(){return this.userID}resetStore(){this.TUIStore.reset(exports.o.CHAT),this.TUIStore.reset(exports.o.CONV),this.TUIStore.reset(exports.o.GRP),this.TUIStore.reset(exports.o.USER),this.TUIStore.reset(exports.o.SEARCH),this.TUIStore.reset(exports.o.FRIEND),this.TUIStore.reset(exports.o.CUSTOM),console.log("TUIChatEngine.resetStore ok.")}initService(){this.TUIChat.init(),this.TUIConversation.init(),this.TUIUser.init(),this.initOptionalServices(),this.isInited=!0,console.log("TUIChatEngine.initService ok.")}initOptionalServices(){const e=Nu.VERSION.split(".");e[0]>3||3===e[0]&&e[1]>=3&&e[2]>0?(!0===this.chat.callExperimentalAPI("canIUseModule",["group-module"])&&this.TUIGroup.init(),!0===this.chat.callExperimentalAPI("canIUseModule",["relationship-module"])&&this.TUIFriend.init()):(this.TUIGroup.init(),this.TUIFriend.init())}createChat(e){const{chat:t}=e,n=cl(e,["chat"]);Ml(t)?this.chat=Nu.create(Object.assign(Object.assign({},n),{scene:"chat-uikit-engine"})):this.chat=t}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,o)=>{this.chat.login({userID:t,userSig:n}).then((t=>{console.log("TUIChatEngine.loginChat ok."),this.checkCommercialAbility(),t.data.repeatLogin&&this.chat.isReady()&&e(t),this.loginStatusPromise.set("login",{resolve:e,reject:o,imResponse:t})})).catch((e=>{o(e)}))}))}registerPlugin(e){const{useUploadPlugin:t=!1,useProfanityFilterPlugin:n=!1,TIMPush:o,pushConfig:i,TUIOfflinePush:s,offlinePushConfig:r}=e;!0===t&&this.chat.registerPlugin({"tim-upload-plugin":wu}),!0===n&&this.chat.registerPlugin({"tim-profanity-filter-plugin":Gu}),!bl||Al||Ml(o)||Ml(i)||this.chat.registerPlugin({"tim-push":o,pushConfig:i}),!bl||Al||Ml(s)||Ml(r)||this.chat.registerPlugin({"tim-offline-push-plugin":s,offlinePushConfig:r})}onSDKReady(){if(this.loginStatusPromise.has("login")){const e=this.loginStatusPromise.get("login");e.resolve(e.imResponse),this.TUIUser.getUserProfile()}this.loginStatusPromise.delete("login")}onSDKNotReady(){this.loginStatusPromise.has("login")&&this.loginStatusPromise.get("login").reject(new Error("sdk not ready")),this.loginStatusPromise.delete("login"),this.resetStore()}checkCommercialAbility(){Object.keys(Ll).forEach((e=>{const t=Ll[e];this.chat.callExperimentalAPI("isCommercialAbilityEnabled",t).then((t=>{const{enabled:n=!1}=t.data;this.TUIStore.update(exports.o.APP,e,n)}))}))}}class Kl{constructor(){this.defaultStore={enabledMessageReadReceipt:!1,enabledEmojiPlugin:!1,enabledOnlineStatus:!1,enabledCustomerServicePlugin:!1,enabledTranslationPlugin:!1,enabledVoiceToText:!1,enableTyping:!0,enableConversationDraft:!0,isOfficial:!1,SDKVersion:"3.0.0",tasks:{sendMessage:!1,revokeMessage:!1,modifyNickName:!1,groupChat:!1,muteGroup:!1,dismissGroup:!1,call:!1,searchCloudMessage:!1,customerService:!1,translateTextMessage:!1}},this.store={enabledEmojiPlugin:!1,enabledMessageReadReceipt:!1,enabledOnlineStatus:!1,enabledCustomerServicePlugin:!1,enabledTranslationPlugin:!1,enabledVoiceToText:!1,enableTyping:!0,enableConversationDraft:!0,isOfficial:!1,SDKVersion:"3.0.0",tasks:{sendMessage:!1,revokeMessage:!1,modifyNickName:!1,groupChat:!1,muteGroup:!1,dismissGroup:!1,call:!1,searchCloudMessage:!1,customerService:!1,translateTextMessage:!1}}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}}class $l{constructor(){this.defaultStore={userProfile:{},displayOnlineStatus:!1,displayMessageReadReceipt:!0,userStatusList:new Map,kickedOut:"",netStateChange:"",userBlacklist:[],targetLanguage:"zh"},this.store={userProfile:{},displayOnlineStatus:!1,displayMessageReadReceipt:!0,userStatusList:new Map,kickedOut:"",netStateChange:"",userBlacklist:[],targetLanguage:"zh"}}update(e,t){"userStatusList"===e?this.updateUserStatusList(t):this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateUserStatusList(e){0!==e.length?e.forEach((e=>{const{userID:t,statusType:n=0,customStatus:o=""}=e;n===dl.UNSUB_USER?this.store.userStatusList.delete(t):this.store.userStatusList.set(t,{statusType:n,customStatus:o})})):this.store.userStatusList.clear()}}class zl{getEngine(){return Hl.getInstance()}}const Yl=function(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(function(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(e)){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1},Wl=["[图片]","[语音]","[视频]","[文件]","[位置]","[地理位置]","[动画表情]","[自定义消息]","[群提示消息]","[聊天记录]"];class Jl extends zl{constructor(e){super(),this.initProxy(e),this.isMuted=this.messageRemindType===this.getEngine().TYPES.MSG_REMIND_ACPT_NOT_NOTE||this.messageRemindType===this.getEngine().TYPES.MSG_REMIND_DISCARD,this.operationType=0,this._conversation=e}initProxy(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}updateProperties(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}updateOperationType(e){this.operationType=e}getConversation(){return this._conversation}deleteConversation(){return this.getEngine().TUIConversation.deleteConversation(this.conversationID)}pinConversation(){return this.getEngine().TUIConversation.pinConversation({conversationID:this.conversationID,isPinned:!this.isPinned})}muteConversation(){const e=this.getEngine(),t={messageRemindType:!0===this.isMuted?e.TYPES.MSG_REMIND_ACPT_AND_NOTE:e.TYPES.MSG_REMIND_ACPT_NOT_NOTE};if(this.type===e.TYPES.CONV_C2C){const n=this.conversationID.replace(e.TYPES.CONV_C2C,"");t.userIDList=[n]}else if(this.type===e.TYPES.CONV_GROUP){const n=this.conversationID.replace(e.TYPES.CONV_GROUP,"");t.groupID=n}return e.TUIConversation.muteConversation(t)}getAvatar(){var e,t,n,o,i,s;const r=this.getEngine();let a="";switch(this.type){case r.TYPES.CONV_C2C:a=Tl(null===(e=this.userProfile)||void 0===e?void 0:e.avatar)?null===(t=this.userProfile)||void 0===t?void 0:t.avatar:"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_16.png";break;case r.TYPES.CONV_GROUP:a=Tl(null===(n=this.groupProfile)||void 0===n?void 0:n.avatar)?null===(o=this.groupProfile)||void 0===o?void 0:o.avatar:"https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.png";break;case r.TYPES.CONV_SYSTEM:a=Tl(null===(i=this.groupProfile)||void 0===i?void 0:i.avatar)?null===(s=this.groupProfile)||void 0===s?void 0:s.avatar:"https://web.sdk.qcloud.com/component/TUIKit/assets/group_avatar.png"}return a}getShowName(){var e,t,n,o;const i=this.getEngine();let s="";switch(this.type){case i.TYPES.CONV_C2C:s=this.remark||(null===(e=this.userProfile)||void 0===e?void 0:e.nick)||(null===(t=this.userProfile)||void 0===t?void 0:t.userID)||"";break;case i.TYPES.CONV_GROUP:s=(null===(n=this.groupProfile)||void 0===n?void 0:n.name)||(null===(o=this.groupProfile)||void 0===o?void 0:o.groupID)||"";break;case i.TYPES.CONV_SYSTEM:s=i.TUITranslate.t("系统通知")}return s}getGroupAtInfo(){const e=this.getEngine(),t=e.TUITranslate.t.bind(e.TUITranslate),n=[`[${t("TUIConversation.有人@我")}]`,`[${t("TUIConversation.@所有人")}]`,`[${t("TUIConversation.@所有人")}][${t("TUIConversation.有人@我")}]`];let o="";for(let i=0;i0&&(o=n[this.groupAtInfoList[i].atTypeArray[0]-1]);return o}getLastMessage(e){return"time"===e?this.getLastMessageTime():"text"===e?this.getLastMessageText():(console.warn(`ConversationModel.getLastMessage key:${e} is invalid.`),null)}getLastMessageTime(){var e;const t=this.getEngine();let n="";return(null===(e=this.lastMessage)||void 0===e?void 0:e.lastTime)>0&&(n=function(e,t){const n=36e5,o=24*n,i=7*o,s=(new Date).getTime()-e;let r="";if(s<0)return r;const a=s/6e4,c=s/n,u=s/o,l=s/i;if(l>=1&&l<=4)r=` ${parseInt(`${l}`,10)} ${t("time.周")}${t("time.前")}`;else if(u>=1&&u<=6)r=` ${parseInt(`${u}`,10)} ${t("time.天")}${t("time.前")}`;else if(c>=1&&c<=23)r=` ${parseInt(`${c}`,10)} ${t("time.小时")}${t("time.前")}`;else if(a>=1&&a<=59)r=` ${parseInt(`${a}`,10)} ${t("time.分钟")}${t("time.前")}`;else if(s>=0&&s<=6e4)r=`${t("time.刚刚")}`;else{const t=new Date;t.setTime(e),r=`${t.getFullYear()}-${t.getMonth()+1<10?`0${t.getMonth()+1}`:t.getMonth()+1}-${t.getDate()<10?`0${t.getDate()}`:t.getDate()}`}return r}(1e3*this.lastMessage.lastTime,t.TUITranslate.t.bind(t.TUITranslate))),n}getLastMessageText(){var e;if(this.draftText)return Sl(this.draftText).abstract;const t=this.getEngine(),n=t.TUITranslate.t.bind(t.TUITranslate);if(4===this.operationType)return n("TUIConversation.您已被群管理员移出群聊");if(5===this.operationType)return n("TUIConversation.该群聊已被解散");if(8===this.operationType)return n("TUIConversation.您已退出该群聊");const o=this._conversation,{lastMessage:i}=this;let s="",r="";const a=o.unreadCount>0&&o.messageRemindType===t.TYPES.MSG_REMIND_ACPT_NOT_NOTE?`[${o.unreadCount>99?"99+":o.unreadCount}${n("TUIConversation.条")}]`:"";if(o.type===t.TYPES.CONV_GROUP)if(i.fromAccount===t.getMyUserID())s=n("TUIConversation.我");else{const e=i.fromAccount;s=t.TUIFriend.getFriendRemark([e])[e]||i.nameCard||i.nick||e}if(i.type===t.TYPES.MSG_TEXT)r=this.decodeTextMessage(i.payload.text);else if(i.type===t.TYPES.MSG_CUSTOM){const o=Sl(null===(e=null==i?void 0:i.payload)||void 0===e?void 0:e.data);if(1===(null==o?void 0:o.businessID))return r=t.TUIChat.messageHandler.handleCallKitSignaling(i),r;r=Wl.includes(i.messageForShow)?n(`TUIChat.${i.messageForShow}`):i.messageForShow}else r=Wl.includes(i.messageForShow)?n(`TUIChat.${i.messageForShow}`):i.messageForShow;return i.isRevoked&&(r=n("TUIChat.撤回了一条消息")),o.type===t.TYPES.CONV_GROUP&&i.type===t.TYPES.MSG_GRP_TIP?r:`${a}${s?`${s}:`:""}${r}`}decodeTextMessage(e){if(Yl(e))return e;const t=/(\[.+?\])/g;let n=e;if(t.test(e)){const o=this.getEngine(),i=o.TUITranslate.t.bind(o.TUITranslate);n=e.replace(t,(e=>{const t=i(`Emoji.${e}`);return Al||!t||t.startsWith("Emoji.")?Dl[e]||e:t}))}return n}}class Xl{constructor(){this.defaultStore={currentConversationID:"",totalUnreadCount:0,conversationList:[],currentConversation:null,operationTypeMap:new Map},this.store={currentConversationID:"",totalUnreadCount:0,conversationList:[],currentConversation:null,operationTypeMap:new Map}}update(e,t){switch(e){case"conversationList":this.updateConversationList(t);break;case"operationTypeMap":this.updateOperationTypeMap(t);break;default:this.store[e]=t}}getData(e){return this.store[e]}getModel(e){return this.store.conversationList.find((t=>t.conversationID===e))}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateConversationList(e){const t=[];e.forEach((e=>{let n=e;e instanceof Jl?n.updateProperties(e):n=new Jl(e);const o=this.getOperationType(e);n.updateOperationType(o),t.push(n)})),this.store.conversationList=t}updateOperationTypeMap(e){const{conversationID:t,operationType:n=0}=e;this.store.operationTypeMap.set(t,n)}getOperationType(e){const{conversationID:t}=e;return this.store.operationTypeMap.get(t)||0}}class Zl extends zl{constructor(e){super(),this.messageHandlers={[this.getEngine().TYPES.MSG_TEXT]:e=>this.getEngine().TUIChat.messageHandler.handleTextMessage(e),[this.getEngine().TYPES.MSG_FACE]:e=>this.getEngine().TUIChat.messageHandler.handleFaceMessage(e),[this.getEngine().TYPES.MSG_LOCATION]:e=>this.getEngine().TUIChat.messageHandler.handleLocationMessage(e),[this.getEngine().TYPES.MSG_IMAGE]:e=>this.getEngine().TUIChat.messageHandler.handleImageMessage(e),[this.getEngine().TYPES.MSG_AUDIO]:e=>this.getEngine().TUIChat.messageHandler.handleAudioMessage(e),[this.getEngine().TYPES.MSG_VIDEO]:e=>this.getEngine().TUIChat.messageHandler.handleVideoMessage(e),[this.getEngine().TYPES.MSG_FILE]:e=>this.getEngine().TUIChat.messageHandler.handleFileMessage(e),[this.getEngine().TYPES.MSG_CUSTOM]:e=>this.getEngine().TUIChat.messageHandler.handleCustomMessage(e),[this.getEngine().TYPES.MSG_MERGER]:e=>this.getEngine().TUIChat.messageHandler.handleMergeMessage(e),[this.getEngine().TYPES.MSG_GRP_TIP]:e=>this.getEngine().TUIChat.messageHandler.handleGroupTipsMessage(e)},this._message=e,this._signalingInfo=void 0,this.progress=0,this.reactionList=[],this.initProperties(e)}initProperties(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}updateProperties(e){this._message=e,Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}getMessage(){return this._message}modifyMessage(e){return e.type&&this._message.type!==e.type&&!e.payload?Promise.reject({code:ml.MISMATCH_TYPE_AND_PAYLOAD,message:vl.MISMATCH_TYPE_AND_PAYLOAD}):(this._message.type=e.type||this._message.type,this._message.payload=e.payload||this._message.payload,this._message.cloudCustomData=e.cloudCustomData||this._message.cloudCustomData,this.getEngine().TUIChat.modifyMessage(this._message))}revokeMessage(){return this.getEngine().TUIChat.revokeMessage(this._message)}resendMessage(){return this.getEngine().TUIChat.resendMessage(this._message)}deleteMessage(){return this.getEngine().TUIChat.deleteMessage([this._message])}quoteMessage(){return this.getEngine().TUIChat.quoteMessage(this._message)}replyMessage(){return this.getEngine().TUIChat.replyMessage(this._message)}setMessageExtensions(e){return this.getEngine().TUIChat.setMessageExtensions(this._message,e)}getMessageExtensions(){return this.getEngine().TUIChat.getMessageExtensions(this._message)}deleteMessageExtensions(e){return this.getEngine().TUIChat.deleteMessageExtensions(this._message,e)}getSignalingInfo(){return this.type!==this.getEngine().TYPES.MSG_CUSTOM?null:Ml(this._signalingInfo)?(this._signalingInfo=this.getEngine().chat.getSignalingInfo(this._message),this._signalingInfo):this._signalingInfo}getMessageContent(){const e=this.messageHandlers[this.type];if(Ml(e))return{};if(this.type===this.getEngine().TYPES.MSG_GRP_TIP)return e(this._message);const t=this.getEngine().TUIFriend.getFriendRemark([this.from]);return Object.assign(Object.assign({},e(this._message)),{showName:t[this.from]||this.nameCard||this.nick||this.from})}sendForwardMessage(e){return this.getEngine().TUIChat.sendForwardMessage(e,[this._message])}}class Ql{constructor(){this.defaultStore={messageList:[],isCompleted:!1,nextReqMessageID:"",quoteMessage:{},newMessageList:[],typingStatus:!1,messageSource:void 0,translateTextInfo:void 0,voiceToTextInfo:void 0,userInfo:{}},this.store={messageList:[],isCompleted:!1,nextReqMessageID:"",quoteMessage:{},newMessageList:[],typingStatus:!1,messageSource:void 0,translateTextInfo:void 0,voiceToTextInfo:void 0,userInfo:{}}}update(e,t){switch(e){case"messageList":this.updateMessageList(t);break;case"translateTextInfo":this.updateTranslateTextInfo(t);break;case"voiceToTextInfo":this.updateVoiceToTextInfo(t);break;default:this.store[e]=t}}getData(e){return this.store[e]}getModel(e){return this.store.messageList.find((t=>t.ID===e))}reset(e=[]){const t=e.filter((e=>!Ol.includes(e)));this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),null==t?void 0:t.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateMessageList(e){const t=[];e.forEach((e=>{let n=e;e instanceof Zl||(n=this.getModel(e.ID),n?n.updateProperties(e):n=new Zl(e)),t.push(n)})),this.store.messageList=t}updateTranslateTextInfo(e){this.updateBykey("translateTextInfo",e)}updateVoiceToTextInfo(e){this.updateBykey("voiceToTextInfo",e)}updateBykey(e,t){const{conversationID:n,messageID:o,visible:i=!1}=t;this.store[e]||(this.store[e]=new Map),this.store[e].has(n)||this.store[e].set(n,[]);const s=this.store[e].get(n)||[];let r=!0;for(let a=0;a{Cl(t)||(this[t]=e[t])}))}}class tp{constructor(){this.defaultStore={currentGroupID:"",currentGroup:{},currentGroupAttributes:{},currentGroupCounters:{},currentGroupMemberList:[],groupList:[],groupSystemNoticeList:[],isCompleted:!1,offset:0},this.store={currentGroupID:"",currentGroup:void 0,currentGroupAttributes:{},currentGroupCounters:{},currentGroupMemberList:[],groupList:[],groupSystemNoticeList:[],isCompleted:!1,offset:0}}update(e,t){switch(e){case"groupList":this.updateGroupList(t);break;case"currentGroup":this.store.currentGroup=t instanceof ep?t:new ep(t);break;default:this.store[e]=t}}getData(e){if("groupSystemNoticeList"===e){const e=[...this.store.groupSystemNoticeList];return this.store.groupSystemNoticeList.length=0,e}return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateGroupList(e){this.store.groupList=e.map((e=>e instanceof ep?e:new ep(e)))}}class np{constructor(){this.store={}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){0===e.length&&(this.store={}),this.store=Object.assign(Object.assign({},this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:void 0})),{}))}}class op{constructor(){this.defaultStore={friendList:[],friendApplicationList:[],friendApplicationUnreadCount:0},this.store={friendList:[],friendApplicationList:[],friendApplicationUnreadCount:0}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}}class ip{constructor(){this.defaultStore={currentSearchInputValue:{value:"",searchType:"global"},currentSearchMessageType:{value:{key:"",label:"",value:""},searchType:"global"},currentSearchMessageTime:{value:{key:"",label:"",value:{timePosition:0,timePeriod:0}},searchType:"global"},currentSearchingStatus:{isSearching:!1,searchType:"global"},isShowInConversationSearch:!1},this.store={currentSearchInputValue:{value:"",searchType:"global"},currentSearchMessageType:{value:{key:"",label:"",value:""},searchType:"global"},currentSearchMessageTime:{value:{key:"",label:"",value:{timePosition:0,timePeriod:0}},searchType:"global"},currentSearchingStatus:{isSearching:!1,searchType:"global"},isShowInConversationSearch:!1}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),null==e?void 0:e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}}class sp{constructor(){this.storeMap={[exports.o.APP]:new Kl,[exports.o.USER]:new $l,[exports.o.CONV]:new Xl,[exports.o.CHAT]:new Ql,[exports.o.GRP]:new tp,[exports.o.FRIEND]:new op,[exports.o.SEARCH]:new ip},this.task={}}static getInstance(){return sp.instance||(sp.instance=new sp),sp.instance}watch(e,t){this.task[e]||(this.task[e]={});const n=this.task[e];Object.keys(t).forEach((o=>{const i=t[o];n[o]||(n[o]=new Map),n[o].set(i,1),this.notifyOnWatch(e,o,i)}))}unwatch(e,t){if(!this.task[e])return;const n=this.task[e];Object.keys(t).forEach((e=>{var o;null===(o=n[e])||void 0===o||o.delete(t[e])}))}update(e,t,n){var o;e!==exports.o.CUSTOM||this.storeMap[e]||(this.storeMap[e]=new np),null===(o=this.storeMap[e])||void 0===o||o.update(t,n),this.notify(e,t)}getData(e,t){var n;return e!==exports.o.CUSTOM||this.storeMap[e]||(this.storeMap[e]=new np),null===(n=this.storeMap[e])||void 0===n?void 0:n.getData(t)}getConversationModel(e){var t;return null===(t=this.storeMap[exports.o.CONV])||void 0===t?void 0:t.getModel(e)}getMessageModel(e){var t;return null===(t=this.storeMap[exports.o.CHAT])||void 0===t?void 0:t.getModel(e)}reset(e,t=[],n=!1){if(e in this.storeMap){const o=this.storeMap[e];0===t.length&&(t=Object.keys(null==o?void 0:o.store)),o.reset(t),n&&t.forEach((t=>{this.notify(e,t)}))}}notifyOnWatch(e,t,n){const o=this.getData(e,t);Rl.indexOf(t)>-1&&0===o.length||n&&n.call(this,o)}notify(e,t){if(!this.task[e])return;const n=this.task[e];if(n[t]){const o=n[t],i=this.getData(e,t);for(const[e]of o.entries())e.call(this,i)}}}function rp(e){return(rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ap(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cp(e){var t=function(e){if("object"!=rp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rp(t)?t:t+""}function up(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};ap(this,e),this.init(t,n)}return lp(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Ip,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),o=1;o-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var s="string"!=typeof t?[].concat(t):t.split(".");s.length>1;){if(i())return{};var r=o(s.shift());!e[r]&&n&&(e[r]=new n),e=Object.prototype.hasOwnProperty.call(e,r)?e[r]:{}}return i()?{}:{obj:e,k:o(s.shift())}}function kp(e,t,n){var o=Ep(e,t,Object);o.obj[o.k]=n}function Dp(e,t){var n=Ep(e,t),o=n.obj,i=n.k;if(o)return o[i]}function Lp(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):Lp(e[o],t[o],n):e[o]=t[o]);return e}function Rp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Op={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ap(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Op[e]})):e}var bp="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Pp=[" ",",","?","!",";"];function Np(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var o=t.split(n),i=e,s=0;ss+r;)r++,c=i[a=o.slice(s,s+r).join(n)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(a)){if("string"==typeof c)return c;if(a&&"string"==typeof c[a])return c[a]}var u=o.slice(s+r).join(n);return u?Np(c,u,n):void 0}i=i[o[s]]}return i}}function xp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function wp(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ap(this,t),o=e.call(this),bp&&Cp.call(pp(o)),o.data=n||{},o.options=i,void 0===o.options.keySeparator&&(o.options.keySeparator="."),void 0===o.options.ignoreJSONStructure&&(o.options.ignoreJSONStructure=!0),o}return lp(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure,r=[e,t];n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeof n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split("."));var a=Dp(this.data,r);return a||!s||"string"!=typeof n?a:Np(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,r=[e,t];n&&(r=r.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=t,t=(r=e.split("."))[1]),this.addNamespaces(t),kp(this.data,r,o),i.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},r=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(r=e.split("."))[1]),this.addNamespaces(t);var a=Dp(this.data,r)||{};o?Lp(a,n,i):a=wp(wp({},a),n),kp(this.data,r,a),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?wp(wp({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),t}(),Gp={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,i){var s=this;return e.forEach((function(e){s.processors[e]&&(t=s.processors[e].process(t,n,o,i))})),t}};function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Bp(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return ap(this,t),o=e.call(this),bp&&Cp.call(pp(o)),i=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],s=n,r=pp(o),i.forEach((function(e){s[e]&&(r[e]=s[e])})),o.options=a,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o.logger=Mp.create("translator"),o}return lp(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],s=n&&e.indexOf(n)>-1,r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var o=Pp.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===o.length)return!0;var i=new RegExp("(".concat(o.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),s=!i.test(e);if(!s){var r=e.indexOf(n);r>0&&!i.test(e.substring(0,r))&&(s=!0)}return s}(e,n,o));if(s&&!r){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var c=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(o)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,o){var i=this;if("object"!==rp(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"===rp(n)&&(n=Bp({},n)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var s=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],n),c=a.key,u=a.namespaces,l=u[u.length-1],p=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(d){var h=n.nsSeparator||this.options.nsSeparator;return s?{res:"".concat(l).concat(h).concat(c),usedKey:c,exactUsedKey:c,usedLng:p,usedNS:l}:"".concat(l).concat(h).concat(c)}return s?{res:c,usedKey:c,exactUsedKey:c,usedLng:p,usedNS:l}:c}var g=this.resolve(e,n),f=g&&g.res,m=g&&g.usedKey||c,_=g&&g.exactUsedKey||c,v=Object.prototype.toString.apply(f),y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject;if(I&&f&&"string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f&&["[object Number]","[object Function]","[object RegExp]"].indexOf(v)<0&&("string"!=typeof y||"[object Array]"!==v)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,f,Bp(Bp({},n),{},{ns:u})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return s?(g.res=M,g):M}if(r){var C="[object Array]"===v,T=C?[]:{},S=C?_:m;for(var E in f)if(Object.prototype.hasOwnProperty.call(f,E)){var k="".concat(S).concat(r).concat(E);T[E]=this.translate(k,Bp(Bp({},n),{joinArrays:!1,ns:u})),T[E]===k&&(T[E]=f[E])}f=T}}else if(I&&"string"==typeof y&&"[object Array]"===v)(f=f.join(y))&&(f=this.extendTranslation(f,e,n,o));else{var D=!1,L=!1,R=void 0!==n.count&&"string"!=typeof n.count,O=t.hasDefaultValue(n),A=R?this.pluralResolver.getSuffix(p,n.count,n):"",b=n["defaultValue".concat(A)]||n.defaultValue;!this.isValidLookup(f)&&O&&(D=!0,f=b),this.isValidLookup(f)||(L=!0,f=c);var P=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:f,N=O&&b!==f&&this.options.updateMissing;if(L||D||N){if(this.logger.log(N?"updateKey":"missingKey",p,l,c,N?b:f),r){var x=this.resolve(c,Bp(Bp({},n),{},{keySeparator:!1}));x&&x.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var w=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var G=0;G1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!r.isValidLookup(t)){var c=r.extractFromKey(e,a),u=c.key;n=u;var l=c.namespaces;r.options.fallbackNS&&(l=l.concat(r.options.fallbackNS));var p=void 0!==a.count&&"string"!=typeof a.count,d=p&&!a.ordinal&&0===a.count&&r.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,g=a.lngs?a.lngs:r.languageUtils.toResolveHierarchy(a.lng||r.language,a.fallbackLng);l.forEach((function(e){r.isValidLookup(t)||(s=e,!qp["".concat(g[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(s)&&(qp["".concat(g[0],"-").concat(e)]=!0,r.logger.warn('key "'.concat(n,'" for languages "').concat(g.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((function(n){if(!r.isValidLookup(t)){i=n;var s,c=[u];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(c,u,n,e,a);else{var l;p&&(l=r.pluralResolver.getSuffix(n,a.count,a));var g="".concat(r.options.pluralSeparator,"zero");if(p&&(c.push(u+l),d&&c.push(u+g)),h){var f="".concat(u).concat(r.options.contextSeparator).concat(a.context);c.push(f),p&&(c.push(f+l),d&&c.push(f+g))}}for(;s=c.pop();)r.isValidLookup(t)||(o=s,t=r.getResource(n,e,s,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:s}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),t}();function jp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Hp=function(){function e(t){ap(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Mp.create("languageUtils")}return lp(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=jp(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=jp(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=jp(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var o=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find((function(e){return e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:0===e.indexOf(o)?e:void 0}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],s=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),o.forEach((function(e){i.indexOf(e)<0&&s(n.formatLanguageCode(e))})),i}}]),e}(),Kp=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$p={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},zp=["v1","v2","v3"],Yp={zero:0,one:1,two:2,few:3,many:4,other:5},Wp=function(){function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ap(this,e),this.languageUtils=t,this.options=o,this.logger=Mp.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},Kp.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:$p[e.fc]}}))})),n)}return lp(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((function(e,t){return Yp[e]-Yp[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):o.numbers.map((function(o){return t.getSuffix(e,o,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(t)):this.getSuffixRetroCompatible(o,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,o=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[o];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var s=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!zp.includes(this.options.compatibilityJSON)}}]),e}();function Jp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Xp(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:".",a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=(o=t,void 0!==(s=Dp(e,i=n))?s:Dp(o,i));return!c&&a&&"string"==typeof n&&void 0===(c=Np(e,n,r))&&(c=Np(t,n,r)),c}var Qp=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ap(this,e),this.logger=Mp.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return lp(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Ap,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Rp(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Rp(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Rp(t.nestingPrefix):t.nestingPrefixEscaped||Rp("$t("),this.nestingSuffix=t.nestingSuffix?Rp(t.nestingSuffix):t.nestingSuffixEscaped||Rp(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var i,s,r,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(a.formatSeparator)<0){var i=Zp(t,c,e,a.options.keySeparator,a.options.ignoreJSONStructure);return a.alwaysFormat?a.format(i,void 0,n,Xp(Xp(Xp({},o),t),{},{interpolationkey:e})):i}var s=e.split(a.formatSeparator),r=s.shift().trim(),u=s.join(a.formatSeparator).trim();return a.format(Zp(t,c,r,a.options.keySeparator,a.options.ignoreJSONStructure),u,n,Xp(Xp(Xp({},o),t),{},{interpolationkey:r}))};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,d=o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?u(a.escape(e)):u(e)}}].forEach((function(t){for(r=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(s=l(n)))if("function"==typeof p){var c=p(e,i,o);s="string"==typeof c?c:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))s="";else{if(d){s=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),s=""}else"string"==typeof s||a.useRawValueToEscape||(s=Sp(s));var u=t.safeValue(s);if(e=e.replace(i[0],u),d?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++r>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,o,i,s=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var o=e.split(new RegExp("".concat(n,"[ ]*{"))),s="{".concat(o[1]);e=o[0];var r=(s=this.interpolate(s,i)).match(/'/g),a=s.match(/"/g);(r&&r.length%2==0&&!a||a.length%2!=0)&&(s=s.replace(/'/g,'"'));try{i=JSON.parse(s),t&&(i=Xp(Xp({},t),i))}catch(c){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),c),"".concat(e).concat(n).concat(s)}return delete i.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var c=[];(i=(i=Xp({},r)).replace&&"string"!=typeof i.replace?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;var u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),c=l,u=!0}if((o=t(a.call(this,n[1].trim(),i),i))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=Sp(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),u&&(o=c.reduce((function(e,t){return s.format(e,t,r.lng,Xp(Xp({},r),{},{interpolationkey:n[1].trim()}))}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();function ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function td(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};ap(this,e),this.logger=Mp.create("formatter"),this.options=t,this.formats={number:nd((function(e,t){var n=new Intl.NumberFormat(e,td({},t));return function(e){return n.format(e)}})),currency:nd((function(e,t){var n=new Intl.NumberFormat(e,td(td({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:nd((function(e,t){var n=new Intl.DateTimeFormat(e,td({},t));return function(e){return n.format(e)}})),relativetime:nd((function(e,t){var n=new Intl.RelativeTimeFormat(e,td({},t));return function(e){return n.format(e,t.range||"day")}})),list:nd((function(e,t){var n=new Intl.ListFormat(e,td({},t));return function(e){return n.format(e)}}))},this.init(t)}return lp(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=nd(t)}},{key:"format",value:function(e,t,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce((function(e,t){var s=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var o=e.split("(");t=o[0].toLowerCase().trim();var i=o[1].substring(0,o[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(":")),o=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=i),"false"===i&&(n[o.trim()]=!1),"true"===i&&(n[o.trim()]=!0),isNaN(i)||(n[o.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),r=s.formatName,a=s.formatOptions;if(o.formats[r]){var c=e;try{var u=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},l=u.locale||u.lng||i.locale||i.lng||n;c=o.formats[r](e,l,td(td(td({},a),i),u))}catch(p){o.logger.warn(p)}return c}return o.logger.warn("there was no format function for ".concat(r)),e}),e)}}]),e}();function id(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function sd(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return ap(this,t),s=e.call(this),bp&&Cp.call(pp(s)),s.backend=n,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=r,s.logger=Mp.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=r.maxParallelReads||10,s.readingCalls=0,s.maxRetries=r.maxRetries>=0?r.maxRetries:5,s.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,r.backend,r),s}return lp(t,[{key:"queueLoad",value:function(e,t,n,o){var i=this,s={},r={},a={},c={};return e.forEach((function(e){var o=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===r[a]&&(r[a]=!0):(i.state[a]=1,o=!1,void 0===r[a]&&(r[a]=!0),void 0===s[a]&&(s[a]=!0),void 0===c[t]&&(c[t]=!0)))})),o||(a[e]=!0)})),(Object.keys(s).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(r),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,n){var o=e.split("|"),i=o[0],s=o[1];t&&this.emit("failedLoading",i,s,t),n&&this.store.addResourceBundle(i,s,n),this.state[e]=t?-1:2;var r={};this.queue.forEach((function(n){var o,a,c,u,l,p,d;o=n.loaded,a=s,(u=(c=Ep(o,[i],Object)).obj)[l=c.k]=u[l]||[],u[l].push(a),d=e,void 0!==(p=n).pending[d]&&(delete p.pending[d],p.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){r[e]||(r[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===r[e][t]&&(r[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:s,callback:r});else{this.readingCalls++;var a=function(a,c){if(o.readingCalls--,o.waitingReads.length>0){var u=o.waitingReads.shift();o.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}a&&c&&i2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var s=this.queueLoad(e,t,o,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),i=o[0],s=o[1];this.read(i,s,"read",void 0,void 0,(function(o,r){o&&t.logger.warn("".concat(n,"loading namespace ").concat(s," for language ").concat(i," failed"),o),!o&&r&&t.logger.log("".concat(n,"loaded namespace ").concat(s," for language ").concat(i),r),t.loaded(e,o,r)}))}},{key:"saveMissing",value:function(e,t,n,o,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var a=sd(sd({},s),{},{isUpdate:i}),c=this.backend.create.bind(this.backend);if(c.length<6)try{var u;(u=5===c.length?c(e,t,n,o,a):c(e,t,n,o))&&"function"==typeof u.then?u.then((function(e){return r(null,e)})).catch(r):r(null,u)}catch(l){r(l)}else c(e,t,n,o,r,a)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}}]),t}();function ad(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===rp(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===rp(e[2])||"object"===rp(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function cd(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ld(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;if(ap(this,t),n=e.call(this),bp&&Cp.call(pp(n)),n.options=cd(i),n.services={},n.logger=Mp,n.modules={external:[]},o=pp(n),Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((function(e){"function"==typeof o[e]&&(o[e]=o[e].bind(o))})),s&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,s),gp(n,pp(n));setTimeout((function(){n.init(i,s)}),0)}return n}return lp(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var o=ad();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=ld(ld(ld({},o),this.options),cd(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=ld(ld({},o.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var s;this.modules.logger?Mp.init(i(this.modules.logger),this.options):Mp.init(null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=od);var r=new Hp(this.options);this.store=new Up(this.options.resources,this.options);var a=this.services;a.logger=Mp,a.resourceStore=this.store,a.languageUtils=r,a.pluralResolver=new Wp(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!s||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(a.formatter=i(s),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Qp(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new rd(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var u=Tp(),l=function(){var t=function(t,o){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(o),n(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),u}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pd,o="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return n();var i=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return s(e)})),this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,n){var o=Tp();return e||(e=this.languages),t||(t=this.options.ns),n||(n=pd),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),n(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Gp.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=Tp();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},s=function(s){e||s||!n.services.languageDetector||(s=[]);var r="string"==typeof s?s:n.services.languageUtils.getBestMatchFromCodes(s);r&&(n.language||i(r),n.translator.language||n.translator.changeLanguage(r),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(r)),n.loadResources(r,(function(e){var s,a;s=e,(a=r)?(i(a),n.translator.changeLanguage(a),n.isLanguageChangingTo=void 0,n.emit("languageChanged",a),n.logger.log("languageChanged",a)):n.isLanguageChangingTo=void 0,o.resolve((function(){return n.t.apply(n,arguments)})),t&&t(s,(function(){return n.t.apply(n,arguments)}))}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t,n){var o=this,i=function e(t,i){var s;if("object"!==rp(i)){for(var r=arguments.length,a=new Array(r>2?r-2:0),c=2;c1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=n.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var r=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var a=n.precheck(this,r);if(void 0!==a)return a}return!(!this.hasResourceBundle(o,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(o,e)||i&&!r(s,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=Tp();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Tp();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter((function(e){return o.indexOf(e)<0}));return i.length?(this.options.preload=o.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new Hp(ad());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pd,i=ld(ld(ld({},this.options),n),{isClone:!0}),s=new t(i);return void 0===n.debug&&void 0===n.prefix||(s.logger=s.logger.clone(n)),["store","services","language"].forEach((function(t){s[t]=e[t]})),s.services=ld({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new Vp(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var hd=dd.createInstance();hd.createInstance=dd.createInstance,hd.createInstance,hd.dir,hd.init,hd.loadResources,hd.reloadResources,hd.use,hd.changeLanguage,hd.getFixedT,hd.t,hd.exists,hd.setDefaultNamespace,hd.hasLoadedNamespace,hd.loadNamespaces,hd.loadLanguages;class gd extends zl{constructor(){super(),this.languages=null,this.keyMap={}}static getInstance(){return gd.instance||(gd.instance=new gd),gd.instance}provideLanguages(e){var t;Al||(this.languages=e,(null===(t=e["zh-CN"])||void 0===t?void 0:t.Chat)&&this.setKeyMap(e["zh-CN"]),console.log("TUITranslateService.provideLanguages ok."))}useI18n(e){var t;if(Al)return;if(!this.languages)return void console.warn("TUITranslateService.useI18next not have messages.");const n={};for(const[i,s]of Object.entries(this.languages))n["zh_cn"===i?"zh":i]={translation:s};hd.init({compatibilityJSON:"v3",lng:e||"zh",fallbackLng:"zh",detection:{order:["querystring","navigator"],caches:["localStorage","cookie"]},resources:n});let o=this.normalizeLanguageKey(e||"zh");null===(t=this.getEngine().TUIReport)||void 0===t||t.reportFeature(201,o)}changeLanguage(e){let t=this.normalizeLanguageKey(e);return this.getEngine().TUIReport.reportFeature(201,t),hd.changeLanguage(e)}normalizeLanguageKey(e){return e.includes("en")?"en-us":e.includes("tw")?"zh-tw":e.includes("zh")||e.includes("cn")?"zh-cn":e.includes("ko")||e.includes("kr")?"ko-kr":e.includes("ja")||e.includes("jp")?"ja-jp":"other-"+e}t(e){if(!this.languages){let t=e;return!Ml(e)&&e.indexOf(".")>-1&&(t=e.split(".").pop()||""),t}const t=this.keyMap[e];return t?hd.t(t):hd.t(e)}setKeyMap(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=t?`${t}.${n}`:n;if(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])&&null!==e[n])this.setKeyMap(e[n],o);else{let o=t?`${t}.${e[n]}`:e[n];o=this.replaceKey(o),this.keyMap[o]=`${t}.${n}`}}}replaceKey(e){return e.startsWith("Chat")?e.replace("Chat","TUIChat"):e.startsWith("Conversation")?e.replace("Conversation","TUIConversation"):e.startsWith("Message")?e.replace("Message","message.tip"):e.startsWith("Call")?e.replace("Call","message.custom"):e}}class fd extends zl{constructor(){super(),this.serv="TUIConversationService"}static getInstance(){return fd.instance||(fd.instance=new fd),fd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,this.onTotalUnreadCountUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_RECEIVED,this.onMessageReceived.bind(this)),this.getConversationInitData()}onConversationListUpdated(e){const t=this.filterSystemConversation(e);this.getEngine().TUIStore.update(exports.o.CONV,"conversationList",t),this.updateCurrentConversation()}onTotalUnreadCountUpdated(e){this.getEngine().TUIStore.update(exports.o.CONV,"totalUnreadCount",e)}onMessageReceived(e){const t=this.getEngine(),n=this.getEngine().TUIStore.getData(exports.o.CONV,"conversationList");let o=!1;for(let i=0;i0){this.getEngine().TUIStore.update(exports.o.CONV,"operationTypeMap",{conversationID:r,operationType:0}),o=!0;break}}}if(o){this.getEngine().TUIStore.update(exports.o.CONV,"conversationList",n);const e=this.getEngine().TUIStore.getData(exports.o.CONV,"currentConversationID")||"",t=this.findConversation(e);t&&this.getEngine().TUIStore.update(exports.o.CONV,"currentConversation",t)}}getConversationInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getConversationList().then((t=>{const{conversationList:n,isSyncCompleted:o}=t.data;if(console.log(`${this.serv}.init, getConversationList count:${n.length} isSyncCompleted:${o}`),n.length>0){this.onConversationListUpdated(n);const t=e.chat.getTotalUnreadMessageCount();this.onTotalUnreadCountUpdated(t)}}))}switchConversation(e){return ul(this,void 0,void 0,(function*(){const t=`${this.serv}.switchConversation`,n=this.getEngine();if(!e)return n.TUIStore.reset(exports.o.CHAT,["messageList","isCompleted","nextReqMessageID"]),n.TUIStore.update(exports.o.CONV,"currentConversationID",""),n.TUIStore.update(exports.o.CONV,"currentConversation",null),console.log(`${t} conversationID is empty, conversationID:${e}`),Promise.resolve({});if(!e.startsWith(n.TYPES.CONV_C2C)&&!e.startsWith(n.TYPES.CONV_GROUP))return console.warn(`${t} conversationID is invalid, conversationID:${e}`),Promise.reject({code:ml.INVALID_CONV_ID,message:vl.INVALID_CONV_ID});const o=n.TUIStore.getData(exports.o.CONV,"currentConversationID");if(o&&o===e)return this.setMessageRead(o),console.warn(`${t} please check conversationID, conversationID:${e}`),Promise.resolve({code:ml.CONV_ID_SAME,message:vl.CONV_ID_SAME});const i=yield this.getConversationModel(e);return Ml(i)?(console.warn(`${t} target conversation is not exist, conversationID:${e}`),Promise.reject({code:ml.CONV_NOT_EXIST,message:vl.CONV_NOT_EXIST})):(o&&this.setMessageRead(o),e&&this.setMessageRead(e),n.TUIStore.reset(exports.o.CHAT,["messageList","isCompleted","nextReqMessageID"]),n.TUIStore.update(exports.o.CONV,"currentConversationID",e),n.TUIStore.update(exports.o.CONV,"currentConversation",i),Promise.resolve(i))}))}getConversationModel(e){return ul(this,void 0,void 0,(function*(){let t=this.findConversation(e);if(Ml(t))try{const n=yield this.getConversationProfile(e);n.data&&n.data.conversation&&(t=new Jl(n.data.conversation))}catch(n){t=void 0}return t}))}findConversation(e){let t;const n=this.getEngine().TUIStore.getData(exports.o.CONV,"conversationList");for(let o=0;o{const n=this.getEngine().TUIStore.getData(exports.o.CONV,"currentConversationID");return console.log(`${this.serv}.deleteConversation conversationID:${e} currentConversationID:${n}`),e===n&&(this.getEngine().TUIStore.update(exports.o.CONV,"currentConversationID",""),this.getEngine().TUIStore.update(exports.o.CONV,"currentConversation",null)),t}))}pinConversation(e){return this.getEngine().chat.pinConversation(e)}muteConversation(e){return this.getEngine().chat.setMessageRemindType(e)}clearHistoryMessage(e){return this.getEngine().chat.clearHistoryMessage(e).then((e=>(this.getEngine().TUIStore.update(exports.o.CHAT,"messageList",[]),this.getEngine().TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),this.getEngine().TUIStore.update(exports.o.CHAT,"isCompleted",!0),e)))}setMessageRead(e){return this.getEngine().chat.setMessageRead({conversationID:e})}setConversationDraft(e){const{conversationID:t,draftInfo:n}=e;let o="";return n&&(o=JSON.stringify(n)),this.getEngine().chat.setConversationDraft({conversationID:t,draftText:o}).then((e=>{const{conversation:t}=e.data;this.updateConversation(t)}))}updateConversation(e){let t=!1;const n=this.getEngine().TUIStore.getData(exports.o.CONV,"conversationList");for(let o=0;oe.type!==this.getEngine().TYPES.CONV_SYSTEM))}}class md{constructor(e){this.TUIUserService=e}getEngine(){return this.TUIUserService.getEngine()}init(){this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.PROFILE_UPDATED,this.onProfileUpdated.bind(this)),this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.BLACKLIST_UPDATED,this.onBlacklistUpdated.bind(this)),this.getUserProfileInitData()}onProfileUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.USER,"userProfile");e.forEach((e=>{e.userID===n.userID&&t.TUIStore.update(exports.o.USER,"userProfile",e)}))}onBlacklistUpdated(e){const t=this.getEngine();this.getBlacklistProfile(e).then((e=>{t.TUIStore.update(exports.o.USER,"userBlacklist",e)}))}getUserProfileInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getBlacklist().then((e=>{const t=e.data||[];console.log(`TUIUserProfileHandler.init, getBlacklist count:${t.length}`),t.length>0&&this.onBlacklistUpdated(t)}))}getBlacklistProfile(e){const t=[];let n=0;for(;n{o.push(this.TUIUserService.getUserProfile({userIDList:e}))}));const i=[];return Promise.all(o).then((e=>(e.forEach((e=>{const t=e.data.map((e=>{const{userID:t,nick:n,avatar:o}=e;return{userID:t,nick:n,avatar:o}}));i.push(...t)})),i)))}getUserProfile(e){const t=this.getEngine();return Ml(e)?t.chat.getMyProfile().then((e=>(t.TUIStore.update(exports.o.USER,"userProfile",e.data),e))).catch((e=>Promise.reject(e))):t.chat.getUserProfile(e)}updateMyProfile(e){return this.getEngine().chat.updateMyProfile(e)}addToBlacklist(e){return this.getEngine().chat.addToBlacklist(e)}removeFromBlacklist(e){return this.getEngine().chat.removeFromBlacklist(e)}}function _d(e,t,n=!0){var o,i;o=n?yd(e):e,i=t,Pl?xl.setStorageSync(o,i):Id()&&localStorage.setItem(o,JSON.stringify(i))}function vd(e,t=!0){try{return function(e){if(Pl)return xl.getStorageSync(e);if(Id()){const t=localStorage.getItem(e);if("undefined"!==t)return JSON.parse(t)}}(t?yd(e):e)}catch(n){return void console.warn("Storage.getStorageItem error:",n)}}function yd(e){return`chat_engine_${e}`}function Id(){return navigator&&navigator.cookieEnabled&&localStorage}class Md{constructor(e){this.TUIUserService=e}getEngine(){return this.TUIUserService.getEngine()}init(){const e=this.getEngine(),t=vd("displayOnlineStatus")||!1;e.TUIStore.update(exports.o.USER,"displayOnlineStatus",t),e.eventCenter.addEvent(e.EVENT.USER_STATUS_UPDATED,this.onUserStatusUpdated.bind(this)),this.onConversationListUpdated()}onConversationListUpdated(){const e=this.getEngine();e.TUIStore.watch(exports.o.CONV,{conversationList:()=>{const t=e.TUIStore.getData(exports.o.APP,"enabledOnlineStatus"),n=e.TUIStore.getData(exports.o.USER,"displayOnlineStatus");t&&n&&this.startToSubscribe()}})}onUserStatusUpdated(e){this.getEngine().TUIStore.update(exports.o.USER,"userStatusList",e)}switchUserStatus(e){const t=this.getEngine(),{displayOnlineStatus:n=!1}=e;t.TUIStore.update(exports.o.USER,"displayOnlineStatus",n),_d("displayOnlineStatus",n);const o=t.TUIStore.getData(exports.o.APP,"enabledOnlineStatus");o?!0===n?this.startToSubscribe():this.unsubscribeUserStatus():console.warn(`UserStatusHandler.switchUserStatus enabledOnlineStatus:${o} displayOnlineStatus:${n}`)}getUserStatus(e){const t=this.getEngine();return t.chat.getUserStatus(e).then((e=>{const{successUserList:n}=e.data;return n.length>0&&t.TUIStore.update(exports.o.USER,"userStatusList",n),e})).catch((e=>Promise.reject(e)))}subscribeUserStatus(e){var t;const n=(null===(t=null==e?void 0:e.userIDList)||void 0===t?void 0:t.length)||0;return 0===n?(console.warn(`UserStatusHandler.subscribeUserStatus userID count:${n}`),Promise.resolve()):this.getEngine().chat.subscribeUserStatus(e)}unsubscribeUserStatus(e){const t=this.getEngine(),{userIDList:n=[]}=e||{};return t.chat.unsubscribeUserStatus({userIDList:n}).then((e=>{const{failureUserList:o}=e.data,i=[];return n.forEach((e=>{o.includes(e)||i.push({userID:e,statusType:dl.UNSUB_USER})})),t.TUIStore.update(exports.o.USER,"userStatusList",i),e})).catch((e=>Promise.reject(e)))}startToSubscribe(){const e=this.getEngine(),t=e.TUIStore.getData(exports.o.CONV,"conversationList"),n=e.TUIStore.getData(exports.o.USER,"userStatusList"),o=[];t.forEach((t=>{if(t.type===e.TYPES.CONV_C2C){const i=t.conversationID.replace(e.TYPES.CONV_C2C,"");n.has(i)||o.push(i)}})),0!==o.length&&e.chat.isReady()&&(this.subscribeUserStatus({userIDList:o}),this.getUserStatus({userIDList:o}))}}class Cd extends zl{constructor(){super(),this.userProfileHandler=new md(this),this.userStatusHandler=new Md(this)}static getInstance(){return Cd.instance||(Cd.instance=new Cd),Cd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.KICKED_OUT,this.onKickedOut.bind(this)),e.eventCenter.addEvent(e.EVENT.NET_STATE_CHANGE,this.onNetStateChange.bind(this)),this.userProfileHandler.init(),this.userStatusHandler.init(),this.initMessageReadReceipt()}onKickedOut(e){this.getEngine().TUIStore.update(exports.o.USER,"kickedOut",e.type)}onNetStateChange(e){this.getEngine().TUIStore.update(exports.o.USER,"netStateChange",e.state)}initMessageReadReceipt(){const e=vd("displayMessageReadReceipt")||!0;this.getEngine().TUIStore.update(exports.o.USER,"displayMessageReadReceipt",e)}switchUserStatus(e){return this.userStatusHandler.switchUserStatus(e)}switchMessageReadStatus(e){this.getEngine().TUIStore.update(exports.o.USER,"displayMessageReadReceipt",e),_d("displayMessageReadReceipt",e)}getUserProfile(e){return this.userProfileHandler.getUserProfile(e)}updateMyProfile(e){return this.userProfileHandler.updateMyProfile(e)}addToBlacklist(e){return this.userProfileHandler.addToBlacklist(e)}removeFromBlacklist(e){return this.userProfileHandler.removeFromBlacklist(e)}getUserStatus(e){return this.userStatusHandler.getUserStatus(e)}subscribeUserStatus(e){return this.userStatusHandler.subscribeUserStatus(e)}unsubscribeUserStatus(e){return this.userStatusHandler.unsubscribeUserStatus(e)}}class Td{constructor(e){this.TUIChatService=e,this.userShowNameMap=new Map,this.requestedUserMap=new Map}getEngine(){return this.TUIChatService.getEngine()}t(e){return this.getEngine().TUITranslate.t(e)}handleTextMessage(e){return{text:this.decodeText(e.payload)}}handleFaceMessage(e){const t={name:"",url:"",type:""};return e.payload.data.indexOf("@custom")>-1?(t.name=e.payload.data,t.type="custom",t):(t.name=e.payload.data.indexOf("@2x")<0?`${e.payload.data}@2x`:e.payload.data,t.url=`https://web.sdk.qcloud.com/im/assets/face-elem/${t.name}.png`,t)}handleLocationMessage(e){const t={lon:"",lat:"",href:"",url:"",description:""};return t.lon=e.payload.longitude.toFixed(6),t.lat=e.payload.latitude.toFixed(6),t.href=`https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=${t.lon}&pointy=${t.lat}&name=${e.payload.description}`,t.url=`https://apis.map.qq.com/ws/staticmap/v2/?center=${t.lat},${t.lon}&zoom=10&size=300*150&maptype=roadmap&markers=size:large|color:0xFFCCFF|label:k|${t.lat},${t.lon}&key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD`,t.description=e.payload.description,t}handleImageMessage(e){return{url:e.payload.imageInfoArray[0].url,width:e.payload.imageInfoArray[0].width,height:e.payload.imageInfoArray[0].height}}handleAudioMessage(e){return{url:e.payload.url,second:e.payload.second}}handleVideoMessage(e){return{url:e.payload.videoUrl,snapshotUrl:e.payload.snapshotUrl,snapshotWidth:e.payload.snapshotWidth,snapshotHeight:e.payload.snapshotHeight}}handleFileMessage(e){return{url:e.payload.fileUrl,name:e.payload.fileName,size:El(e.payload.fileSize)}}handleCustomMessage(e){var t;const n=this.handleCreateGroupCustomMessage(e);return{custom:this.handleCallKitSignaling(e)||n||(null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.extension)||`${this.t("TUIChat.[自定义消息]")}`,businessID:n?"group_create":""}}handleMergeMessage(e){return Object.assign({},e.payload)}handleGroupTipsMessage(e){var t,n,o,i,s,r;const a=this.getEngine(),c={text:""};let u=(null==e?void 0:e.nick)||(null===(n=null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.userIDList)||void 0===n?void 0:n.join(","));switch((null===(i=null===(o=null==e?void 0:e.payload)||void 0===o?void 0:o.memberList)||void 0===i?void 0:i.length)>0&&(u="",null===(r=null===(s=null==e?void 0:e.payload)||void 0===s?void 0:s.memberList)||void 0===r||r.map((e=>{const t=(null==e?void 0:e.nick)||(null==e?void 0:e.userID);return u+=`${this.substringByLength(t)},`,e})),u=null==u?void 0:u.slice(0,-1)),e.payload.operationType){case a.TYPES.GRP_TIP_MBR_JOIN:c.text=`${u} ${this.t("message.tip.加入群组")}`;break;case a.TYPES.GRP_TIP_MBR_QUIT:c.text=`${this.t("message.tip.群成员")}:${u} ${this.t("message.tip.退出群组")}`;break;case a.TYPES.GRP_TIP_MBR_KICKED_OUT:c.text=`${this.t("message.tip.群成员")}:${u} ${this.t("message.tip.被")}${this.t("message.tip.踢出群组")}`;break;case a.TYPES.GRP_TIP_MBR_SET_ADMIN:c.text=`${this.t("message.tip.群成员")}:${u} ${this.t("message.tip.成为管理员")}`;break;case a.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:c.text=`${this.t("message.tip.群成员")}:${u} ${this.t("message.tip.被撤销管理员")}`;break;case a.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:c.text=this.handleGroupProfileUpdated(e);break;case a.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:for(const t of e.payload.memberList)t.muteTime>0?c.text=`${this.t("message.tip.群成员")}:${u} ${this.t("message.tip.被禁言")}`:c.text=`${this.t("message.tip.群成员")}:${u} ${this.t("message.tip.被取消禁言")}`;break;default:c.text=`[${this.t("message.tip.群提示消息")}]`}return c}handleGroupSystemMessage(e){const t=e.payload.groupProfile.name||e.payload.groupProfile.groupID,n={text:""};switch(e.payload.operationType){case 1:n.text=`${e.payload.operatorID} ${this.t("message.tip.申请加入群组")}:${t}`;break;case 2:n.text=`${this.t("message.tip.成功加入群组")}:${t}`;break;case 3:n.text=`${this.t("message.tip.申请加入群组")}:${t} ${this.t("message.tip.被拒绝")}`;break;case 4:n.text=`${this.t("message.tip.你被管理员")}${e.payload.operatorID} ${this.t("message.tip.踢出群组")}:${t}`;break;case 5:n.text=`${this.t("message.tip.群")}:${t} ${this.t("message.tip.被")} ${e.payload.operatorID} ${this.t("message.tip.解散")}`;break;case 6:n.text=`${e.payload.operatorID} ${this.t("message.tip.创建群")}:${t}`;break;case 7:case 12:n.text=`${e.payload.operatorID} ${this.t("message.tip.邀请你加群")}:${t}`;break;case 8:n.text=`${this.t("message.tip.你退出群组")}:${t}`;break;case 9:n.text=`${this.t("message.tip.你被")}${e.payload.operatorID} ${this.t("message.tip.设置为群")}:${t} ${this.t("message.tip.的管理员")}`;break;case 10:n.text=`${this.t("message.tip.你被")}${e.payload.operatorID} ${this.t("message.tip.撤销群")}:${t} ${this.t("message.tip.的管理员身份")}`;break;case 13:n.text=`${e.payload.operatorID} ${this.t("message.tip.同意加群")}:${t}`;break;case 14:n.text=`${e.payload.operatorID} ${this.t("message.tip.拒接加群")}:${t}`;break;case 255:n.text=`${this.t("message.tip.自定义群系统通知")}: ${e.payload.userDefinedField}`;break;default:n.text="未解析的群系统通知"}return n}handleCallKitSignaling(e){var t,n,o,i,s,r,a,c,u,l;const p=Sl(e.payload.data);if(1!==(null==p?void 0:p.businessID))return"";const d=Sl(null==p?void 0:p.data),h=e.fromAccount||e.from,g=this.getEngine().TUIFriend.getFriendRemark([h]),f=this.getEngine().getMyUserID();let m=g[h]||e.nameCard||e.nick||h;switch(m=this.substringByLength(m),null==p?void 0:p.actionType){case 1:return"audioCall"!==(null===(t=null==d?void 0:d.data)||void 0===t?void 0:t.cmd)&&"videoCall"!==(null===(n=null==d?void 0:d.data)||void 0===n?void 0:n.cmd)||!(null==p?void 0:p.groupID)?"hangup"===(null===(o=null==d?void 0:d.data)||void 0===o?void 0:o.cmd)?(null==p?void 0:p.groupID)?`${this.t("message.custom.通话结束")}`:`${this.t("message.custom.通话时长")}:${function(e){const t=e;let n,o,i,s="";return t>=3600?(n=parseInt(""+t/3600,10)<10?`0${parseInt(""+t/3600,10)}`:parseInt(""+t/3600,10),o=parseInt(""+t%60/60,10)<10?`0${parseInt(""+t%60/60,10)}`:parseInt(""+t%60/60,10),i=t%3600<10?"0"+t%3600:t%3600,i>60&&(o=parseInt(""+i/60,10)<10?`0${parseInt(""+i/60,10)}`:parseInt(""+i/60,10),i=i%60<10?"0"+i%60:i%60),s=`${n}:${o}:${i}`):t>=60&&t<3600?(o=parseInt(""+t/60,10)<10?`0${parseInt(""+t/60,10)}`:parseInt(""+t/60,10),i=t%60<10?"0"+t%60:t%60,s=`00:${o}:${i}`):t<60&&(i=t<10?`0${t}`:t,s=`00:00:${i}`),s}(null==d?void 0:d.call_end)}`:"switchToAudio"===(null===(i=null==d?void 0:d.data)||void 0===i?void 0:i.cmd)?`${this.t("message.custom.切换语音通话")}`:"switchToVideo"===(null===(s=null==d?void 0:d.data)||void 0===s?void 0:s.cmd)?`${this.t("message.custom.切换视频通话")}`:`${this.t("message.custom.发起通话")}`:`${m} ${this.t("message.custom.发起通话")}`;case 2:return(null==p?void 0:p.groupID)?`${m} ${this.t("message.custom.取消通话")}`:this.isOldUIKit("message.custom.已取消")?this.t("message.custom.取消通话"):(null==p?void 0:p.inviter)===f?this.t("message.custom.已取消"):this.t("message.custom.对方已取消");case 3:return"switchToAudio"===(null===(r=null==d?void 0:d.data)||void 0===r?void 0:r.cmd)?`${this.t("message.custom.切换语音通话")}`:"switchToVideo"===(null===(a=null==d?void 0:d.data)||void 0===a?void 0:a.cmd)?`${this.t("message.custom.切换视频通话")}`:(null==p?void 0:p.groupID)?`${m} ${this.t("message.custom.已接听")}`:this.t("message.custom.已接听");case 4:return(null==p?void 0:p.groupID)?`${m} ${this.t("message.custom.拒绝通话")}`:this.isOldUIKit("message.custom.已拒绝")?this.t("message.custom.拒绝通话"):"line_busy"===(null==d?void 0:d.line_busy)||"lineBusy"===(null==d?void 0:d.data.message)?(null==p?void 0:p.inviter)===f?this.t("message.custom.对方忙线中"):this.t("message.custom.忙线未接听"):(null==p?void 0:p.inviter)===f?this.t("message.custom.对方已拒绝"):this.t("message.custom.已拒绝");case 5:if("switchToAudio"===(null===(c=null==d?void 0:d.data)||void 0===c?void 0:c.cmd))return`${this.t("message.custom.切换语音通话")}`;if("switchToVideo"===(null===(u=null==d?void 0:d.data)||void 0===u?void 0:u.cmd))return`${this.t("message.custom.切换视频通话")}`;if(null==p?void 0:p.groupID){if(h===(null==p?void 0:p.inviter)){this.handleCallkitTimeoutSignaling(p.inviteeList);let e="";return null===(l=p.inviteeList)||void 0===l||l.forEach((t=>{const n=this.userShowNameMap.get(t)||t;e+=`${this.substringByLength(n)}、`})),e=e.substring(0,e.lastIndexOf("、")),`${e} ${this.t("message.custom.无应答")}`}return`${m} ${this.t("message.custom.无应答")}`}return this.isOldUIKit("message.custom.对方无应答")?this.t("message.custom.无应答"):(null==p?void 0:p.inviter)===f?this.t("message.custom.对方无应答"):this.t("message.custom.超时无应答");default:return""}}handleCreateGroupCustomMessage(e){let t;const n=Sl(e.payload.data);return"group_create"===(null==n?void 0:n.businessID)&&(t=`${n.opUser} ${n.content}`),t}decodeText(e){const t=[];let n=e.text,o=-1,i=-1;for(;""!==n;)switch(o=n.indexOf("["),i=n.indexOf("]"),o){case 0:if(-1===i)t.push({name:"text",text:n}),n="";else{const e=n.slice(0,i+1);e.indexOf("@custom")>-1?(t.push({name:"img",src:"",type:"custom",emojiKey:e}),n=n.substring(i+1)):kl[e]?(t.push({name:"img",src:"https://web.sdk.qcloud.com/im/assets/emoji-plugin/"+kl[e],emojiKey:e}),n=n.substring(i+1)):(t.push({name:"text",text:"["}),n=n.slice(1))}break;case-1:t.push({name:"text",text:n}),n="";break;default:t.push({name:"text",text:n.slice(0,o)}),n=n.substring(o)}return t}handleGroupProfileUpdated(e){const{nick:t,payload:n}=e,{newGroupProfile:o,memberList:i,operatorID:s}=n;let r="";const a=t||s,c=Object.keys(o)[0];switch(c){case"muteAllMembers":r=o[c]?`${this.t("message.tip.管理员")} ${a} ${this.t("message.tip.开启全员禁言")}`:`${this.t("message.tip.管理员")} ${a} ${this.t("message.tip.取消全员禁言")}`;break;case"ownerID":r=`${i[0].nick||i[0].userID} ${this.t("message.tip.成为新的群主")}`;break;case"groupName":r=`${a} ${this.t("message.tip.修改群名为")} ${o[c]}`;break;case"notification":r=this.isOldUIKit("message.tip.把群公告修改为")?`${a} ${this.t("message.tip.发布新公告")}`:`${a} ${this.t("message.tip.把群公告修改为")} "${o[c]}"`}return r}handleCallkitTimeoutSignaling(e=[]){if(0===e.length)return;const t=this.getEngine().TUIFriend.getFriendRemark(e),n=[];e.forEach((e=>{const o=t[e];o?this.userShowNameMap.set(e,o):this.requestedUserMap.has(e)||(n.push(e),this.requestedUserMap.set(e,1))})),n.length>0&&this.getEngine().TUIUser.getUserProfile({userIDList:n}).then((e=>{(e.data||[]).forEach((e=>{const{userID:t,nick:n}=e,o=n||t;this.userShowNameMap.set(t,o)}))})).catch((()=>{}))}substringByLength(e,t=12){return e.length>t?`${e.slice(0,t)}...`:e}isOldUIKit(e){var t;const n=e.lastIndexOf("."),o=e.slice(0,n+1);return null===(t=this.t(e))||void 0===t?void 0:t.startsWith(o)}}class Sd{constructor(e){this.TUIChatService=e,this.typingTo="",this.timer=null}getEngine(){return this.TUIChatService.getEngine()}clearTypingStatus(){this.getEngine().TUIStore.getData(exports.o.CHAT,"typingStatus")&&this.getEngine().TUIStore.update(exports.o.CHAT,"typingStatus",!1),this.timer&&clearTimeout(this.timer),this.timer=null}handleLastMessage(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.CHAT,"typingStatus");if(e.type===this.getEngine().TYPES.MSG_CUSTOM&&"in"===e.flow){const o=Sl(e.payload.data);if(o.businessID===hl.BUSINESS_ID){const{typingStatus:e,userAction:i}=o;if(e===hl.STATUS_START||i===hl.ACTION_START_ID)return n?(this.timer&&clearTimeout(this.timer),this.timer=null):t.TUIStore.update(exports.o.CHAT,"typingStatus",!0),this.timer=setTimeout((()=>{this.clearTypingStatus()}),3e4),t.TUIStore.getData(exports.o.CHAT,"typingStatus");e!==hl.STATUS_END&&i!==hl.ACTION_END_ID||this.clearTypingStatus()}}}filterTypingMessage(e=[]){return 0===e.length?[]:(this.getEngine().TUIStore.getData(exports.o.APP,"enableTyping")&&this.handleLastMessage(e[e.length-1]),e.filter((e=>e.type!==this.getEngine().TYPES.MSG_CUSTOM||Sl(e.payload.data).businessID!==hl.BUSINESS_ID)))}createTypingMessage(e=hl.STATUS_END,t=""){const{BUSINESS_ID:n,STATUS_START:o,VERSION:i,ACTION_START_ID:s,ACTION_END_ID:r,ACTION_START:a,ACTION_END:c,NEED_TYPING:u}=hl;return{to:t,conversationType:this.getEngine().TYPES.CONV_C2C,payload:{data:JSON.stringify({businessID:n,typingStatus:e,version:i,userAction:e===o?s:r,actionParam:e===o?a:c}),description:"",extension:""},cloudCustomData:JSON.stringify({messageFeature:{needTyping:u,version:i}})}}sendTyping(e=!1,t=""){if(e){this.typingTo=t;const e=this.createTypingMessage(hl.STATUS_START,t);this.getEngine().TUIChat.sendCustomMessage(e,{onlineUserOnly:!0})}else this.sendTypingEnd()}sendTypingEnd(){if(this.typingTo){const e=this.createTypingMessage(hl.STATUS_END,this.typingTo);this.getEngine().TUIChat.sendCustomMessage(e,{onlineUserOnly:!0})}this.typingTo=""}}class Ed{constructor(e){this.TUIChatService=e}getEngine(){return this.TUIChatService.getEngine()}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.onMessageReadReceiptReceived.bind(this))}onMessageReadReceiptReceived(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.CONV,"currentConversationID"),o=[];e.forEach((e=>{const{messageID:i}=e,s=t.chat.findMessage(i);s&&n===s.conversationID&&o.push(s)})),o.length>0&&t.TUIChat.updateMessageList(o,"edit")}sendMessageReadReceipt(e){const t=[];return e.forEach((e=>{const n=e.getMessage();t.push(n)})),this.getEngine().chat.sendMessageReadReceipt(t)}getGroupMessageReadMemberList(e){const t=e.message.getMessage(),n=Object.assign(Object.assign({},e),{message:t});return this.getEngine().chat.getGroupMessageReadMemberList(n)}getMessageReadReceiptList(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.APP,"enabledMessageReadReceipt"),o=t.TUIStore.getData(exports.o.USER,"displayMessageReadReceipt");!n||!o||0===e.length||e[0].conversationType!==t.TYPES.CONV_GROUP||t.chat.getMessageReadReceiptList(e).then((e=>{const{messageList:t}=e.data;this.TUIChatService.updateMessageList(t,"edit")})).catch((e=>{console.warn(`ReadReceiptHandler.getMessageReadReceiptList error:${e.message}`)}))}}class kd extends zl{constructor(){super(),this.serv="TUIChatService",this.messageHandler=new Td(this),this.typingHandler=new Sd(this),this.readReceiptHandler=new Ed(this),this.isSwitching=!0,this.delayGetHoppingFunction=void 0,this.hoppingConfigMap=new Map}static getInstance(){return kd.instance||(kd.instance=new kd),kd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.MESSAGE_RECEIVED,this.onMessageReceived.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_MODIFIED,this.onMessageModified.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_REVOKED,this.onMessageRevoked.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_READ_BY_PEER,this.onMessageReadByPeer.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_REACTIONS_UPDATED,this.onMessageReactionsUpdated.bind(this)),this.onCurrentConversationIDUpdated(),this.onMessageSource(),this.readReceiptHandler.init()}onMessageReceived(e){this.updateMessageList(e,"received"),this.getEngine().TUIStore.update(exports.o.CHAT,"newMessageList",e)}onMessageModified(e){this.updateMessageList(e,"edit")}onMessageRevoked(e){this.updateMessageList(e,"edit")}onMessageReadByPeer(e){this.updateMessageList(e,"edit")}onMessageReactionsUpdated(e){this.updateMessageReactionList([e])}onCurrentConversationIDUpdated(){const e=this.getEngine();e.TUIStore.watch(exports.o.CONV,{currentConversationID:t=>{this.isSwitching=!0,this.delayGetHoppingFunction=void 0,this.hoppingConfigMap.clear(),e.TUIStore.reset(exports.o.CHAT),this.typingHandler.clearTypingStatus(),this.typingHandler.sendTypingEnd(),Yl(t)||this.getMessageList().finally((()=>{this.isSwitching=!1,this.delayGetHoppingFunction&&this.delayGetHoppingFunction()}))}})}onMessageSource(){const e=this.getEngine();e.TUIStore.watch(exports.o.CHAT,{messageSource:t=>{const n=this.getStoreData(exports.o.CONV,"currentConversationID");if(!n||t&&t.conversationID!==n)return;if(Ml(t))return this.hoppingConfigMap.clear(),e.TUIStore.update(exports.o.CHAT,"messageList",[]),e.TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),e.TUIStore.update(exports.o.CHAT,"isCompleted",!1),void this.getMessageList();const o=this.getStoreData(exports.o.CHAT,"messageList");o&&o.find((e=>t&&e.ID===t.ID))||(this.isSwitching?this.delayGetHoppingFunction=this.getMessageListHoppingForDown:this.getMessageListHoppingForDown())}})}getMessageListHoppingForDown(){const e=this.getStoreData(exports.o.CHAT,"messageList"),{conversationID:t,sequence:n,time:o,ID:i}=this.getStoreData(exports.o.CHAT,"messageSource");if(e&&e.find((e=>i&&e.ID===i)))return;const s=this.getEngine();s.TUIStore.update(exports.o.CHAT,"messageList",[]),s.TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),s.TUIStore.update(exports.o.CHAT,"isCompleted",!1),this.getMessageListHopping({conversationID:t,sequence:n,time:o,direction:1})}getStoreData(e,t){return this.getEngine().TUIStore.getData(e,t)}sendMessage(e,t){this.updateMessageList([e],"send");const n=this.getEngine().chat.sendMessage(e,t);return this.getResponse(n)}getResponse(e,t=!0,n=!0){return e.then((e=>{const n=e.data.messageList?e.data.messageList:[e.data.message];return t&&this.updateMessageList(n,"edit"),e})).catch((e=>{var t;return n&&(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.message)&&this.updateMessageList([e.data.message],"edit"),Promise.reject(e)}))}updateMessageList(e,t=""){if(this.getStoreData(exports.o.CHAT,"messageSource")&&"unshift"!==t&&"edit"!==t)return;const n=this.getStoreData(exports.o.CHAT,"messageList"),o=this.updateTargetMessageList(e,n,t);this.getEngine().TUIStore.update(exports.o.CHAT,"messageList",o)}updateTargetMessageList(e,t,n=""){const o=this.getStoreData(exports.o.CONV,"currentConversationID");let i=e.filter((e=>e.conversationID===o));if(i=this.handleC2CCallSignaling(i),!n||0===i.length)return t;const s=t||[];let r=[];if("send"===n||"push"===n){const e=this.getStoreData(exports.o.CHAT,"userInfo");Object.keys(e).length>0&&this.updateLocalMessage(i,e)}switch(n){case"edit":for(const e of t){const t=i.find((t=>t.ID===e.ID));r.push(t||e)}break;case"resend":r=s.filter((e=>e.ID!==i[0].ID)).concat(i);break;case"send":r=s.concat(this.typingHandler.filterTypingMessage(i));break;case"push":r=s.concat(this.typingHandler.filterTypingMessage(i)),this.getEngine().chat.setMessageRead({conversationID:o});break;case"received":r=s.concat(this.typingHandler.filterTypingMessage(i)),r=this.sortMessageList(r),this.getEngine().chat.setMessageRead({conversationID:o});break;case"unshift":r=i.filter((e=>0===s.length||!s.find((t=>t.ID===e.ID)))),r.push(...s),r=this.sortMessageList(r)}return r}enterTypingState(){this.getStoreData(exports.o.APP,"enableTyping")&&this.sendTyping(!0)}leaveTypingState(){this.getStoreData(exports.o.APP,"enableTyping")&&this.sendTyping(!1)}sendTyping(e){const t=this.getEngine(),n=this.getStoreData(exports.o.CONV,"currentConversationID");if(!n.startsWith(t.TYPES.CONV_C2C))return;const o=n.replace(t.TYPES.CONV_C2C,"");if(e){const e=this.getStoreData(exports.o.CHAT,"messageList").filter((e=>"in"===e.flow));if(0===e.length)return;const t=1e3*e[e.length-1].time;if((new Date).getTime()-t>3e4)return}this.typingHandler.sendTyping(e,o)}quoteMessage(e){var t;return this.getEngine().TUIStore.update(exports.o.CHAT,"quoteMessage",{message:e,type:"quote"}),null===(t=this.getEngine().TUIReport)||void 0===t||t.reportFeature(205),e}replyMessage(e){return this.getEngine().TUIStore.update(exports.o.CHAT,"quoteMessage",{message:e,type:"reply"}),e}getCurrentConvInfo(){const{conversationID:e="",type:t}=this.getStoreData(exports.o.CONV,"currentConversation")||{};return{to:e.replace(t,""),conversationType:t}}t(e){return this.getEngine().TUITranslate.t(e)||e}getMessageAbstractAndType(e){var t,n;const o=this.getEngine(),i={abstract:"",type:0};switch(e.type){case o.TYPES.MSG_TEXT:i.abstract=null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text,i.type=1;break;case o.TYPES.MSG_CUSTOM:i.abstract="[自定义消息]",i.type=2;break;case o.TYPES.MSG_IMAGE:i.abstract="[图片]",i.type=3;break;case o.TYPES.MSG_AUDIO:i.abstract="[语音]",i.type=4;break;case o.TYPES.MSG_VIDEO:i.abstract="[视频]",i.type=5;break;case o.TYPES.MSG_FILE:i.abstract="[文件]",i.type=6;break;case o.TYPES.MSG_LOCATION:i.type=7;break;case o.TYPES.MSG_FACE:i.abstract="[表情]",i.type=8;break;case o.TYPES.MSG_GRP_TIP:i.type=9;break;case o.TYPES.MSG_MERGER:i.abstract=null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.title,i.type=10}return i}genMessageReply(e,t){if("reply"!==t&&"quote"!==t)return{};const{abstract:n,type:o}=this.getMessageAbstractAndType(e),i={messageAbstract:n,messageSender:e.nick||e.from,messageID:e.ID},s=Object.assign(Object.assign({},i),{messageType:o,messageTime:null==e?void 0:e.time,messageSequence:null==e?void 0:e.sequence,version:1});if("reply"===t&&(s.messageRootID=e.ID,e.cloudCustomData)){const t=Sl(e.cloudCustomData);t.messageReply&&t.messageReply.messageRootID&&(s.messageRootID=t.messageReply.messageRootID)}return{messageReply:s,messageReplyRoot:i}}getMessageInfo(e,t,n){const{messageReply:o,messageReplyRoot:i}=this.genMessageReply(t,n),s=e.cloudCustomData?Sl(e.cloudCustomData):{};let r;if(s.messageReply?s.messageReply=Object.assign(Object.assign({},o),s.messageReply):s.messageReply=o,"reply"===n){const{messageRootID:e}=o;r=this.getEngine().chat.findMessage(e);const t=(null==r?void 0:r.cloudCustomData)?Sl(r.cloudCustomData):{};t.messageReplies||(t.messageReplies={}),a=t.messageReplies.replies,("function"==typeof Array.isArray?Array.isArray(a):"array"===Object.prototype.toString.call(a).match(/^\[object (.*)\]$/)[1].toLowerCase())||(t.messageReplies.replies=[]),t.messageReplies.replies.push(i),r.cloudCustomData=JSON.stringify(t)}var a;return{cloudCustomData:JSON.stringify(s),rootMessage:r}}sendTextMessage(e,t){const n=this.getEngine(),{message:o,type:i}=this.getStoreData(exports.o.CHAT,"quoteMessage");let s={cloudCustomData:e.cloudCustomData||"",rootMessage:void 0};o&&(s=this.getMessageInfo(e,o,i));const r=n.chat.createTextMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{cloudCustomData:s.cloudCustomData}));return this.sendMessage(r,t).then((e=>(s.rootMessage&&this.modifyMessage(s.rootMessage),n.TUIStore.reset(exports.o.CHAT,["quoteMessage"],!0),e)))}sendTextAtMessage(e,t){const n=this.getEngine(),{message:o,type:i}=this.getStoreData(exports.o.CHAT,"quoteMessage");let s={cloudCustomData:e.cloudCustomData||"",rootMessage:void 0};o&&(s=this.getMessageInfo(e,o,i));const r=n.chat.createTextAtMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{cloudCustomData:s.cloudCustomData}));return this.sendMessage(r,t).then((e=>(s.rootMessage&&this.modifyMessage(s.rootMessage),n.TUIStore.reset(exports.o.CHAT,["quoteMessage"],!0),e)))}sendImageMessage(e,t){const n=this.getEngine().chat.createImageMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendAudioMessage(e,t){const n=this.getEngine().chat.createAudioMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendVideoMessage(e,t){const n=this.getEngine().chat.createVideoMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendCustomMessage(e,t){const n=this.getEngine().chat.createCustomMessage(Object.assign(Object.assign({},this.getCurrentConvInfo()),e));return this.sendMessage(n,t)}sendFaceMessage(e,t){const n=this.getEngine().chat.createFaceMessage(Object.assign(Object.assign({},this.getCurrentConvInfo()),e));return this.sendMessage(n,t)}sendFileMessage(e,t){const n=this.getEngine().chat.createFileMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendLocationMessage(e,t){const n=this.getEngine().chat.createLocationMessage(Object.assign(Object.assign({},this.getCurrentConvInfo()),e));return this.sendMessage(n,t)}onProgress(e,t){const n=this.getEngine().TUIStore.getMessageModel(e);n&&(t-n.progress>=.1||1===t)&&(n.progress=t,this.updateMessageList([n],"edit"))}setAbstractList(e){const t=this.getEngine(),n=e.nick||e.from;let o="";switch(e.type){case t.TYPES.MSG_TEXT:o=e.payload.text||"",o.length>20&&(o=o.slice(0,20));break;case t.TYPES.MSG_MERGER:o=`${this.t("TUIChat.[聊天记录]")}`;break;case t.TYPES.MSG_IMAGE:o=`${this.t("TUIChat.[图片]")}`;break;case t.TYPES.MSG_AUDIO:o=`${this.t("TUIChat.[音频]")}`;break;case t.TYPES.MSG_VIDEO:o=`${this.t("TUIChat.[视频]")}`;break;case t.TYPES.MSG_CUSTOM:o=`${this.t("TUIChat.[自定义消息]")}`;break;case t.TYPES.MSG_FILE:o=`${this.t("TUIChat.[文件]")}`;break;case t.TYPES.MSG_FACE:o=`${this.t("TUIChat.[动画表情]")}`}return`${n}: ${o}`}genMergerForwardPayload(e,t){const{abstractList:n=[],compatibleText:o="",title:i}=t;return 0===n.length&&e.forEach((e=>{n.push(this.setAbstractList(e))})),{messageList:e,title:i,abstractList:n,compatibleText:o||this.t("TUIChat.请升级IMSDK到v2.10.1或更高版本查看此消息")}}genSendMergerForwardMessage(e){const{conversationList:t,messageList:n,params:o,mergeInfo:i,sendMessageOptions:s}=e,r=[];for(let a=0;ae instanceof Zl?e.getMessage():e))}sendForwardMessage(e,t,n){t=this.getOriginMessageList(t);const o=n||{},{needMerge:i=!1,params:s={},mergeInfo:r={}}=o,a=cl(o,["needMerge","params","mergeInfo"]);if(i)return this.sendMergerForwardMessage({conversationList:e,messageList:t,params:s,mergeInfo:r,sendMessageOptions:a});const c=[];for(let u=0;u{const{code:t=0,data:n={}}=e.code;throw t===fl.MSG_MODIFY_CONFLICT?console.warn(`${_l.MSG_MODIFY_CONFLICT} data.message: ${null==n?void 0:n.message}`):t===fl.MSG_MODIFY_DISABLED_IN_AVCHATROOM?console.warn(_l.MSG_MODIFY_DISABLED_IN_AVCHATROOM):t===fl.MODIFY_MESSAGE_NOT_EXIST&&console.warn(_l.MODIFY_MESSAGE_NOT_EXIST),e}))}getMessageList(e={conversationID:this.getStoreData(exports.o.CONV,"currentConversationID"),nextReqMessageID:this.getStoreData(exports.o.CHAT,"nextReqMessageID")}){const t=this.getEngine();if(!t.chat.isReady())return Promise.reject({code:ml.GET_MSG_LIST_ERROR,message:vl.GET_MSG_LIST_ERROR});if(this.getStoreData(exports.o.CHAT,"isCompleted"))return Promise.resolve({data:{messageList:[],nextReqMessageID:"",isCompleted:!0}});const n=this.getStoreData(exports.o.CHAT,"messageSource"),o=this.hoppingConfigMap.get("nextMessageSeq"),i=this.hoppingConfigMap.get("nextMessageTime"),s=o||i;return n&&n.conversationID===(null==e?void 0:e.conversationID)&&s?this.getMessageListHopping():t.chat.getMessageList(e).then((e=>{var n;const{messageList:o,nextReqMessageID:i,isCompleted:s}=e.data,r=this.getStoreData(exports.o.CHAT,"userInfo");Object.keys(r).length>0&&this.updateLocalMessage(o,r),this.updateMessageList(o,"unshift"),t.TUIStore.update(exports.o.CHAT,"nextReqMessageID",i),t.TUIStore.update(exports.o.CHAT,"isCompleted",s);const a=null===(n=o[0])||void 0===n?void 0:n.conversationID,{operationType:c=0}=this.getEngine().TUIStore.getConversationModel(a)||{};return 0===c&&(this.getMessageReactions({messageList:o}),this.readReceiptHandler.getMessageReadReceiptList(o)),e})).catch((e=>Promise.reject(e)))}getMessageListHopping(e){var t;void 0===e&&(e={conversationID:null===(t=this.getStoreData(exports.o.CHAT,"messageSource"))||void 0===t?void 0:t.conversationID,sequence:this.hoppingConfigMap.get("nextMessageSeq"),time:this.hoppingConfigMap.get("nextMessageTime")});const n=this.getEngine();return n.chat.getMessageListHopping(e).then((t=>{const{messageList:o,nextMessageSeq:i,nextMessageTime:s,isCompleted:r}=t.data,a=1===e.direction?e.sequence:i,c=1===e.direction?e.time:s;return this.updateMessageList(o,"unshift"),this.delayGetHoppingFunction=void 0,this.hoppingConfigMap.set("nextMessageSeq",a),this.hoppingConfigMap.set("nextMessageTime",c),n.TUIStore.update(exports.o.CHAT,"isCompleted",r),t})).catch((e=>Promise.reject(e)))}sendMessageReadReceipt(e){return this.readReceiptHandler.sendMessageReadReceipt(e)}getGroupMessageReadMemberList(e){return this.readReceiptHandler.getGroupMessageReadMemberList(e).then((e=>{const{isCompleted:t,cursor:n,messageID:o,unreadUserIDList:i,readUserIDList:s}=e.data,r={code:0,data:{cursor:n,isCompleted:t,messageID:o,unreadUserInfoList:[],readUserInfoList:[]}},a=[...i,...s];return 0===a.length?r:this.getEngine().TUIUser.getUserProfile({userIDList:a}).then((e=>(i.length>0?e.data.forEach((e=>{const{userID:t,nick:n="",avatar:o=""}=e;r.data.unreadUserInfoList.push({userID:t,nick:n,avatar:o})})):e.data.forEach((e=>{const{userID:t,nick:n="",avatar:o=""}=e;r.data.readUserInfoList.push({userID:t,nick:n,avatar:o})})),r)))}))}downloadMergedMessages(e){return this.getEngine().chat.downloadMergerMessage(e)}setTranslationLanguage(e){this.getEngine().TUIStore.update(exports.o.USER,"targetLanguage",e)}translateText(e){const t=this.getStoreData(exports.o.USER,"targetLanguage"),n=Object.assign({targetLanguage:t,sourceLanguage:"auto"},e);return this.getEngine().chat.translateText(n)}searchCloudMessages(e){const t=this.getStoreData(exports.o.CONV,"conversationList");return this.getEngine().chat.searchCloudMessages(e).then((e=>{const{searchResultList:n}=e.data;return e.data.searchResultList=n.map((e=>{const{messageList:n,conversationID:o}=e,i=cl(e,["messageList","conversationID"]),s=n.map((e=>new Zl(e))),r=t.find((e=>e.conversationID===o));return Object.assign(Object.assign({},i),{messageList:s.sort(((e,t)=>t.time-e.time)),conversation:r})})),e}))}addMessageReaction(e,t){return this.getEngine().chat.addMessageReaction(e.getMessage(),t)}removeMessageReaction(e,t){return this.getEngine().chat.removeMessageReaction(e.getMessage(),t)}getMessageReactions(e){const{messageList:t=[]}=e,n=this.getStoreData(exports.o.APP,"enabledEmojiPlugin");console.log(`TUIChatService.getMessageReactions enabledEmojiPlugin:${n} messageList length:${t.length}`),n&&t.length>0&&this.getEngine().chat.getMessageReactions(e).then((e=>{const t=e.data.resultList||e.data;this.updateMessageReactionList(t)})).catch((()=>{}))}getAllUserListOfMessageReaction(e){var t;return this.getEngine().chat.getAllUserListOfMessageReaction(Object.assign(Object.assign({},e),{message:null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.getMessage()}))}updateMessageReactionList(e){const t=[];e.forEach((e=>{const{messageID:n,reactionList:o}=e,i=this.getEngine().TUIStore.getMessageModel(n);if(i){const e=[];for(let t=0;t0&&this.updateMessageList(t,"edit")}convertVoiceToText(e){const{message:t,language:n="zh"}=e,o=t.getMessage();return this.getEngine().chat.convertVoiceToText({message:o,language:n})}clearHistoryMessage(e){const t=this.getEngine();return t.chat.clearHistoryMessage(e).then((e=>(t.TUIStore.update(exports.o.CHAT,"messageList",[]),t.TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),t.TUIStore.update(exports.o.CHAT,"isCompleted",!1),e)))}updateMessageInfo(e){const t=this.getStoreData(exports.o.CHAT,"userInfo");this.getEngine().TUIStore.update(exports.o.CHAT,"userInfo",Object.assign(t,e));const n=this.getStoreData(exports.o.CHAT,"messageList");n.length>0&&this.updateLocalMessage(n,e)&&this.getEngine().TUIStore.update(exports.o.CHAT,"messageList",n)}updateLocalMessage(e,t){let n=!1;return e.forEach((e=>{if(t[e.from]){const{nick:o,nameCard:i,avatar:s}=t[e.from];o&&(e.nick=o,n=!0),i&&(e.nameCard=i,n=!0),s&&(e.avatar=s,n=!0)}})),n}handleC2CCallSignaling(e){const t=this.getEngine(),n=t.getMyUserID();return e.filter((e=>{var o,i,s,r,a;const{conversationType:c,type:u,payload:l}=e;let p=!0;if(c===t.TYPES.CONV_C2C&&u===t.TYPES.MSG_CUSTOM&&t.chat.getSignalingInfo(e)){const t=Sl(l.data);if(1===(null==t?void 0:t.businessID)){const c=Sl(t.data);if(p=!(e._isExcludedFromUnreadCount&&e._isExcludedFromLastMessage),p&&!0!==(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.consumed)){let o=null===(i=null==c?void 0:c.data)||void 0===i?void 0:i.inviter;"line_busy"!==(null==c?void 0:c.line_busy)&&"lineBusy"!==(null===(s=null==c?void 0:c.data)||void 0===s?void 0:s.message)||(o=t.inviter);const{from:u,to:l}=e;if(o!==n&&e.from===n){const t=this.getStoreData(exports.o.CONV,"currentConversation");e.from=l,e.to=u,e.flow="in",e.avatar=(null===(r=null==t?void 0:t.userProfile)||void 0===r?void 0:r.avatar)||""}if(o===n&&e.from!==n){const t=this.getStoreData(exports.o.USER,"userProfile");e.from=l,e.to=u,e.flow="out",e.avatar=null==t?void 0:t.avatar}console.log(`${this.serv}.handleC2CCallSignaling myUserID:${n} callSignaling.inviter:${t.inviter} customData.data.inviter:${null===(a=null==c?void 0:c.data)||void 0===a?void 0:a.inviter}`)}}}return p}))}sortMessageList(e){const{conversationType:t}=e[0];if(t===this.getEngine().TYPES.CONV_C2C)return e.sort(((e,t)=>e.time-t.time));const n=e.filter((e=>"success"===e.status)).sort(((e,t)=>e.sequence-t.sequence));for(let o=0;o{e.groupID===n&&t.TUIStore.update(exports.o.GRP,"currentGroup",e)}))}onGroupAttributesUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.GRP,"currentGroupID");let o=t.TUIStore.getData(exports.o.GRP,"groupList");const{groupID:i,groupAttributes:s}=e;n===i&&t.TUIStore.update(exports.o.GRP,"currentGroupAttributes",s),o=o.map((e=>(e.groupID===i&&(e.groupAttributes=s),e))),t.TUIStore.update(exports.o.GRP,"groupList",o)}onGroupCounterUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.GRP,"currentGroupID"),o=t.TUIStore.getData(exports.o.GRP,"currentGroupCounters")||{};let i=t.TUIStore.getData(exports.o.GRP,"groupList");const{groupID:s,key:r,value:a}=e;n===s&&(o[r]=a,t.TUIStore.update(exports.o.GRP,"currentGroupCounters",o)),i=i.map((e=>(e.groupID===s&&(e.groupCounters=Object.assign(Object.assign({},e.groupCounters),{[r]:a})),e))),t.TUIStore.update(exports.o.GRP,"groupList",i)}onMessageReceived(e){const t=this.getEngine(),n=[];e.forEach((e=>{if(e.type===t.TYPES.MSG_GRP_TIP){const{payload:n}=e,{operationType:o,userIDList:i}=n;switch(o){case t.TYPES.GRP_TIP_MBR_JOIN:this.addMemberList(i);break;case t.TYPES.GRP_TIP_MBR_QUIT:case t.TYPES.GRP_TIP_MBR_KICKED_OUT:this.removeMemberList(i);break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:this.updateGroupMember(i);break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:case t.TYPES.GRP_TIP_BAN_AVCHATROOM_MEMBER:case t.TYPES.GRP_TIP_UNBAN_AVCHATROOM_MEMBER:this.updateGroupMember(i)}}e.type===t.TYPES.MSG_GRP_SYS_NOTICE&&n.push(e)})),n.length>0&&t.TUIStore.update(exports.o.GRP,"groupSystemNoticeList",n)}getGroupInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getGroupList().then((e=>{const{groupList:t=[]}=e.data;console.log(`TUIGroupService.init, getGroupList count:${t.length}`),t.length>0&&this.onGroupListUpdated(t)}))}updateGroupMember(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine().TUIStore.getData(exports.o.GRP,"currentGroupID");if(t){const n=yield this.getGroupMemberProfile({groupID:t,userIDList:e}),{memberList:o}=n.data;this.updateMemberList(o)}}))}resetCurrentStore(){this.getEngine().TUIStore.reset(exports.o.GRP,["currentGroupID","currentGroup","currentGroupAttributes","currentGroupCounters","currentGroupMemberList"],!0)}switchGroup(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine();t.TUIStore.update(exports.o.GRP,"offset",0),t.TUIStore.update(exports.o.GRP,"isCompleted",!1);const n=t.TUIStore.getConversationModel(`GROUP${e}`);if((null==n?void 0:n.operationType)>0){const e=t.TUIStore.getData(exports.o.GRP,"currentGroup");return Promise.resolve(e)}const o=t.TUIStore.getData(exports.o.GRP,"currentGroupID");if(!e)return this.resetCurrentStore(),Promise.resolve({});if(o===e){const e=t.TUIStore.getData(exports.o.GRP,"currentGroup");return Promise.resolve(e)}this.resetCurrentStore(),t.TUIStore.update(exports.o.GRP,"currentGroupID",e);try{yield this.getGroupInfo(e)}catch(r){Promise.reject(r)}const i=setTimeout((()=>{this.groupMap.delete(e),clearTimeout(i)}),5e3),s=t.TUIStore.getData(exports.o.GRP,"currentGroup");return Promise.resolve(s)}))}getGroupInfo(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine(),n=this.groupMap.get(e);if(n)return this.updateMemberList((null==n?void 0:n.memberList)||[]),t.TUIStore.update(exports.o.GRP,"currentGroup",n.group),t.TUIStore.update(exports.o.GRP,"currentGroupAttributes",n.groupAttributes||{}),void t.TUIStore.update(exports.o.GRP,"currentGroupCounters",n.counters||{});const o={group:{},memberList:[],groupAttributes:void 0,counters:void 0},{data:{group:i}}=yield this.getGroupProfile({groupID:e});o.group=i;const{data:{memberList:s}}=yield this.getGroupMemberList({groupID:e});o.memberList=s;const r=yield this.getGroupAttributes({groupID:e,keyList:[]}),{groupAttributes:a}=r.data;o.groupAttributes=a,t.TUIStore.update(exports.o.GRP,"currentGroupAttributes",a);try{const n=yield this.getGroupCounters({groupID:e,keyList:[]}),{counters:i}=n.data;o.counters=i,t.TUIStore.update(exports.o.GRP,"currentGroupCounters",i)}catch(c){console.warn(null==c?void 0:c.message)}this.groupMap.set(e,o)}))}getGroupProfile(e){const t=this.getEngine();return t.chat.getGroupProfile(e).then((n=>ul(this,void 0,void 0,(function*(){if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{group:e}=n.data;t.TUIStore.update(exports.o.GRP,"currentGroup",e)}return n}))))}updateGroupProfile(e){return this.getEngine().chat.updateGroupProfile(e)}createGroup(e){return this.getEngine().chat.createGroup(e)}dismissGroup(e){return this.getEngine().chat.dismissGroup(e)}searchGroupByID(e){const t=this.getEngine();return t.chat.searchGroupByID(e).then((e=>{const{group:n}=e.data,o=t.TUIStore.getData(exports.o.GRP,"groupList");return e.data.group.isJoinedGroup=o.some((e=>e.groupID===n.groupID)),e}))}joinGroup(e){return this.getEngine().chat.joinGroup(e)}quitGroup(e){return this.getEngine().chat.quitGroup(e)}getGroupApplicationList(){return this.getEngine().chat.getGroupApplicationList()}handleGroupApplication(e){return this.getEngine().chat.handleGroupApplication(e)}getGroupOnlineMemberCount(e){return this.getEngine().chat.getGroupOnlineMemberCount(e)}changeGroupOwner(e){return this.getEngine().chat.changeGroupOwner(e)}initGroupAttributes(e){return this.getEngine().chat.initGroupAttributes(e)}setGroupAttributes(e){return this.getEngine().chat.setGroupAttributes(e)}deleteGroupAttributes(e){return this.getEngine().chat.deleteGroupAttributes(e)}getGroupAttributes(e){return this.getEngine().chat.getGroupAttributes(e)}setGroupCounters(e){return this.getEngine().chat.setGroupCounters(e)}increaseGroupCounter(e){return this.getEngine().chat.increaseGroupCounter(e)}decreaseGroupCounter(e){return this.getEngine().chat.decreaseGroupCounter(e)}getGroupCounters(e){return this.getEngine().chat.getGroupCounters(e)}updateMemberList(e){const t=this.getEngine(),n=[...(t.TUIStore.getData(exports.o.GRP,"currentGroupMemberList")||[]).filter((t=>!e.find((e=>e.userID===t.userID)))),...e];t.TUIStore.update(exports.o.GRP,"currentGroupMemberList",n)}addMemberList(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine().TUIStore.getData(exports.o.GRP,"currentGroupID");if(t)try{const n=yield this.getGroupMemberProfile({groupID:t,userIDList:e}),{memberList:o}=n.data;this.updateMemberList(o)}catch(n){const t=e.map((e=>({userID:e,avatar:"",nick:"",role:"",joinTime:0,nameCard:"",muteUntil:0,memberCustomField:[]})));this.updateMemberList(t)}}))}removeMemberList(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.GRP,"currentGroupMemberList").filter((t=>-1===e.indexOf(t.userID)));t.TUIStore.update(exports.o.GRP,"currentGroupMemberList",n)}getGroupMemberList(e){const t=this.getEngine();if(Ml(e.offset)){const n=t.TUIStore.getData(exports.o.GRP,"offset");e.offset=n}return t.chat.getGroupMemberList(e).then((n=>{if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{memberList:e,offset:o=0}=n.data;this.updateMemberList(e),t.TUIStore.update(exports.o.GRP,"offset",o),0===o&&t.TUIStore.update(exports.o.GRP,"isCompleted",!0)}return n}))}getGroupMemberProfile(e){return this.getEngine().chat.getGroupMemberProfile(e)}addGroupMember(e){const t=this.getEngine();return t.chat.addGroupMember(e).then((n=>ul(this,void 0,void 0,(function*(){if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{successUserIDList:e,group:o}=n.data;t.TUIStore.update(exports.o.GRP,"currentGroup",o),this.addMemberList(e)}return n}))))}deleteGroupMember(e){const t=this.getEngine();return t.chat.deleteGroupMember(e).then((n=>{if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{userIDList:e,group:o}=n.data;this.removeMemberList(e),t.TUIStore.update(exports.o.GRP,"currentGroup",o)}return n}))}setGroupMemberMuteTime(e){return this.getEngine().chat.setGroupMemberMuteTime(e)}setGroupMemberRole(e){return this.getEngine().chat.setGroupMemberRole(e)}setGroupMemberNameCard(e){return this.getEngine().chat.setGroupMemberNameCard(e)}setGroupMemberCustomField(e){return this.getEngine().chat.setGroupMemberCustomField(e)}markGroupMemberList(e){return this.getEngine().chat.markGroupMemberList(e)}}class Ld extends zl{constructor(){super()}static getInstance(){return Ld.instance||(Ld.instance=new Ld),Ld.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.FRIEND_LIST_UPDATED,this.onFriendListUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.FRIEND_APPLICATION_LIST_UPDATED,this.onFriendApplicationListUpdated.bind(this)),this.getFriendInitData()}onFriendListUpdated(e){this.getEngine().TUIStore.update(exports.o.FRIEND,"friendList",e)}onFriendApplicationListUpdated(e){const{friendApplicationList:t,unreadCount:n=0}=e,o=this.getEngine();o.TUIStore.update(exports.o.FRIEND,"friendApplicationList",t),o.TUIStore.update(exports.o.FRIEND,"friendApplicationUnreadCount",n)}getFriendInitData(){const e=this.getEngine();e.chat.isReady()&&(e.chat.getFriendList().then((e=>{const t=e.data||[];console.log(`TUIFriendService.init, getFriendList count:${t.length}`),t.length>0&&this.onFriendListUpdated(t)})),e.chat.getFriendApplicationList().then((e=>{this.onFriendApplicationListUpdated(e.data)})))}getFriendList(){return this.getEngine().chat.getFriendList()}getFriendRemark(e){const t=this.getEngine().TUIStore.getData(exports.o.FRIEND,"friendList"),n={};return e.forEach((e=>{for(let o=0;o0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}run(e){return this.middlewares=this.cache.map((e=>e)),this.options=e,this.next()}}function Ad(e,t,n){const o=Object.create(null);Object.keys(n).forEach((n=>{if(!t[n])return;o[n]=t[n];const i=new Od;t[n]=function(){const s=Array.from(arguments);return i.use(((t,o)=>e.isInited?o():Promise.reject({code:ml.NOT_INIT,message:`${n} | ${vl.NOT_INIT}`}))).use((e=>o[n].apply(t,e))),i.run(s)}}))}console.log("TUIChatEngine.VERSION:2.4.4");const bd=Hl.getInstance();jl.getInstance();const Pd=sp.getInstance(),Nd=gd.getInstance(),xd=fd.getInstance(),wd=Cd.getInstance(),Ud=kd.getInstance(),Gd=Dd.getInstance(),Fd=Ld.getInstance(),Bd=Rd.getInstance();bd.mount(pl.TUIStore,Pd),bd.mount(pl.TUITranslate,Nd),bd.mount(pl.TUIConversation,xd),bd.mount(pl.TUIUser,wd),bd.mount(pl.TUIChat,Ud),bd.mount(pl.TUIGroup,Gd),bd.mount(pl.TUIFriend,Fd),bd.mount(pl.TUIReport,Bd),Ad(bd,bd,Il),Ad(bd,xd,{deleteConversation:1,pinConversation:1,muteConversation:1,switchConversation:1,getConversationProfile:1,clearHistoryMessage:1}),Ad(bd,Ud,{modifyMessage:1,revokeMessage:1,resendMessage:1,deleteMessage:1,quoteMessage:1,replyMessage:1,setMessageExtensions:1,deleteMessageExtensions:1,getMessageExtensions:1,sendTextMessage:1,sendTextAtMessage:1,sendImageMessage:1,sendAudioMessage:1,sendVideoMessage:1,sendFileMessage:1,sendCustomMessage:1,sendFaceMessage:1,sendLocationMessage:1,sendForwardMessage:1,enterTypingState:1,leaveTypingState:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageList:1,downloadMergedMessages:1,setTranslationLanguage:1,translateText:1,searchCloudMessages:1,addMessageReaction:1,removeMessageReaction:1,getMessageReactions:1,getAllUserListOfMessageReaction:1}),Ad(bd,Gd,{switchGroup:1,getGroupProfile:1,updateGroupProfile:1,createGroup:1,dismissGroup:1,searchGroupByID:1,joinGroup:1,quitGroup:1,getGroupApplicationList:1,handleGroupApplication:1,getGroupOnlineMemberCount:1,changeGroupOwner:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getGroupMemberList:1,getGroupMemberProfile:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberNameCard:1,setGroupMemberCustomField:1,markGroupMemberList:1}),Ad(bd,wd,{switchUserStatus:1,switchMessageReadStatus:1,getUserProfile:1,updateMyProfile:1,addToBlacklist:1,removeFromBlacklist:1}),Ad(bd,Fd,{getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,getFriendProfile:1,updateFriend:1,acceptFriendApplication:1,refuseFriendApplication:1,deleteFriendApplication:1,setFriendApplicationRead:1}),Ad(bd,Bd,Il);const qd=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),Vd=void 0!==Gn&&"undefined"==typeof window,Hd=void 0!==Gn,Kd=(void 0!==Gn||"undefined"!=typeof window)&&!(qd||Vd),$d=qd?Un:Hd?Gn:"undefined"!=typeof window?window:{},zd=Kd&&window&&window.navigator&&window.navigator.userAgent||"",Yd=/Android/i.test(zd),Wd=/(?:Windows Phone)/.test(zd),Jd=/(?:SymbianOS)/.test(zd),Xd=/OpenHarmony/i.test(zd),Zd=Kd&&("ontouchstart"in window||navigator.maxTouchPoints>0)&&function(){if(Kd){if(/Tablet|Pad/i.test(zd))return!0;if(180===window.orientation||0===window.orientation)return window.innerWidth>=768&&window.innerHeight>=1024;if(90===window.orientation||-90===window.orientation)return window.innerWidth>=1024&&window.innerHeight>=768}return!1}(),Qd=/iPhone/i.test(zd)||/iPod/i.test(zd),eh=qd,th=Yd||Wd||Jd||Qd||Zd||Xd,nh=Kd&&!th,oh=Vd&&!qd;const ih=new Map;class sh{constructor(){if(sh.instance)return sh.instance;sh.instance=this,this.eventCallback=null,this.listener=null,this.button=0,this.init()}init(){Kd&&(this.eventCallback=e=>{this.listener&&this.listener(e)},document.addEventListener("mousedown",this.eventCallback))}listen(e){if(Kd){const{domRefs:t,ignoreDomRefs:n,handler:o,button:i=0}=e;this.button=i,this.listener=e=>{const i=Array.isArray(n)?n:[n];for(const t of i)if(t&&t.contains(e.target))return;const s=Array.isArray(t)?t:[t];for(const t of s)if(t&&t.contains(e.target)&&this.button===e.button)return;o(e),this.remove()}}}remove(){this.listener=null,this.button=-1}}const rh={PROTOCOLS:["javascript:","vbscript:","file:","about:","ftp:","ws:","wss:","mailto:","tel:","sms:","gopher:","data:","blob:"],HTML_TAGS:["","]]>","(t,n=Kr())=>{!exports.isInSSRComponentSetup&&qs(e,t,n)},uh=ch($),lh=ch(Z),ph=ch(Q),dh=ch(ee);var hh={exports:{}};hh.exports=function(){var e=1e3,t=6e4,n=36e5,o="millisecond",i="second",s="minute",r="hour",a="day",c="week",u="month",l="quarter",p="year",d="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},_=function(e,t,n){var o=String(e);return!o||o.length>=t?e:""+Array(t+1-o.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),o=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+_(o,2,"0")+":"+_(i,2,"0")},m:function e(t,n){if(t.date()1)return e(r[0])}else{var a=t.name;I[a]=t,i=a}return!o&&i&&(y=i),i||!o&&y},S=function(e,t){if(C(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},E=v;E.l=T,E.i=C,E.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function m(e){this.$L=T(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[M]=!0}var _=m.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var o=t.match(g);if(o){var i=o[2]-1||0,s=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,s)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,s)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return E},_.isValid=function(){return!(this.$d.toString()===h)},_.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return S(e)=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function kh(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=s.next()).done;)r.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r}function Dh(e,t,n){if(n||2===arguments.length)for(var o,i=0,s=t.length;i=0&&Math.floor(t)===t&&isFinite(e)&&t<=4294967295}function og(e){return null!==e&&"object"==typeof e}function ig(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function sg(e){return"function"==typeof e}function rg(e,t){return t=t||jh()}function ag(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var o=new e(t);return e.config.silent=n,o}function cg(e,t){return function(){for(var n=[],o=0;o1?n&&sg(t)?t():t:void 0}},isRaw:Dg,isReactive:Lg,isReadonly:function(e){return fg.has(e)},isRef:Cg,markRaw:function(e){if(!ig(e)&&!Zh(e)||!Object.isExtensible(e))return e;var t=Pg();return t[kg]=!0,Jh(e,"__ob__",t),gg.set(e,!0),e},nextTick:function(){for(var e,t=[],n=0;n"']/,Sf=/[&<>"']/g,Ef=/[<>"']|&(?!#?\w+;)/,kf=/[<>"']|&(?!#?\w+;)/g,Df={"&":"&","<":"<",">":">",'"':""","'":"'"},Lf=e=>Df[e];function Rf(e,t){if(t){if(Tf.test(e))return e.replace(Sf,Lf)}else if(Ef.test(e))return e.replace(kf,Lf);return e}const Of=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Af(e){return e.replace(Of,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const bf=/(^|[^\[])\^/g;function Pf(e,t){e=e.source||e,t=t||"";const n={replace:(t,o)=>(o=(o=o.source||o).replace(bf,"$1"),e=e.replace(t,o),n),getRegex:()=>new RegExp(e,t)};return n}const Nf=/[^\w:]/g,xf=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wf(e,t,n){if(e){let e;try{e=decodeURIComponent(Af(n)).replace(Nf,"").toLowerCase()}catch(yl){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!xf.test(n)&&(n=function(e,t){Uf[" "+e]||(Gf.test(e)?Uf[" "+e]=e+"/":Uf[" "+e]=Hf(e,"/",!0));e=Uf[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ff,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Bf,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(yl){return null}return n}const Uf={},Gf=/^[^:]+:\/*[^/]*$/,Ff=/^([^:]+:)[\s\S]*$/,Bf=/^([^:]+:\/*[^/]*)[\s\S]*$/;const qf={exec:function(){}};function Vf(e){let t,n,o=1;for(;o{let o=!1,i=t;for(;--i>=0&&"\\"===n[i];)o=!o;return o?"|":" |"})).split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function zf(e,t,n,o){const i=t.href,s=t.title?Rf(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){o.state.inLink=!0;const e={type:"link",raw:n,href:i,title:s,text:r,tokens:o.inlineTokens(r,[])};return o.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:s,text:Rf(r)}}class Yf{constructor(e){this.options=e||Cf}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Hf(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const o=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=o.length?e.slice(o.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Hf(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,o,i,s,r,a,c,u,l,p,d=t[1].trim();const h=d.length>1,g={type:"list",raw:"",ordered:h,start:h?+d.slice(0,-1):"",loose:!1,items:[]};d=h?`\\d{1,9}\\${d.slice(-1)}`:`\\${d}`,this.options.pedantic&&(d=h?d:"[*+-]");const f=new RegExp(`^( {0,3}${d})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!this.rules.block.hr.test(e)&&(t=f.exec(e));){l=t[2].split("\n"),this.options.pedantic?(s=2,p=l[0].trimLeft()):(s=t[2].search(/[^ ]/),s=t[1].length+(s>4?1:s),p=l[0].slice(s-t[1].length)),a=!1,n=t[0],!l[0]&&/^ *$/.test(l[1])&&(n=t[1]+l.slice(0,2).join("\n")+"\n",g.loose=!0,l=[]);const d=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(r=1;r=s)&&u.trim()){n=t[1]+l.slice(0,r).join("\n")+"\n";break}p+="\n"+u.slice(s)}else u.trim()||(a=!0),u.search(/[^ ]/)>=s?p+="\n"+u.slice(s):p+="\n"+u}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i="[ ] "!==o[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),g.raw+=n,e=e.slice(n.length)}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const m=g.items.length;for(r=0;r"space"===e.type))&&(g.loose=!0,g.items[r].loose=!0);return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):Rf(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:jf(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,o,i,s,r=e.align.length;for(n=0;n({text:e})));for(r=e.header.length,o=0;o/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Rf(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Hf(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let o=0,i=0;for(;i-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),zf(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return zf(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let o=this.rules.inline.emStrong.lDelim.exec(e);if(!o)return;if(o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=o[0].length-1;let i,s,r=n,a=0;const c="*"===o[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(o=c.exec(t));){if(i=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!i)continue;if(s=i.length,o[3]||o[4]){r+=s;continue}if((o[5]||o[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(r-=s,r>0)continue;if(s=Math.min(s,s+r+a),Math.min(n,s)%2){const t=e.slice(1,n+o.index+s);return{type:"em",raw:e.slice(0,n+o.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+o.index+s-1);return{type:"strong",raw:e.slice(0,n+o.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),o=/^ /.test(e)&&/ $/.test(e);return n&&o&&(e=e.substring(1,e.length-1)),e=Rf(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,o;return"@"===n[2]?(e=Rf(this.options.mangle?t(n[1]):n[1]),o="mailto:"+e):(e=Rf(n[1]),o=e),{type:"link",raw:n[0],text:e,href:o,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,o;if("@"===n[2])e=Rf(this.options.mangle?t(n[0]):n[0]),o="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=Rf(n[0]),o="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:o,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Rf(n[0]):n[0]:Rf(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Wf={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:qf,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Wf.def=Pf(Wf.def).replace("label",Wf._label).replace("title",Wf._title).getRegex(),Wf.bullet=/(?:[*+-]|\d{1,9}[.)])/,Wf.listItemStart=Pf(/^( *)(bull) */).replace("bull",Wf.bullet).getRegex(),Wf.list=Pf(Wf.list).replace(/bull/g,Wf.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Wf.def.source+")").getRegex(),Wf._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wf._comment=/|$)/,Wf.html=Pf(Wf.html,"i").replace("comment",Wf._comment).replace("tag",Wf._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Wf.paragraph=Pf(Wf._paragraph).replace("hr",Wf.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Wf._tag).getRegex(),Wf.blockquote=Pf(Wf.blockquote).replace("paragraph",Wf.paragraph).getRegex(),Wf.normal=Vf({},Wf),Wf.gfm=Vf({},Wf.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Wf.gfm.table=Pf(Wf.gfm.table).replace("hr",Wf.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Wf._tag).getRegex(),Wf.pedantic=Vf({},Wf.normal,{html:Pf("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Wf._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qf,paragraph:Pf(Wf.normal._paragraph).replace("hr",Wf.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Wf.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Jf={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qf,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qf,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),o+="&#"+n+";";return o}Jf._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Jf.punctuation=Pf(Jf.punctuation).replace(/punctuation/g,Jf._punctuation).getRegex(),Jf.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Jf.escapedEmSt=/\\\*|\\_/g,Jf._comment=Pf(Wf._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Jf.emStrong.lDelim=Pf(Jf.emStrong.lDelim).replace(/punct/g,Jf._punctuation).getRegex(),Jf.emStrong.rDelimAst=Pf(Jf.emStrong.rDelimAst,"g").replace(/punct/g,Jf._punctuation).getRegex(),Jf.emStrong.rDelimUnd=Pf(Jf.emStrong.rDelimUnd,"g").replace(/punct/g,Jf._punctuation).getRegex(),Jf._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Jf._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Jf._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Jf.autolink=Pf(Jf.autolink).replace("scheme",Jf._scheme).replace("email",Jf._email).getRegex(),Jf._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Jf.tag=Pf(Jf.tag).replace("comment",Jf._comment).replace("attribute",Jf._attribute).getRegex(),Jf._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jf._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Jf._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Jf.link=Pf(Jf.link).replace("label",Jf._label).replace("href",Jf._href).replace("title",Jf._title).getRegex(),Jf.reflink=Pf(Jf.reflink).replace("label",Jf._label).getRegex(),Jf.reflinkSearch=Pf(Jf.reflinkSearch,"g").replace("reflink",Jf.reflink).replace("nolink",Jf.nolink).getRegex(),Jf.normal=Vf({},Jf),Jf.pedantic=Vf({},Jf.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Pf(/^!?\[(label)\]\((.*?)\)/).replace("label",Jf._label).getRegex(),reflink:Pf(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jf._label).getRegex()}),Jf.gfm=Vf({},Jf.normal,{escape:Pf(Jf.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\!!(n=o.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?t.push(n):(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(o.raw+="\n"+n.raw,o.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startBlock.forEach((function(e){o=e.call({lexer:this},n),"number"==typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))o=t[t.length-1],s&&"paragraph"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,o,i,s,r,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+$f("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+$f("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(r||(a=""),r=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((o=>!!(n=o.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===n.type&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===n.type&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,Zf))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,Zf))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startInline.forEach((function(e){o=e.call({lexer:this},n),"number"==typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,Xf))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),r=!0,o=t[t.length-1],o&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class em{constructor(e){this.options=e||Cf}code(e,t,n){const o=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,o);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",o?'
'+(n?e:Rf(e,!0))+"
\n":"
"+(n?e:Rf(e,!0))+"
\n"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,n,o){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=wf(this.options.sanitize,this.options.baseUrl,e)))return n;let o='",o}image(e,t,n){if(null===(e=wf(this.options.sanitize,this.options.baseUrl,e)))return n;let o=''+n+'":">",o}text(e){return e}}class tm{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class nm{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[e];do{o++,n=e+"-"+o}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=o,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class om{constructor(e){this.options=e||Cf,this.options.renderer=this.options.renderer||new em,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tm,this.slugger=new nm}static parse(e,t){return new om(t).parse(e)}static parseInline(e,t){return new om(t).parseInline(e)}parse(e,t=!0){let n,o,i,s,r,a,c,u,l,p,d,h,g,f,m,_,v,y,I,M="";const C=e.length;for(n=0;n0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):f+=y),f+=this.parse(m.tokens,g),l+=this.renderer.listitem(f,v,_);M+=this.renderer.list(l,d,h);continue;case"html":M+=this.renderer.html(p.text);continue;case"paragraph":M+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(l=p.tokens?this.parseInline(p.tokens):p.text;n+1{o(e.text,e.lang,(function(t,n){if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),r--,0===r&&s()}))}),0))})),void(0===r&&s())}try{const n=Qf.lex(e,t);return t.walkTokens&&im.walkTokens(n,t.walkTokens),om.parse(n,t)}catch(yl){if(yl.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Rf(yl.message+"",!0)+"
    ";throw yl}}im.options=im.setOptions=function(e){var t;return Vf(im.defaults,e),t=im.defaults,Cf=t,im},im.getDefaults=Mf,im.defaults=Cf,im.use=function(...e){const t=Vf({},...e),n=im.defaults.extensions||{renderers:{},childTokens:{}};let o;e.forEach((e=>{if(e.extensions&&(o=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let o=e.renderer.apply(this,n);return!1===o&&(o=t.apply(this,n)),o}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=im.defaults.renderer||new em;for(const t in e.renderer){const o=n[t];n[t]=(...i)=>{let s=e.renderer[t].apply(n,i);return!1===s&&(s=o.apply(n,i)),s}}t.renderer=n}if(e.tokenizer){const n=im.defaults.tokenizer||new Yf;for(const t in e.tokenizer){const o=n[t];n[t]=(...i)=>{let s=e.tokenizer[t].apply(n,i);return!1===s&&(s=o.apply(n,i)),s}}t.tokenizer=n}if(e.walkTokens){const n=im.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}o&&(t.extensions=n),im.setOptions(t)}))},im.walkTokens=function(e,t){for(const n of e)switch(t.call(im,n),n.type){case"table":for(const e of n.header)im.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)im.walkTokens(n.tokens,t);break;case"list":im.walkTokens(n.items,t);break;default:im.defaults.extensions&&im.defaults.extensions.childTokens&&im.defaults.extensions.childTokens[n.type]?im.defaults.extensions.childTokens[n.type].forEach((function(e){im.walkTokens(n[e],t)})):n.tokens&&im.walkTokens(n.tokens,t)}},im.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");Kf(t=Vf({},im.defaults,t||{}));try{const n=Qf.lexInline(e,t);return t.walkTokens&&im.walkTokens(n,t.walkTokens),om.parseInline(n,t)}catch(yl){if(yl.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Rf(yl.message+"",!0)+"
    ";throw yl}},im.Parser=om,im.parser=om.parse,im.Renderer=em,im.TextRenderer=tm,im.Lexer=Qf,im.lexer=Qf.lex,im.Tokenizer=Yf,im.Slugger=nm,im.parse=im,im.options,im.setOptions,im.use,im.walkTokens,im.parseInline,om.parse,Qf.lex,exports.A=sl,exports.A$1=function(e){return function(e){const t=/(?:https?:\/\/|mailto:|www\.)(?:localhost(?::\d{1,5})?|[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b)(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi,n=[],o=e.split(t),i=e.match(t)||[];let s=0;return o.forEach((e=>{if(e&&n.push({type:"text",text:e}),i[s]){const e=i[s];let t=e;e.toLowerCase().startsWith("www.")&&(t="https://"+e),n.push({type:"url",text:e,url:t}),s++}})),n}(e).map((e=>{if("url"===e.type){const t=function(t,n={}){const{maxLength:o=2083,allowedProtocols:i=["http:","https:","mailto:"],allowCredentials:s=!1,allowDataUrl:r=!1}=n;if(!t||"string"!=typeof t)return"about:blank";if(t.length>o)return"about:blank";try{let n=t.replace(/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/g,"");n=n.normalize("NFKC"),n=n.replace(/\s+/g," ").trim();let o=n;const a=new Set;let c=0;for(;c<5;)try{const e=decodeURIComponent(o);if(a.has(e))break;a.add(e),o=e,c++}catch(e){break}const u=function(){const e=[],t=Object.keys(rh);for(let n=0;n1){const e=n[0].split(":");i=e[0]||"",s=e[1]||""}const r=o.split(":"),a=r[0],c=r[1]||"";return{href:e,protocol:(t[1]||"").toLowerCase(),host:o,hostname:a,port:c,pathname:t[5]||"",search:t[6]||"",hash:t[8]||"",username:i,password:s}}(n),p=l.protocol.replace(":","").toLowerCase()+":";let d=!1;for(let e=0;e{n.select(e).scrollOffset((e=>{e&&t(e)})).exec(),setTimeout((()=>o(new Error(`getScrollInfo ${e} timeout.`))),500)}))}return Promise.reject(new Error("getScrollInfo occur error"))},exports.Pinia=Ou,exports.Qt=Ud,exports.R=il,exports.ReactiveEffect=$n,exports.T=function(e,t){if(!e)return Promise.reject(new Error(`getBoundingClientRect get error selector ${typeof e}.`));if(window||document){const t="object"==typeof e?e:document.querySelector(e);if(!t)return Promise.reject(new Error(`getBoundingClientRect can't find ${e} dom.`));const n=t.getBoundingClientRect();return Promise.resolve({id:t.id,top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width,height:n.height,x:n.x,y:n.y})}if(Hd){if(!t)return Promise.reject(new Error("getBoundingClientRect need instanceName in params."));const n=Gn.createSelectorQuery().in(ih.get(t));return new Promise(((t,o)=>{n.select(e).boundingClientRect((e=>{e&&t(e)})).exec(),setTimeout((()=>o(new Error(`getBoundingClientRect ${e} timeout.`))),500)}))}return Promise.reject(new Error("getBoundingClientRect occur error"))},exports.Text=Gr,exports.VueApi=If,exports.Wt=Nd,exports.Xt=xd,exports.Zt=wd,exports._Vue=Cc,exports._export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},exports.c=lc,exports.callWithAsyncErrorHandling=Ni,exports.callWithErrorHandling=Pi,exports.camelize=k,exports.computed=ta,exports.createApp=Ic,exports.createPinia=_u,exports.createPropsRestProxy=gr,exports.createSSRApp=Mc,exports.createVNode=Na,exports.createVueApp=Oa,exports.customRef=Di,exports.d=rc,exports.dayjs=fh,exports.dayjs_minExports=gh,exports.defineAsyncComponent=ra,exports.defineComponent=ws,exports.defineEmits=sr,exports.defineExpose=rr,exports.defineProps=ir,exports.defineStore=ku,exports.devtoolsComponentAdded=ns,exports.devtoolsComponentRemoved=is,exports.devtoolsComponentUpdated=os,exports.diff=ua,exports.e=pc,exports.effect=Jn,exports.effectScope=Vn,exports.es=Gd,exports.f=sc,exports.f$1=Qd,exports.findComponentPropsData=Ya,exports.g=function(){let e="";return nh?e="pc":th?e="h5":eh?e="wechat":oh&&(e="app"),e},exports.gei=yc,exports.getCurrentInstance=Kr,exports.getCurrentScope=Hn,exports.getExposeProxy=ea,exports.guardReactiveProps=Fr,exports.h=dc,exports.hasInjectionContext=xs,exports.hasQueueJob=Wi,exports.i=$d,exports.index=Gn,exports.initVueI18n=function(e,t={},n,o){if("string"!=typeof e){const n=[t,e];e=n[0],t=n[1]}"string"!=typeof e&&(e=void 0!==Gn&&Gn.getLocale?Gn.getLocale():"undefined"!=typeof global&&global.getLocale?global.getLocale():Be),"string"!=typeof n&&(n="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||Be);const i=new Ke({locale:e,fallbackLocale:n,messages:t,watcher:o});let s=(e,t)=>{if("function"!=typeof getApp)s=function(e,t){return i.t(e,t)};else{let e=!1;s=function(t,n){const o=getApp().$vm;return o&&(o.$locale,e||(e=!0,function(e,t){e.$watchLocale?e.$watchLocale((e=>{t.setLocale(e)})):e.$watch((()=>e.$locale),(e=>{t.setLocale(e)}))}(o,i))),i.t(t,n)}}return s(e,t)};return{i18n:i,f:(e,t,n)=>i.f(e,t,n),t:(e,t)=>s(e,t),add:(e,t,n=!0)=>i.add(e,t,n),watch:e=>i.watchLocale(e),getLocale:()=>i.getLocale(),setLocale:e=>i.setLocale(e)}},exports.inject=Ns,exports.injectHook=qs,exports.invalidateJob=Ji,exports.isProxy=ci,exports.isReactive=si,exports.isReadonly=ri,exports.isRef=mi,exports.isSameOrAfter=yh,exports.isSameOrBefore=Mh,exports.isShallow=ai,exports.j=vc,exports.k=function(e){const{element:t,onLongPress:n,options:o={}}=e;if(!t||!n)throw new Error("addLongPressEventListener missing arguments");const{duration:i=800,eventDelegation:s}=o;let r;function a(){clearTimeout(r),u()}function c(){clearTimeout(r),u()}function u(){t.removeEventListener("pointerup",a),t.removeEventListener("pointermove",c)}t.addEventListener("pointerdown",(e=>{const o=e.target,u=(null==s?void 0:s.subSelector)?o.closest(s.subSelector)||void 0:o,l=e.currentTarget;r=setTimeout((()=>n(e,u,l)),i),t.addEventListener("pointerup",a),t.addEventListener("pointermove",c)}))},exports.localeData=_h,exports.logError=wi,exports.m=_c,exports.markRaw=li,exports.marked=im,exports.mergeDefaults=dr,exports.mergeModels=hr,exports.mergeProps=Br,exports.n=hc,exports.nextTick$1=$i,exports.normalizeClass=B,exports.normalizeProps=q,exports.normalizeStyle=x,exports.o$1=ic,exports.onActivated=Us,exports.onBeforeMount=js,exports.onBeforeUnmount=zs,exports.onBeforeUpdate=Ks,exports.onDeactivated=Gs,exports.onErrorCaptured=Zs,exports.onHide=uh,exports.onLoad=lh,exports.onMounted=Hs,exports.onReady=ph,exports.onRenderTracked=Xs,exports.onRenderTriggered=Js,exports.onScopeDispose=Kn,exports.onServerPrefetch=Ws,exports.onUnload=dh,exports.onUnmounted=Ys,exports.onUpdated=$s,exports.p=fc,exports.patch=_a,exports.provide=Ps,exports.proxyRefs=Ei,exports.pruneComponentPropsCache=za,exports.qt=bd,exports.queuePostFlushCb=Xi,exports.r=ac,exports.reactive=ei,exports.readonly=ni,exports.ref=_i,exports.resolveComponent=gs,exports.resolveDirective=fs,exports.resolveFilter=null,exports.s=uc,exports.setCurrentRenderingInstance=ls,exports.setTemplateRef=Ia,exports.setupDevtoolsPlugin=oc,exports.shallowReactive=ti,exports.shallowReadonly=oi,exports.shallowRef=vi,exports.sr=mc,exports.ss=Bd,exports.stop=Xn,exports.t=gc,exports.toDisplayString=V,exports.toHandlerKey=O,exports.toHandlers=Qs,exports.toRaw=ui,exports.toRef=Ai,exports.toRefs=Li,exports.toValue=Ti,exports.triggerRef=Mi,exports.ts=Fd,exports.unref=Ci,exports.updateProps=Lr,exports.useAttrs=ur,exports.useCssModule=Aa,exports.useCssVars=ba,exports.useModel=na,exports.useSSRContext=ys,exports.useSlots=cr,exports.v=function(e,t){ih.set(e,t)},exports.version=oa,exports.w=cc,exports.warn=ia,exports.watch=Ss,exports.watchEffect=Is,exports.watchPostEffect=Ms,exports.watchSyncEffect=Cs,exports.withAsyncContext=fr,exports.withCtx=ds,exports.withDefaults=ar,exports.withDirectives=Rs,exports.withModifiers=Pa,exports.withScopeId=ps,exports.wx$1=Un;