var rx=Object.defineProperty;var ox=(e,t,n)=>t in e?rx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Kt=(e,t,n)=>(ox(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function WI(e,t){const n=Object.create(null),r=e.split(",");for(let o=0;o!!n[o.toLowerCase()]:o=>!!n[o]}const yr={},nf=[],Vs=()=>{},ix=()=>!1,sx=/^on[^a-z]/,Ty=e=>sx.test(e),KI=e=>e.startsWith("onUpdate:"),to=Object.assign,YI=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ax=Object.prototype.hasOwnProperty,jn=(e,t)=>ax.call(e,t),Vt=Array.isArray,rf=e=>fg(e)==="[object Map]",Ff=e=>fg(e)==="[object Set]",zw=e=>fg(e)==="[object Date]",hn=e=>typeof e=="function",Fr=e=>typeof e=="string",Rh=e=>typeof e=="symbol",ur=e=>e!==null&&typeof e=="object",eL=e=>ur(e)&&hn(e.then)&&hn(e.catch),tL=Object.prototype.toString,fg=e=>tL.call(e),lx=e=>fg(e).slice(8,-1),nL=e=>fg(e)==="[object Object]",JI=e=>Fr(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xm=WI(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wy=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ux=/-(\w)/g,Ca=wy(e=>e.replace(ux,(t,n)=>n?n.toUpperCase():"")),cx=/\B([A-Z])/g,id=wy(e=>e.replace(cx,"-$1").toLowerCase()),Sy=wy(e=>e.charAt(0).toUpperCase()+e.slice(1)),y1=wy(e=>e?`on${Sy(e)}`:""),Nh=(e,t)=>!Object.is(e,t),Zm=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Iv=e=>{const t=parseFloat(e);return isNaN(t)?e:t},dx=e=>{const t=Fr(e)?Number(e):NaN;return isNaN(t)?e:t};let jw;const aM=()=>jw||(jw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Oo(e){if(Vt(e)){const t={};for(let n=0;n{if(n){const r=n.split(px);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function st(e){let t="";if(Fr(e))t=e;else if(Vt(e))for(let n=0;nXc(n,t))}const Ee=e=>Fr(e)?e:e==null?"":Vt(e)||ur(e)&&(e.toString===tL||!hn(e.toString))?JSON.stringify(e,oL,2):String(e),oL=(e,t)=>t&&t.__v_isRef?oL(e,t.value):rf(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o])=>(n[`${r} =>`]=o,n),{})}:Ff(t)?{[`Set(${t.size})`]:[...t.values()]}:ur(t)&&!Vt(t)&&!nL(t)?String(t):t;let ts;class _x{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ts,!t&&ts&&(this.index=(ts.scopes||(ts.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=ts;try{return ts=this,t()}finally{ts=n}}}on(){ts=this}off(){ts=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},sL=e=>(e.w&mu)>0,aL=e=>(e.n&mu)>0,Mx=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{(g==="length"||g>=d)&&u.push(f)})}else switch(n!==void 0&&u.push(s.get(n)),t){case"add":Vt(e)?JI(n)&&u.push(s.get("length")):(u.push(s.get(Pc)),rf(e)&&u.push(s.get(uM)));break;case"delete":Vt(e)||(u.push(s.get(Pc)),rf(e)&&u.push(s.get(uM)));break;case"set":rf(e)&&u.push(s.get(Pc));break}if(u.length===1)u[0]&&cM(u[0]);else{const d=[];for(const f of u)f&&d.push(...f);cM(QI(d))}}function cM(e,t){const n=Vt(e)?e:[...e];for(const r of n)r.computed&&Kw(r);for(const r of n)r.computed||Kw(r)}function Kw(e,t){(e!==Bs||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function Cx(e,t){var n;return(n=Cv.get(e))==null?void 0:n.get(t)}const Tx=WI("__proto__,__v_isRef,__isVue"),cL=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Rh)),Sx=tC(),kx=tC(!1,!0),Dx=tC(!0),Yw=Ex();function Ex(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=Hn(this);for(let i=0,s=this.length;i{e[t]=function(...n){Gf();const r=Hn(this)[t].apply(this,n);return $f(),r}}),e}function Ax(e){const t=Hn(this);return Wi(t,"has",e),t.hasOwnProperty(e)}function tC(e=!1,t=!1){return function(r,o,i){if(o==="__v_isReactive")return!e;if(o==="__v_isReadonly")return e;if(o==="__v_isShallow")return t;if(o==="__v_raw"&&i===(e?t?jx:gL:t?hL:pL).get(r))return r;const s=Vt(r);if(!e){if(s&&jn(Yw,o))return Reflect.get(Yw,o,i);if(o==="hasOwnProperty")return Ax}const u=Reflect.get(r,o,i);return(Rh(o)?cL.has(o):Tx(o))||(e||Wi(r,"get",o),t)?u:gr(u)?s&&JI(o)?u:u.value:ur(u)?e?Ph(u):zt(u):u}}const Lx=dL(),Ox=dL(!0);function dL(e=!1){return function(n,r,o,i){let s=n[r];if(Mf(s)&&gr(s)&&!gr(o))return!1;if(!e&&(!Tv(o)&&!Mf(o)&&(s=Hn(s),o=Hn(o)),!Vt(n)&&gr(s)&&!gr(o)))return s.value=o,!0;const u=Vt(n)&&JI(r)?Number(r)e,ky=e=>Reflect.getPrototypeOf(e);function cm(e,t,n=!1,r=!1){e=e.__v_raw;const o=Hn(e),i=Hn(t);n||(t!==i&&Wi(o,"get",t),Wi(o,"get",i));const{has:s}=ky(o),u=r?nC:n?sC:xh;if(s.call(o,t))return u(e.get(t));if(s.call(o,i))return u(e.get(i));e!==o&&e.get(t)}function dm(e,t=!1){const n=this.__v_raw,r=Hn(n),o=Hn(e);return t||(e!==o&&Wi(r,"has",e),Wi(r,"has",o)),e===o?n.has(e):n.has(e)||n.has(o)}function fm(e,t=!1){return e=e.__v_raw,!t&&Wi(Hn(e),"iterate",Pc),Reflect.get(e,"size",e)}function Jw(e){e=Hn(e);const t=Hn(this);return ky(t).has.call(t,e)||(t.add(e),dl(t,"add",e,e)),this}function Xw(e,t){t=Hn(t);const n=Hn(this),{has:r,get:o}=ky(n);let i=r.call(n,e);i||(e=Hn(e),i=r.call(n,e));const s=o.call(n,e);return n.set(e,t),i?Nh(t,s)&&dl(n,"set",e,t):dl(n,"add",e,t),this}function Zw(e){const t=Hn(this),{has:n,get:r}=ky(t);let o=n.call(t,e);o||(e=Hn(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&dl(t,"delete",e,void 0),i}function Qw(){const e=Hn(this),t=e.size!==0,n=e.clear();return t&&dl(e,"clear",void 0,void 0),n}function pm(e,t){return function(r,o){const i=this,s=i.__v_raw,u=Hn(s),d=t?nC:e?sC:xh;return!e&&Wi(u,"iterate",Pc),s.forEach((f,g)=>r.call(o,d(f),d(g),i))}}function hm(e,t,n){return function(...r){const o=this.__v_raw,i=Hn(o),s=rf(i),u=e==="entries"||e===Symbol.iterator&&s,d=e==="keys"&&s,f=o[e](...r),g=n?nC:t?sC:xh;return!t&&Wi(i,"iterate",d?uM:Pc),{next(){const{value:v,done:_}=f.next();return _?{value:v,done:_}:{value:u?[g(v[0]),g(v[1])]:g(v),done:_}},[Symbol.iterator](){return this}}}}function kl(e){return function(...t){return e==="delete"?!1:this}}function Fx(){const e={get(i){return cm(this,i)},get size(){return fm(this)},has:dm,add:Jw,set:Xw,delete:Zw,clear:Qw,forEach:pm(!1,!1)},t={get(i){return cm(this,i,!1,!0)},get size(){return fm(this)},has:dm,add:Jw,set:Xw,delete:Zw,clear:Qw,forEach:pm(!1,!0)},n={get(i){return cm(this,i,!0)},get size(){return fm(this,!0)},has(i){return dm.call(this,i,!0)},add:kl("add"),set:kl("set"),delete:kl("delete"),clear:kl("clear"),forEach:pm(!0,!1)},r={get(i){return cm(this,i,!0,!0)},get size(){return fm(this,!0)},has(i){return dm.call(this,i,!0)},add:kl("add"),set:kl("set"),delete:kl("delete"),clear:kl("clear"),forEach:pm(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=hm(i,!1,!1),n[i]=hm(i,!0,!1),t[i]=hm(i,!1,!0),r[i]=hm(i,!0,!0)}),[e,n,t,r]}const[Gx,$x,Bx,Hx]=Fx();function rC(e,t){const n=t?e?Hx:Bx:e?$x:Gx;return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(jn(n,o)&&o in r?n:r,o,i)}const qx={get:rC(!1,!1)},Vx={get:rC(!1,!0)},zx={get:rC(!0,!1)},pL=new WeakMap,hL=new WeakMap,gL=new WeakMap,jx=new WeakMap;function Wx(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Kx(e){return e.__v_skip||!Object.isExtensible(e)?0:Wx(lx(e))}function zt(e){return Mf(e)?e:oC(e,!1,fL,qx,pL)}function Yx(e){return oC(e,!1,Ux,Vx,hL)}function Ph(e){return oC(e,!0,xx,zx,gL)}function oC(e,t,n,r,o){if(!ur(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=Kx(e);if(s===0)return e;const u=new Proxy(e,s===2?r:n);return o.set(e,u),u}function of(e){return Mf(e)?of(e.__v_raw):!!(e&&e.__v_isReactive)}function Mf(e){return!!(e&&e.__v_isReadonly)}function Tv(e){return!!(e&&e.__v_isShallow)}function mL(e){return of(e)||Mf(e)}function Hn(e){const t=e&&e.__v_raw;return t?Hn(t):e}function iC(e){return Mv(e,"__v_skip",!0),e}const xh=e=>ur(e)?zt(e):e,sC=e=>ur(e)?Ph(e):e;function aC(e){iu&&Bs&&(e=Hn(e),uL(e.dep||(e.dep=QI())))}function lC(e,t){e=Hn(e);const n=e.dep;n&&cM(n)}function gr(e){return!!(e&&e.__v_isRef===!0)}function Ne(e){return yL(e,!1)}function vL(e){return yL(e,!0)}function yL(e,t){return gr(e)?e:new Jx(e,t)}class Jx{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:Hn(t),this._value=n?t:xh(t)}get value(){return aC(this),this._value}set value(t){const n=this.__v_isShallow||Tv(t)||Mf(t);t=n?t:Hn(t),Nh(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:xh(t),lC(this))}}function Oe(e){return gr(e)?e.value:e}const Xx={get:(e,t,n)=>Oe(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return gr(o)&&!gr(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function _L(e){return of(e)?e:new Proxy(e,Xx)}class Zx{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=t(()=>aC(this),()=>lC(this));this._get=n,this._set=r}get value(){return this._get()}set value(t){this._set(t)}}function Qx(e){return new Zx(e)}function Jt(e){const t=Vt(e)?new Array(e.length):{};for(const n in e)t[n]=bL(e,n);return t}class eU{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Cx(Hn(this._object),this._key)}}class tU{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function cr(e,t,n){return gr(e)?e:hn(e)?new tU(e):ur(e)&&arguments.length>1?bL(e,t,n):Ne(e)}function bL(e,t,n){const r=e[t];return gr(r)?r:new eU(e,t,n)}class nU{constructor(t,n,r,o){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new eC(t,()=>{this._dirty||(this._dirty=!0,lC(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=r}get value(){const t=Hn(this);return aC(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function rU(e,t,n=!1){let r,o;const i=hn(e);return i?(r=e,o=Vs):(r=e.get,o=e.set),new nU(r,o,i||!o,n)}function su(e,t,n,r){let o;try{o=r?e(...r):e()}catch(i){Dy(i,t,n)}return o}function ws(e,t,n,r){if(hn(e)){const i=su(e,t,n,r);return i&&eL(i)&&i.catch(s=>{Dy(s,t,n)}),i}const o=[];for(let i=0;i>>1;Fh(di[r])fa&&di.splice(t,1)}function aU(e){Vt(e)?sf.push(...e):(!ja||!ja.includes(e,e.allowRecurse?rc+1:rc))&&sf.push(e),IL()}function eS(e,t=Uh?fa+1:0){for(;tFh(n)-Fh(r)),rc=0;rce.id==null?1/0:e.id,lU=(e,t)=>{const n=Fh(e)-Fh(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function TL(e){dM=!1,Uh=!0,di.sort(lU);const t=Vs;try{for(fa=0;faFr(M)?M.trim():M)),v&&(o=n.map(Iv))}let u,d=r[u=y1(t)]||r[u=y1(Ca(t))];!d&&i&&(d=r[u=y1(id(t))]),d&&ws(d,e,6,o);const f=r[u+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,ws(f,e,6,o)}}function wL(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const i=e.emits;let s={},u=!1;if(!hn(e)){const d=f=>{const g=wL(f,t,!0);g&&(u=!0,to(s,g))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!i&&!u?(ur(e)&&r.set(e,null),null):(Vt(i)?i.forEach(d=>s[d]=null):to(s,i),ur(e)&&r.set(e,s),s)}function Ey(e,t){return!e||!Ty(t)?!1:(t=t.slice(2).replace(/Once$/,""),jn(e,t[0].toLowerCase()+t.slice(1))||jn(e,id(t))||jn(e,t))}let Yo=null,Ay=null;function wv(e){const t=Yo;return Yo=e,Ay=e&&e.type.__scopeId||null,t}function Mr(e){Ay=e}function Ir(){Ay=null}function xt(e,t=Yo,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&pS(-1);const i=wv(t);let s;try{s=e(...o)}finally{wv(i),r._d&&pS(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function _1(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:i,propsOptions:[s],slots:u,attrs:d,emit:f,render:g,renderCache:v,data:_,setupState:M,ctx:C,inheritAttrs:D}=e;let w,S;const N=wv(e);try{if(n.shapeFlag&4){const L=o||r;w=ua(g.call(L,L,v,i,M,_,C)),S=d}else{const L=t;w=ua(L.length>1?L(i,{attrs:d,slots:u,emit:f}):L(i,null)),S=t.props?d:cU(d)}}catch(L){ih.length=0,Dy(L,e,1),w=St(Si)}let A=w;if(S&&D!==!1){const L=Object.keys(S),{shapeFlag:j}=A;L.length&&j&7&&(s&&L.some(KI)&&(S=dU(S,s)),A=Ta(A,S))}return n.dirs&&(A=Ta(A),A.dirs=A.dirs?A.dirs.concat(n.dirs):n.dirs),n.transition&&(A.transition=n.transition),w=A,wv(N),w}const cU=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ty(n))&&((t||(t={}))[n]=e[n]);return t},dU=(e,t)=>{const n={};for(const r in e)(!KI(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function fU(e,t,n){const{props:r,children:o,component:i}=e,{props:s,children:u,patchFlag:d}=t,f=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return r?tS(r,s,f):!!s;if(d&8){const g=t.dynamicProps;for(let v=0;ve.__isSuspense;function gU(e,t){t&&t.pendingBranch?Vt(e)?t.effects.push(...e):t.effects.push(e):aU(e)}function nn(e,t){return dC(e,null,t)}const gm={};function $t(e,t,n){return dC(e,t,n)}function dC(e,t,{immediate:n,deep:r,flush:o,onTrack:i,onTrigger:s}=yr){var u;const d=ZI()===((u=Ao)==null?void 0:u.scope)?Ao:null;let f,g=!1,v=!1;if(gr(e)?(f=()=>e.value,g=Tv(e)):of(e)?(f=()=>e,r=!0):Vt(e)?(v=!0,g=e.some(L=>of(L)||Tv(L)),f=()=>e.map(L=>{if(gr(L))return L.value;if(of(L))return fc(L);if(hn(L))return su(L,d,2)})):hn(e)?t?f=()=>su(e,d,2):f=()=>{if(!(d&&d.isUnmounted))return _&&_(),ws(e,d,3,[M])}:f=Vs,t&&r){const L=f;f=()=>fc(L())}let _,M=L=>{_=N.onStop=()=>{su(L,d,4)}},C;if(qh)if(M=Vs,t?n&&ws(t,d,3,[f(),v?[]:void 0,M]):f(),o==="sync"){const L=r7();C=L.__watcherHandles||(L.__watcherHandles=[])}else return Vs;let D=v?new Array(e.length).fill(gm):gm;const w=()=>{if(N.active)if(t){const L=N.run();(r||g||(v?L.some((j,V)=>Nh(j,D[V])):Nh(L,D)))&&(_&&_(),ws(t,d,3,[L,D===gm?void 0:v&&D[0]===gm?[]:D,M]),D=L)}else N.run()};w.allowRecurse=!!t;let S;o==="sync"?S=w:o==="post"?S=()=>$i(w,d&&d.suspense):(w.pre=!0,d&&(w.id=d.uid),S=()=>cC(w));const N=new eC(f,S);t?n?w():D=N.run():o==="post"?$i(N.run.bind(N),d&&d.suspense):N.run();const A=()=>{N.stop(),d&&d.scope&&YI(d.scope.effects,N)};return C&&C.push(A),A}function mU(e,t,n){const r=this.proxy,o=Fr(e)?e.includes(".")?SL(r,e):()=>r[e]:e.bind(r,r);let i;hn(t)?i=t:(i=t.handler,n=t);const s=Ao;If(this);const u=dC(o,i.bind(r),n);return s?If(s):xc(),u}function SL(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o{fc(n,t)});else if(nL(e))for(const n in e)fc(e[n],t);return e}function $n(e,t){const n=Yo;if(n===null)return e;const r=Ny(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let i=0;i{e.isMounted=!0}),gi(()=>{e.isUnmounting=!0}),e}const gs=[Function,Array],DL={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:gs,onEnter:gs,onAfterEnter:gs,onEnterCancelled:gs,onBeforeLeave:gs,onLeave:gs,onAfterLeave:gs,onLeaveCancelled:gs,onBeforeAppear:gs,onAppear:gs,onAfterAppear:gs,onAppearCancelled:gs},vU={name:"BaseTransition",props:DL,setup(e,{slots:t}){const n=Ki(),r=kL();let o;return()=>{const i=t.default&&fC(t.default(),!0);if(!i||!i.length)return;let s=i[0];if(i.length>1){for(const D of i)if(D.type!==Si){s=D;break}}const u=Hn(e),{mode:d}=u;if(r.isLeaving)return b1(s);const f=nS(s);if(!f)return b1(s);const g=Gh(f,u,r,n);$h(f,g);const v=n.subTree,_=v&&nS(v);let M=!1;const{getTransitionKey:C}=f.type;if(C){const D=C();o===void 0?o=D:D!==o&&(o=D,M=!0)}if(_&&_.type!==Si&&(!oc(f,_)||M)){const D=Gh(_,u,r,n);if($h(_,D),d==="out-in")return r.isLeaving=!0,D.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&n.update()},b1(s);d==="in-out"&&f.type!==Si&&(D.delayLeave=(w,S,N)=>{const A=EL(r,_);A[String(_.key)]=_,w._leaveCb=()=>{S(),w._leaveCb=void 0,delete g.delayedLeave},g.delayedLeave=N})}return s}}},yU=vU;function EL(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Gh(e,t,n,r){const{appear:o,mode:i,persisted:s=!1,onBeforeEnter:u,onEnter:d,onAfterEnter:f,onEnterCancelled:g,onBeforeLeave:v,onLeave:_,onAfterLeave:M,onLeaveCancelled:C,onBeforeAppear:D,onAppear:w,onAfterAppear:S,onAppearCancelled:N}=t,A=String(e.key),L=EL(n,e),j=($,z)=>{$&&ws($,r,9,z)},V=($,z)=>{const G=z[1];j($,z),Vt($)?$.every(O=>O.length<=1)&&G():$.length<=1&&G()},x={mode:i,persisted:s,beforeEnter($){let z=u;if(!n.isMounted)if(o)z=D||u;else return;$._leaveCb&&$._leaveCb(!0);const G=L[A];G&&oc(e,G)&&G.el._leaveCb&&G.el._leaveCb(),j(z,[$])},enter($){let z=d,G=f,O=g;if(!n.isMounted)if(o)z=w||d,G=S||f,O=N||g;else return;let T=!1;const P=$._enterCb=Z=>{T||(T=!0,Z?j(O,[$]):j(G,[$]),x.delayedLeave&&x.delayedLeave(),$._enterCb=void 0)};z?V(z,[$,P]):P()},leave($,z){const G=String(e.key);if($._enterCb&&$._enterCb(!0),n.isUnmounting)return z();j(v,[$]);let O=!1;const T=$._leaveCb=P=>{O||(O=!0,z(),P?j(C,[$]):j(M,[$]),$._leaveCb=void 0,L[G]===e&&delete L[G])};L[G]=e,_?V(_,[$,T]):T()},clone($){return Gh($,t,n,r)}};return x}function b1(e){if(Ly(e))return e=Ta(e),e.children=null,e}function nS(e){return Ly(e)?e.children?e.children[0]:void 0:e}function $h(e,t){e.shapeFlag&6&&e.component?$h(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function fC(e,t=!1,n){let r=[],o=0;for(let i=0;i1)for(let i=0;ito({name:e.name},t,{setup:e}))():e}const nh=e=>!!e.type.__asyncLoader,Ly=e=>e.type.__isKeepAlive;function AL(e,t){OL(e,"a",t)}function LL(e,t){OL(e,"da",t)}function OL(e,t,n=Ao){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Oy(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Ly(o.parent.vnode)&&_U(r,t,n,o),o=o.parent}}function _U(e,t,n,r){const o=Oy(t,e,r,!0);pl(()=>{YI(r[t],o)},n)}function Oy(e,t,n=Ao,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{if(n.isUnmounted)return;Gf(),If(n);const u=ws(t,n,e,s);return xc(),$f(),u});return r?o.unshift(i):o.push(i),i}}const fl=e=>(t,n=Ao)=>(!qh||e==="sp")&&Oy(e,(...r)=>t(...r),n),Bf=fl("bm"),On=fl("m"),RL=fl("bu"),NL=fl("u"),gi=fl("bum"),pl=fl("um"),bU=fl("sp"),MU=fl("rtg"),IU=fl("rtc");function CU(e,t=Ao){Oy("ec",e,t)}const pC="components",TU="directives";function Yt(e,t){return hC(pC,e,!0,t)||e}const PL=Symbol.for("v-ndc");function af(e){return Fr(e)?hC(pC,e,!1)||e:e||PL}function wU(e){return hC(TU,e)}function hC(e,t,n=!0,r=!1){const o=Yo||Ao;if(o){const i=o.type;if(e===pC){const u=e7(i,!1);if(u&&(u===t||u===Ca(t)||u===Sy(Ca(t))))return i}const s=rS(o[e]||i[e],t)||rS(o.appContext[e],t);return!s&&r?i:s}}function rS(e,t){return e&&(e[t]||e[Ca(t)]||e[Sy(Ca(t))])}function qt(e,t,n,r){let o;const i=n&&n[r];if(Vt(e)||Fr(e)){o=new Array(e.length);for(let s=0,u=e.length;st(s,u,void 0,i&&i[u]));else{const s=Object.keys(e);o=new Array(s.length);for(let u=0,d=s.length;u{const i=r.fn(...o);return i&&(i.key=r.key),i}:r.fn)}return e}function Ft(e,t,n={},r,o){if(Yo.isCE||Yo.parent&&nh(Yo.parent)&&Yo.parent.isCE)return t!=="default"&&(n.name=t),St("slot",n,r&&r());let i=e[t];i&&i._c&&(i._d=!1),X();const s=i&&xL(i(n)),u=It(dt,{key:n.key||s&&s.key||`_${t}`},s||(r?r():[]),s&&e._===1?64:-2);return!o&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),i&&i._c&&(i._d=!0),u}function xL(e){return e.some(t=>Hh(t)?!(t.type===Si||t.type===dt&&!xL(t.children)):!0)?e:null}const fM=e=>e?WL(e)?Ny(e)||e.proxy:fM(e.parent):null,rh=to(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>fM(e.parent),$root:e=>fM(e.root),$emit:e=>e.emit,$options:e=>gC(e),$forceUpdate:e=>e.f||(e.f=()=>cC(e.update)),$nextTick:e=>e.n||(e.n=br.bind(e.proxy)),$watch:e=>mU.bind(e)}),M1=(e,t)=>e!==yr&&!e.__isScriptSetup&&jn(e,t),SU={get({_:e},t){const{ctx:n,setupState:r,data:o,props:i,accessCache:s,type:u,appContext:d}=e;let f;if(t[0]!=="$"){const M=s[t];if(M!==void 0)switch(M){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(M1(r,t))return s[t]=1,r[t];if(o!==yr&&jn(o,t))return s[t]=2,o[t];if((f=e.propsOptions[0])&&jn(f,t))return s[t]=3,i[t];if(n!==yr&&jn(n,t))return s[t]=4,n[t];pM&&(s[t]=0)}}const g=rh[t];let v,_;if(g)return t==="$attrs"&&Wi(e,"get",t),g(e);if((v=u.__cssModules)&&(v=v[t]))return v;if(n!==yr&&jn(n,t))return s[t]=4,n[t];if(_=d.config.globalProperties,jn(_,t))return _[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return M1(o,t)?(o[t]=n,!0):r!==yr&&jn(r,t)?(r[t]=n,!0):jn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:i}},s){let u;return!!n[s]||e!==yr&&jn(e,s)||M1(t,s)||(u=i[0])&&jn(u,s)||jn(r,s)||jn(rh,s)||jn(o.config.globalProperties,s)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:jn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function pg(){return kU().slots}function kU(){const e=Ki();return e.setupContext||(e.setupContext=YL(e))}function oS(e){return Vt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let pM=!0;function DU(e){const t=gC(e),n=e.proxy,r=e.ctx;pM=!1,t.beforeCreate&&iS(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:s,watch:u,provide:d,inject:f,created:g,beforeMount:v,mounted:_,beforeUpdate:M,updated:C,activated:D,deactivated:w,beforeDestroy:S,beforeUnmount:N,destroyed:A,unmounted:L,render:j,renderTracked:V,renderTriggered:x,errorCaptured:$,serverPrefetch:z,expose:G,inheritAttrs:O,components:T,directives:P,filters:Z}=t;if(f&&EU(f,r,null),s)for(const J in s){const ie=s[J];hn(ie)&&(r[J]=ie.bind(n))}if(o){const J=o.call(n,n);ur(J)&&(e.data=zt(J))}if(pM=!0,i)for(const J in i){const ie=i[J],pe=hn(ie)?ie.bind(n,n):hn(ie.get)?ie.get.bind(n,n):Vs,ue=!hn(ie)&&hn(ie.set)?ie.set.bind(n):Vs,de=Ve({get:pe,set:ue});Object.defineProperty(r,J,{enumerable:!0,configurable:!0,get:()=>de.value,set:Y=>de.value=Y})}if(u)for(const J in u)UL(u[J],r,n,J);if(d){const J=hn(d)?d.call(n):d;Reflect.ownKeys(J).forEach(ie=>{ui(ie,J[ie])})}g&&iS(g,e,"c");function oe(J,ie){Vt(ie)?ie.forEach(pe=>J(pe.bind(n))):ie&&J(ie.bind(n))}if(oe(Bf,v),oe(On,_),oe(RL,M),oe(NL,C),oe(AL,D),oe(LL,w),oe(CU,$),oe(IU,V),oe(MU,x),oe(gi,N),oe(pl,L),oe(bU,z),Vt(G))if(G.length){const J=e.exposed||(e.exposed={});G.forEach(ie=>{Object.defineProperty(J,ie,{get:()=>n[ie],set:pe=>n[ie]=pe})})}else e.exposed||(e.exposed={});j&&e.render===Vs&&(e.render=j),O!=null&&(e.inheritAttrs=O),T&&(e.components=T),P&&(e.directives=P)}function EU(e,t,n=Vs){Vt(e)&&(e=hM(e));for(const r in e){const o=e[r];let i;ur(o)?"default"in o?i=tn(o.from||r,o.default,!0):i=tn(o.from||r):i=tn(o),gr(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):t[r]=i}}function iS(e,t,n){ws(Vt(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function UL(e,t,n,r){const o=r.includes(".")?SL(n,r):()=>n[r];if(Fr(e)){const i=t[e];hn(i)&&$t(o,i)}else if(hn(e))$t(o,e.bind(n));else if(ur(e))if(Vt(e))e.forEach(i=>UL(i,t,n,r));else{const i=hn(e.handler)?e.handler.bind(n):t[e.handler];hn(i)&&$t(o,i,e)}}function gC(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,u=i.get(t);let d;return u?d=u:!o.length&&!n&&!r?d=t:(d={},o.length&&o.forEach(f=>Sv(d,f,s,!0)),Sv(d,t,s)),ur(t)&&i.set(t,d),d}function Sv(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Sv(e,i,n,!0),o&&o.forEach(s=>Sv(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const u=AU[s]||n&&n[s];e[s]=u?u(e[s],t[s]):t[s]}return e}const AU={data:sS,props:aS,emits:aS,methods:Wp,computed:Wp,beforeCreate:Mi,created:Mi,beforeMount:Mi,mounted:Mi,beforeUpdate:Mi,updated:Mi,beforeDestroy:Mi,beforeUnmount:Mi,destroyed:Mi,unmounted:Mi,activated:Mi,deactivated:Mi,errorCaptured:Mi,serverPrefetch:Mi,components:Wp,directives:Wp,watch:OU,provide:sS,inject:LU};function sS(e,t){return t?e?function(){return to(hn(e)?e.call(this,this):e,hn(t)?t.call(this,this):t)}:t:e}function LU(e,t){return Wp(hM(e),hM(t))}function hM(e){if(Vt(e)){const t={};for(let n=0;n1)return n&&hn(t)?t.call(r&&r.proxy):t}}function PU(e,t,n,r=!1){const o={},i={};Mv(i,Ry,1),e.propsDefaults=Object.create(null),GL(e,t,o,i);for(const s in e.propsOptions[0])s in o||(o[s]=void 0);n?e.props=r?o:Yx(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function xU(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:s}}=e,u=Hn(o),[d]=e.propsOptions;let f=!1;if((r||s>0)&&!(s&16)){if(s&8){const g=e.vnode.dynamicProps;for(let v=0;v{d=!0;const[_,M]=$L(v,t,!0);to(s,_),M&&u.push(...M)};!n&&t.mixins.length&&t.mixins.forEach(g),e.extends&&g(e.extends),e.mixins&&e.mixins.forEach(g)}if(!i&&!d)return ur(e)&&r.set(e,nf),nf;if(Vt(i))for(let g=0;g-1,M[1]=D<0||C-1||jn(M,"default"))&&u.push(v)}}}const f=[s,u];return ur(e)&&r.set(e,f),f}function lS(e){return e[0]!=="$"}function uS(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function cS(e,t){return uS(e)===uS(t)}function dS(e,t){return Vt(t)?t.findIndex(n=>cS(n,e)):hn(t)&&cS(t,e)?0:-1}const BL=e=>e[0]==="_"||e==="$stable",mC=e=>Vt(e)?e.map(ua):[ua(e)],UU=(e,t,n)=>{if(t._n)return t;const r=xt((...o)=>mC(t(...o)),n);return r._c=!1,r},HL=(e,t,n)=>{const r=e._ctx;for(const o in e){if(BL(o))continue;const i=e[o];if(hn(i))t[o]=UU(o,i,r);else if(i!=null){const s=mC(i);t[o]=()=>s}}},qL=(e,t)=>{const n=mC(t);e.slots.default=()=>n},FU=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=Hn(t),Mv(t,"_",n)):HL(t,e.slots={})}else e.slots={},t&&qL(e,t);Mv(e.slots,Ry,1)},GU=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,s=yr;if(r.shapeFlag&32){const u=t._;u?n&&u===1?i=!1:(to(o,t),!n&&u===1&&delete o._):(i=!t.$stable,HL(t,o)),s=t}else t&&(qL(e,t),s={default:1});if(i)for(const u in o)!BL(u)&&!(u in s)&&delete o[u]};function mM(e,t,n,r,o=!1){if(Vt(e)){e.forEach((_,M)=>mM(_,t&&(Vt(t)?t[M]:t),n,r,o));return}if(nh(r)&&!o)return;const i=r.shapeFlag&4?Ny(r.component)||r.component.proxy:r.el,s=o?null:i,{i:u,r:d}=e,f=t&&t.r,g=u.refs===yr?u.refs={}:u.refs,v=u.setupState;if(f!=null&&f!==d&&(Fr(f)?(g[f]=null,jn(v,f)&&(v[f]=null)):gr(f)&&(f.value=null)),hn(d))su(d,u,12,[s,g]);else{const _=Fr(d),M=gr(d);if(_||M){const C=()=>{if(e.f){const D=_?jn(v,d)?v[d]:g[d]:d.value;o?Vt(D)&&YI(D,i):Vt(D)?D.includes(i)||D.push(i):_?(g[d]=[i],jn(v,d)&&(v[d]=g[d])):(d.value=[i],e.k&&(g[e.k]=d.value))}else _?(g[d]=s,jn(v,d)&&(v[d]=s)):M&&(d.value=s,e.k&&(g[e.k]=s))};s?(C.id=-1,$i(C,n)):C()}}}const $i=gU;function $U(e){return BU(e)}function BU(e,t){const n=aM();n.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:s,createText:u,createComment:d,setText:f,setElementText:g,parentNode:v,nextSibling:_,setScopeId:M=Vs,insertStaticContent:C}=e,D=(W,te,se,Te=null,ce=null,Se=null,Pe=!1,xe=null,He=!!te.dynamicChildren)=>{if(W===te)return;W&&!oc(W,te)&&(Te=le(W),Y(W,ce,Se,!0),W=null),te.patchFlag===-2&&(He=!1,te.dynamicChildren=null);const{type:Ie,ref:q,shapeFlag:ne}=te;switch(Ie){case Hf:w(W,te,se,Te);break;case Si:S(W,te,se,Te);break;case I1:W==null&&N(te,se,Te,Pe);break;case dt:T(W,te,se,Te,ce,Se,Pe,xe,He);break;default:ne&1?j(W,te,se,Te,ce,Se,Pe,xe,He):ne&6?P(W,te,se,Te,ce,Se,Pe,xe,He):(ne&64||ne&128)&&Ie.process(W,te,se,Te,ce,Se,Pe,xe,He,ve)}q!=null&&ce&&mM(q,W&&W.ref,Se,te||W,!te)},w=(W,te,se,Te)=>{if(W==null)r(te.el=u(te.children),se,Te);else{const ce=te.el=W.el;te.children!==W.children&&f(ce,te.children)}},S=(W,te,se,Te)=>{W==null?r(te.el=d(te.children||""),se,Te):te.el=W.el},N=(W,te,se,Te)=>{[W.el,W.anchor]=C(W.children,te,se,Te,W.el,W.anchor)},A=({el:W,anchor:te},se,Te)=>{let ce;for(;W&&W!==te;)ce=_(W),r(W,se,Te),W=ce;r(te,se,Te)},L=({el:W,anchor:te})=>{let se;for(;W&&W!==te;)se=_(W),o(W),W=se;o(te)},j=(W,te,se,Te,ce,Se,Pe,xe,He)=>{Pe=Pe||te.type==="svg",W==null?V(te,se,Te,ce,Se,Pe,xe,He):z(W,te,ce,Se,Pe,xe,He)},V=(W,te,se,Te,ce,Se,Pe,xe)=>{let He,Ie;const{type:q,props:ne,shapeFlag:_e,transition:Be,dirs:je}=W;if(He=W.el=s(W.type,Se,ne&&ne.is,ne),_e&8?g(He,W.children):_e&16&&$(W.children,He,null,Te,ce,Se&&q!=="foreignObject",Pe,xe),je&&Wu(W,null,Te,"created"),x(He,W,W.scopeId,Pe,Te),ne){for(const Fe in ne)Fe!=="value"&&!Xm(Fe)&&i(He,Fe,null,ne[Fe],Se,W.children,Te,ce,ye);"value"in ne&&i(He,"value",null,ne.value),(Ie=ne.onVnodeBeforeMount)&&ra(Ie,Te,W)}je&&Wu(W,null,Te,"beforeMount");const lt=(!ce||ce&&!ce.pendingBranch)&&Be&&!Be.persisted;lt&&Be.beforeEnter(He),r(He,te,se),((Ie=ne&&ne.onVnodeMounted)||lt||je)&&$i(()=>{Ie&&ra(Ie,Te,W),lt&&Be.enter(He),je&&Wu(W,null,Te,"mounted")},ce)},x=(W,te,se,Te,ce)=>{if(se&&M(W,se),Te)for(let Se=0;Se{for(let Ie=He;Ie{const xe=te.el=W.el;let{patchFlag:He,dynamicChildren:Ie,dirs:q}=te;He|=W.patchFlag&16;const ne=W.props||yr,_e=te.props||yr;let Be;se&&Ku(se,!1),(Be=_e.onVnodeBeforeUpdate)&&ra(Be,se,te,W),q&&Wu(te,W,se,"beforeUpdate"),se&&Ku(se,!0);const je=ce&&te.type!=="foreignObject";if(Ie?G(W.dynamicChildren,Ie,xe,se,Te,je,Se):Pe||ie(W,te,xe,null,se,Te,je,Se,!1),He>0){if(He&16)O(xe,te,ne,_e,se,Te,ce);else if(He&2&&ne.class!==_e.class&&i(xe,"class",null,_e.class,ce),He&4&&i(xe,"style",ne.style,_e.style,ce),He&8){const lt=te.dynamicProps;for(let Fe=0;Fe{Be&&ra(Be,se,te,W),q&&Wu(te,W,se,"updated")},Te)},G=(W,te,se,Te,ce,Se,Pe)=>{for(let xe=0;xe{if(se!==Te){if(se!==yr)for(const xe in se)!Xm(xe)&&!(xe in Te)&&i(W,xe,se[xe],null,Pe,te.children,ce,Se,ye);for(const xe in Te){if(Xm(xe))continue;const He=Te[xe],Ie=se[xe];He!==Ie&&xe!=="value"&&i(W,xe,Ie,He,Pe,te.children,ce,Se,ye)}"value"in Te&&i(W,"value",se.value,Te.value)}},T=(W,te,se,Te,ce,Se,Pe,xe,He)=>{const Ie=te.el=W?W.el:u(""),q=te.anchor=W?W.anchor:u("");let{patchFlag:ne,dynamicChildren:_e,slotScopeIds:Be}=te;Be&&(xe=xe?xe.concat(Be):Be),W==null?(r(Ie,se,Te),r(q,se,Te),$(te.children,se,q,ce,Se,Pe,xe,He)):ne>0&&ne&64&&_e&&W.dynamicChildren?(G(W.dynamicChildren,_e,se,ce,Se,Pe,xe),(te.key!=null||ce&&te===ce.subTree)&&vC(W,te,!0)):ie(W,te,se,q,ce,Se,Pe,xe,He)},P=(W,te,se,Te,ce,Se,Pe,xe,He)=>{te.slotScopeIds=xe,W==null?te.shapeFlag&512?ce.ctx.activate(te,se,Te,Pe,He):Z(te,se,Te,ce,Se,Pe,He):K(W,te,He)},Z=(W,te,se,Te,ce,Se,Pe)=>{const xe=W.component=JU(W,Te,ce);if(Ly(W)&&(xe.ctx.renderer=ve),XU(xe),xe.asyncDep){if(ce&&ce.registerDep(xe,oe),!W.el){const He=xe.subTree=St(Si);S(null,He,te,se)}return}oe(xe,W,te,se,ce,Se,Pe)},K=(W,te,se)=>{const Te=te.component=W.component;if(fU(W,te,se))if(Te.asyncDep&&!Te.asyncResolved){J(Te,te,se);return}else Te.next=te,sU(Te.update),Te.update();else te.el=W.el,Te.vnode=te},oe=(W,te,se,Te,ce,Se,Pe)=>{const xe=()=>{if(W.isMounted){let{next:q,bu:ne,u:_e,parent:Be,vnode:je}=W,lt=q,Fe;Ku(W,!1),q?(q.el=je.el,J(W,q,Pe)):q=je,ne&&Zm(ne),(Fe=q.props&&q.props.onVnodeBeforeUpdate)&&ra(Fe,Be,q,je),Ku(W,!0);const it=_1(W),Tt=W.subTree;W.subTree=it,D(Tt,it,v(Tt.el),le(Tt),W,ce,Se),q.el=it.el,lt===null&&pU(W,it.el),_e&&$i(_e,ce),(Fe=q.props&&q.props.onVnodeUpdated)&&$i(()=>ra(Fe,Be,q,je),ce)}else{let q;const{el:ne,props:_e}=te,{bm:Be,m:je,parent:lt}=W,Fe=nh(te);if(Ku(W,!1),Be&&Zm(Be),!Fe&&(q=_e&&_e.onVnodeBeforeMount)&&ra(q,lt,te),Ku(W,!0),ne&&me){const it=()=>{W.subTree=_1(W),me(ne,W.subTree,W,ce,null)};Fe?te.type.__asyncLoader().then(()=>!W.isUnmounted&&it()):it()}else{const it=W.subTree=_1(W);D(null,it,se,Te,W,ce,Se),te.el=it.el}if(je&&$i(je,ce),!Fe&&(q=_e&&_e.onVnodeMounted)){const it=te;$i(()=>ra(q,lt,it),ce)}(te.shapeFlag&256||lt&&nh(lt.vnode)&<.vnode.shapeFlag&256)&&W.a&&$i(W.a,ce),W.isMounted=!0,te=se=Te=null}},He=W.effect=new eC(xe,()=>cC(Ie),W.scope),Ie=W.update=()=>He.run();Ie.id=W.uid,Ku(W,!0),Ie()},J=(W,te,se)=>{te.component=W;const Te=W.vnode.props;W.vnode=te,W.next=null,xU(W,te.props,Te,se),GU(W,te.children,se),Gf(),eS(),$f()},ie=(W,te,se,Te,ce,Se,Pe,xe,He=!1)=>{const Ie=W&&W.children,q=W?W.shapeFlag:0,ne=te.children,{patchFlag:_e,shapeFlag:Be}=te;if(_e>0){if(_e&128){ue(Ie,ne,se,Te,ce,Se,Pe,xe,He);return}else if(_e&256){pe(Ie,ne,se,Te,ce,Se,Pe,xe,He);return}}Be&8?(q&16&&ye(Ie,ce,Se),ne!==Ie&&g(se,ne)):q&16?Be&16?ue(Ie,ne,se,Te,ce,Se,Pe,xe,He):ye(Ie,ce,Se,!0):(q&8&&g(se,""),Be&16&&$(ne,se,Te,ce,Se,Pe,xe,He))},pe=(W,te,se,Te,ce,Se,Pe,xe,He)=>{W=W||nf,te=te||nf;const Ie=W.length,q=te.length,ne=Math.min(Ie,q);let _e;for(_e=0;_eq?ye(W,ce,Se,!0,!1,ne):$(te,se,Te,ce,Se,Pe,xe,He,ne)},ue=(W,te,se,Te,ce,Se,Pe,xe,He)=>{let Ie=0;const q=te.length;let ne=W.length-1,_e=q-1;for(;Ie<=ne&&Ie<=_e;){const Be=W[Ie],je=te[Ie]=He?Gl(te[Ie]):ua(te[Ie]);if(oc(Be,je))D(Be,je,se,null,ce,Se,Pe,xe,He);else break;Ie++}for(;Ie<=ne&&Ie<=_e;){const Be=W[ne],je=te[_e]=He?Gl(te[_e]):ua(te[_e]);if(oc(Be,je))D(Be,je,se,null,ce,Se,Pe,xe,He);else break;ne--,_e--}if(Ie>ne){if(Ie<=_e){const Be=_e+1,je=Be_e)for(;Ie<=ne;)Y(W[Ie],ce,Se,!0),Ie++;else{const Be=Ie,je=Ie,lt=new Map;for(Ie=je;Ie<=_e;Ie++){const vn=te[Ie]=He?Gl(te[Ie]):ua(te[Ie]);vn.key!=null&<.set(vn.key,Ie)}let Fe,it=0;const Tt=_e-je+1;let mn=!1,In=0;const Cn=new Array(Tt);for(Ie=0;Ie=Tt){Y(vn,ce,Se,!0);continue}let Qe;if(vn.key!=null)Qe=lt.get(vn.key);else for(Fe=je;Fe<=_e;Fe++)if(Cn[Fe-je]===0&&oc(vn,te[Fe])){Qe=Fe;break}Qe===void 0?Y(vn,ce,Se,!0):(Cn[Qe-je]=Ie+1,Qe>=In?In=Qe:mn=!0,D(vn,te[Qe],se,null,ce,Se,Pe,xe,He),it++)}const En=mn?HU(Cn):nf;for(Fe=En.length-1,Ie=Tt-1;Ie>=0;Ie--){const vn=je+Ie,Qe=te[vn],yt=vn+1{const{el:Se,type:Pe,transition:xe,children:He,shapeFlag:Ie}=W;if(Ie&6){de(W.component.subTree,te,se,Te);return}if(Ie&128){W.suspense.move(te,se,Te);return}if(Ie&64){Pe.move(W,te,se,ve);return}if(Pe===dt){r(Se,te,se);for(let ne=0;nexe.enter(Se),ce);else{const{leave:ne,delayLeave:_e,afterLeave:Be}=xe,je=()=>r(Se,te,se),lt=()=>{ne(Se,()=>{je(),Be&&Be()})};_e?_e(Se,je,lt):lt()}else r(Se,te,se)},Y=(W,te,se,Te=!1,ce=!1)=>{const{type:Se,props:Pe,ref:xe,children:He,dynamicChildren:Ie,shapeFlag:q,patchFlag:ne,dirs:_e}=W;if(xe!=null&&mM(xe,null,se,W,!0),q&256){te.ctx.deactivate(W);return}const Be=q&1&&_e,je=!nh(W);let lt;if(je&&(lt=Pe&&Pe.onVnodeBeforeUnmount)&&ra(lt,te,W),q&6)Ae(W.component,se,Te);else{if(q&128){W.suspense.unmount(se,Te);return}Be&&Wu(W,null,te,"beforeUnmount"),q&64?W.type.remove(W,te,se,ce,ve,Te):Ie&&(Se!==dt||ne>0&&ne&64)?ye(Ie,te,se,!1,!0):(Se===dt&&ne&384||!ce&&q&16)&&ye(He,te,se),Te&&re(W)}(je&&(lt=Pe&&Pe.onVnodeUnmounted)||Be)&&$i(()=>{lt&&ra(lt,te,W),Be&&Wu(W,null,te,"unmounted")},se)},re=W=>{const{type:te,el:se,anchor:Te,transition:ce}=W;if(te===dt){fe(se,Te);return}if(te===I1){L(W);return}const Se=()=>{o(se),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(W.shapeFlag&1&&ce&&!ce.persisted){const{leave:Pe,delayLeave:xe}=ce,He=()=>Pe(se,Se);xe?xe(W.el,Se,He):He()}else Se()},fe=(W,te)=>{let se;for(;W!==te;)se=_(W),o(W),W=se;o(te)},Ae=(W,te,se)=>{const{bum:Te,scope:ce,update:Se,subTree:Pe,um:xe}=W;Te&&Zm(Te),ce.stop(),Se&&(Se.active=!1,Y(Pe,W,te,se)),xe&&$i(xe,te),$i(()=>{W.isUnmounted=!0},te),te&&te.pendingBranch&&!te.isUnmounted&&W.asyncDep&&!W.asyncResolved&&W.suspenseId===te.pendingId&&(te.deps--,te.deps===0&&te.resolve())},ye=(W,te,se,Te=!1,ce=!1,Se=0)=>{for(let Pe=Se;PeW.shapeFlag&6?le(W.component.subTree):W.shapeFlag&128?W.suspense.next():_(W.anchor||W.el),Q=(W,te,se)=>{W==null?te._vnode&&Y(te._vnode,null,null,!0):D(te._vnode||null,W,te,null,null,null,se),eS(),CL(),te._vnode=W},ve={p:D,um:Y,m:de,r:re,mt:Z,mc:$,pc:ie,pbc:G,n:le,o:e};let Le,me;return t&&([Le,me]=t(ve)),{render:Q,hydrate:Le,createApp:NU(Q,Le)}}function Ku({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function vC(e,t,n=!1){const r=e.children,o=t.children;if(Vt(r)&&Vt(o))for(let i=0;i>1,e[n[u]]0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=t[s];return n}const qU=e=>e.__isTeleport,oh=e=>e&&(e.disabled||e.disabled===""),fS=e=>typeof SVGElement<"u"&&e instanceof SVGElement,vM=(e,t)=>{const n=e&&e.to;return Fr(n)?t?t(n):null:n},VU={__isTeleport:!0,process(e,t,n,r,o,i,s,u,d,f){const{mc:g,pc:v,pbc:_,o:{insert:M,querySelector:C,createText:D,createComment:w}}=f,S=oh(t.props);let{shapeFlag:N,children:A,dynamicChildren:L}=t;if(e==null){const j=t.el=D(""),V=t.anchor=D("");M(j,n,r),M(V,n,r);const x=t.target=vM(t.props,C),$=t.targetAnchor=D("");x&&(M($,x),s=s||fS(x));const z=(G,O)=>{N&16&&g(A,G,O,o,i,s,u,d)};S?z(n,V):x&&z(x,$)}else{t.el=e.el;const j=t.anchor=e.anchor,V=t.target=e.target,x=t.targetAnchor=e.targetAnchor,$=oh(e.props),z=$?n:V,G=$?j:x;if(s=s||fS(V),L?(_(e.dynamicChildren,L,z,o,i,s,u),vC(e,t,!0)):d||v(e,t,z,G,o,i,s,u,!1),S)$||mm(t,n,j,f,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const O=t.target=vM(t.props,C);O&&mm(t,O,null,f,0)}else $&&mm(t,V,x,f,1)}VL(t)},remove(e,t,n,r,{um:o,o:{remove:i}},s){const{shapeFlag:u,children:d,anchor:f,targetAnchor:g,target:v,props:_}=e;if(v&&i(g),(s||!oh(_))&&(i(f),u&16))for(let M=0;M0?Hs||nf:null,jU(),Bh>0&&Hs&&Hs.push(e),e}function ae(e,t,n,r,o,i){return zL(B(e,t,n,r,o,i,!0))}function It(e,t,n,r,o){return zL(St(e,t,n,r,o,!0))}function Hh(e){return e?e.__v_isVNode===!0:!1}function oc(e,t){return e.type===t.type&&e.key===t.key}const Ry="__vInternal",jL=({key:e})=>e??null,Qm=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Fr(e)||gr(e)||hn(e)?{i:Yo,r:e,k:t,f:!!n}:e:null);function B(e,t=null,n=null,r=0,o=null,i=e===dt?0:1,s=!1,u=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&jL(t),ref:t&&Qm(t),scopeId:Ay,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Yo};return u?(_C(d,n),i&128&&e.normalize(d)):n&&(d.shapeFlag|=Fr(n)?8:16),Bh>0&&!s&&Hs&&(d.patchFlag>0||i&6)&&d.patchFlag!==32&&Hs.push(d),d}const St=WU;function WU(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===PL)&&(e=Si),Hh(e)){const u=Ta(e,t,!0);return n&&_C(u,n),Bh>0&&!i&&Hs&&(u.shapeFlag&6?Hs[Hs.indexOf(e)]=u:Hs.push(u)),u.patchFlag|=-2,u}if(t7(e)&&(e=e.__vccOpts),t){t=Vl(t);let{class:u,style:d}=t;u&&!Fr(u)&&(t.class=st(u)),ur(d)&&(mL(d)&&!Vt(d)&&(d=to({},d)),t.style=Oo(d))}const s=Fr(e)?1:hU(e)?128:qU(e)?64:ur(e)?4:hn(e)?2:0;return B(e,t,n,r,o,s,i,!0)}function Vl(e){return e?mL(e)||Ry in e?to({},e):e:null}function Ta(e,t,n=!1){const{props:r,ref:o,patchFlag:i,children:s}=e,u=t?Eo(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&jL(u),ref:t&&t.ref?n&&o?Vt(o)?o.concat(Qm(t)):[o,Qm(t)]:Qm(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==dt?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ta(e.ssContent),ssFallback:e.ssFallback&&Ta(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function jr(e=" ",t=0){return St(Hf,null,e,t)}function Ce(e="",t=!1){return t?(X(),It(Si,null,e)):St(Si,null,e)}function ua(e){return e==null||typeof e=="boolean"?St(Si):Vt(e)?St(dt,null,e.slice()):typeof e=="object"?Gl(e):St(Hf,null,String(e))}function Gl(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ta(e)}function _C(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Vt(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),_C(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!(Ry in t)?t._ctx=Yo:o===3&&Yo&&(Yo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else hn(t)?(t={default:t,_ctx:Yo},n=32):(t=String(t),r&64?(n=16,t=[jr(t)]):n=8);e.children=t,e.shapeFlag|=n}function Eo(...e){const t={};for(let n=0;nAo||Yo;let bC,Rd,hS="__VUE_INSTANCE_SETTERS__";(Rd=aM()[hS])||(Rd=aM()[hS]=[]),Rd.push(e=>Ao=e),bC=e=>{Rd.length>1?Rd.forEach(t=>t(e)):Rd[0](e)};const If=e=>{bC(e),e.scope.on()},xc=()=>{Ao&&Ao.scope.off(),bC(null)};function WL(e){return e.vnode.shapeFlag&4}let qh=!1;function XU(e,t=!1){qh=t;const{props:n,children:r}=e.vnode,o=WL(e);PU(e,n,o,t),FU(e,r);const i=o?ZU(e,t):void 0;return qh=!1,i}function ZU(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=iC(new Proxy(e.ctx,SU));const{setup:r}=n;if(r){const o=e.setupContext=r.length>1?YL(e):null;If(e),Gf();const i=su(r,e,0,[e.props,o]);if($f(),xc(),eL(i)){if(i.then(xc,xc),t)return i.then(s=>{gS(e,s,t)}).catch(s=>{Dy(s,e,0)});e.asyncDep=i}else gS(e,i,t)}else KL(e,t)}function gS(e,t,n){hn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ur(t)&&(e.setupState=_L(t)),KL(e,n)}let mS;function KL(e,t,n){const r=e.type;if(!e.render){if(!t&&mS&&!r.render){const o=r.template||gC(e).template;if(o){const{isCustomElement:i,compilerOptions:s}=e.appContext.config,{delimiters:u,compilerOptions:d}=r,f=to(to({isCustomElement:i,delimiters:u},s),d);r.render=mS(o,f)}}e.render=r.render||Vs}If(e),Gf(),DU(e),$f(),xc()}function QU(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return Wi(e,"get","$attrs"),t[n]}}))}function YL(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return QU(e)},slots:e.slots,emit:e.emit,expose:t}}function Ny(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(_L(iC(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in rh)return rh[n](e)},has(t,n){return n in t||n in rh}}))}function e7(e,t=!0){return hn(e)?e.displayName||e.name:e.name||t&&e.__name}function t7(e){return hn(e)&&"__vccOpts"in e}const Ve=(e,t)=>rU(e,t,qh);function Re(e,t,n){const r=arguments.length;return r===2?ur(t)&&!Vt(t)?Hh(t)?St(e,null,[t]):St(e,t):St(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Hh(n)&&(n=[n]),St(e,t,n))}const n7=Symbol.for("v-scx"),r7=()=>tn(n7),o7="3.3.4",i7="http://www.w3.org/2000/svg",ic=typeof document<"u"?document:null,vS=ic&&ic.createElement("template"),s7={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?ic.createElementNS(i7,e):ic.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>ic.createTextNode(e),createComment:e=>ic.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ic.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const s=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{vS.innerHTML=r?`${e}`:e;const u=vS.content;if(r){const d=u.firstChild;for(;d.firstChild;)u.appendChild(d.firstChild);u.removeChild(d)}t.insertBefore(u,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function a7(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function l7(e,t,n){const r=e.style,o=Fr(n);if(n&&!o){if(t&&!Fr(t))for(const i in t)n[i]==null&&yM(r,i,"");for(const i in n)yM(r,i,n[i])}else{const i=r.display;o?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=i)}}const yS=/\s*!important$/;function yM(e,t,n){if(Vt(n))n.forEach(r=>yM(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=u7(e,t);yS.test(n)?e.setProperty(id(r),n.replace(yS,""),"important"):e[r]=n}}const _S=["Webkit","Moz","ms"],C1={};function u7(e,t){const n=C1[t];if(n)return n;let r=Ca(t);if(r!=="filter"&&r in e)return C1[t]=r;r=Sy(r);for(let o=0;o<_S.length;o++){const i=_S[o]+r;if(i in e)return C1[t]=i}return t}const bS="http://www.w3.org/1999/xlink";function c7(e,t,n,r,o){if(r&&t.startsWith("xlink:"))n==null?e.removeAttributeNS(bS,t.slice(6,t.length)):e.setAttributeNS(bS,t,n);else{const i=vx(t);n==null||i&&!rL(n)?e.removeAttribute(t):e.setAttribute(t,i?"":n)}}function d7(e,t,n,r,o,i,s){if(t==="innerHTML"||t==="textContent"){r&&s(r,o,i),e[t]=n??"";return}const u=e.tagName;if(t==="value"&&u!=="PROGRESS"&&!u.includes("-")){e._value=n;const f=u==="OPTION"?e.getAttribute("value"):e.value,g=n??"";f!==g&&(e.value=g),n==null&&e.removeAttribute(t);return}let d=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=rL(n):n==null&&f==="string"?(n="",d=!0):f==="number"&&(n=0,d=!0)}try{e[t]=n}catch{}d&&e.removeAttribute(t)}function el(e,t,n,r){e.addEventListener(t,n,r)}function f7(e,t,n,r){e.removeEventListener(t,n,r)}function p7(e,t,n,r,o=null){const i=e._vei||(e._vei={}),s=i[t];if(r&&s)s.value=r;else{const[u,d]=h7(t);if(r){const f=i[t]=v7(r,o);el(e,u,f,d)}else s&&(f7(e,u,s,d),i[t]=void 0)}}const MS=/(?:Once|Passive|Capture)$/;function h7(e){let t;if(MS.test(e)){t={};let r;for(;r=e.match(MS);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):id(e.slice(2)),t]}let T1=0;const g7=Promise.resolve(),m7=()=>T1||(g7.then(()=>T1=0),T1=Date.now());function v7(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;ws(y7(r,n.value),t,5,[r])};return n.value=e,n.attached=m7(),n}function y7(e,t){if(Vt(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const IS=/^on[a-z]/,_7=(e,t,n,r,o=!1,i,s,u,d)=>{t==="class"?a7(e,r,o):t==="style"?l7(e,n,r):Ty(t)?KI(t)||p7(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):b7(e,t,r,o))?d7(e,t,r,i,s,u,d):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),c7(e,t,r,o))};function b7(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&IS.test(t)&&hn(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||IS.test(t)&&Fr(n)?!1:t in e}const Dl="transition",Rp="animation",bo=(e,{slots:t})=>Re(yU,XL(e),t);bo.displayName="Transition";const JL={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},M7=bo.props=to({},DL,JL),Yu=(e,t=[])=>{Vt(e)?e.forEach(n=>n(...t)):e&&e(...t)},CS=e=>e?Vt(e)?e.some(t=>t.length>1):e.length>1:!1;function XL(e){const t={};for(const T in e)T in JL||(t[T]=e[T]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:u=`${n}-enter-to`,appearFromClass:d=i,appearActiveClass:f=s,appearToClass:g=u,leaveFromClass:v=`${n}-leave-from`,leaveActiveClass:_=`${n}-leave-active`,leaveToClass:M=`${n}-leave-to`}=e,C=I7(o),D=C&&C[0],w=C&&C[1],{onBeforeEnter:S,onEnter:N,onEnterCancelled:A,onLeave:L,onLeaveCancelled:j,onBeforeAppear:V=S,onAppear:x=N,onAppearCancelled:$=A}=t,z=(T,P,Z)=>{Rl(T,P?g:u),Rl(T,P?f:s),Z&&Z()},G=(T,P)=>{T._isLeaving=!1,Rl(T,v),Rl(T,M),Rl(T,_),P&&P()},O=T=>(P,Z)=>{const K=T?x:N,oe=()=>z(P,T,Z);Yu(K,[P,oe]),TS(()=>{Rl(P,T?d:i),za(P,T?g:u),CS(K)||wS(P,r,D,oe)})};return to(t,{onBeforeEnter(T){Yu(S,[T]),za(T,i),za(T,s)},onBeforeAppear(T){Yu(V,[T]),za(T,d),za(T,f)},onEnter:O(!1),onAppear:O(!0),onLeave(T,P){T._isLeaving=!0;const Z=()=>G(T,P);za(T,v),QL(),za(T,_),TS(()=>{T._isLeaving&&(Rl(T,v),za(T,M),CS(L)||wS(T,r,w,Z))}),Yu(L,[T,Z])},onEnterCancelled(T){z(T,!1),Yu(A,[T])},onAppearCancelled(T){z(T,!0),Yu($,[T])},onLeaveCancelled(T){G(T),Yu(j,[T])}})}function I7(e){if(e==null)return null;if(ur(e))return[w1(e.enter),w1(e.leave)];{const t=w1(e);return[t,t]}}function w1(e){return dx(e)}function za(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Rl(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function TS(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let C7=0;function wS(e,t,n,r){const o=e._endId=++C7,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:s,timeout:u,propCount:d}=ZL(e,t);if(!s)return r();const f=s+"end";let g=0;const v=()=>{e.removeEventListener(f,_),i()},_=M=>{M.target===e&&++g>=d&&v()};setTimeout(()=>{g(n[C]||"").split(", "),o=r(`${Dl}Delay`),i=r(`${Dl}Duration`),s=SS(o,i),u=r(`${Rp}Delay`),d=r(`${Rp}Duration`),f=SS(u,d);let g=null,v=0,_=0;t===Dl?s>0&&(g=Dl,v=s,_=i.length):t===Rp?f>0&&(g=Rp,v=f,_=d.length):(v=Math.max(s,f),g=v>0?s>f?Dl:Rp:null,_=g?g===Dl?i.length:d.length:0);const M=g===Dl&&/\b(transform|all)(,|$)/.test(r(`${Dl}Property`).toString());return{type:g,timeout:v,propCount:_,hasTransform:M}}function SS(e,t){for(;e.lengthkS(n)+kS(e[r])))}function kS(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function QL(){return document.body.offsetHeight}const eO=new WeakMap,tO=new WeakMap,nO={name:"TransitionGroup",props:to({},M7,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ki(),r=kL();let o,i;return NL(()=>{if(!o.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!D7(o[0].el,n.vnode.el,s))return;o.forEach(w7),o.forEach(S7);const u=o.filter(k7);QL(),u.forEach(d=>{const f=d.el,g=f.style;za(f,s),g.transform=g.webkitTransform=g.transitionDuration="";const v=f._moveCb=_=>{_&&_.target!==f||(!_||/transform$/.test(_.propertyName))&&(f.removeEventListener("transitionend",v),f._moveCb=null,Rl(f,s))};f.addEventListener("transitionend",v)})}),()=>{const s=Hn(e),u=XL(s);let d=s.tag||dt;o=i,i=t.default?fC(t.default()):[];for(let f=0;fdelete e.mode;nO.props;const rO=nO;function w7(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function S7(e){tO.set(e,e.el.getBoundingClientRect())}function k7(e){const t=eO.get(e),n=tO.get(e),r=t.left-n.left,o=t.top-n.top;if(r||o){const i=e.el.style;return i.transform=i.webkitTransform=`translate(${r}px,${o}px)`,i.transitionDuration="0s",e}}function D7(e,t,n){const r=e.cloneNode();e._vtc&&e._vtc.forEach(s=>{s.split(/\s+/).forEach(u=>u&&r.classList.remove(u))}),n.split(/\s+/).forEach(s=>s&&r.classList.add(s)),r.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(r);const{hasTransform:i}=ZL(r);return o.removeChild(r),i}const vu=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Vt(t)?n=>Zm(t,n):t};function E7(e){e.target.composing=!0}function DS(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const al={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e._assign=vu(o);const i=r||o.props&&o.props.type==="number";el(e,t?"change":"input",s=>{if(s.target.composing)return;let u=e.value;n&&(u=u.trim()),i&&(u=Iv(u)),e._assign(u)}),n&&el(e,"change",()=>{e.value=e.value.trim()}),t||(el(e,"compositionstart",E7),el(e,"compositionend",DS),el(e,"change",DS))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:o}},i){if(e._assign=vu(i),e.composing||document.activeElement===e&&e.type!=="range"&&(n||r&&e.value.trim()===t||(o||e.type==="number")&&Iv(e.value)===t))return;const s=t??"";e.value!==s&&(e.value=s)}},A7={deep:!0,created(e,t,n){e._assign=vu(n),el(e,"change",()=>{const r=e._modelValue,o=Cf(e),i=e.checked,s=e._assign;if(Vt(r)){const u=XI(r,o),d=u!==-1;if(i&&!d)s(r.concat(o));else if(!i&&d){const f=[...r];f.splice(u,1),s(f)}}else if(Ff(r)){const u=new Set(r);i?u.add(o):u.delete(o),s(u)}else s(oO(e,i))})},mounted:ES,beforeUpdate(e,t,n){e._assign=vu(n),ES(e,t,n)}};function ES(e,{value:t,oldValue:n},r){e._modelValue=t,Vt(t)?e.checked=XI(t,r.props.value)>-1:Ff(t)?e.checked=t.has(r.props.value):t!==n&&(e.checked=Xc(t,oO(e,!0)))}const L7={created(e,{value:t},n){e.checked=Xc(t,n.props.value),e._assign=vu(n),el(e,"change",()=>{e._assign(Cf(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e._assign=vu(r),t!==n&&(e.checked=Xc(t,r.props.value))}},O7={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Ff(t);el(e,"change",()=>{const i=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?Iv(Cf(s)):Cf(s));e._assign(e.multiple?o?new Set(i):i:i[0])}),e._assign=vu(r)},mounted(e,{value:t}){AS(e,t)},beforeUpdate(e,t,n){e._assign=vu(n)},updated(e,{value:t}){AS(e,t)}};function AS(e,t){const n=e.multiple;if(!(n&&!Vt(t)&&!Ff(t))){for(let r=0,o=e.options.length;r-1:i.selected=t.has(s);else if(Xc(Cf(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Cf(e){return"_value"in e?e._value:e.value}function oO(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const R7={created(e,t,n){vm(e,t,n,null,"created")},mounted(e,t,n){vm(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){vm(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){vm(e,t,n,r,"updated")}};function N7(e,t){switch(e){case"SELECT":return O7;case"TEXTAREA":return al;default:switch(t){case"checkbox":return A7;case"radio":return L7;default:return al}}}function vm(e,t,n,r,o){const s=N7(e.tagName,n.props&&n.props.type)[o];s&&s(e,t,n,r)}const P7=["ctrl","shift","alt","meta"],x7={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>P7.some(n=>e[`${n}Key`]&&!t.includes(n))},bn=(e,t)=>(n,...r)=>{for(let o=0;on=>{if(!("key"in n))return;const r=id(n.key);if(t.some(o=>o===r||U7[o]===r))return e(n)},eo={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Np(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Np(e,!0),r.enter(e)):r.leave(e,()=>{Np(e,!1)}):Np(e,t))},beforeUnmount(e,{value:t}){Np(e,t)}};function Np(e,t){e.style.display=t?e._vod:"none"}const F7=to({patchProp:_7},s7);let LS;function iO(){return LS||(LS=$U(F7))}const OS=(...e)=>{iO().render(...e)},G7=(...e)=>{const t=iO().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=$7(r);if(!o)return;const i=t._component;!hn(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.innerHTML="";const s=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},t};function $7(e){return Fr(e)?document.querySelector(e):e}const B7={theme:"dark"};function H7(e){e.setCommonStore(B7)}function q7(e){console.log("app",e)}const V7={name:"TUITheme",plugin:H7,install:q7};/*! * shared v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */const z7=typeof window<"u",j7=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Tu=e=>j7?Symbol(e):e,W7=(e,t,n)=>K7({l:e,k:t,s:n}),K7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Lo=e=>typeof e=="number"&&isFinite(e),Y7=e=>IC(e)==="[object Date]",yu=e=>IC(e)==="[object RegExp]",Py=e=>dn(e)&&Object.keys(e).length===0;function J7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const No=Object.assign;let RS;const sh=()=>RS||(RS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function NS(e){return e.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const X7=Object.prototype.hasOwnProperty;function MC(e,t){return X7.call(e,t)}const Ar=Array.isArray,Xr=e=>typeof e=="function",kt=e=>typeof e=="string",Wn=e=>typeof e=="boolean",zr=e=>e!==null&&typeof e=="object",sO=Object.prototype.toString,IC=e=>sO.call(e),dn=e=>IC(e)==="[object Object]",Z7=e=>e==null?"":Ar(e)||dn(e)&&e.toString===sO?JSON.stringify(e,null,2):String(e);/*! * message-compiler v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */const Qn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,__EXTEND_POINT__:15};function xy(e,t,n={}){const{domain:r,messages:o,args:i}=n,s=e,u=new SyntaxError(String(s));return u.code=e,t&&(u.location=t),u.domain=r,u}function Q7(e){throw e}function eF(e,t,n){return{line:e,column:t,offset:n}}function _M(e,t,n){const r={start:e,end:t};return n!=null&&(r.source=n),r}const $a=" ",tF="\r",Ii=` `,nF=String.fromCharCode(8232),rF=String.fromCharCode(8233);function oF(e){const t=e;let n=0,r=1,o=1,i=0;const s=x=>t[x]===tF&&t[x+1]===Ii,u=x=>t[x]===Ii,d=x=>t[x]===rF,f=x=>t[x]===nF,g=x=>s(x)||u(x)||d(x)||f(x),v=()=>n,_=()=>r,M=()=>o,C=()=>i,D=x=>s(x)||d(x)||f(x)?Ii:t[x],w=()=>D(n),S=()=>D(n+i);function N(){return i=0,g(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}function A(){return s(n+i)&&i++,i++,t[n+i]}function L(){n=0,r=1,o=1,i=0}function j(x=0){i=x}function V(){const x=n+i;for(;x!==n;)N();i=0}return{index:v,line:_,column:M,peekOffset:C,charAt:D,currentChar:w,currentPeek:S,next:N,peek:A,reset:L,resetPeek:j,skipToPeek:V}}const El=void 0,PS="'",iF="tokenizer";function sF(e,t={}){const n=t.location!==!1,r=oF(e),o=()=>r.index(),i=()=>eF(r.line(),r.column(),r.index()),s=i(),u=o(),d={currentType:14,offset:u,startLoc:s,endLoc:s,lastType:14,lastOffset:u,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},f=()=>d,{onError:g}=t;function v(me,W,te,...se){const Te=f();if(W.column+=te,W.offset+=te,g){const ce=_M(Te.startLoc,W),Se=xy(me,ce,{domain:iF,args:se});g(Se)}}function _(me,W,te){me.endLoc=i(),me.currentType=W;const se={type:W};return n&&(se.loc=_M(me.startLoc,me.endLoc)),te!=null&&(se.value=te),se}const M=me=>_(me,14);function C(me,W){return me.currentChar()===W?(me.next(),W):(v(Qn.EXPECTED_TOKEN,i(),0,W),"")}function D(me){let W="";for(;me.currentPeek()===$a||me.currentPeek()===Ii;)W+=me.currentPeek(),me.peek();return W}function w(me){const W=D(me);return me.skipToPeek(),W}function S(me){if(me===El)return!1;const W=me.charCodeAt(0);return W>=97&&W<=122||W>=65&&W<=90||W===95}function N(me){if(me===El)return!1;const W=me.charCodeAt(0);return W>=48&&W<=57}function A(me,W){const{currentType:te}=W;if(te!==2)return!1;D(me);const se=S(me.currentPeek());return me.resetPeek(),se}function L(me,W){const{currentType:te}=W;if(te!==2)return!1;D(me);const se=me.currentPeek()==="-"?me.peek():me.currentPeek(),Te=N(se);return me.resetPeek(),Te}function j(me,W){const{currentType:te}=W;if(te!==2)return!1;D(me);const se=me.currentPeek()===PS;return me.resetPeek(),se}function V(me,W){const{currentType:te}=W;if(te!==8)return!1;D(me);const se=me.currentPeek()===".";return me.resetPeek(),se}function x(me,W){const{currentType:te}=W;if(te!==9)return!1;D(me);const se=S(me.currentPeek());return me.resetPeek(),se}function $(me,W){const{currentType:te}=W;if(!(te===8||te===12))return!1;D(me);const se=me.currentPeek()===":";return me.resetPeek(),se}function z(me,W){const{currentType:te}=W;if(te!==10)return!1;const se=()=>{const ce=me.currentPeek();return ce==="{"?S(me.peek()):ce==="@"||ce==="%"||ce==="|"||ce===":"||ce==="."||ce===$a||!ce?!1:ce===Ii?(me.peek(),se()):S(ce)},Te=se();return me.resetPeek(),Te}function G(me){D(me);const W=me.currentPeek()==="|";return me.resetPeek(),W}function O(me,W=!0){const te=(Te=!1,ce="",Se=!1)=>{const Pe=me.currentPeek();return Pe==="{"?ce==="%"?!1:Te:Pe==="@"||!Pe?ce==="%"?!0:Te:Pe==="%"?(me.peek(),te(Te,"%",!0)):Pe==="|"?ce==="%"||Se?!0:!(ce===$a||ce===Ii):Pe===$a?(me.peek(),te(!0,$a,Se)):Pe===Ii?(me.peek(),te(!0,Ii,Se)):!0},se=te();return W&&me.resetPeek(),se}function T(me,W){const te=me.currentChar();return te===El?El:W(te)?(me.next(),te):null}function P(me){return T(me,te=>{const se=te.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36})}function Z(me){return T(me,te=>{const se=te.charCodeAt(0);return se>=48&&se<=57})}function K(me){return T(me,te=>{const se=te.charCodeAt(0);return se>=48&&se<=57||se>=65&&se<=70||se>=97&&se<=102})}function oe(me){let W="",te="";for(;W=Z(me);)te+=W;return te}function J(me){let W="";for(;;){const te=me.currentChar();if(te==="{"||te==="}"||te==="@"||te==="|"||!te)break;if(te==="%")if(O(me))W+=te,me.next();else break;else if(te===$a||te===Ii)if(O(me))W+=te,me.next();else{if(G(me))break;W+=te,me.next()}else W+=te,me.next()}return W}function ie(me){w(me);let W="",te="";for(;W=P(me);)te+=W;return me.currentChar()===El&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function pe(me){w(me);let W="";return me.currentChar()==="-"?(me.next(),W+=`-${oe(me)}`):W+=oe(me),me.currentChar()===El&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),W}function ue(me){w(me),C(me,"'");let W="",te="";const se=ce=>ce!==PS&&ce!==Ii;for(;W=T(me,se);)W==="\\"?te+=de(me):te+=W;const Te=me.currentChar();return Te===Ii||Te===El?(v(Qn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Te===Ii&&(me.next(),C(me,"'")),te):(C(me,"'"),te)}function de(me){const W=me.currentChar();switch(W){case"\\":case"'":return me.next(),`\\${W}`;case"u":return Y(me,W,4);case"U":return Y(me,W,6);default:return v(Qn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,W),""}}function Y(me,W,te){C(me,W);let se="";for(let Te=0;TeTe!=="{"&&Te!=="}"&&Te!==$a&&Te!==Ii;for(;W=T(me,se);)te+=W;return te}function fe(me){let W="",te="";for(;W=P(me);)te+=W;return te}function Ae(me){const W=(te=!1,se)=>{const Te=me.currentChar();return Te==="{"||Te==="%"||Te==="@"||Te==="|"||!Te||Te===$a?se:Te===Ii?(se+=Te,me.next(),W(te,se)):(se+=Te,me.next(),W(!0,se))};return W(!1,"")}function ye(me){w(me);const W=C(me,"|");return w(me),W}function le(me,W){let te=null;switch(me.currentChar()){case"{":return W.braceNest>=1&&v(Qn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),me.next(),te=_(W,2,"{"),w(me),W.braceNest++,te;case"}":return W.braceNest>0&&W.currentType===2&&v(Qn.EMPTY_PLACEHOLDER,i(),0),me.next(),te=_(W,3,"}"),W.braceNest--,W.braceNest>0&&w(me),W.inLinked&&W.braceNest===0&&(W.inLinked=!1),te;case"@":return W.braceNest>0&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),te=Q(me,W)||M(W),W.braceNest=0,te;default:let Te=!0,ce=!0,Se=!0;if(G(me))return W.braceNest>0&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),te=_(W,1,ye(me)),W.braceNest=0,W.inLinked=!1,te;if(W.braceNest>0&&(W.currentType===5||W.currentType===6||W.currentType===7))return v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),W.braceNest=0,ve(me,W);if(Te=A(me,W))return te=_(W,5,ie(me)),w(me),te;if(ce=L(me,W))return te=_(W,6,pe(me)),w(me),te;if(Se=j(me,W))return te=_(W,7,ue(me)),w(me),te;if(!Te&&!ce&&!Se)return te=_(W,13,re(me)),v(Qn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,te.value),w(me),te;break}return te}function Q(me,W){const{currentType:te}=W;let se=null;const Te=me.currentChar();switch((te===8||te===9||te===12||te===10)&&(Te===Ii||Te===$a)&&v(Qn.INVALID_LINKED_FORMAT,i(),0),Te){case"@":return me.next(),se=_(W,8,"@"),W.inLinked=!0,se;case".":return w(me),me.next(),_(W,9,".");case":":return w(me),me.next(),_(W,10,":");default:return G(me)?(se=_(W,1,ye(me)),W.braceNest=0,W.inLinked=!1,se):V(me,W)||$(me,W)?(w(me),Q(me,W)):x(me,W)?(w(me),_(W,12,fe(me))):z(me,W)?(w(me),Te==="{"?le(me,W)||se:_(W,11,Ae(me))):(te===8&&v(Qn.INVALID_LINKED_FORMAT,i(),0),W.braceNest=0,W.inLinked=!1,ve(me,W))}}function ve(me,W){let te={type:14};if(W.braceNest>0)return le(me,W)||M(W);if(W.inLinked)return Q(me,W)||M(W);const se=me.currentChar();switch(se){case"{":return le(me,W)||M(W);case"}":return v(Qn.UNBALANCED_CLOSING_BRACE,i(),0),me.next(),_(W,3,"}");case"@":return Q(me,W)||M(W);default:if(G(me))return te=_(W,1,ye(me)),W.braceNest=0,W.inLinked=!1,te;if(O(me))return _(W,0,J(me));if(se==="%")return me.next(),_(W,4,"%");break}return te}function Le(){const{currentType:me,offset:W,startLoc:te,endLoc:se}=d;return d.lastType=me,d.lastOffset=W,d.lastStartLoc=te,d.lastEndLoc=se,d.offset=o(),d.startLoc=i(),r.currentChar()===El?_(d,14):ve(r,d)}return{nextToken:Le,currentOffset:o,currentPosition:i,context:f}}const aF="parser",lF=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function uF(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function cF(e={}){const t=e.location!==!1,{onError:n}=e;function r(S,N,A,L,...j){const V=S.currentPosition();if(V.offset+=L,V.column+=L,n){const x=_M(A,V),$=xy(N,x,{domain:aF,args:j});n($)}}function o(S,N,A){const L={type:S,start:N,end:N};return t&&(L.loc={start:A,end:A}),L}function i(S,N,A,L){S.end=N,L&&(S.type=L),t&&S.loc&&(S.loc.end=A)}function s(S,N){const A=S.context(),L=o(3,A.offset,A.startLoc);return L.value=N,i(L,S.currentOffset(),S.currentPosition()),L}function u(S,N){const A=S.context(),{lastOffset:L,lastStartLoc:j}=A,V=o(5,L,j);return V.index=parseInt(N,10),S.nextToken(),i(V,S.currentOffset(),S.currentPosition()),V}function d(S,N){const A=S.context(),{lastOffset:L,lastStartLoc:j}=A,V=o(4,L,j);return V.key=N,S.nextToken(),i(V,S.currentOffset(),S.currentPosition()),V}function f(S,N){const A=S.context(),{lastOffset:L,lastStartLoc:j}=A,V=o(9,L,j);return V.value=N.replace(lF,uF),S.nextToken(),i(V,S.currentOffset(),S.currentPosition()),V}function g(S){const N=S.nextToken(),A=S.context(),{lastOffset:L,lastStartLoc:j}=A,V=o(8,L,j);return N.type!==12?(r(S,Qn.UNEXPECTED_EMPTY_LINKED_MODIFIER,A.lastStartLoc,0),V.value="",i(V,L,j),{nextConsumeToken:N,node:V}):(N.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,oa(N)),V.value=N.value||"",i(V,S.currentOffset(),S.currentPosition()),{node:V})}function v(S,N){const A=S.context(),L=o(7,A.offset,A.startLoc);return L.value=N,i(L,S.currentOffset(),S.currentPosition()),L}function _(S){const N=S.context(),A=o(6,N.offset,N.startLoc);let L=S.nextToken();if(L.type===9){const j=g(S);A.modifier=j.node,L=j.nextConsumeToken||S.nextToken()}switch(L.type!==10&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(L)),L=S.nextToken(),L.type===2&&(L=S.nextToken()),L.type){case 11:L.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(L)),A.key=v(S,L.value||"");break;case 5:L.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(L)),A.key=d(S,L.value||"");break;case 6:L.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(L)),A.key=u(S,L.value||"");break;case 7:L.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(L)),A.key=f(S,L.value||"");break;default:r(S,Qn.UNEXPECTED_EMPTY_LINKED_KEY,N.lastStartLoc,0);const j=S.context(),V=o(7,j.offset,j.startLoc);return V.value="",i(V,j.offset,j.startLoc),A.key=V,i(A,j.offset,j.startLoc),{nextConsumeToken:L,node:A}}return i(A,S.currentOffset(),S.currentPosition()),{node:A}}function M(S){const N=S.context(),A=N.currentType===1?S.currentOffset():N.offset,L=N.currentType===1?N.endLoc:N.startLoc,j=o(2,A,L);j.items=[];let V=null;do{const z=V||S.nextToken();switch(V=null,z.type){case 0:z.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(z)),j.items.push(s(S,z.value||""));break;case 6:z.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(z)),j.items.push(u(S,z.value||""));break;case 5:z.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(z)),j.items.push(d(S,z.value||""));break;case 7:z.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,oa(z)),j.items.push(f(S,z.value||""));break;case 8:const G=_(S);j.items.push(G.node),V=G.nextConsumeToken||null;break}}while(N.currentType!==14&&N.currentType!==1);const x=N.currentType===1?N.lastOffset:S.currentOffset(),$=N.currentType===1?N.lastEndLoc:S.currentPosition();return i(j,x,$),j}function C(S,N,A,L){const j=S.context();let V=L.items.length===0;const x=o(1,N,A);x.cases=[],x.cases.push(L);do{const $=M(S);V||(V=$.items.length===0),x.cases.push($)}while(j.currentType!==14);return V&&r(S,Qn.MUST_HAVE_MESSAGES_IN_PLURAL,A,0),i(x,S.currentOffset(),S.currentPosition()),x}function D(S){const N=S.context(),{offset:A,startLoc:L}=N,j=M(S);return N.currentType===14?j:C(S,A,L,j)}function w(S){const N=sF(S,No({},e)),A=N.context(),L=o(0,A.offset,A.startLoc);return t&&L.loc&&(L.loc.source=S),L.body=D(N),A.currentType!==14&&r(N,Qn.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,S[A.offset]||""),i(L,N.currentOffset(),N.currentPosition()),L}return{parse:w}}function oa(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function dF(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function xS(e,t){for(let n=0;ns;function d(D,w){s.code+=D}function f(D,w=!0){const S=w?o:"";d(i?S+" ".repeat(D):S)}function g(D=!0){const w=++s.indentLevel;D&&f(w)}function v(D=!0){const w=--s.indentLevel;D&&f(w)}function _(){f(s.indentLevel)}return{context:u,push:d,indent:g,deindent:v,newline:_,helper:D=>`_${D}`,needIndent:()=>s.needIndent}}function hF(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Tf(e,t.key),t.modifier&&(e.push(", "),Tf(e,t.modifier)),e.push(")")}function gF(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let i=0;i1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let i=0;i{const n=kt(t.mode)?t.mode:"normal",r=kt(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,i=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` `,s=t.needIndent?t.needIndent:n!=="arrow",u=e.helpers||[],d=pF(e,{mode:n,filename:r,sourceMap:o,breakLineCode:i,needIndent:s});d.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),d.indent(s),u.length>0&&(d.push(`const { ${u.map(v=>`${v}: _${v}`).join(", ")} } = ctx`),d.newline()),d.push("return "),Tf(d,e),d.deindent(s),d.push("}");const{code:f,map:g}=d.context();return{ast:e,code:f,map:g?g.toJSON():void 0}};function _F(e,t={}){const n=No({},t),o=cF(n).parse(e);return fF(o,n),yF(o,n)}/*! * devtools-if v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */const aO={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};/*! * core-base v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */const wu=[];wu[0]={w:[0],i:[3,0],"[":[4],o:[7]};wu[1]={w:[1],".":[2],"[":[4],o:[7]};wu[2]={w:[2],i:[3,0],0:[3,0]};wu[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};wu[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};wu[5]={"'":[4,0],o:8,l:[5,0]};wu[6]={'"':[4,0],o:8,l:[6,0]};const bF=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function MF(e){return bF.test(e)}function IF(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function CF(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function TF(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:MF(t)?IF(t):"*"+t}function wF(e){const t=[];let n=-1,r=0,o=0,i,s,u,d,f,g,v;const _=[];_[0]=()=>{s===void 0?s=u:s+=u},_[1]=()=>{s!==void 0&&(t.push(s),s=void 0)},_[2]=()=>{_[0](),o++},_[3]=()=>{if(o>0)o--,r=4,_[0]();else{if(o=0,s===void 0||(s=TF(s),s===!1))return!1;_[1]()}};function M(){const C=e[n+1];if(r===5&&C==="'"||r===6&&C==='"')return n++,u="\\"+C,_[0](),!0}for(;r!==null;)if(n++,i=e[n],!(i==="\\"&&M())){if(d=CF(i),v=wu[r],f=v[d]||v.l||8,f===8||(r=f[0],f[1]!==void 0&&(g=_[f[1]],g&&(u=i,g()===!1))))return;if(r===7)return t}}const US=new Map;function SF(e,t){return zr(e)?e[t]:null}function kF(e,t){if(!zr(e))return null;let n=US.get(t);if(n||(n=wF(t),n&&US.set(t,n)),!n)return null;const r=n.length;let o=e,i=0;for(;ie,EF=e=>"",AF="text",LF=e=>e.length===0?"":e.join(""),OF=Z7;function FS(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function RF(e){const t=Lo(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Lo(e.named.count)||Lo(e.named.n))?Lo(e.named.count)?e.named.count:Lo(e.named.n)?e.named.n:t:t}function NF(e,t){t.count||(t.count=e),t.n||(t.n=e)}function PF(e={}){const t=e.locale,n=RF(e),r=zr(e.pluralRules)&&kt(t)&&Xr(e.pluralRules[t])?e.pluralRules[t]:FS,o=zr(e.pluralRules)&&kt(t)&&Xr(e.pluralRules[t])?FS:void 0,i=S=>S[r(n,S.length,o)],s=e.list||[],u=S=>s[S],d=e.named||{};Lo(e.pluralIndex)&&NF(n,d);const f=S=>d[S];function g(S){const N=Xr(e.messages)?e.messages(S):zr(e.messages)?e.messages[S]:!1;return N||(e.parent?e.parent.message(S):EF)}const v=S=>e.modifiers?e.modifiers[S]:DF,_=dn(e.processor)&&Xr(e.processor.normalize)?e.processor.normalize:LF,M=dn(e.processor)&&Xr(e.processor.interpolate)?e.processor.interpolate:OF,C=(S,N)=>{const A=g(S)(w);return kt(N)?v(N)(A):A},D=dn(e.processor)&&kt(e.processor.type)?e.processor.type:AF,w={list:u,named:f,plural:i,linked:C,message:g,type:D,interpolate:M,normalize:_};return w}let Vh=null;function xF(e){Vh=e}function UF(e,t,n){Vh&&Vh.emit(aO.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const FF=GF(aO.FunctionTranslate);function GF(e){return t=>Vh&&Vh.emit(e,t)}function $F(e,t,n){return[...new Set([n,...Ar(t)?t:zr(t)?Object.keys(t):kt(t)?[t]:[n]])]}function lO(e,t,n){const r=kt(n)?n:hg,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(r);if(!i){i=[];let s=[n];for(;Ar(s);)s=GS(i,s,t);const u=Ar(t)||!dn(t)?t:t.default?t.default:null;s=kt(u)?[u]:u,Ar(s)&&GS(i,s,!1),o.__localeChainCache.set(r,i)}return i}function GS(e,t,n){let r=!0;for(let o=0;okt(e)?e.toUpperCase():e,lower:e=>kt(e)?e.toLowerCase():e,capitalize:e=>kt(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}}let uO;function zF(e){uO=e}let cO;function jF(e){cO=e}let dO;function WF(e){dO=e}let fO=null;const BS=e=>{fO=e},KF=()=>fO;let pO=null;const HS=e=>{pO=e},YF=()=>pO;let qS=0;function JF(e={}){const t=kt(e.version)?e.version:qF,n=kt(e.locale)?e.locale:hg,r=Ar(e.fallbackLocale)||dn(e.fallbackLocale)||kt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:n,o=dn(e.messages)?e.messages:{[n]:{}},i=dn(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},s=dn(e.numberFormats)?e.numberFormats:{[n]:{}},u=No({},e.modifiers||{},VF()),d=e.pluralRules||{},f=Xr(e.missing)?e.missing:null,g=Wn(e.missingWarn)||yu(e.missingWarn)?e.missingWarn:!0,v=Wn(e.fallbackWarn)||yu(e.fallbackWarn)?e.fallbackWarn:!0,_=!!e.fallbackFormat,M=!!e.unresolving,C=Xr(e.postTranslation)?e.postTranslation:null,D=dn(e.processor)?e.processor:null,w=Wn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,S=!!e.escapeParameter,N=Xr(e.messageCompiler)?e.messageCompiler:uO,A=Xr(e.messageResolver)?e.messageResolver:cO||SF,L=Xr(e.localeFallbacker)?e.localeFallbacker:dO||$F,j=zr(e.fallbackContext)?e.fallbackContext:void 0,V=Xr(e.onWarn)?e.onWarn:J7,x=e,$=zr(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,z=zr(x.__numberFormatters)?x.__numberFormatters:new Map,G=zr(x.__meta)?x.__meta:{};qS++;const O={version:t,cid:qS,locale:n,fallbackLocale:r,messages:o,modifiers:u,pluralRules:d,missing:f,missingWarn:g,fallbackWarn:v,fallbackFormat:_,unresolving:M,postTranslation:C,processor:D,warnHtmlMessage:w,escapeParameter:S,messageCompiler:N,messageResolver:A,localeFallbacker:L,fallbackContext:j,onWarn:V,__meta:G};return O.datetimeFormats=i,O.numberFormats=s,O.__datetimeFormatters=$,O.__numberFormatters=z,__INTLIFY_PROD_DEVTOOLS__&&UF(O,t,G),O}function TC(e,t,n,r,o){const{missing:i,onWarn:s}=e;if(i!==null){const u=i(e,n,t,o);return kt(u)?u:t}else return t}function Pp(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}const XF=e=>e;let VS=Object.create(null);function ZF(e,t={}){{const r=(t.onCacheKey||XF)(e),o=VS[r];if(o)return o;let i=!1;const s=t.onError||Q7;t.onError=f=>{i=!0,s(f)};const{code:u}=_F(e,t),d=new Function(`return ${u}`)();return i?d:VS[r]=d}}let hO=Qn.__EXTEND_POINT__;const S1=()=>++hO,Yd={INVALID_ARGUMENT:hO,INVALID_DATE_ARGUMENT:S1(),INVALID_ISO_DATE_ARGUMENT:S1(),__EXTEND_POINT__:S1()};function Jd(e){return xy(e,null,void 0)}const zS=()=>"",ca=e=>Xr(e);function jS(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:i,fallbackLocale:s,messages:u}=e,[d,f]=bM(...t),g=Wn(f.missingWarn)?f.missingWarn:e.missingWarn,v=Wn(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn,_=Wn(f.escapeParameter)?f.escapeParameter:e.escapeParameter,M=!!f.resolvedMessage,C=kt(f.default)||Wn(f.default)?Wn(f.default)?d:f.default:n?i?d:()=>d:"",D=n||C!=="",w=kt(f.locale)?f.locale:e.locale;_&&QF(f);let[S,N,A]=M?[d,w,u[w]||{}]:gO(e,d,w,s,v,g),L=S,j=d;if(!M&&!(kt(L)||ca(L))&&D&&(L=C,j=L),!M&&(!(kt(L)||ca(L))||!kt(N)))return o?Uy:d;let V=!1;const x=()=>{V=!0},$=ca(L)?L:mO(e,d,N,L,j,x);if(V)return L;const z=nG(e,N,A,f),G=PF(z),O=eG(e,$,G),T=r?r(O):O;if(__INTLIFY_PROD_DEVTOOLS__){const P={timestamp:Date.now(),key:kt(d)?d:ca(L)?L.key:"",locale:N||(ca(L)?L.locale:""),format:kt(L)?L:ca(L)?L.source:"",message:T};P.meta=No({},e.__meta,KF()||{}),FF(P)}return T}function QF(e){Ar(e.list)?e.list=e.list.map(t=>kt(t)?NS(t):t):zr(e.named)&&Object.keys(e.named).forEach(t=>{kt(e.named[t])&&(e.named[t]=NS(e.named[t]))})}function gO(e,t,n,r,o,i){const{messages:s,onWarn:u,messageResolver:d,localeFallbacker:f}=e,g=f(e,r,n);let v={},_,M=null;const C="translate";for(let D=0;D{throw i&&i(s),s},onCacheKey:s=>W7(t,n,s)}}function nG(e,t,n,r){const{modifiers:o,pluralRules:i,messageResolver:s,fallbackLocale:u,fallbackWarn:d,missingWarn:f,fallbackContext:g}=e,_={locale:t,modifiers:o,pluralRules:i,messages:M=>{let C=s(n,M);if(C==null&&g){const[,,D]=gO(g,M,t,u,d,f);C=s(D,M)}if(kt(C)){let D=!1;const S=mO(e,M,t,C,M,()=>{D=!0});return D?zS:S}else return ca(C)?C:zS}};return e.processor&&(_.processor=e.processor),r.list&&(_.list=r.list),r.named&&(_.named=r.named),Lo(r.plural)&&(_.pluralIndex=r.plural),_}function WS(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=e,{__datetimeFormatters:u}=e,[d,f,g,v]=MM(...t),_=Wn(g.missingWarn)?g.missingWarn:e.missingWarn;Wn(g.fallbackWarn)?g.fallbackWarn:e.fallbackWarn;const M=!!g.part,C=kt(g.locale)?g.locale:e.locale,D=s(e,o,C);if(!kt(d)||d==="")return new Intl.DateTimeFormat(C).format(f);let w={},S,N=null;const A="datetime format";for(let V=0;V{s===this.plugin.id&&this.fallbacks.setSettings(u)}),this.proxiedOn=new Proxy({},{get:(s,u)=>this.target?this.target.on[u]:(...d)=>{this.onQueue.push({method:u,args:d})}}),this.proxiedTarget=new Proxy({},{get:(s,u)=>this.target?this.target[u]:u==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(u)?(...d)=>(this.targetQueue.push({method:u,args:d,resolve:()=>{}}),this.fallbacks[u](...d)):(...d)=>new Promise(f=>{this.targetQueue.push({method:u,args:d,resolve:f})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function cG(e,t){const n=e,r=vO(),o=rG(),i=oG&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(iG,e,t);else{const s=i?new uG(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:s}),s&&t(s.proxiedTarget)}}/*! * vue-i18n v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */const dG="9.2.0-beta.32";function fG(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(sh().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(sh().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(sh().__INTLIFY_PROD_DEVTOOLS__=!1)}let yO=Qn.__EXTEND_POINT__;const Ui=()=>++yO,Mo={UNEXPECTED_RETURN_TYPE:yO,INVALID_ARGUMENT:Ui(),MUST_BE_CALL_SETUP_TOP:Ui(),NOT_INSLALLED:Ui(),NOT_AVAILABLE_IN_LEGACY_MODE:Ui(),REQUIRED_VALUE:Ui(),INVALID_VALUE:Ui(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Ui(),NOT_INSLALLED_WITH_PROVIDE:Ui(),UNEXPECTED_ERROR:Ui(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Ui(),BRIDGE_SUPPORT_VUE_2_ONLY:Ui(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Ui(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Ui(),__EXTEND_POINT__:Ui()};function Po(e,...t){return xy(e,null,void 0)}const TM=Tu("__transrateVNode"),wM=Tu("__datetimeParts"),SM=Tu("__numberParts"),_O=Tu("__setPluralRules");Tu("__intlifyMeta");const bO=Tu("__injectWithOption");function kM(e){if(!zr(e))return e;for(const t in e)if(MC(e,t))if(!t.includes("."))zr(e[t])&&kM(e[t]);else{const n=t.split("."),r=n.length-1;let o=e;for(let i=0;i{if("locale"in u&&"resource"in u){const{locale:d,resource:f}=u;d?(s[d]=s[d]||{},ah(f,s[d])):ah(f,s)}else kt(u)&&ah(JSON.parse(u),s)}),o==null&&i)for(const u in s)MC(s,u)&&kM(s[u]);return s}const ym=e=>!zr(e)||Ar(e);function ah(e,t){if(ym(e)||ym(t))throw Po(Mo.INVALID_VALUE);for(const n in e)MC(e,n)&&(ym(e[n])||ym(t[n])?t[n]=e[n]:ah(e[n],t[n]))}function MO(e){return e.type}function IO(e,t,n){let r=zr(t.messages)?t.messages:{};"__i18nGlobal"in n&&(r=Fy(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,r[i])});{if(zr(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(s=>{e.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(zr(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(s=>{e.mergeNumberFormat(s,t.numberFormats[s])})}}}function XS(e){return St(Hf,null,e,0)}const ZS="__INTLIFY_META__";let QS=0;function ek(e){return(t,n,r,o)=>e(n,r,Ki()||void 0,o)}const pG=()=>{const e=Ki();let t=null;return e&&(t=MO(e)[ZS])?{[ZS]:t}:null};function wC(e={},t){const{__root:n}=e,r=n===void 0;let o=Wn(e.inheritLocale)?e.inheritLocale:!0;const i=Ne(n&&o?n.locale.value:kt(e.locale)?e.locale:hg),s=Ne(n&&o?n.fallbackLocale.value:kt(e.fallbackLocale)||Ar(e.fallbackLocale)||dn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i.value),u=Ne(Fy(i.value,e)),d=Ne(dn(e.datetimeFormats)?e.datetimeFormats:{[i.value]:{}}),f=Ne(dn(e.numberFormats)?e.numberFormats:{[i.value]:{}});let g=n?n.missingWarn:Wn(e.missingWarn)||yu(e.missingWarn)?e.missingWarn:!0,v=n?n.fallbackWarn:Wn(e.fallbackWarn)||yu(e.fallbackWarn)?e.fallbackWarn:!0,_=n?n.fallbackRoot:Wn(e.fallbackRoot)?e.fallbackRoot:!0,M=!!e.fallbackFormat,C=Xr(e.missing)?e.missing:null,D=Xr(e.missing)?ek(e.missing):null,w=Xr(e.postTranslation)?e.postTranslation:null,S=n?n.warnHtmlMessage:Wn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,N=!!e.escapeParameter;const A=n?n.modifiers:dn(e.modifiers)?e.modifiers:{};let L=e.pluralRules||n&&n.pluralRules,j;function V(){r&&HS(null);const q={version:dG,locale:i.value,fallbackLocale:s.value,messages:u.value,modifiers:A,pluralRules:L,missing:D===null?void 0:D,missingWarn:g,fallbackWarn:v,fallbackFormat:M,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:S,escapeParameter:N,messageResolver:e.messageResolver,__meta:{framework:"vue"}};q.datetimeFormats=d.value,q.numberFormats=f.value,q.__datetimeFormatters=dn(j)?j.__datetimeFormatters:void 0,q.__numberFormatters=dn(j)?j.__numberFormatters:void 0;const ne=JF(q);return r&&HS(ne),ne}j=V(),Pp(j,i.value,s.value);function x(){return[i.value,s.value,u.value,d.value,f.value]}const $=Ve({get:()=>i.value,set:q=>{i.value=q,j.locale=i.value}}),z=Ve({get:()=>s.value,set:q=>{s.value=q,j.fallbackLocale=s.value,Pp(j,i.value,q)}}),G=Ve(()=>u.value),O=Ve(()=>d.value),T=Ve(()=>f.value);function P(){return Xr(w)?w:null}function Z(q){w=q,j.postTranslation=q}function K(){return C}function oe(q){q!==null&&(D=ek(q)),C=q,j.missing=D}function J(q,ne,_e,Be,je,lt){x();let Fe;if(__INTLIFY_PROD_DEVTOOLS__)try{BS(pG()),r||(j.fallbackContext=n?YF():void 0),Fe=q(j)}finally{BS(null),r||(j.fallbackContext=void 0)}else Fe=q(j);if(Lo(Fe)&&Fe===Uy){const[it,Tt]=ne();return n&&_?Be(n):je(it)}else{if(lt(Fe))return Fe;throw Po(Mo.UNEXPECTED_RETURN_TYPE)}}function ie(...q){return J(ne=>Reflect.apply(jS,null,[ne,...q]),()=>bM(...q),"translate",ne=>Reflect.apply(ne.t,ne,[...q]),ne=>ne,ne=>kt(ne))}function pe(...q){const[ne,_e,Be]=q;if(Be&&!zr(Be))throw Po(Mo.INVALID_ARGUMENT);return ie(ne,_e,No({resolvedMessage:!0},Be||{}))}function ue(...q){return J(ne=>Reflect.apply(WS,null,[ne,...q]),()=>MM(...q),"datetime format",ne=>Reflect.apply(ne.d,ne,[...q]),()=>$S,ne=>kt(ne))}function de(...q){return J(ne=>Reflect.apply(YS,null,[ne,...q]),()=>IM(...q),"number format",ne=>Reflect.apply(ne.n,ne,[...q]),()=>$S,ne=>kt(ne))}function Y(q){return q.map(ne=>kt(ne)?XS(ne):ne)}const fe={normalize:Y,interpolate:q=>q,type:"vnode"};function Ae(...q){return J(ne=>{let _e;const Be=ne;try{Be.processor=fe,_e=Reflect.apply(jS,null,[Be,...q])}finally{Be.processor=null}return _e},()=>bM(...q),"translate",ne=>ne[TM](...q),ne=>[XS(ne)],ne=>Ar(ne))}function ye(...q){return J(ne=>Reflect.apply(YS,null,[ne,...q]),()=>IM(...q),"number format",ne=>ne[SM](...q),()=>[],ne=>kt(ne)||Ar(ne))}function le(...q){return J(ne=>Reflect.apply(WS,null,[ne,...q]),()=>MM(...q),"datetime format",ne=>ne[wM](...q),()=>[],ne=>kt(ne)||Ar(ne))}function Q(q){L=q,j.pluralRules=L}function ve(q,ne){const _e=kt(ne)?ne:i.value,Be=W(_e);return j.messageResolver(Be,q)!==null}function Le(q){let ne=null;const _e=lO(j,s.value,i.value);for(let Be=0;Be<_e.length;Be++){const je=u.value[_e[Be]]||{},lt=j.messageResolver(je,q);if(lt!=null){ne=lt;break}}return ne}function me(q){const ne=Le(q);return ne??(n?n.tm(q)||{}:{})}function W(q){return u.value[q]||{}}function te(q,ne){u.value[q]=ne,j.messages=u.value}function se(q,ne){u.value[q]=u.value[q]||{},ah(ne,u.value[q]),j.messages=u.value}function Te(q){return d.value[q]||{}}function ce(q,ne){d.value[q]=ne,j.datetimeFormats=d.value,KS(j,q,ne)}function Se(q,ne){d.value[q]=No(d.value[q]||{},ne),j.datetimeFormats=d.value,KS(j,q,ne)}function Pe(q){return f.value[q]||{}}function xe(q,ne){f.value[q]=ne,j.numberFormats=f.value,JS(j,q,ne)}function He(q,ne){f.value[q]=No(f.value[q]||{},ne),j.numberFormats=f.value,JS(j,q,ne)}QS++,n&&z7&&($t(n.locale,q=>{o&&(i.value=q,j.locale=q,Pp(j,i.value,s.value))}),$t(n.fallbackLocale,q=>{o&&(s.value=q,j.fallbackLocale=q,Pp(j,i.value,s.value))}));const Ie={id:QS,locale:$,fallbackLocale:z,get inheritLocale(){return o},set inheritLocale(q){o=q,q&&n&&(i.value=n.locale.value,s.value=n.fallbackLocale.value,Pp(j,i.value,s.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:G,get modifiers(){return A},get pluralRules(){return L||{}},get isGlobal(){return r},get missingWarn(){return g},set missingWarn(q){g=q,j.missingWarn=g},get fallbackWarn(){return v},set fallbackWarn(q){v=q,j.fallbackWarn=v},get fallbackRoot(){return _},set fallbackRoot(q){_=q},get fallbackFormat(){return M},set fallbackFormat(q){M=q,j.fallbackFormat=M},get warnHtmlMessage(){return S},set warnHtmlMessage(q){S=q,j.warnHtmlMessage=q},get escapeParameter(){return N},set escapeParameter(q){N=q,j.escapeParameter=q},t:ie,getLocaleMessage:W,setLocaleMessage:te,mergeLocaleMessage:se,getPostTranslationHandler:P,setPostTranslationHandler:Z,getMissingHandler:K,setMissingHandler:oe,[_O]:Q};return Ie.datetimeFormats=O,Ie.numberFormats=T,Ie.rt=pe,Ie.te=ve,Ie.tm=me,Ie.d=ue,Ie.n=de,Ie.getDateTimeFormat=Te,Ie.setDateTimeFormat=ce,Ie.mergeDateTimeFormat=Se,Ie.getNumberFormat=Pe,Ie.setNumberFormat=xe,Ie.mergeNumberFormat=He,Ie[bO]=e.__injectWithOption,Ie[TM]=Ae,Ie[wM]=le,Ie[SM]=ye,Ie}function hG(e){const t=kt(e.locale)?e.locale:hg,n=kt(e.fallbackLocale)||Ar(e.fallbackLocale)||dn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=Xr(e.missing)?e.missing:void 0,o=Wn(e.silentTranslationWarn)||yu(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Wn(e.silentFallbackWarn)||yu(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,s=Wn(e.fallbackRoot)?e.fallbackRoot:!0,u=!!e.formatFallbackMessages,d=dn(e.modifiers)?e.modifiers:{},f=e.pluralizationRules,g=Xr(e.postTranslation)?e.postTranslation:void 0,v=kt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,_=!!e.escapeParameterHtml,M=Wn(e.sync)?e.sync:!0;let C=e.messages;if(dn(e.sharedMessages)){const j=e.sharedMessages;C=Object.keys(j).reduce((x,$)=>{const z=x[$]||(x[$]={});return No(z,j[$]),x},C||{})}const{__i18n:D,__root:w,__injectWithOption:S}=e,N=e.datetimeFormats,A=e.numberFormats,L=e.flatJson;return{locale:t,fallbackLocale:n,messages:C,flatJson:L,datetimeFormats:N,numberFormats:A,missing:r,missingWarn:o,fallbackWarn:i,fallbackRoot:s,fallbackFormat:u,modifiers:d,pluralRules:f,postTranslation:g,warnHtmlMessage:v,escapeParameter:_,messageResolver:e.messageResolver,inheritLocale:M,__i18n:D,__root:w,__injectWithOption:S}}function DM(e={},t){{const n=wC(hG(e)),r={id:n.id,get locale(){return n.locale.value},set locale(o){n.locale.value=o},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(o){n.fallbackLocale.value=o},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(o){},get missing(){return n.getMissingHandler()},set missing(o){n.setMissingHandler(o)},get silentTranslationWarn(){return Wn(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(o){n.missingWarn=Wn(o)?!o:o},get silentFallbackWarn(){return Wn(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(o){n.fallbackWarn=Wn(o)?!o:o},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(o){n.fallbackFormat=o},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(o){n.setPostTranslationHandler(o)},get sync(){return n.inheritLocale},set sync(o){n.inheritLocale=o},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){n.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(o){n.escapeParameter=o},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(o){},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...o){const[i,s,u]=o,d={};let f=null,g=null;if(!kt(i))throw Po(Mo.INVALID_ARGUMENT);const v=i;return kt(s)?d.locale=s:Ar(s)?f=s:dn(s)&&(g=s),Ar(u)?f=u:dn(u)&&(g=u),Reflect.apply(n.t,n,[v,f||g||{},d])},rt(...o){return Reflect.apply(n.rt,n,[...o])},tc(...o){const[i,s,u]=o,d={plural:1};let f=null,g=null;if(!kt(i))throw Po(Mo.INVALID_ARGUMENT);const v=i;return kt(s)?d.locale=s:Lo(s)?d.plural=s:Ar(s)?f=s:dn(s)&&(g=s),kt(u)?d.locale=u:Ar(u)?f=u:dn(u)&&(g=u),Reflect.apply(n.t,n,[v,f||g||{},d])},te(o,i){return n.te(o,i)},tm(o){return n.tm(o)},getLocaleMessage(o){return n.getLocaleMessage(o)},setLocaleMessage(o,i){n.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){n.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(n.d,n,[...o])},getDateTimeFormat(o){return n.getDateTimeFormat(o)},setDateTimeFormat(o,i){n.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){n.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(n.n,n,[...o])},getNumberFormat(o){return n.getNumberFormat(o)},setNumberFormat(o,i){n.setNumberFormat(o,i)},mergeNumberFormat(o,i){n.mergeNumberFormat(o,i)},getChoiceIndex(o,i){return-1},__onComponentInstanceCreated(o){const{componentInstanceCreatedListener:i}=e;i&&i(o,r)}};return r}}const SC={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function gG({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((r,o)=>r=[...r,...Ar(o.children)?o.children:[o]],[]):t.reduce((n,r)=>{const o=e[r];return o&&(n[r]=o()),n},{})}function CO(e){return dt}const tk={name:"i18n-t",props:No({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Lo(e)||!isNaN(e)}},SC),setup(e,t){const{slots:n,attrs:r}=t,o=e.i18n||Gy({useScope:e.scope,__useComponent:!0}),i=Object.keys(n).filter(s=>s!=="_");return()=>{const s={};e.locale&&(s.locale=e.locale),e.plural!==void 0&&(s.plural=kt(e.plural)?+e.plural:e.plural);const u=gG(t,i),d=o[TM](e.keypath,u,s),f=No({},r),g=kt(e.tag)||zr(e.tag)?e.tag:CO();return Re(g,f,d)}}};function TO(e,t,n,r){const{slots:o,attrs:i}=t;return()=>{const s={part:!0};let u={};e.locale&&(s.locale=e.locale),kt(e.format)?s.key=e.format:zr(e.format)&&(kt(e.format.key)&&(s.key=e.format.key),u=Object.keys(e.format).reduce((_,M)=>n.includes(M)?No({},_,{[M]:e.format[M]}):_,{}));const d=r(e.value,s,u);let f=[s.key];Ar(d)?f=d.map((_,M)=>{const C=o[_.type];return C?C({[_.type]:_.value,index:M,parts:d}):[_.value]}):kt(d)&&(f=[d]);const g=No({},i),v=kt(e.tag)||zr(e.tag)?e.tag:CO();return Re(v,g,f)}}const mG=["localeMatcher","style","unit","unitDisplay","currency","currencyDisplay","useGrouping","numberingSystem","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","notation","formatMatcher"],nk={name:"i18n-n",props:No({value:{type:Number,required:!0},format:{type:[String,Object]}},SC),setup(e,t){const n=e.i18n||Gy({useScope:"parent",__useComponent:!0});return TO(e,t,mG,(...r)=>n[SM](...r))}},vG=["dateStyle","timeStyle","fractionalSecondDigits","calendar","dayPeriod","numberingSystem","localeMatcher","timeZone","hour12","hourCycle","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"],rk={name:"i18n-d",props:No({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},SC),setup(e,t){const n=e.i18n||Gy({useScope:"parent",__useComponent:!0});return TO(e,t,vG,(...r)=>n[wM](...r))}};function yG(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const r=n.__getInstance(t);return r!=null?r.__composer:e.global.__composer}}function _G(e){const t=(n,{instance:r,value:o,modifiers:i})=>{if(!r||!r.$)throw Po(Mo.UNEXPECTED_ERROR);const s=yG(e,r.$),u=bG(o);n.textContent=Reflect.apply(s.t,s,[...MG(u)])};return{beforeMount:t,beforeUpdate:t}}function bG(e){if(kt(e))return{path:e};if(dn(e)){if(!("path"in e))throw Po(Mo.REQUIRED_VALUE,"path");return e}else throw Po(Mo.INVALID_VALUE)}function MG(e){const{path:t,locale:n,args:r,choice:o,plural:i}=e,s={},u=r||{};return kt(n)&&(s.locale=n),Lo(o)&&(s.plural=o),Lo(i)&&(s.plural=i),[t,u,s]}function IG(e,t,...n){const r=dn(n[0])?n[0]:{},o=!!r.useI18nComponentName;(Wn(r.globalInstall)?r.globalInstall:!0)&&(e.component(o?"i18n":tk.name,tk),e.component(nk.name,nk),e.component(rk.name,rk)),e.directive("t",_G(t))}function CG(e,t,n){return{beforeCreate(){const r=Ki();if(!r)throw Po(Mo.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root?this.$i18n=ok(e,i):(i.__injectWithOption=!0,this.$i18n=DM(i))}else o.__i18n?this===this.$root?this.$i18n=ok(e,o):this.$i18n=DM({__i18n:o.__i18n,__injectWithOption:!0,__root:t}):this.$i18n=e;o.__i18nGlobal&&IO(t,o,o),e.__onComponentInstanceCreated(this.$i18n),n.__setInstance(r,this.$i18n),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$tc=(...i)=>this.$i18n.tc(...i),this.$te=(i,s)=>this.$i18n.te(i,s),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i)},mounted(){},unmounted(){const r=Ki();if(!r)throw Po(Mo.UNEXPECTED_ERROR);delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__deleteInstance(r),delete this.$i18n}}}function ok(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[_O](t.pluralizationRules||e.pluralizationRules);const n=Fy(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(r=>e.mergeLocaleMessage(r,n[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>e.mergeNumberFormat(r,t.numberFormats[r])),e}const TG=Tu("global-vue-i18n");function wG(e={},t){const n=__VUE_I18N_LEGACY_API__&&Wn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,r=!!e.globalInjection,o=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,i=new Map,s=SG(e,n),u=Tu("");function d(v){return i.get(v)||null}function f(v,_){i.set(v,_)}function g(v){i.delete(v)}{const v={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return o},async install(_,...M){_.__VUE_I18N_SYMBOL__=u,_.provide(_.__VUE_I18N_SYMBOL__,v),!n&&r&&PG(_,v.global),__VUE_I18N_FULL_INSTALL__&&IG(_,v,...M),__VUE_I18N_LEGACY_API__&&n&&_.mixin(CG(s,s.__composer,v))},get global(){return s},__instances:i,__getInstance:d,__setInstance:f,__deleteInstance:g};return v}}function Gy(e={}){const t=Ki();if(t==null)throw Po(Mo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Po(Mo.NOT_INSLALLED);const n=kG(t),r=EG(n),o=MO(t),i=DG(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Po(Mo.NOT_AVAILABLE_IN_LEGACY_MODE);return OG(t,i,r,e)}if(i==="global")return IO(r,e,o),r;if(i==="parent"){let d=AG(n,t,e.__useComponent);return d==null&&(d=r),d}const s=n;let u=s.__getInstance(t);if(u==null){const d=No({},e);"__i18n"in o&&(d.__i18n=o.__i18n),r&&(d.__root=r),u=wC(d),LG(s,t),s.__setInstance(t,u)}return u}function SG(e,t,n){return __VUE_I18N_LEGACY_API__&&t?DM(e):wC(e)}function kG(e){{const t=tn(e.isCE?TG:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Po(e.isCE?Mo.NOT_INSLALLED_WITH_PROVIDE:Mo.UNEXPECTED_ERROR);return t}}function DG(e,t){return Py(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function EG(e){return e.mode==="composition"?e.global:e.global.__composer}function AG(e,t,n=!1){let r=null;const o=t.root;let i=t.parent;for(;i!=null;){const s=e;if(e.mode==="composition")r=s.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const u=s.__getInstance(i);u!=null&&(r=u.__composer,n&&r&&!r[bO]&&(r=null))}if(r!=null||o===i)break;i=i.parent}return r}function LG(e,t,n){On(()=>{},t),pl(()=>{e.__deleteInstance(t)},t)}function OG(e,t,n,r={}){const o=t==="local",i=vL(null);if(o&&e.proxy&&!e.proxy.$options.i18n)throw Po(Mo.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Wn(r.inheritLocale)?r.inheritLocale:!0,u=Ne(o&&s?n.locale.value:kt(r.locale)?r.locale:hg),d=Ne(o&&s?n.fallbackLocale.value:kt(r.fallbackLocale)||Ar(r.fallbackLocale)||dn(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:u.value),f=Ne(Fy(u.value,r)),g=Ne(dn(r.datetimeFormats)?r.datetimeFormats:{[u.value]:{}}),v=Ne(dn(r.numberFormats)?r.numberFormats:{[u.value]:{}}),_=o?n.missingWarn:Wn(r.missingWarn)||yu(r.missingWarn)?r.missingWarn:!0,M=o?n.fallbackWarn:Wn(r.fallbackWarn)||yu(r.fallbackWarn)?r.fallbackWarn:!0,C=o?n.fallbackRoot:Wn(r.fallbackRoot)?r.fallbackRoot:!0,D=!!r.fallbackFormat,w=Xr(r.missing)?r.missing:null,S=Xr(r.postTranslation)?r.postTranslation:null,N=o?n.warnHtmlMessage:Wn(r.warnHtmlMessage)?r.warnHtmlMessage:!0,A=!!r.escapeParameter,L=o?n.modifiers:dn(r.modifiers)?r.modifiers:{},j=r.pluralRules||o&&n.pluralRules;function V(){return[u.value,d.value,f.value,g.value,v.value]}const x=Ve({get:()=>i.value?i.value.locale.value:u.value,set:se=>{i.value&&(i.value.locale.value=se),u.value=se}}),$=Ve({get:()=>i.value?i.value.fallbackLocale.value:d.value,set:se=>{i.value&&(i.value.fallbackLocale.value=se),d.value=se}}),z=Ve(()=>i.value?i.value.messages.value:f.value),G=Ve(()=>g.value),O=Ve(()=>v.value);function T(){return i.value?i.value.getPostTranslationHandler():S}function P(se){i.value&&i.value.setPostTranslationHandler(se)}function Z(){return i.value?i.value.getMissingHandler():w}function K(se){i.value&&i.value.setMissingHandler(se)}function oe(se){return V(),se()}function J(...se){return i.value?oe(()=>Reflect.apply(i.value.t,null,[...se])):oe(()=>"")}function ie(...se){return i.value?Reflect.apply(i.value.rt,null,[...se]):""}function pe(...se){return i.value?oe(()=>Reflect.apply(i.value.d,null,[...se])):oe(()=>"")}function ue(...se){return i.value?oe(()=>Reflect.apply(i.value.n,null,[...se])):oe(()=>"")}function de(se){return i.value?i.value.tm(se):{}}function Y(se,Te){return i.value?i.value.te(se,Te):!1}function re(se){return i.value?i.value.getLocaleMessage(se):{}}function fe(se,Te){i.value&&(i.value.setLocaleMessage(se,Te),f.value[se]=Te)}function Ae(se,Te){i.value&&i.value.mergeLocaleMessage(se,Te)}function ye(se){return i.value?i.value.getDateTimeFormat(se):{}}function le(se,Te){i.value&&(i.value.setDateTimeFormat(se,Te),g.value[se]=Te)}function Q(se,Te){i.value&&i.value.mergeDateTimeFormat(se,Te)}function ve(se){return i.value?i.value.getNumberFormat(se):{}}function Le(se,Te){i.value&&(i.value.setNumberFormat(se,Te),v.value[se]=Te)}function me(se,Te){i.value&&i.value.mergeNumberFormat(se,Te)}const W={get id(){return i.value?i.value.id:-1},locale:x,fallbackLocale:$,messages:z,datetimeFormats:G,numberFormats:O,get inheritLocale(){return i.value?i.value.inheritLocale:s},set inheritLocale(se){i.value&&(i.value.inheritLocale=se)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(f.value)},get modifiers(){return i.value?i.value.modifiers:L},get pluralRules(){return i.value?i.value.pluralRules:j},get isGlobal(){return i.value?i.value.isGlobal:!1},get missingWarn(){return i.value?i.value.missingWarn:_},set missingWarn(se){i.value&&(i.value.missingWarn=se)},get fallbackWarn(){return i.value?i.value.fallbackWarn:M},set fallbackWarn(se){i.value&&(i.value.missingWarn=se)},get fallbackRoot(){return i.value?i.value.fallbackRoot:C},set fallbackRoot(se){i.value&&(i.value.fallbackRoot=se)},get fallbackFormat(){return i.value?i.value.fallbackFormat:D},set fallbackFormat(se){i.value&&(i.value.fallbackFormat=se)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:N},set warnHtmlMessage(se){i.value&&(i.value.warnHtmlMessage=se)},get escapeParameter(){return i.value?i.value.escapeParameter:A},set escapeParameter(se){i.value&&(i.value.escapeParameter=se)},t:J,getPostTranslationHandler:T,setPostTranslationHandler:P,getMissingHandler:Z,setMissingHandler:K,rt:ie,d:pe,n:ue,tm:de,te:Y,getLocaleMessage:re,setLocaleMessage:fe,mergeLocaleMessage:Ae,getDateTimeFormat:ye,setDateTimeFormat:le,mergeDateTimeFormat:Q,getNumberFormat:ve,setNumberFormat:Le,mergeNumberFormat:me};function te(se){se.locale.value=u.value,se.fallbackLocale.value=d.value,Object.keys(f.value).forEach(Te=>{se.mergeLocaleMessage(Te,f.value[Te])}),Object.keys(g.value).forEach(Te=>{se.mergeDateTimeFormat(Te,g.value[Te])}),Object.keys(v.value).forEach(Te=>{se.mergeNumberFormat(Te,v.value[Te])}),se.escapeParameter=A,se.fallbackFormat=D,se.fallbackRoot=C,se.fallbackWarn=M,se.missingWarn=_,se.warnHtmlMessage=N}return Bf(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Po(Mo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const se=i.value=e.proxy.$i18n.__composer;t==="global"?(u.value=se.locale.value,d.value=se.fallbackLocale.value,f.value=se.messages.value,g.value=se.datetimeFormats.value,v.value=se.numberFormats.value):o&&te(se)}),W}const RG=["locale","fallbackLocale","availableLocales"],NG=["t","rt","d","n","tm"];function PG(e,t){const n=Object.create(null);RG.forEach(r=>{const o=Object.getOwnPropertyDescriptor(t,r);if(!o)throw Po(Mo.UNEXPECTED_ERROR);const i=gr(o.value)?{get(){return o.value.value},set(s){o.value.value=s}}:{get(){return o.get&&o.get()}};Object.defineProperty(n,r,i)}),e.config.globalProperties.$i18n=n,NG.forEach(r=>{const o=Object.getOwnPropertyDescriptor(t,r);if(!o||!o.value)throw Po(Mo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${r}`,o)})}zF(ZF);jF(kF);WF(lO);fG();if(__INTLIFY_PROD_DEVTOOLS__){const e=sh();e.__INTLIFY__=!0,xF(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const xG={群公告:"Group notice",群成员:"Group member",群管理:"Manage group",好友工作群:"Work",陌生人社交群:"Public",临时会议群:"Meeting",直播群:"AVChatRom",自由加入:"Join freely",需要验证:"Require approval",禁止加群:"Disallow group joining",人:"",群ID:"Group ID",群头像:"Group profile photo",群类型:"Group type",加群方式:"Group joining mode",转让群组:"Transfer ownership",解散群聊:"Disband group",退出群组:"Quit group",群管理员:"Group admin",学生禁言:"Mute All","学生禁言开启后,只允许群主和管理员发言。":"If Mute All is enabled, only the group owner and admin can speak.",单独禁言人员:"Mute a member",删除成员:"Remove member","确定从群聊中删除该成员?":"Are you sure you want to remove this member from the group chat?","确定从群聊中删除所选成员?":"Are you sure you want to remove selected member(s) from the group chat?",暂无公告:"No notice",发布:"Post",编辑:"Edit",群名称:"Group name",查看更多:"View more",管理员:"Admin",群主:"Group owner",我:"me",添加成员:"Add member",新增管理员:"Add admin",移除管理员:"Revoke admin",新增禁言用户:"Add muted member",移除禁言用户:"Remove muted member",修改群聊名称:"Edit group name","修改群聊名称后,将在群内通知其他成员":"After modifying the group chat name, other members will be notified in the group","仅限中文、字母、数字和下划线,2-20个字":"Chinese, letters, numbers and underscores only, 2-20 words","请先注册 TUIGroup 模块":"Please register the TUIGroup module first",该用户不存在:"The user does not exist",该用户不在群组内:"The user is not in the group"},UG={撤回:"Recall message",删除:"Delete message",复制:"Copy",重新发送:"Resend",转发:"Forward",引用:"Reference",回复:"Reply",回复详情:"Replies",条回复:"replies",打开:"Open",已读:"Read",全部已读:"All read",人已读:" read",人未读:" unread",人关闭阅读状态:" read status closed",消息详情:"Message Detail",关闭阅读状态:"Read status closed",该消息不存在:"The message does not exist",无法定位到原消息:"Unable to navigate to the original message",未读:"Unread",您:"You",撤回了一条消息:"recalled a message",重新编辑:"Re-edit",我:"I",查看更多:"View more",转发给:"Forward to",请输入消息:"Enter a message",描述:"Description",经度:"Longitude",纬度:"Latitude",自定义消息:"Custom message",图片:"[photo]",语音:"[audio]",视频:"[video]",表情:"[face]",文件:"[file]",自定义:"[custom message]",管理员开启学生禁言:"The admin enables Mute All",您已被管理员禁言:"You have been muted by the admin","按Enter发送,Ctrl+Enter换行":"Press Enter to send a message and Ctrl+Enter to start a new line",单击下载:"Click download","确认重发该消息?":"Confirm to resend the message?",取消:"Cancel",确定:"Submit",对方正在输入:"Typing...",回到最新位置:"Back to the latest location",条新消息:" new messages",安全提示:"【Security Tips】This APP is only used to experience the functions of Tencent Cloud Instant Messaging products, and cannot be used for business negotiation and expansion. Don't trust money-related information such as remittances and lottery wins, don't make unfamiliar phone calls easily, and beware of being deceived.",点此投诉:"Complain",语音通话:"Voice Call",视频通话:"Video Call",发起群语音:"Make group voice call",发起群视频:"Make group video call",已接听:"Answered",拒绝通话:"Decline Call",无应答:"No Answer",取消通话:"Cancel Call",发起通话:"Start Call",结束群聊:"Edit Group Call",通话时长:"Duration",欢迎使用TUICallKit:"Welcome to TUICallKit","检测到您暂未集成TUICallKit,无法体验音视频通话功能":"It is detected that you have not integrated TUI CallKit yet, so you cannot experience the audio and video call. ",请点击:"Please click",集成TUICallKit:" Integrate TUICallKit ",开通腾讯实时音视频服务:"Integration Tencent Real-Time Communication",进行体验:"to experience.",您当前购买使用的套餐包暂未开通此功能:"The package you purchased does not support this ability.",选择提醒的人:"Select Contact",manage:xG},FG={发起单聊:"New one-to-one chat",发起群聊:"New group chat",请输入userID:"Enter a user ID",删除会话:"Delete conversation",系统通知:"System notification",置顶会话:"Top conversation",取消置顶:"cancel top conversation",消息免打扰:"Message not disturb",取消免打扰:"cancel not disturb","有人@我":"Someone {'@'} me","@所有人":"{'@'}Everyone",条:"strip",我:"me","网络异常,请您检查网络设置":"Network exception, please check the network settings"},GG={输入groupID搜索:"Enter groupId search",群名称:"Group name",群ID:"Group ID",加入群聊:"Join",解散群聊:"Dissolution",退出群聊:"Quit",群类型:"Group type",请填写验证信息:"Please fill in the verification information",申请加入:"Apply Join",已申请:"Applied"},$G={资料设置:"Edit profile",头像:"Profile photo",昵称:"Name",账号:"Account",个性签名:"Status",性别:"Gender",男:"Male",女:"Female",不显示:"Rather not say",出生年月:"Birthday",取消:"Cancel",保存:"Save",请选择出生日期:"Select the date of birthday",选择头像:"Select Avatar",设置昵称:"Setting Name","仅限中文、字母、数字和下划线,2-20个字":"Chinese, letters, numbers and underscores only, 2-20 words",请输入昵称:"Enter Name",性别选择:"Select gender",请输入内容:"Enter content",用户ID:"userID",暂未设置:"Not set yet"},BG={群聊通知:"Group Chat Notifications",系统通知:"System Notifications",我的群聊:"My Group Chats","输入群ID,按回车搜索":"Enter a group ID",群名称:"Group name",群ID:"Group ID",加入群聊:"Join group chat",解散群聊:"Disband group chat",退出群聊:"Quit group chat",进入群聊:"Enter group chat",群类型:"Group type",请填写验证信息:"Enter the verification info",申请加入:"Request to join",已申请:"Requested",接受:"Accept",拒绝:"Refuse",已处理:"Handled",添加群聊:"add group chat",已加入:"joined",该群组不存在:"The group does not exist",加群:"join",我的好友:"Friend",发送消息:"Send Message",个性签名:"Signature"},HG={发起会话:"Start chat",发起单聊:"New one-to-one chat",发起群聊:"New group chat",该用户不存在:"The user does not exist","创建群聊,请注册 TUIGroup 模块":"To create a group chat, please register the TUIGroup module",创建成功:"Creation successful","发起多人会话(群聊)":"New group chat",群头像:"Group profile photo",群名称:"Group name",群ID:"Group ID",群类型:"Group type",选填:"Optional",取消:"Cancel",创建:"Create","类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见":"Similar to a WeChat group. Users can join the group only via invitation by existing members. The invitation does not need to be agreed by the invitee or approved by the group owner. See the documentation for details.","类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见":"Similar to a QQ group. After a public group is created, the group owner can designate group admins. To join the group, a user needs to search the group ID and send a request, which needs to be approved by the group owner or an admin before the user can join the group. See the documentation for details. ","创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见":"After the group is created, a user can join and quit the group freely and can view the messages sent before joining the group. It is suitable for scenarios that integrate Tencent Real-Time Communication (TRTC), such as audio and video conferences and online education. See the documentation for details.","创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见":"After a group is created, a user can join and quit the group freely. The group can have an unlimited number of members, but it does not store message history. It can be combined with Live Video Broadcasting (LVB) to support on-screen comment scenarios. See the documentation for details. ",产品文档:"product documentation",设置群名称:"Group name",请输入群名称:"Enter the group name",设置群ID:"Group ID",请输入群ID:"Enter the group ID",选择群类型:"Group type"},qG={群成员:"group members",加入群组:"joined the group",退出群组:"left the group",被:"by",踢出群组:"was kicked out of the group",成为管理员:"was set as an admin",被撤销管理员:"was revoked",被禁言:" was unmuted",被取消禁言:"cancel the prohibition",群提示消息:"group prompt message",管理员:"The admin",开启学生禁言:"enabled Mute All",取消学生禁言:"disabled Mute All",成为新的群主:"became the new group owner",修改群名为:"changed the group name to",发布新公告:"posted a new notice",申请加入群组:"requested to join the group",成功加入群组:"Successfully joined the group",被拒绝:"The request to join the group was refused",你被管理员:"You",群:"group",解散:"disbanded",创建群:"created the group",邀请你加群:"invite you to join the group",你退出群组:"You left the group",你被:"You were",设置为群:"set as group",的管理员:"as an admin",撤销群:"revoked",的管理员身份:"admin role of the group",同意加群:"agreed to join the group",拒接加群:"refused to join the group",自定义群系统通知:"Custom group system notification"},VG={自定义消息:"Custom message",通话时长:"Call duration",结束群聊:"End",切换语音通话:"Switch voice call",切换视频通话:"Switch video call",发起通话:"Start a call",取消通话:"Cancel",已接听:"Answered",拒绝通话:"Decline",无应答:"No answer",对本次服务评价:"Rate this service","查看详情>>":"View details >>"},zG={tip:qG,custom:VG},jG={取消:"Cancel",完成:"Done",已选中:"Selected",人:"",保存:"Save",请输入userID:"Enter a user ID",确定:"submit",全选:"All",已在群聊中:"exists"},WG={周:"week(s) ",天:"day(s)",小时:"hour(s) ",分钟:"minute(s)",刚刚:"Just now",前:" ago",昨天:"Yesterday",星期一:"Monday",星期二:"Tuesday",星期三:"Wednesday",星期四:"Thursday",星期五:"Friday",星期六:"Saturday",星期日:"Sunday"},KG={请对本次服务进行评价:"Please rate this service",提交评价:"Feedback","常用语-快捷回复工具":"Common Expressions - Quick Reply Tool",使用:"Build with",自定义消息:"Custom message",搭建:"","在吗?在吗?在吗?重要的话说三遍。":"Are you there? ","好久没聊天了,快来和我说说话~":"It’s been a long time. How about you?","好的,就这么说定了。":"Okay. It's a deal.","感恩的心,感谢有你。":"So grateful! ","糟糕!是心动的感觉!":"Oh, no. Flipped.","心疼地抱抱自己,我太难了!":"Give myself a warm hug. ","没关系,别在意,事情过去就过去了。":"Take it easy.","早上好,今天也是让人期待的一天呢!":"Good morning. Have a wonderful day.","熬夜有什么用,又没人陪你聊天,早点休息吧。":"It's better to go to bed early."},YG={请对本次服务进行评价:"Please rate this service",提交评价:"Feedback",服务评价工具:"Service rate tool",使用:"Build with",自定义消息:"Custom message",搭建:"",星:"Star"},JG={en:{取消:"Cancel",发送:"Send",系统通知:"System notification",关闭:"Close",确定:"Save",TUIChat:UG,TUIConversation:FG,TUIGroup:GG,TUIProfile:$G,TUIContact:BG,message:zG,component:jG,time:WG,Evaluate:YG,Words:KG,TUISearch:HG}},XG={群公告:"群公告",群成员:"群成员",群管理:"群管理",好友工作群:"好友工作群",陌生人社交群:"陌生人社交群",临时会议群:"临时会议群",直播群:"直播群",自由加入:"自由加入",需要验证:"需要验证",禁止加群:"禁止加群",人:"人",群ID:"群ID",群头像:"群头像",群类型:"群类型",加群方式:"加群方式",转让群组:"转让群组",解散群聊:"解散群聊",退出群组:"退出群组",群管理员:"群管理员",学生禁言:"学生禁言","学生禁言开启后,只允许群主和管理员发言。":"学生禁言开启后,只允许群主和管理员发言。",单独禁言人员:"单独禁言人员",删除成员:"删除成员","确定从群聊中删除该成员?":"确定从群聊中删除该成员?","确定从群聊中删除所选成员?":"确定从群聊中删除所选成员?",暂无公告:"暂无公告",发布:"发布",编辑:"编辑",群名称:"群名称",查看更多:"查看更多",管理员:"管理员",群主:"群主",我:"我",添加成员:"添加成员",新增管理员:"新增管理员",移除管理员:"移除管理员",新增禁言用户:"新增禁言用户",移除禁言用户:"移除禁言用户",修改群聊名称:"修改群聊名称","修改群聊名称后,将在群内通知其他成员":"修改群聊名称后,将在群内通知其他成员","仅限中文、字母、数字和下划线,2-20个字":"仅限中文、字母、数字和下划线,2-20个字","请先注册 TUIGroup 模块":"请先注册 TUIGroup 模块",该用户不存在:"该用户不存在",该用户不在群组内:"该用户不在群组内"},ZG={撤回:"撤回",删除:"删除",复制:"复制",重新发送:"重新发送",转发:"转发",引用:"引用",回复:"回复",回复详情:"回复详情",条回复:"条回复",打开:"打开",已读:"已读",未读:"未读",人已读:"人已读",人未读:"人未读",人关闭阅读状态:"人关闭阅读状态",全部已读:"全部已读",消息详情:"消息详情",关闭阅读状态:"关闭",您:"您",撤回了一条消息:"撤回了一条消息",重新编辑:"重新编辑",我:"我",自定义消息:"自定义消息",查看更多:"查看更多","确认重发该消息?":"确认重发该消息?",取消:"取消",确定:"确定",转发给:"转发给",请输入消息:"请输入消息,按Ctrl + ↵ 换行",描述:"描述",经度:"经度",纬度:"纬度",图片:"[图片]",语音:"[语音]",视频:"[视频]",表情:"[表情]",文件:"[文件]",自定义:"[自定义消息]",管理员开启学生禁言:"管理员开启学生禁言",您已被管理员禁言:"您已被管理员禁言","按Enter发送,Ctrl+Enter换行":"按Enter发送,Ctrl+Enter换行",单击下载:"单击下载",该消息不存在:"该消息不存在",无法定位到原消息:"无法定位到原消息",对方正在输入:"对方正在输入...",回到最新位置:"回到最新位置",条新消息:"条新消息",安全提示:"【安全提示】本 APP 仅用于体验腾讯云即时通信 IM 产品功能,不可用于业务洽谈与拓展。请勿轻信汇款、中奖等涉及钱款的信息,勿轻易拨打陌生电话,谨防上当受骗。",点此投诉:"点此投诉",语音通话:"语音通话",视频通话:"视频通话",发起群语音:"发起群语音",发起群视频:"发起群视频",已接听:"已接听",拒绝通话:"拒绝通话",无应答:"无应答",取消通话:"取消通话",发起通话:"发起通话",结束群聊:"结束群聊",通话时长:"通话时长",欢迎使用TUICallKit:"欢迎使用腾讯云音视频通话组件TUICallKit ","检测到您暂未集成TUICallKit,无法体验音视频通话功能":"检测到您暂未集成TUICallKit,无法体验音视频通话功能。",请点击:"请点击",集成TUICallKit:"集成 TUICallKit ",开通腾讯实时音视频服务:"开通腾讯实时音视频服务",进行体验:"进行体验。",您当前购买使用的套餐包暂未开通群消息已读回执功能:"您当前购买使用的套餐包暂未开通【群消息已读回执】功能,请升级至旗舰版进行体验",您当前购买使用的套餐包暂未开通在线用户列表功能:"您当前购买使用的套餐包暂未开通【在线用户列表】功能,请升级至旗舰版进行体验",您当前购买使用的套餐包暂未开通此功能:"您当前购买使用的套餐包暂未开通此功能。",选择提醒的人:"选择提醒的人",manage:XG},QG={发起单聊:"发起单聊",发起群聊:"发起群聊",请输入userID:"请输入userID",删除会话:"删除会话",置顶会话:"置顶会话",取消置顶:"取消置顶",消息免打扰:"消息免打扰",取消免打扰:"取消免打扰",系统通知:"系统通知","有人@我":"有人{'@'}我","@所有人":"{'@'}所有人",条:"条",我:"我","网络异常,请您检查网络设置":"网络异常,请您检查网络设置"},e$={输入groupID搜索:"输入groupID搜索",群名称:"群名称",群ID:"群ID",加入群聊:"加入群聊",解散群聊:"解散群聊",退出群聊:"退出群聊",群类型:"群类型",请填写验证信息:"请填写验证信息",申请加入:"申请加入",已申请:"已申请"},t$={资料设置:"资料设置",头像:"头像",昵称:"昵称",账号:"账号",个性签名:"个性签名",性别:"性别",男:"男",女:"女",不显示:"不显示",出生年月:"出生年月",取消:"取消",保存:"保存",请选择出生日期:"请选择出生日期",选择头像:"选择头像",设置昵称:"设置昵称","仅限中文、字母、数字和下划线,2-20个字":"仅限中文、字母、数字和下划线,2-20个字",请输入昵称:"请输入昵称",性别选择:"性别选择",请输入内容:"请输入内容",用户ID:"用户ID",暂未设置:"暂未设置"},n$={群聊通知:"群聊通知",系统通知:"系统通知",我的群聊:"我的群聊","输入群ID,按回车搜索":"输入群ID,按回车搜索",群名称:"群名称",群ID:"群ID",加入群聊:"加入群聊",解散群聊:"解散群聊",退出群聊:"退出群聊",进入群聊:"进入群聊",群类型:"群类型",请填写验证信息:"请填写验证信息",申请加入:"申请加入",已申请:"已申请",接受:"接受",拒绝:"拒绝",已处理:"已处理",添加群聊:"添加群聊",已加入:"已加入",该群组不存在:"该群组不存在",加群:"加群",我的好友:"我的好友",发送消息:"发送消息",个性签名:"个性签名"},r$={发起会话:"发起会话",发起单聊:"发起单聊",发起群聊:"发起群聊",该用户不存在:"该用户不存在","创建群聊,请注册 TUIGroup 模块":"创建群聊,请注册 TUIGroup 模块",创建成功:"创建成功","发起多人会话(群聊)":"发起多人会话(群聊)",群头像:"群头像",群名称:"群名称",群ID:"群ID",群类型:"群类型",选填:"选填",取消:"取消",创建:"创建","类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见":"类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见","类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见":"类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见","创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见":"创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见","创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见":"创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见",产品文档:"产品文档",设置群名称:"设置群名称",请输入群名称:"请输入群名称",设置群ID:"设置群ID",请输入群ID:"请输入群ID",选择群类型:"选择群类型"},o$={群成员:"群成员",加入群组:"加入群组",退出群组:"退出群组",被:"被",踢出群组:"移除出群组",成为管理员:"成为管理员",被撤销管理员:"被撤销管理员",被禁言:"被禁言",被取消禁言:"被取消禁言",群提示消息:"群提示消息",管理员:"管理员",开启学生禁言:"开启学生禁言",取消学生禁言:"取消学生禁言",成为新的群主:"成为新的群主",修改群名为:"修改群名为",发布新公告:"发布新公告",申请加入群组:"申请加入群组",成功加入群组:"成功加入群组",被拒绝:"被拒绝",你被管理员:"你被管理员",群:"群",解散:"解散",创建群:"创建群",邀请你加群:"邀请你加群",你退出群组:"你退出群组",你被:"你被",设置为群:"设置为群",的管理员:"的管理员",撤销群:"撤销群",的管理员身份:"的管理员身份",同意加群:"同意加群",拒接加群:"拒接加群",自定义群系统通知:"自定义群系统通知"},i$={自定义消息:"自定义消息",通话时长:"通话时长",结束群聊:"结束群聊",切换语音通话:"切换语音通话",切换视频通话:"切换视频通话",发起通话:"发起通话",取消通话:"取消通话",已接听:"已接听",拒绝通话:"拒绝通话",无应答:"无应答",对本次服务评价:"对本次服务评价","查看详情>>":"查看详情>>"},s$={tip:o$,custom:i$},a$={取消:"取消",完成:"完成",已选中:"已选中",人:"人",保存:"保存",请输入userID:"请输入userID",确定:"确定",全选:"全选",已在群聊中:"已在群聊中"},l$={周:"周",天:"天",小时:"小时",分钟:"分钟",刚刚:"刚刚",前:"前",昨天:"昨天",星期一:"星期一",星期二:"星期二",星期三:"星期三",星期四:"星期四",星期五:"星期五",星期六:"星期六",星期日:"星期日"},u$={"常用语-快捷回复工具":"常用语-快捷回复工具","在吗?在吗?在吗?重要的话说三遍。":"在吗?在吗?在吗?重要的话说三遍。","好久没聊天了,快来和我说说话~":"好久没聊天了,快来和我说说话~","好的,就这么说定了。":"好的,就这么说定了。","感恩的心,感谢有你。":"感恩的心,感谢有你。","糟糕!是心动的感觉!":"糟糕!是心动的感觉!","心疼地抱抱自己,我太难了!":"心疼地抱抱自己,我太难了!","没关系,别在意,事情过去就过去了。":"没关系,别在意,事情过去就过去了。","早上好,今天也是让人期待的一天呢!":"早上好,今天也是让人期待的一天呢!","熬夜有什么用,又没人陪你聊天,早点休息吧。":"熬夜有什么用,又没人陪你聊天,早点休息吧。"},c$={请对本次服务进行评价:"请对本次服务进行评价",提交评价:"提交评价",服务评价工具:"服务评价工具",使用:"使用",自定义消息:"自定义消息",搭建:"搭建",星:"星"},d$={zh_cn:{取消:"取消",发送:"发送",系统通知:"系统通知",关闭:"关闭",确定:"确定",TUIChat:ZG,TUIConversation:QG,TUIGroup:e$,TUIProfile:t$,TUIContact:n$,message:s$,component:a$,time:l$,Evaluate:c$,Words:u$,TUISearch:r$}},f$={...JG,...d$},Ka=class Ka{constructor(t){Kt(this,"messages",{en:{},zh_cn:{}});Kt(this,"i18n");this.messages=t}static getInstance(){return Ka.instance||(Ka.instance=new Ka(f$)),Ka.instance}provideMessage(t){return this.messages.en={...this.messages.en,...t.en},this.messages.zh_cn={...this.messages.zh_cn,...t.zh_cn},this.messages}useI18n(){return Gy()}static install(t){const n=Ka.getInstance();n.i18n=wG({legacy:!1,globalInjection:!0,global:!0,locale:"zh_cn",fallbackLocale:"zh_cn",messages:n.messages}),t.use(n.i18n)}static plugin(t){t.config.i18n=Ka.getInstance()}};Kt(Ka,"instance");let EM=Ka;const zh=function(){const e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),o=/(?:Firefox)/.test(e),i=/(?:iPad|PlayBook)/.test(e)||r&&!/(?:Mobile)/.test(e)||o&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!i;return{isTablet:i,isPhone:s,isAndroid:r,isPC:!s&&!r&&!n,isH5:s||r||i}},p$=[{name:"TUILongPress",callback:(e,t,n)=>{if(typeof t.value!="function"){const u=n.context.name;let d=`[longpress:] provided expression '${t.expression}' is not afunction, but has to be `;u&&(d+=`Found in component '${u}' `),console.warn(d)}let r=null;const o=u=>{u.type==="click"&&u.button!==0||r===null&&(r=setTimeout(()=>{s(u)},1e3))},i=u=>{r!==null&&(clearTimeout(r),r=null)},s=u=>{t.value(u)};e.addEventListener("mousedown",o,!1),e.addEventListener("touchstart",o,!1),e.addEventListener("click",i),e.addEventListener("mouseout",i),e.addEventListener("touchend",i),e.addEventListener("touchcancel",i)}}],h$=e=>{p$.map(t=>{e.directive(t.name,{beforeMount:t.callback})})};function g$(e){const t=e;let n,r,o,i;return t>=3600?(r=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),n=`${r}:${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,n=`00:${o}:${i}`):t<60&&(i=t<10?`0${t}`:t,n=`00:00:${i}`),n}const lh="https://web.sdk.qcloud.com/im/assets/emoji/",lf={"[NO]":"emoji_0@2x.png","[OK]":"emoji_1@2x.png","[下雨]":"emoji_2@2x.png","[么么哒]":"emoji_3@2x.png","[乒乓]":"emoji_4@2x.png","[便便]":"emoji_5@2x.png","[信封]":"emoji_6@2x.png","[偷笑]":"emoji_7@2x.png","[傲慢]":"emoji_8@2x.png","[再见]":"emoji_9@2x.png","[冷汗]":"emoji_10@2x.png","[凋谢]":"emoji_11@2x.png","[刀]":"emoji_12@2x.png","[删除]":"emoji_13@2x.png","[勾引]":"emoji_14@2x.png","[发呆]":"emoji_15@2x.png","[发抖]":"emoji_16@2x.png","[可怜]":"emoji_17@2x.png","[可爱]":"emoji_18@2x.png","[右哼哼]":"emoji_19@2x.png","[右太极]":"emoji_20@2x.png","[右车头]":"emoji_21@2x.png","[吐]":"emoji_22@2x.png","[吓]":"emoji_23@2x.png","[咒骂]":"emoji_24@2x.png","[咖啡]":"emoji_25@2x.png","[啤酒]":"emoji_26@2x.png","[嘘]":"emoji_27@2x.png","[回头]":"emoji_28@2x.png","[困]":"emoji_29@2x.png","[坏笑]":"emoji_30@2x.png","[多云]":"emoji_31@2x.png","[大兵]":"emoji_32@2x.png","[大哭]":"emoji_33@2x.png","[太阳]":"emoji_34@2x.png","[奋斗]":"emoji_35@2x.png","[奶瓶]":"emoji_36@2x.png","[委屈]":"emoji_37@2x.png","[害羞]":"emoji_38@2x.png","[尴尬]":"emoji_39@2x.png","[左哼哼]":"emoji_40@2x.png","[左太极]":"emoji_41@2x.png","[左车头]":"emoji_42@2x.png","[差劲]":"emoji_43@2x.png","[弱]":"emoji_44@2x.png","[强]":"emoji_45@2x.png","[彩带]":"emoji_46@2x.png","[彩球]":"emoji_47@2x.png","[得意]":"emoji_48@2x.png","[微笑]":"emoji_49@2x.png","[心碎了]":"emoji_50@2x.png","[快哭了]":"emoji_51@2x.png","[怄火]":"emoji_52@2x.png","[怒]":"emoji_53@2x.png","[惊恐]":"emoji_54@2x.png","[惊讶]":"emoji_55@2x.png","[憨笑]":"emoji_56@2x.png","[手枪]":"emoji_57@2x.png","[打哈欠]":"emoji_58@2x.png","[抓狂]":"emoji_59@2x.png","[折磨]":"emoji_60@2x.png","[抠鼻]":"emoji_61@2x.png","[抱抱]":"emoji_62@2x.png","[抱拳]":"emoji_63@2x.png","[拳头]":"emoji_64@2x.png","[挥手]":"emoji_65@2x.png","[握手]":"emoji_66@2x.png","[撇嘴]":"emoji_67@2x.png","[擦汗]":"emoji_68@2x.png","[敲打]":"emoji_69@2x.png","[晕]":"emoji_70@2x.png","[月亮]":"emoji_71@2x.png","[棒棒糖]":"emoji_72@2x.png","[汽车]":"emoji_73@2x.png","[沙发]":"emoji_74@2x.png","[流汗]":"emoji_75@2x.png","[流泪]":"emoji_76@2x.png","[激动]":"emoji_77@2x.png","[灯泡]":"emoji_78@2x.png","[炸弹]":"emoji_79@2x.png","[熊猫]":"emoji_80@2x.png","[爆筋]":"emoji_81@2x.png","[爱你]":"emoji_82@2x.png","[爱心]":"emoji_83@2x.png","[爱情]":"emoji_84@2x.png","[猪头]":"emoji_85@2x.png","[猫咪]":"emoji_86@2x.png","[献吻]":"emoji_87@2x.png","[玫瑰]":"emoji_88@2x.png","[瓢虫]":"emoji_89@2x.png","[疑问]":"emoji_90@2x.png","[白眼]":"emoji_91@2x.png","[皮球]":"emoji_92@2x.png","[睡觉]":"emoji_93@2x.png","[磕头]":"emoji_94@2x.png","[示爱]":"emoji_95@2x.png","[礼品袋]":"emoji_96@2x.png","[礼物]":"emoji_97@2x.png","[篮球]":"emoji_98@2x.png","[米饭]":"emoji_99@2x.png","[糗大了]":"emoji_100@2x.png","[红双喜]":"emoji_101@2x.png","[红灯笼]":"emoji_102@2x.png","[纸巾]":"emoji_103@2x.png","[胜利]":"emoji_104@2x.png","[色]":"emoji_105@2x.png","[药]":"emoji_106@2x.png","[菜刀]":"emoji_107@2x.png","[蛋糕]":"emoji_108@2x.png","[蜡烛]":"emoji_109@2x.png","[街舞]":"emoji_110@2x.png","[衰]":"emoji_111@2x.png","[西瓜]":"emoji_112@2x.png","[调皮]":"emoji_113@2x.png","[象棋]":"emoji_114@2x.png","[跳绳]":"emoji_115@2x.png","[跳跳]":"emoji_116@2x.png","[车厢]":"emoji_117@2x.png","[转圈]":"emoji_118@2x.png","[鄙视]":"emoji_119@2x.png","[酷]":"emoji_120@2x.png","[钞票]":"emoji_121@2x.png","[钻戒]":"emoji_122@2x.png","[闪电]":"emoji_123@2x.png","[闭嘴]":"emoji_124@2x.png","[闹钟]":"emoji_125@2x.png","[阴险]":"emoji_126@2x.png","[难过]":"emoji_127@2x.png","[雨伞]":"emoji_128@2x.png","[青蛙]":"emoji_129@2x.png","[面条]":"emoji_130@2x.png","[鞭炮]":"emoji_131@2x.png","[风车]":"emoji_132@2x.png","[飞吻]":"emoji_133@2x.png","[飞机]":"emoji_134@2x.png","[饥饿]":"emoji_135@2x.png","[香蕉]":"emoji_136@2x.png","[骷髅]":"emoji_137@2x.png","[麦克风]":"emoji_138@2x.png","[麻将]":"emoji_139@2x.png","[鼓掌]":"emoji_140@2x.png","[龇牙]":"emoji_141@2x.png"},wO=["[龇牙]","[调皮]","[流汗]","[偷笑]","[再见]","[敲打]","[擦汗]","[猪头]","[玫瑰]","[流泪]","[大哭]","[嘘]","[酷]","[抓狂]","[委屈]","[便便]","[炸弹]","[菜刀]","[可爱]","[色]","[害羞]","[得意]","[吐]","[微笑]","[怒]","[尴尬]","[惊恐]","[冷汗]","[爱心]","[示爱]","[白眼]","[傲慢]","[难过]","[惊讶]","[疑问]","[困]","[么么哒]","[憨笑]","[爱情]","[衰]","[撇嘴]","[阴险]","[奋斗]","[发呆]","[右哼哼]","[抱抱]","[坏笑]","[飞吻]","[鄙视]","[晕]","[大兵]","[可怜]","[强]","[弱]","[握手]","[胜利]","[抱拳]","[凋谢]","[米饭]","[蛋糕]","[西瓜]","[啤酒]","[瓢虫]","[勾引]","[OK]","[爱你]","[咖啡]","[月亮]","[刀]","[发抖]","[差劲]","[拳头]","[心碎了]","[太阳]","[礼物]","[皮球]","[骷髅]","[挥手]","[闪电]","[饥饿]","[咒骂]","[折磨]","[抠鼻]","[鼓掌]","[糗大了]","[左哼哼]","[打哈欠]","[快哭了]","[吓]","[篮球]","[乒乓]","[NO]","[跳跳]","[怄火]","[转圈]","[磕头]","[回头]","[跳绳]","[激动]","[街舞]","[献吻]","[左太极]","[右太极]","[闭嘴]","[猫咪]","[红双喜]","[鞭炮]","[红灯笼]","[麻将]","[麦克风]","[礼品袋]","[信封]","[象棋]","[彩带]","[蜡烛]","[爆筋]","[棒棒糖]","[奶瓶]","[面条]","[香蕉]","[飞机]","[左车头]","[车厢]","[右车头]","[多云]","[下雨]","[钞票]","[熊猫]","[灯泡]","[风车]","[闹钟]","[雨伞]","[彩球]","[钻戒]","[沙发]","[纸巾]","[手枪]","[青蛙]"],m$="https://web.sdk.qcloud.com/im/assets/face-elem/",v$=[{icon:1,list:["yz00","yz01","yz02","yz03","yz04","yz05","yz06","yz07","yz08","yz09","yz10","yz11","yz12","yz13","yz14","yz15","yz16","yz17"]},{icon:2,list:["ys00","ys01","ys02","ys03","ys04","ys05","ys06","ys07","ys08","ys09","ys10","ys11","ys12","ys13","ys14","ys15"]},{icon:3,list:["gcs00","gcs01","gcs02","gcs03","gcs04","gcs05","gcs06","gcs07","gcs08","gcs09","gcs10","gcs11","gcs12","gcs13","gcs14","gcs15","gcs16"]}];function SO(e){const t=[];let n=e.text,r=-1,o=-1;for(;n!=="";)switch(r=n.indexOf("["),o=n.indexOf("]"),r){case 0:if(o===-1)t.push({name:"text",text:n}),n="";else{const i=n.slice(0,o+1);lf[i]?(t.push({name:"img",src:lh+lf[i]}),n=n.substring(o+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,r)}),n=n.substring(r);break}return t}var pi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function y$(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var kO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(pi,function(){function n(k,l){var p=Object.keys(k);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(k);l&&(a=a.filter(function(c){return Object.getOwnPropertyDescriptor(k,c).enumerable})),p.push.apply(p,a)}return p}function r(k){for(var l=1;l"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function M(k,l,p){return(M=_()?Reflect.construct.bind():function(a,c,h){var m=[null];m.push.apply(m,c);var y=new(Function.bind.apply(a,m));return h&&v(y,h.prototype),y}).apply(null,arguments)}function C(k){var l=typeof Map=="function"?new Map:void 0;return(C=function(p){if(p===null||(a=p,Function.toString.call(a).indexOf("[native code]")===-1))return p;var a;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(p))return l.get(p);l.set(p,c)}function c(){return M(p,arguments,g(this).constructor)}return c.prototype=Object.create(p.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),v(c,p)})(k)}function D(k,l){if(k==null)return{};var p,a,c=function(m,y){if(m==null)return{};var b,I,E={},R=Object.keys(m);for(I=0;I=0||(E[b]=m[b]);return E}(k,l);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(k);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(k,p)&&(c[p]=k[p])}return c}function w(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function S(k,l){if(l&&(typeof l=="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(k)}function N(k){var l=_();return function(){var p,a=g(k);if(l){var c=g(this).constructor;p=Reflect.construct(a,arguments,c)}else p=a.apply(this,arguments);return S(this,p)}}function A(k,l){return j(k)||function(p,a){var c=p==null?null:typeof Symbol<"u"&&p[Symbol.iterator]||p["@@iterator"];if(c!=null){var h,m,y=[],b=!0,I=!1;try{for(c=c.call(p);!(b=(h=c.next()).done)&&(y.push(h.value),!a||y.length!==a);b=!0);}catch(E){I=!0,m=E}finally{try{b||c.return==null||c.return()}finally{if(I)throw m}}return y}}(k,l)||x(k,l)||z()}function L(k){return function(l){if(Array.isArray(l))return $(l)}(k)||V(k)||x(k)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function j(k){if(Array.isArray(k))return k}function V(k){if(typeof Symbol<"u"&&k[Symbol.iterator]!=null||k["@@iterator"]!=null)return Array.from(k)}function x(k,l){if(k){if(typeof k=="string")return $(k,l);var p=Object.prototype.toString.call(k).slice(8,-1);return p==="Object"&&k.constructor&&(p=k.constructor.name),p==="Map"||p==="Set"?Array.from(k):p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p)?$(k,l):void 0}}function $(k,l){(l==null||l>k.length)&&(l=k.length);for(var p=0,a=new Array(l);p=k.length?{done:!0}:{done:!1,value:k[a++]}},e:function(b){throw b},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h,m=!0,y=!1;return{s:function(){p=p.call(k)},n:function(){var b=p.next();return m=b.done,b},e:function(b){y=!0,h=b},f:function(){try{m||p.return==null||p.return()}finally{if(y)throw h}}}}var O={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange"},T={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},P={NEW_INVITATION_RECEIVED:"newInvitationReceived",INVITEE_ACCEPTED:"ts_invitee_accepted",INVITEE_REJECTED:"ts_invitee_rejected",INVITATION_CANCELLED:"ts_invitation_cancelled",INVITATION_TIMEOUT:"ts_invitation_timeout",INVITATION_MODIFIED:"ts_invitation_modified",ACTION_TYPE_UNKNOWN:0,ACTION_TYPE_INVITE:1,ACTION_TYPE_CANCEL_INVITE:2,ACTION_TYPE_ACCEPT_INVITE:3,ACTION_TYPE_REJECT_INVITE:4,ACTION_TYPE_INVITE_TIMEOUT:5},Z=function(){function k(){i(this,k),this.cache=[],this.options=null}return u(k,[{key:"use",value:function(l){if(typeof l!="function")throw"middleware must be a function";return this.cache.push(l),this}},{key:"next",value:function(l){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(l){return this.middlewares=this.cache.map(function(p){return p}),this.options=l,this.next()}}]),k}(),K=function(){function k(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;i(this,k),this.high=l,this.low=p}return u(k,[{key:"equal",value:function(l){return l!==null&&this.low===l.low&&this.high===l.high}},{key:"toString",value:function(){var l=Number(this.high).toString(16),p=Number(this.low).toString(16);if(p.length<8)for(var a=8-p.length;a;)p="0"+p,a--;return l+p}}]),k}(),oe={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com"},KOREA:{DEFAULT:"wss://wsskr.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com"},GERMANY:{DEFAULT:"wss://wssger.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com"},IND:{DEFAULT:"wss://wssind.my-imcloud.com",BACKUP:"wss://wssind.im.qcloud.com",STAT:"https://apiind.my-imcloud.com"},JPN:{DEFAULT:"wss://wssjpn.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT:"wss://wssusa.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com"}}},J={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15},ie="1.7.3",pe=537048168,ue="CHINA",de="OVERSEA",Y="SINGAPORE",re="KOREA",fe="GERMANY",Ae="IND",ye="JPN",le="USA",Q={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue;this.CURRENT=oe.PRODUCTION[k]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GROUP:"group_open_http_svc",GROUP_AVCHATROOM:"group_open_avchatroom_http_svc",GROUP_COMMUNITY:"million_group_open_http_svc",GROUP_ATTR:"group_open_attr_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP_NO_AUTH:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_svc",BIG_GROUP_LONG_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MESSAGE:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",MESSAGE_SEARCH:"message_search"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v4",group_open_long_polling_http_svc:"v4",group_open_long_polling_http_noauth_svc:"v4",imopenstat:"v4",im_cos_sign_svr:"v4",im_cos_msg:"v4",webim:"v4",im_open_push:"v4",im_open_status:"v4"}},ve={SEARCH_MSG:new K(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new K(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new K(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new K(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new K(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new K(0,Math.pow(2,6)).toString(),USER_STATUS:new K(0,Math.pow(2,7)).toString(),CONV_MARK:new K(0,Math.pow(2,9)).toString(),CONV_GROUP:new K(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new K(0,Math.pow(2,11)).toString(),MSG_EXT:new K(0,Math.pow(2,13)).toString(),GRP_COUNTER:new K(0,Math.pow(2,15)).toString()},Le="c2c_text_message",me="c2c_custom_message",W="group_text_message",te="group_custom_message",se="user_profile",Te="sns",ce="group_profile",Se="group_member_profile";Q.HOST.setCurrent(ue);var Pe=typeof wx<"u"&&typeof wx.getSystemInfoSync=="function"&&!!wx.getSystemInfoSync().fontSizeSetting,xe=typeof qq<"u"&&typeof qq.getSystemInfoSync=="function"&&!!qq.getSystemInfoSync().fontSizeSetting,He=typeof tt<"u"&&typeof tt.getSystemInfoSync=="function"&&!!tt.getSystemInfoSync().fontSizeSetting,Ie=typeof swan<"u"&&typeof swan.getSystemInfoSync=="function"&&!!swan.getSystemInfoSync().fontSizeSetting,q=typeof my<"u"&&typeof my.getSystemInfoSync=="function"&&!!my.getSystemInfoSync().fontSizeSetting,ne=typeof jd<"u"&&typeof jd.getSystemInfoSync=="function",_e=typeof uni<"u"&&typeof window>"u"&&typeof uni.requireNativePlugin=="function",Be=typeof uni<"u",je=Pe||xe||He||Ie||q||_e||ne,lt=(typeof uni<"u"||typeof window<"u")&&!je,Fe=xe?qq:He?tt:Ie?swan:q?my:Pe?wx:_e?uni:ne?jd:{},it=lt&&window&&window.navigator&&window.navigator.userAgent||"",Tt=/(micromessenger|webbrowser)/i.test(it),mn=/AppleWebKit\/([\d.]+)/i.exec(it);mn&&parseFloat(mn.pop());var In,Cn,En=(In="WEB",Tt?In="WEB":xe?In="QQ_MP":He?In="TT_MP":Ie?In="BAIDU_MP":q?In="ALI_MP":Pe?In="WX_MP":_e&&(In="UNI_NATIVE_APP"),J[In]),vn=/iPad/i.test(it),Qe=/iPhone/i.test(it)&&!vn,yt=/iPod/i.test(it),Nt=Qe||vn||yt,ln=(Cn=it.match(/OS (\d+)_/i))&&Cn[1]?Cn[1]:null,en=/Android/i.test(it),Tn=function(){var k=it.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!k)return null;var l=k[1]&&parseFloat(k[1]),p=k[2]&&parseFloat(k[2]);return l&&p?parseFloat(k[1]+"."+k[2]):l||null}();(function(){var k=it.match(/Chrome\/(\d+)/);k&&k[1]&&parseFloat(k[1])})();var qn=/MSIE/.test(it)||it.indexOf("Trident")>-1&&it.indexOf("rv:11.0")>-1,ze=function(){var k=/MSIE\s(\d+)\.\d/.exec(it),l=k&&parseFloat(k[1]);return!l&&/Trident\/7.0/i.test(it)&&/rv:11.0/.test(it)&&(l=11),l}();(function(){var k=it.match(/TBS\/(\d+)/i);k&&k[1]&&k[1]})();var wt,_t,Bt=/Windows/i.test(it),Wt=/MAC OS X/i.test(it),mr=lt&&typeof Worker<"u"&&!qn,Cr=en||Nt,Xo=lt&&window.tencent_cloud_im_csig_flutter_for_web_25F_cy!==void 0;wt=typeof console<"u"?console:typeof pi<"u"&&pi.console?pi.console:typeof window<"u"&&window.console?window.console:{};for(var ho=function(){},$e=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Ze=$e.length;Ze--;)_t=$e[Ze],console[_t]||(wt[_t]=ho);var Ht=wt,wn=0,Mn=function(){return new Date().getTime()+wn},Pn=function(){wn=0},Kr=function(){return Math.floor(Mn()/1e3)},Gr=0;function ro(){return Bu()?"%c Chat %c":"Chat"}function ls(){var k,l=((k=new Date).setTime(Mn()),k);return l.toLocaleTimeString("en-US",{hour12:!1})+"."+function(p){var a;switch(p.toString().length){case 1:a="00"+p;break;case 2:a="0"+p;break;default:a=p}return a}(l.getMilliseconds())}var U={arguments2String:function(k){var l="";if(k.length===1)l=k[0];else for(var p=0,a=k.length;p=0?p[c]=l[c]:p[c]=k(l[c])):p[c]=void 0:p[c]=null;return p};function Pu(k,l){if(!rt(k)||!rt(l))return!1;var p=!1;return l.forEach(function(a){var c=a.key,h=a.value,m=k.find(function(y){return y.key===c});m?m.value!==h&&(m.value=h,p=!0):(k.push({key:c,value:h}),p=!0)}),p}var Go=function(k){return k===T.GRP_AVCHATROOM},go=function(k){var l=k.type,p=k.groupID;return l===T.GRP_COMMUNITY||"".concat(p).startsWith(vd)&&!"".concat(p).includes(Qs)},oo=function(k){return"".concat(k).startsWith(vd)&&"".concat(k).includes(Qs)},mo=function(k){return Et(k)&&k.slice(0,3)===T.CONV_C2C},io=function(k){return Et(k)&&k.slice(0,5)===T.CONV_GROUP},Cd=function(k){return Et(k)&&k===T.CONV_SYSTEM};function xu(k,l){var p={};return Object.keys(k).forEach(function(a){p[a]=l(k[a],a)}),p}function Uu(k){return je?new Promise(function(l,p){Fe.getImageInfo({src:k,success:function(a){l({width:a.width,height:a.height})},fail:function(){l({width:0,height:0})}})}):qn&&ze===9?Promise.resolve({width:0,height:0}):new Promise(function(l,p){var a=new Image;a.onload=function(){l({width:this.width,height:this.height}),a=null},a.onerror=function(){l({width:0,height:0}),a=null},a.src=k})}function Na(){function k(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(k()+k()).concat(k()).concat(k()).concat(k()).concat(k()).concat(k()).concat(k())}function Os(){var k="unknown";if(Wt&&(k="mac"),Bt&&(k="windows"),Nt&&(k="ios"),en&&(k="android"),je)try{var l=Fe.getSystemInfoSync().platform;l!==void 0&&(k=l)}catch{}return k}function Dg(k,l){k=k.split("."),l=l.split(".");for(var p=Math.max(k.length,l.length);k.lengthh)return 1;if(c-1?"".concat(p,"&"):"".concat(p,"?");I.url="".concat(E,m===198?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")}return Ge(p)?(I.url,D(I,ip)):I}function Fu(k){var l=k[2];k[2]=k[1],k[1]=l;for(var p=0;p=0;a--)k[a]==="1"&&l.push(Math.pow(2,p-a-1));return l}function Bu(){return!qn&&!je}function Pa(k){return"the length of userIDList cannot exceed ".concat(k)}function Ni(k,l){if(k){var p=k;return l&&(k.startsWith("http://")?p=k.replace(/^http:\/\/[^/]+/,l):k.startsWith("https://")&&(p=k.replace(/^https:\/\/[^/]+/,l))),p}}function ps(k){if(rt(k)&&k.length!==0){var l=0;return k.forEach(function(p){l+=p}),l.toFixed(0)}}function cp(k){if(rt(k)&&k.length!==0){var l=0;return k.forEach(function(p){l+=p}),(l/k.length).toFixed(0)}}var y0=Object.prototype.hasOwnProperty;function Ye(k){if(k==null)return!0;if(typeof k=="boolean")return!1;if(typeof k=="number")return k===0;if(typeof k=="string"||typeof k=="function"||Array.isArray(k))return k.length===0;if(k instanceof Error)return k.message==="";if(yn(k)){for(var l in k)if(y0.call(k,l))return!1;return!0}return!(!yd(k)&&(p=k,Ls(p)!=="set")&&!$r(k))&&k.size===0;var p}function dp(k,l,p){if(l===void 0)return!0;var a=!0;if(yn(l))Object.keys(l).forEach(function(h){var m=k.length===1?k[0][h]:void 0;a=!!xa(m,l[h],p,h)&&a});else if(rt(l))for(var c=0;c256)||(Je({api:"setConversationCustomData",param:"customData",desc:Rt("customData",256)}),!1):(Je({api:"setConversationCustomData",param:"customData",desc:mi()}),!1)}}},markConversation:{conversationIDList:r({},Xn),markType:{type:"number",validator:function(k){return un(k)?k<=0?(Je({api:"markConversation",param:"markType",desc:(l="markType",p=0,fn("NumberGreaterThanLog",l,p))}),!1):!(k>=Math.pow(2,64))||(Je({api:"markConversation",param:"markType",desc:xn("markType","Math.pow(2,64)")}),!1):(Je({api:"markConversation",param:"markType",desc:Hu()}),!1);var l,p}},enableMark:r({},wd)},createConversationGroup:{conversationIDList:r({},Xn),groupName:r(r({},at),{},{validator:function(k){return!!k&&(!(k.length>32)||(Je({api:"createConversationGroup",param:"groupName",desc:Rt("groupName",32)}),!1))}})},deleteConversationGroup:[r({name:"groupName"},at)],renameConversationGroup:{oldName:r({},at),newName:r(r({},at),{},{validator:function(k){return!!k&&(!(k.length>32)||(Je({api:"renameConversationGroup",param:"newName",desc:Rt("newName",32)}),!1))}})},addConversationsToGroup:{conversationIDList:r({},Xn),groupName:r({},at)},deleteConversationsFromGroup:{conversationIDList:r({},Xn),groupName:r({},at)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:at,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Xn},createGroup:{name:at},joinGroup:{groupID:at,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[r({name:"groupID"},at)],handleApplication:{message:Zn,handleAction:at,handleMessage:{type:"String"}},changeGroupOwner:{groupID:at,newOwnerID:at},updateGroupProfile:{groupID:at,muteAllMembers:{type:"Boolean"}},dismissGroup:[r({name:"groupID"},at)],searchGroupByID:[r({name:"groupID"},at)],initGroupAttributes:{groupID:at,groupAttributes:r(r({},Zn),{},{validator:function(k){var l=!0;return Object.keys(k).forEach(function(p){if(!Et(k[p]))return Je({api:"initGroupAttributes",param:"groupAttributes",desc:Vn("value")}),l=!1}),l}})},setGroupAttributes:{groupID:at,groupAttributes:r(r({},Zn),{},{validator:function(k){var l=!0;return Object.keys(k).forEach(function(p){if(!Et(k[p]))return Je({api:"setGroupAttributes",param:"groupAttributes",desc:Vn("value")}),l=!1}),l}})},deleteGroupAttributes:{groupID:at,keyList:{type:"Array",validator:function(k){if(Ge(k)||!rt(k))return Je({api:"deleteGroupAttributes",param:"keyList",desc:ke()}),!1;if(!Ye(k)){var l=!0;return k.forEach(function(p){if(!Et(p))return Je({api:"deleteGroupAttributes",param:"keyList",desc:fn("StringArrayRequiredLog")}),l=!1}),l}return!0}}},getGroupAttributes:{groupID:at,keyList:{type:"Array",validator:function(k){if(Ge(k)||!rt(k))return Je({api:"getGroupAttributes",param:"keyList",desc:ke()}),!1;if(!Ye(k)){var l=!0;return k.forEach(function(p){if(!Et(p))return Je({api:"getGroupAttributes",param:"keyList",desc:Vn("key")}),l=!1}),l}return!0}}},setGroupCounters:{groupID:at,counters:Zn},increaseGroupCounter:{groupID:at,key:at,value:qu},decreaseGroupCounter:{groupID:at,key:at,value:qu},getGroupCounters:{groupID:at},getGroupMemberList:{groupID:at,count:{type:"Number"}},getGroupMemberProfile:{groupID:at,userIDList:Xn,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:at,userIDList:Xn},setGroupMemberRole:{groupID:at,userID:at,role:at},setGroupMemberMuteTime:{groupID:at,userID:at,muteTime:{type:"Number",validator:function(k){return k>=0}}},setGroupMemberNameCard:{groupID:at,userID:{type:"String"},nameCard:{type:"String",validator:function(k){return Et(k)?(k.length,!0):(Je({api:"setGroupMemberNameCard",param:"nameCard",desc:mi()}),!1)}}},setGroupMemberCustomField:{groupID:at,userID:{type:"String"},memberCustomField:Xn},deleteGroupMember:{groupID:at},markGroupMemberList:{groupID:at,markType:{type:"number",validator:function(k){return un(k)?!(k<1e3)||(Je({api:"markGroupMemberList",param:"markType",desc:(l="markType",p=1e3,fn("NumberGreaterOrEqualLog",l,p))}),!1):(Je({api:"markGroupMemberList",param:"markType",desc:Hu()}),!1);var l,p}},userIDList:r({},Xn),enableMark:r({},wd)},createTextMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){return yn(k)?Et(k.text)?k.text.length!==0||(Je({api:"createTextMessage",param:"payload.text",desc:Yr()}),!1):(Je({api:"createTextMessage",param:"payload.text",desc:mi()}),!1):(Je({api:"createTextMessage",param:"payload",desc:An()}),!1)}})},createTextAtMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){return yn(k)?Et(k.text)?k.text.length===0?(Je({api:"createTextAtMessage",param:"payload.text",desc:Yr()}),!1):!(k.atUserList&&!rt(k.atUserList))||(Je({api:"createTextAtMessage",param:"payload.atUserList",desc:ke()}),!1):(Je({api:"createTextAtMessage",param:"payload.text",desc:mi()}),!1):(Je({api:"createTextAtMessage",param:"payload",desc:An()}),!1)}})},createCustomMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){return yn(k)?k.data&&!Et(k.data)?(Je({api:"createCustomMessage",param:"payload.data",desc:mi()}),!1):k.description&&!Et(k.description)?(Je({api:"createCustomMessage",param:"payload.description",desc:mi()}),!1):!(k.extension&&!Et(k.extension))||(Je({api:"createCustomMessage",param:"payload.extension",desc:mi()}),!1):(Je({api:"createCustomMessage",param:"payload",desc:An()}),!1)}})},createImageMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){if(!yn(k))return Je({api:"createImageMessage",param:"payload",desc:An()}),!1;if(Ge(k.file))return Je({api:"createImageMessage",param:"payload.file",desc:fp()}),!1;if(lt){if(!(k.file instanceof HTMLInputElement||$r(k.file)))return yn(k.file)&&typeof uni<"u"?k.file.tempFilePaths.length!==0&&k.file.tempFiles.length!==0||(Je({api:"createImageMessage",param:"payload.file",desc:Br()}),!1):(Je({api:"createImageMessage",param:"payload.file",desc:pp()}),!1);if(k.file instanceof HTMLInputElement&&k.file.files.length===0)return Je({api:"createImageMessage",param:"payload.file",desc:Br()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"createImageMessage",param:"onProgress",desc:ft()}),!0}}})},createAudioMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){return!!yn(k)||(Je({api:"createAudioMessage",param:"payload",desc:An()}),!1)}}),onProgress:{type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"createAudioMessage",param:"onProgress",desc:ft()}),!0}}},createVideoMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){if(!yn(k))return Je({api:"createVideoMessage",param:"payload",desc:An()}),!1;if(Ge(k.file))return Je({api:"createVideoMessage",param:"payload.file",desc:fp()}),!1;if(lt){if(!(k.file instanceof HTMLInputElement||$r(k.file)))return yn(k.file)&&typeof uni<"u"?!!$r(k.file.tempFile)||(Je({api:"createVideoMessage",param:"payload.file",desc:Br()}),!1):(Je({api:"createVideoMessage",param:"payload.file",desc:pp()}),!1);if(k.file instanceof HTMLInputElement&&k.file.files.length===0)return Je({api:"createVideoMessage",param:"payload.file",desc:Br()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"createVideoMessage",param:"onProgress",desc:ft()}),!0}}},createFaceMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){return yn(k)?un(k.index)?!!Et(k.data)||(Je({api:"createFaceMessage",param:"payload.data",desc:mi()}),!1):(Je({api:"createFaceMessage",param:"payload.index",desc:Hu()}),!1):(Je({api:"createFaceMessage",param:"payload",desc:An()}),!1)}})},createFileMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){if(!yn(k))return Je({api:"createFileMessage",param:"payload",desc:An()}),!1;if(Ge(k.file))return Je({api:"createFileMessage",param:"payload.file",desc:fp()}),!1;if(lt){if(!(k.file instanceof HTMLInputElement||$r(k.file)))return yn(k.file)&&typeof uni<"u"?k.file.tempFilePaths.length!==0&&k.file.tempFiles.length!==0||(Je({api:"createFileMessage",param:"payload.file",desc:Br()}),!1):(Je({api:"createFileMessage",param:"payload.file",desc:pp()}),!1);if(k.file instanceof HTMLInputElement&&k.file.files.length===0)return Je({api:"createFileMessage",param:"payload.file",desc:Br()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"createFileMessage",param:"onProgress",desc:ft()}),!0}}},createLocationMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){return yn(k)?Et(k.description)?un(k.longitude)?!!un(k.latitude)||(Je({api:"createLocationMessage",param:"payload.latitude",desc:Hu()}),!1):(Je({api:"createLocationMessage",param:"payload.longitude",desc:Hu()}),!1):(Je({api:"createLocationMessage",param:"payload.description",desc:mi()}),!1):(Je({api:"createLocationMessage",param:"payload",desc:An()}),!1)}})},createMergerMessage:{to:at,conversationType:at,payload:r(r({},Zn),{},{validator:function(k){if(Ye(k.messageList))return Je({api:"createMergerMessage",param:"payload.messageList",desc:Ke()}),!1;if(Ye(k.compatibleText))return Je({api:"createMergerMessage",param:"payload.compatibleText",desc:Rs("compatibleText")}),!1;var l=!1;return k.messageList.forEach(function(p){p.status===so.FAIL&&(l=!0)}),!l||(Je({api:"createMergerMessage",param:"payload.messageList",desc:fn("MergeFailedMessageLog")}),!1)}})},revokeMessage:[r(r({name:"message"},Zn),{},{validator:function(k){return Ye(k)?(Je({api:"revokeMessage",param:"message",desc:Co()}),!1):k.conversationType===T.CONV_SYSTEM?(Je({api:"revokeMessage",param:"message",desc:fn("MessageCanBeRevokedDesc")}),!1):k.isRevoked!==!0||(Je({api:"revokeMessage",param:"message",desc:fn("MessageRevokedLog")}),!1)}})],deleteMessage:[r(r({name:"messageList"},Xn),{},{validator:function(k){return!Ye(k)||(Je({api:"deleteMessage",param:"messageList",desc:Ke()}),!1)}})],translateText:{sourceTextList:Xn,sourceLanguage:at,targetLanguage:at},modifyMessage:[r(r({name:"message"},Zn),{},{validator:function(k){return Ye(k)?(Je({api:"modifyMessage",param:"message",desc:Co()}),!1):k.conversationType===T.CONV_SYSTEM?(Je({api:"modifyMessage",param:"message",desc:fn("MessageCanBeModifiedLog")}),!1):k._onlineOnlyFlag!==!0||(Je({api:"modifyMessage",param:"message",desc:fn("OnlineMessageNotSupportLog")}),!1)}})],searchCloudMessages:{keywordList:{type:"Array",required:!1,validator:function(k){return!k||(rt(k)?k.length===0?(Je({api:"searchCloudMessages",param:"keywordList",desc:Ke()}),!1):!(k.length>5)||(Je({api:"searchCloudMessages",param:"keywordList",desc:vi("keywordList",5)}),!1):(Je({api:"searchCloudMessages",param:"keywordList",desc:ke()}),!1))}},keywordListMatchType:{type:"String",required:!1,validator:function(k){return!k||k==="or"||k==="and"||Je({api:"searchCloudMessages",param:"keywordListMatchType",desc:"".concat(k," is invalid match type")})}},senderUserIDList:{type:"Array",required:!1,validator:function(k){return!k||(rt(k)?(k.length===0&&Je({api:"searchCloudMessages",param:"senderUserIDList",desc:Ke()}),!(k.length>5)||(Je({api:"searchCloudMessages",param:"senderUserIDList",desc:vi("senderUserIDList",5)}),!1)):(Je({api:"searchCloudMessages",param:"senderUserIDList",desc:ke()}),!1))}},messageTypeList:{type:"Array",required:!1,validator:function(k){if(!k)return!0;if(!rt(k))return Je({api:"searchCloudMessages",param:"messageTypeList",desc:ke()}),!1;k.length===0&&Je({api:"searchCloudMessages",param:"messageTypeList",desc:Ke()});var l,p=[T.MSG_TEXT,T.MSG_IMAGE,T.MSG_AUDIO,T.MSG_FILE,T.MSG_VIDEO,T.MSG_LOCATION,T.MSG_CUSTOM,T.MSG_MERGER];return!(k.filter(function(a){return p.indexOf(a)===-1}).length>0)||(Je({api:"searchCloudMessages",param:"messageTypeList",desc:(l="messageTypeList",fn("ContainsUnsupportedMessageTypeLog",l))}),!1)}},conversationID:{type:"String",required:!1,validator:function(k){return!k||ta(k)}},timePosition:{type:"number",required:!1},timePeriod:{type:"number",required:!1},count:{type:"number",required:!1,validator:function(k){return!k||(k>100&&Je({api:"searchCloudMessages",param:"count",desc:(l="count",p=100,fn("MaximumNumberLog",l,p))}),!0);var l,p}},cursor:{type:"String",required:!1}},getUserProfile:{userIDList:{type:"Array",validator:function(k){return rt(k)?(k.length===0&&Je({api:"getUserProfile",param:"userIDList",desc:Ke()}),!0):(Je({api:"getUserProfile",param:"userIDList",desc:ke()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(k){return!!Ge(k)||!!rt(k)||(Je({api:"updateMyProfile",param:"profileCustomField",desc:ke()}),!1)}}},setSelfStatus:{customStatus:{type:"String",validator:function(k){return!!Et(k)||(Je({api:"setSelfStatus",param:"customStatus",desc:mi()}),!1)}}},getUserStatus:{userIDList:{type:"Array",validator:function(k){return rt(k)?k.length!==0||(Je({api:"getUserStatus",param:"userIDList",desc:Ke()}),!1):(Je({api:"getUserStatus",param:"userIDList",desc:ke()}),!1)}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(k){return rt(k)?k.length!==0||(Je({api:"subscribeUserStatus",param:"userIDList",desc:Ke()}),!1):(Je({api:"subscribeUserStatus",param:"userIDList",desc:ke()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(k){return!k||!!rt(k)||(Je({api:"subscribeUserStatus",param:"userIDList",desc:ke()}),!1)}}},addFriend:{to:at,source:{type:"String",required:!0,validator:function(k){return!!k&&(k.startsWith("AddSource_Type_")?!(k.replace("AddSource_Type_","").length>8)||(Je({api:"addFriend",param:"source",desc:Rt("keyword",8)}),!1):(Je({api:"addFriend",param:"source",desc:fn("SourcePrefixLog")}),!1))}},remark:{type:"String",required:!1,validator:function(k){return!(Et(k)&&k.length>96)||(Je({api:"addFriend",param:"remark",desc:Rt("remark",96)}),!1)}}},deleteFriend:{userIDList:Xn},checkFriend:{userIDList:Xn},getFriendProfile:{userIDList:Xn},updateFriend:{userID:at,remark:{type:"String",required:!1,validator:function(k){return!(Et(k)&&k.length>96)||(Je({api:"updateFriend",param:"remark",desc:Rt("remark",96)}),!1)}},friendCustomField:{type:"Array",required:!1,validator:function(k){if(k){if(!rt(k))return Je({api:"updateFriend",param:"friendCustomField",desc:ke()}),!1;var l=!0;return k.forEach(function(p){return Et(p.key)&&p.key.indexOf("Tag_SNS_Custom")!==-1?Et(p.value)?p.key.replace("Tag_SNS_Custom_","").length>8?(Je({api:"updateFriend",param:"friendCustomField",desc:Rt("keyword",8)}),l=!1):void 0:(Je({api:"updateFriend",param:"friendCustomField",desc:Vn("value")}),l=!1):(Je({api:"updateFriend",param:"friendCustomField",desc:fn("FriendCustomFieldPrefixLog")}),l=!1)}),l}return!0}}},acceptFriendApplication:{userID:at},refuseFriendApplication:{userID:at},deleteFriendApplication:{userID:at},createFriendGroup:{name:at},deleteFriendGroup:{name:at},addToFriendGroup:{name:at,userIDList:Xn},removeFromFriendGroup:{name:at,userIDList:Xn},renameFriendGroup:{oldName:at,newName:at},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(k){return rt(k)?k.length!==0||(Je({api:"sendMessageReadReceipt",param:"messageList",desc:Ke()}),!1):(Je({api:"sendMessageReadReceipt",param:"messageList",desc:ke()}),!1)}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(k){return rt(k)?k.length!==0||(Je({api:"getMessageReadReceiptList",param:"messageList",desc:Ke()}),!1):(Je({api:"getMessageReadReceiptList",param:"messageList",desc:ke()}),!1)}}],createTopicInCommunity:{groupID:at,topicName:at},deleteTopicFromCommunity:{groupID:at,topicIDList:{type:"Array",validator:function(k){return!k||!!rt(k)||(Je({api:"deleteTopicFromCommunity",param:"topicIDList",desc:ke()}),!1)}}},updateTopicProfile:{groupID:at,topicID:at},getTopicList:{groupID:at,topicIDList:{type:"Array",validator:function(k){return!k||!!rt(k)||(Je({api:"getTopicList",param:"topicIDList",desc:ke()}),!1)}}},addSignalingListener:[{name:"eventName",type:"String",validator:function(k){return typeof k=="string"&&k.length!==0||(Je({api:"addSignalingListener",param:"eventName",desc:Rs("eventName")}),!1)}},{name:"handler",type:"Function",validator:function(k){return typeof k!="function"?(Je({api:"addSignalingListener",param:"handler",desc:he()}),!1):(k.name===""&&Je({api:"addSignalingListener",param:"handler",desc:wr()}),!0)}}],removeSignalingListener:[{name:"eventName",type:"String",validator:function(k){return typeof k=="string"&&k.length!==0||(Je({api:"removeSignalingListener",param:"eventName",desc:Rs("eventName")}),!1)}},{name:"handler",type:"Function",validator:function(k){return typeof k!="function"?(Je({api:"removeSignalingListener",param:"handler",desc:he()}),!1):(k.name===""&&Je({api:"removeSignalingListener",param:"handler",desc:wr()}),!0)}}],invite:{userID:at},inviteSync:[r(r({},Zn),{},{validator:function(k){return yn(k)?!!Et(k.userID)||(Je({api:"inviteSync",param:"options.userID",desc:mi()}),!1):(Je({api:"inviteSync",param:"options",desc:An()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"inviteSync",param:"successCb",desc:he()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"inviteSync",param:"errorCb",desc:he()}),!0}}],inviteInGroup:{groupID:at,inviteeList:Xn},inviteInGroupSync:[r(r({},Zn),{},{validator:function(k){return yn(k)?Et(k.groupID)?!!rt(k.inviteeList)||(Je({api:"inviteInGroupSync",param:"options.inviteeList",desc:ke()}),!1):(Je({api:"inviteInGroupSync",param:"options.groupID",desc:mi()}),!1):(Je({api:"inviteInGroupSync",param:"options",desc:An()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"inviteSync",param:"successCb",desc:he()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(k){return Ge(k)&&Je({api:"inviteSync",param:"errorCb",desc:he()}),!0}}],accept:{inviteID:at},reject:{inviteID:at},getSignalingInfo:[r(r({name:"message"},Zn),{},{validator:function(k){return!Ye(k)||(Je({api:"getSignalingInfo",param:"message",desc:Co()}),!1)}})],modifyInvitation:{inviteID:at,data:at}},J3={login:1,logout:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,isReady:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,modifyMessage:1,searchCloudMessages:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,setConversationDraft:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},Ua=1,ir=2,hp=3,pr=4,ao=6,Mt=7,hr=8,sr=10,ct=11,pn=12,na=13,_0=14,Fa=15,pw=17,Ag=18,b0=19,Pi=20,Ns=21,gp=22,mp=23,vp=24,hw=25,$o=26,yp=27,_p=28,Ga=29,M0=30,gw=31,mw=32,ni=33,Sr=function(){function k(l){i(this,k),this._m=l,this._n=""}return u(k,[{key:"isLoggedIn",value:function(){return this._m.getModule(pn).isLoggedIn()}},{key:"isOversea",value:function(){return this._m.getModule(pn).isOversea()}},{key:"isPrivateNetWork",value:function(){return this._m.getModule(pn).isPrivateNetWork()}},{key:"getFileDownloadProxy",value:function(){return this._m.getModule(pn).getFileDownloadProxy()}},{key:"getMyUserID",value:function(){return this._m.getModule(pn).getUserID()}},{key:"getMyTinyID",value:function(){return this._m.getModule(pn).getTinyID()}},{key:"getSDKAppID",value:function(){return this._m.getModule(pn).getSDKAppID()}},{key:"isIntl",value:function(){return this._m.getModule(pn).isIntl()}},{key:"isDevMode",value:function(){return this._m.getModule(pn).isDevMode()}},{key:"getModule",value:function(l){return this._m.getModule(l)}},{key:"getPlatform",value:function(){return En}},{key:"getNetworkType",value:function(){return this._m.getModule(Fa).getNetworkType()}},{key:"probeNetwork",value:function(l){return this._m.getModule(Fa).probe(l)}},{key:"getCloudConfig",value:function(l){return this._m.getModule(mp).getCloudConfig(l)}},{key:"emitOuterEvent",value:function(l,p){this._m.getOuterEmitterInstance().emit(l,p)}},{key:"emitInnerEvent",value:function(l,p){this._m.getInnerEmitterInstance().emit(l,p)}},{key:"getInnerEmitterInstance",value:function(){return this._m.getInnerEmitterInstance()}},{key:"generateTjgID",value:function(l){return this._m.getModule(pn).getTinyID()+"-"+l.random}},{key:"filterModifiedMessage",value:function(l){if(!Ye(l)){var p=l.filter(function(a){return a.isModified===!0});p.length>0&&this.emitOuterEvent(O.MESSAGE_MODIFIED,p)}}},{key:"filterUnmodifiedMessage",value:function(l){return Ye(l)?[]:l.filter(function(p){return p.isModified===!1})}},{key:"request",value:function(l){return this._m.getModule(Pi).request(l)}},{key:"canIUse",value:function(l){return this._m.getModule(yp).canIUse(l)}},{key:"getErrorMessage",value:function(l,p,a){return this._m.getErrorMessage(l,p,a)}},{key:"outputWarning",value:function(l,p,a){var c=this.getErrorMessage(l,p,a);c&&U.w(c)}}]),k}(),bp="wslogin",I0="wslogout",C0="wshello",T0="KickOther",w0="getmsg",Mp="sendmsg",Ip="send_group_msg",S0="portrait_get_all",k0="portrait_set",D0="black_list_get",E0="black_list_add",A0="black_list_delete",L0="friend_get",O0="friend_get_specified",R0="friend_check",N0="friend_delete",P0="friend_add",x0="friend_update",Lg="friend_response",U0="pendency_get",F0="pendency_delete",G0="pendency_report",$0="group_get",B0="group_add",H0="group_delete",Cp="group_update",q0="msgwithdraw",V0="msgreaded",z0="set_c2c_peer_mute_notifications",j0="get_c2c_peer_mute_notifications",Tp="getroammsg",W0="get_peer_read_time",K0="delete_c2c_msg_ramble",Og="modify_c2c_msg",Y0="set_key_values",J0="get_key_values",X0="page_get",Z0="batch_delete",Q0="clear_msg",e_="top",t_="deletemsg",vw="set_conv_custom_data",Rg="mark_contact",yw="create_contact_group",n_="del_contact_group",Sd="update_contact_group",_w="add_conv_to_group",bw="del_conv_from_group",r_="get_contact_group",Ng="get_joined_group_list",Pg="get_group_self_member_info",o_="create_group",i_="destroy_group",s_="modify_group_base_info",xg="apply_join_group",Mw="apply_join_group_noauth",a_="quit_group",l_="get_group_public_info",u_="change_group_owner",c_="handle_apply_join_group",d_="handle_invite_join_permission_group",f_="handle_invite_join_group",p_="group_msg_recall",h_="msg_read_report",Ug="read_all_unread_msg",wp="group_msg_get",g_="get_group_msg_receipt",m_="group_msg_receipt",v_="c2c_msg_read_receipt",y_="get_group_msg_receipt_detail",Fg="get_pendency",__="deletemsg",Gg="get_msg",Iw="get_msg_noauth",b_="get_online_member_num",M_="delete_group_ramble_msg_by_seq",$g="modify_group_msg",Bg="set_group_attr",Hg="modify_group_attr",qg="delete_group_attr",Vg="clear_group_attr",zg="get_group_attr",jg="group_set_key_values",Wg="group_get_key_values",I_="batch_get_group_notify",Kg="update_group_counter",Yg="get_group_counter",C_="get_group_member_info",Jg="get_members",T_="get_specified_group_member_info",w_="add_group_member",S_="delete_group_member",k_="ban_group_member",D_="modify_group_member_info",E_="modify_user_info",A_="cos",L_="pre_sig",O_="video_cover",Sp="tim_web_report_v2",R_="alive",Cw="msg_push",Xg="query",Tw="multi_msg_push_ws",Zg="ws_msg_push_ack",ww="stat_forceoffline",N_="save_relay_json_msg",P_="get_relay_json_msg",x_="fetch_config",U_="push_configv2",F_="fetch_imsdk_purchase_bitsv2",G_="push_imsdk_purchase_bitsv2",$_="notify2",B_="create_topic",H_="destroy_topic",q_="modify_topic",Qg="get_topic",V_="ws_set_custom_status",em="ws_get_user_status",tm="ws_status_subscribe",nm="ws_status_unsubscribe",z_="ws_stat_background",j_="ws_stat_foreground",W_="ws_stat_settoken",K_="get_local_words",Y_="ws_batch_trans_text",De={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023,USER_NOT_LOGGED_IN:2024,REPEAT_LOGIN:2025,COS_UNDETECTED:2040,COS_GET_SIG_FAIL:2041,MSG_SEND_FAIL:2100,MSG_SEND_FAIL_NOT_IN_AVCHATROOM:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_FUNCTION_ERROR:2109,MSG_REVOKE_FAIL:2110,MSG_DELETE_FAIL:2111,MSG_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MSG_LIST_EMPTY:2114,MSG_SEND_GRP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GRP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,MSG_I_SELECT_F_FIRST:2251,MSG_I_TYPES_LIMIT:2252,MSG_I_SIZE_LIMIT:2253,MSG_A_UPLOAD_FAIL:2300,MSG_A_SIZE_LIMIT:2301,MSG_V_UPLOAD_FAIL:2350,MSG_V_SIZE_LIMIT:2351,MSG_V_TYPES_LIMIT:2352,MSG_F_UPLOAD_FAIL:2400,MSG_F_SELECT_F_FIRST:2401,MSG_F_SIZE_LIMIT:2402,MSG_F_URL_IS_EMPTY:2403,MSG_MERGER_TYPE_INVALID:2450,MSG_MERGER_KEY_INVALID:2451,MSG_MERGER_DOWNLOAD_FAIL:2452,MSG_FORWARD_TYPE_INVALID:2453,MSG_MODIFY_CONFLICT:2480,MSG_MODIFY_DISABLED_IN_AVCHATROOM:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_WORK:2622,MEMBER_NOT_IN_GRP:2623,JOIN_GRP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,OPERATION_NOT_SUPPORTED_IN_AVCHATROOM:2687,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GRP_EXISTED:2710,FRIEND_GRP_NOT_EXIST:2711,FRIEND_APPLICATION_NOT_EXIST:2716,UPDATE_PROFILE_INVALID_PARAM:2721,UPDATE_PROFILE_NO_KEY:2722,CANNOT_ADD_SELF_TO_BLACKLIST:2742,NETWORK_ERROR:2800,NETWORK_TIMEOUT:2801,NO_NETWORK:2805,UNCAUGHT_ERROR:2903,INVALID_OPERATION:2905,INVALID_TRTC_CMD:2995,OVER_FREQUENCY_LIMIT:2996,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_MODULE:2998,SDK_IS_NOT_READY:2999,LOGGING_IN:3e3,LOGIN_FAILED:3001,KICKED_OUT_MULT_DEVICE:3002,KICKED_OUT_MULT_ACCOUNT:3003,KICKED_OUT_USERSIG_EXPIRED:3004,LOGGED_OUT:3005,KICKED_OUT_REST_API:3006,ILLEGAL_TOPIC_ID:3021,CANNOT_USE_COMMERCIAL_ABILITY:3122,PROFANITY_FOUND:3123,OPTIONS_IS_EMPTY:3153,MSG_A2KEY_EXPIRED:20002,ACCOUNT_A2KEY_EXPIRED:70001,HELLO_ANSWER_KICKED_OUT:1002,OPEN_SERVICE_OVERLOAD_ERROR:60022,SIGNALING_INVALID_INVITE_ID:8010,SIGNALING_NO_PERMISSION:8011,SIGNALING_ALREADY_EXISTS:8012,INVALID_CANCEL_MESSAGE:8020,SEND_MESSAGE_FAILED_WITH_CANCEL:8021,ERR_SVR_COMM_INVALID_SERVICE:60020,MSG_SEARCH_CURSOR_INVALID:27002,MSG_SEARCH_CURSOR_EXPIRED:27003},J_="networkRTT",X_="messageE2EDelay",kd="sendMessageC2C",Dd="sendMessageGroup",Ed="sendMessageGroupAV",Vu="sendMessageRichMedia",yi="cosUpload",Ad="messageReceivedGroup",kp="messageReceivedGroupAVPush",Dp="messageReceivedGroupAVPull",X3=(d(ei={},J_,2),d(ei,X_,3),d(ei,kd,4),d(ei,Dd,5),d(ei,Ed,6),d(ei,Vu,7),d(ei,Ad,8),d(ei,kp,9),d(ei,Dp,10),d(ei,yi,11),ei),Z3={info:4,warning:5,error:6},Sw={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},Q3={login:4},We=function(){function k(l){i(this,k),this._n="SSOLogData",this.eventType=Q3[l]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=l,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=Mn()}return u(k,[{key:"updateTimeStamp",value:function(){this.timestamp=Mn()}},{key:"start",value:function(l){return this._startts=l,this}},{key:"end",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(!this._sentFlag){var a=Mn();this.costTime===0&&(this.costTime=a-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(a)),p?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout(function(){l._sentFlag=!0,l._eventStatModule&&l._eventStatModule.pushIn(l)},0)}}},{key:"setError",value:function(l,p,a){if(!(l instanceof Error))return U.w("".concat(this._n,".setError value not instanceof Error, please check!")),this;if(this._sentFlag)return this;if(this.setNetworkType(a),p)l.code&&this.setCode(l.code),l.message&&this.setMoreMessage(l.message);else{var c=De.NO_NETWORK;this.setCode(c)}return this.setLevel("error"),this}},{key:"setCode",value:function(l){return Ge(l)||this._sentFlag||(l==="ECONNABORTED"&&(this.code=103),un(l)?this.code=l:U.w("".concat(this._n,".setCode value not a number, please check!"),l,o(l))),this}},{key:"setMessage",value:function(l){return Ge(l)||this._sentFlag||(un(l)&&(this.message=l.toString()),Et(l)&&(this.message=l)),this}},{key:"setCostTime",value:function(l){return this.costTime=l,this}},{key:"setLevel",value:function(l){return Ge(l)||this._sentFlag||(this.level=Z3[l]),this}},{key:"setMoreMessage",value:function(l){return Ye(this.moreMessage)?this.moreMessage="".concat(l):this.moreMessage+=" ".concat(l),this}},{key:"setNetworkType",value:function(l){if(Ge(l))U.w("".concat(this._n,".setNetworkType value is undefined, please check!"));else{var p=Sw[l.toLowerCase()];Ge(p)||(this.networkType=p)}return this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(l){this.uiPlatform=l}}],[{key:"bindEventStatModule",value:function(l){k.prototype._eventStatModule=l}}]),k}(),Z_=function(){function k(l){i(this,k),this.type=T.MSG_TEXT,this.content={text:l.text||""}}return u(k,[{key:"setText",value:function(l){this.content.text=l}},{key:"sendable",value:function(){return this.content.text.length!==0}}]),k}(),Q_=function(){function k(l,p){i(this,k),this._imageMemoryURL="",this._fileDownloadProxy=p,je?this.createImageDataASURLInWXMiniApp(l.file):this.createImageDataASURLInWeb(l.file),this._initImageInfoModel(),this.type=T.MSG_IMAGE,this._percent=0,this.content={imageFormat:l.imageFormat||us.UNKNOWN,uuid:l.uuid,imageInfoArray:[]},this.initImageInfoArray(l.imageInfoArray),this._autoFixUrl()}return u(k,[{key:"_initImageInfoModel",value:function(){var l=this;this._ImageInfoModel=function(p){this.instanceID=Qo(9999999),this.sizeType=p.type||0,this.type=0,this.size=p.size||0,this.width=p.width||0,this.height=p.height||0,this.imageUrl=p.url||"",this.url=Ni(p.url||l._imageMemoryURL,l._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(p){this.sizeType=p},setType:function(p){this.type=p},setImageUrl:function(p){p&&(this.imageUrl=p)},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(l){for(var p=0,a=null,c=null;p<=2;)c=Ge(l)||Ge(l[p])?{type:0,size:0,width:0,height:0,url:""}:l[p],(a=new this._ImageInfoModel(c)).setSizeType(p+1),a.setType(p),this.addImageInfo(a),p++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(l){for(var p,a=this.content.imageInfoArray.length,c=0;c1&&(this._percent=1)}},{key:"updateImageFormat",value:function(l){this.content.imageFormat=us[l.toUpperCase()]||us.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(l){l!==void 0&&l.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(l.files[0]))}},{key:"createImageDataASURLInWXMiniApp",value:function(l){l&&l.url&&(this._imageMemoryURL=l.url)}},{key:"replaceImageInfo",value:function(l,p){this.content.imageInfoArray[p]instanceof this._ImageInfoModel||(this.content.imageInfoArray[p]=l)}},{key:"addImageInfo",value:function(l){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(l)}},{key:"updateAccessSideImageInfoArray",value:function(){var l=this.content.imageInfoArray,p=l[0],a=p.width,c=a===void 0?0:a,h=p.height,m=h===void 0?0:h;c!==0&&m!==0&&(Fu(l),Object.assign(l[2],Td({originWidth:c,originHeight:m,min:720})))}},{key:"sendable",value:function(){return this.content.imageInfoArray.length!==0&&this.content.imageInfoArray[0].imageUrl!==""&&this.content.imageInfoArray[0].size!==0}}]),k}(),e1=function(){function k(l){i(this,k),this.type=T.MSG_FACE,this.content=l||null}return u(k,[{key:"sendable",value:function(){return this.content!==null}}]),k}(),t1=function(){function k(l,p){i(this,k),this.type=T.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:l.second,size:l.size,url:Ni(l.url,p),remoteAudioUrl:l.url||"",uuid:l.uuid}}return u(k,[{key:"updatePercent",value:function(l){this._percent=l,this._percent>1&&(this._percent=1)}},{key:"updateAudioUrl",value:function(l){this.content.remoteAudioUrl=l}},{key:"sendable",value:function(){return this.content.remoteAudioUrl!==""}}]),k}(),e6={from:!0,groupID:!0,groupName:!0,to:!0},kw=function(){function k(l){i(this,k),this.type=T.MSG_GRP_TIP,this.content={},this._initContent(l)}return u(k,[{key:"_initContent",value:function(l){var p=this;Object.keys(l).forEach(function(a){switch(a){case"remarkInfo":break;case"groupProfile":p.content.groupProfile={},p._initGroupProfile(l[a]);break;case"operatorInfo":break;case"memberInfoList":case"msgMemberInfo":p._updateMemberList(l[a]);break;case"memberExtraInfo":case"onlineMemberInfo":break;case"memberNum":p.content[a]=l[a],p.content.memberCount=l[a];break;case"newGroupProfile":p.content.newGroupProfile={},p._initNewGroupProfile(l[a]);break;default:p.content[a]=l[a]}}),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(l){for(var p=Object.keys(l),a=0;a1&&(this._percent=1)}},{key:"updateFileUrl",value:function(l){this.content.fileUrl=l}},{key:"sendable",value:function(){return this.content.fileUrl!==""&&this.content.fileName!==""&&this.content.fileSize!==0}}]),k}(),r1=function(){function k(l){i(this,k),this.type=T.MSG_CUSTOM,this.content={data:l.data||"",description:l.description||"",extension:l.extension||""}}return u(k,[{key:"setData",value:function(l){return this.content.data=l,this}},{key:"setDescription",value:function(l){return this.content.description=l,this}},{key:"setExtension",value:function(l){return this.content.extension=l,this}},{key:"sendable",value:function(){return this.content.data.length!==0||this.content.description.length!==0||this.content.extension.length!==0}}]),k}(),o1=function(){function k(l,p){i(this,k),this.type=T.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:l.remoteVideoUrl||l.videoUrl||"",videoFormat:l.videoFormat,videoSecond:parseInt(l.videoSecond,10),videoSize:l.videoSize,videoUrl:Ni(l.videoUrl,p),videoDownloadFlag:2,videoUUID:l.videoUUID,thumbUUID:l.thumbUUID,thumbFormat:l.thumbFormat,thumbWidth:l.thumbWidth,snapshotWidth:l.thumbWidth,thumbHeight:l.thumbHeight,snapshotHeight:l.thumbHeight,thumbSize:l.thumbSize,snapshotSize:l.thumbSize,thumbDownloadFlag:2,thumbUrl:Ni(l.thumbUrl,p),snapshotUrl:Ni(l.thumbUrl,p)}}return u(k,[{key:"updatePercent",value:function(l){this._percent=l,this._percent>1&&(this._percent=1)}},{key:"updateVideoUrl",value:function(l){l&&(this.content.remoteVideoUrl=l)}},{key:"updateSnapshotInfo",value:function(l){var p=l.snapshotUrl,a=l.snapshotWidth,c=l.snapshotHeight;Ye(p)||(this.content.thumbUrl=this.content.snapshotUrl=p),Ye(a)||(this.content.thumbWidth=this.content.snapshotWidth=Number(a)),Ye(c)||(this.content.thumbHeight=this.content.snapshotHeight=Number(c))}},{key:"sendable",value:function(){return this.content.remoteVideoUrl!==""}}]),k}(),i1=function(){function k(l){i(this,k),this.type=T.MSG_LOCATION;var p=l.description,a=l.longitude,c=l.latitude;this.content={description:p,longitude:a,latitude:c}}return u(k,[{key:"sendable",value:function(){return!0}}]),k}(),Ew=function(){function k(l,p){if(i(this,k),this.from=l.from,this.messageSender=l.from,this.time=l.time,this.messageSequence=l.sequence,this.clientSequence=l.clientSequence||l.sequence,this.messageRandom=l.random,this.cloudCustomData=l.cloudCustomData||"",this.clientTime=l.clientTime||void 0,l.ID)this.ID=l.ID||"",this.nick=l.nick||"",this.avatar=l.avatar||"",this.messageBody=[{type:l.type,payload:l.payload}],l.conversationType.startsWith(T.CONV_C2C)?this.receiverUserID=l.to:l.conversationType.startsWith(T.CONV_GROUP)&&(this.receiverGroupID=l.to),this.messageReceiver=l.to;else{this.nick=l.nick||"",this.avatar=l.avatar||"",this.messageBody=[];var a=l.elements[0].type,c=l.elements[0].content;this._patchRichMediaPayload(a,c),this._updateRichMediaDownloadUrl(a,c,p),a===T.MSG_MERGER?this.messageBody.push({type:a,payload:new rm(c).content}):this.messageBody.push({type:a,payload:c}),l.groupID&&(this.receiverGroupID=l.groupID,this.messageReceiver=l.groupID),l.to&&(this.receiverUserID=l.to,this.messageReceiver=l.to),this.ID="".concat(l.tinyID,"-").concat(l.clientTime,"-").concat(l.random)}}return u(k,[{key:"_patchRichMediaPayload",value:function(l,p){l===T.MSG_IMAGE?p.imageInfoArray.forEach(function(a){!a.imageUrl&&a.url&&(a.imageUrl=a.url,a.sizeType=a.type,a.type===1?a.type=0:a.type===3&&(a.type=1))}):l===T.MSG_VIDEO?!p.remoteVideoUrl&&p.videoUrl&&(p.remoteVideoUrl=p.videoUrl):l===T.MSG_AUDIO?!p.remoteAudioUrl&&p.url&&(p.remoteAudioUrl=p.url):l===T.MSG_FILE&&!p.fileUrl&&p.url&&(p.fileUrl=p.url,p.url=void 0)}},{key:"_updateRichMediaDownloadUrl",value:function(l,p,a){a&&(l===T.MSG_IMAGE?p.imageInfoArray.forEach(function(c){c.url=Ni(c.url,a)}):l===T.MSG_VIDEO?(p.videoUrl=Ni(p.videoUrl,a),p.snapshotUrl=Ni(p.thumbUrl,a),p.snapshotHeight=p.thumbHeight,p.snapshotWidth=p.thumbWidth):l===T.MSG_AUDIO?p.url=Ni(p.url,a):l===T.MSG_FILE&&(p.fileUrl=Ni(p.fileUrl,a)))}}]),k}(),rm=function(){function k(l,p){if(i(this,k),this.type=T.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},l.downloadKey){var a=l.downloadKey,c=l.pbDownloadKey,h=l.title,m=l.abstractList,y=l.compatibleText,b=l.version;this.content.downloadKey=a,this.content.pbDownloadKey=c,this.content.title=h,this.content.abstractList=m,this.content.compatibleText=y,this.content.version=b||0}else if(Ye(l.messageList))l.layersOverLimit===1&&(this.content.layersOverLimit=!0);else{var I=l.messageList,E=l.title,R=l.abstractList,F=l.compatibleText,H=l.version,ee=[];I.forEach(function(ge){if(!Ye(ge)){var be=new Ew(ge,p);ee.push(be)}}),this.content.messageList=ee,this.content.title=E,this.content.abstractList=R,this.content.compatibleText=F,this.content.version=H||0}}return u(k,[{key:"sendable",value:function(){return!Ye(this.content.messageList)||!Ye(this.content.downloadKey)}}]),k}(),s1={1:T.MSG_PRIORITY_HIGH,2:T.MSG_PRIORITY_NORMAL,3:T.MSG_PRIORITY_LOW,4:T.MSG_PRIORITY_LOWEST},Hr=function(){function k(l){i(this,k),this.ID="",this.conversationID=l.conversationID||null,this.conversationType=l.conversationType||T.CONV_C2C,this.conversationSubType=l.conversationSubType,this.time=l.time||Math.ceil(Date.now()/1e3),this.sequence=l.sequence||0,this.clientSequence=l.clientSequence||l.sequence||0,this.random=l.random||l.random===0?l.random:Qo(),this.priority=this._computePriority(l.priority),this.nick=l.nick||"",this.avatar=l.avatar||"",this.isPeerRead=!1,this.nameCard="",this._elements=[],this.isPlaceMessage=l.isPlaceMessage||0,this.isRevoked=l.isPlaceMessage===2||l.msgFlagBits===8,this.from=l.from||null,this.to=l.to||null,this.flow="",this.isSystemMessage=l.isSystemMessage||!1,this.protocol=l.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=l.status||so.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=l.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!l.messageControlInfo||l.messageControlInfo.excludedFromUnreadCount!==1),this._isExcludedFromLastMessage=!(!l.messageControlInfo||l.messageControlInfo.excludedFromLastMessage!==1),this.clientTime=l.clientTime||Kr()||0,this.senderTinyID=l.senderTinyID||l.tinyID||"",this.readReceiptInfo=l.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=l.needReadReceipt===!0||l.needReadReceipt===1,this.version=l.messageVersion||0,this.isBroadcastMessage=l.isBroadcastMessage||!1,this._receiverList=l.receiverList||void 0,this.isSupportExtension=l.isSupportExtension===!0||l.isSupportExtension===1,this.revoker=l.revokerInfo&&l.revokerInfo.revoker||null,this.reInitialize(l.currentUser),this.extractGroupInfo(l.groupProfile||null),this.handleGroupAtInfo(l),this.initC2CReadReceiptInfo(l.readReceiptSentByPeer)}return u(k,[{key:"elements",get:function(){return this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(l){if(l!==null){Et(l.nick)&&(this.nick=l.nick),Et(l.avatar)&&(this.avatar=l.avatar);var p=l.messageFromAccountExtraInformation;yn(p)&&Et(p.nameCard)&&(this.nameCard=p.nameCard)}}},{key:"handleGroupAtInfo",value:function(l){var p=this;l.payload&&l.payload.atUserList&&l.payload.atUserList.forEach(function(a){a!==T.MSG_AT_ALL?(p._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:a}),p.atUserList.push(a)):(p._groupAtInfoList.push({groupAtAllFlag:1}),p.atUserList.push(T.MSG_AT_ALL))}),rt(l.groupAtInfo)&&l.groupAtInfo.forEach(function(a){a.groupAtAllFlag===0?p.atUserList.push(a.groupAtUserID):a.groupAtAllFlag===1&&p.atUserList.push(T.MSG_AT_ALL)})}},{key:"getGroupAtInfoList",value:function(){return this._groupAtInfoList}},{key:"_initProxy",value:function(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}},{key:"reInitialize",value:function(l){l&&(this.status=this.from?so.SUCCESS:so.UNSEND,!this.from&&(this.from=l)),this._initFlow(l),this._initSequence(l),this._concatConversationID(l),this.generateMessageID()}},{key:"isSendable",value:function(){return this._elements.length!==0&&typeof this._elements[0].sendable=="function"&&this._elements[0].sendable()}},{key:"_initTo",value:function(l){this.conversationType===T.CONV_GROUP&&(this.to=l.groupID)}},{key:"_initSequence",value:function(l){this.clientSequence===0&&l&&(this.clientSequence=function(p){if(!p)return!1;if(Cl[p]===void 0){var a=new Date,c="3".concat(a.getHours()).slice(-2),h="0".concat(a.getMinutes()).slice(-2),m="0".concat(a.getSeconds()).slice(-2);Cl[p]=parseInt([c,h,m,"0001"].join("")),c=null,h=null,m=null,U.l("autoIncrementIndex start index:".concat(Cl[p]))}return Cl[p]++}(l)),this.sequence===0&&this.conversationType===T.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===T.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(l){l!==""&&(l===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(l){var p=this.to,a="",c=this.conversationType;c!==T.CONV_SYSTEM?(a=c===T.CONV_C2C?l===this.from?p:this.from:this.to,this.conversationID=a?"".concat(c).concat(a):null):this.conversationID=T.CONV_SYSTEM}},{key:"isElement",value:function(l){return l instanceof Z_||l instanceof Q_||l instanceof e1||l instanceof t1||l instanceof n1||l instanceof o1||l instanceof kw||l instanceof Dw||l instanceof r1||l instanceof i1||l instanceof rm}},{key:"setElement",value:function(l,p){var a=this;if(this.isElement(l))return this._elements=[l],void this._initProxy();var c=function(m){if(m.type&&m.content)switch(m.type){case T.MSG_TEXT:a.setTextElement(m.content);break;case T.MSG_IMAGE:a.setImageElement(m.content,p);break;case T.MSG_AUDIO:a.setAudioElement(m.content,p);break;case T.MSG_FILE:a.setFileElement(m.content,p);break;case T.MSG_VIDEO:a.setVideoElement(m.content,p);break;case T.MSG_CUSTOM:a.setCustomElement(m.content);break;case T.MSG_LOCATION:a.setLocationElement(m.content);break;case T.MSG_GRP_TIP:a.setGroupTipElement(m.content);break;case T.MSG_GRP_SYS_NOTICE:a.setGroupSystemNoticeElement(m.content);break;case T.MSG_FACE:a.setFaceElement(m.content);break;case T.MSG_MERGER:a.setMergerElement(m.content,p)}};if(rt(l))for(var h=0;h1&&arguments[1]!==void 0&&arguments[1];if(k instanceof Un)return l&&zu!==null&&zu.emit(O.ERROR,k),Promise.reject(k);if(k instanceof Error){var p=new Un({code:De.UNCAUGHT_ERROR});return l&&zu!==null&&zu.emit(O.ERROR,p),Promise.reject(p)}if(Ge(k)||Ge(k.code))return Promise.reject(new Un({code:De.UNCAUGHT_ERROR}));var a=new Un(k);return l&&zu!==null&&zu.emit(O.ERROR,a),Promise.reject(a)},r6=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="C2CModule",c._messageFromUnreadDBMap=new Map,c._noticeFromUnreadDBList=[],c}return u(p,[{key:"onNewC2CMessage",value:function(a){var c=a.dataList,h=a.isInstantMessage,m=a.C2CRemainingUnreadList,y=a.C2CPairUnreadList,b=a.isSyncingEnded;U.d("".concat(this._n,".onNewC2CMessage count:").concat(c.length," isInstantMessage:").concat(h));var I=this._newC2CMessageStoredAndSummary({dataList:c,C2CRemainingUnreadList:m,C2CPairUnreadList:y,isInstantMessage:h}),E=I.conversationOptionsList,R=I.messageList,F=I.isUnreadC2CMessage;this.filterModifiedMessage(R),this.getModule(ct).onNewMessage({conversationOptionsList:E,isInstantMessage:h,isUnreadC2CMessage:F,isSyncingEnded:b});var H=this.filterUnmodifiedMessage(R);h&&H.length>0&&this.emitOuterEvent(O.MESSAGE_RECEIVED,H),R.length=0}},{key:"_newC2CMessageStoredAndSummary",value:function(a){for(var c=a.dataList,h=a.C2CRemainingUnreadList,m=a.C2CPairUnreadList,y=a.isInstantMessage,b=null,I=[],E=[],R={},F=this.getModule($o),H=!1,ee=this.getModule(ct),ge=this.getModule(pr),be=this.getFileDownloadProxy(),we=0,Ue=c.length;we0&&F.addMessageDelay(b.clientTime)}else this._messageFromUnreadDBMap.set(b.ID,1);if(qe.msgLifeTime!==0){if(b._onlineOnlyFlag===!1){var vo=ee.getLastMessageTime(nt);if(un(vo)&&b.time0){hs=!0;var um=I.find(function(nx){return nx.conversationID==="C2C".concat(m[xi].from)});um?um.unreadCount=m[xi].unreadCount:I.push({conversationID:"C2C".concat(m[xi].from),unreadCount:m[xi].unreadCount,type:T.CONV_C2C})}},Ld=0,Sl=m.length;Ld0&&(m=a.cloudCustomData);var y=[];if(yn(c)&&yn(c.messageControlInfo)){var b=c.messageControlInfo,I=b.excludedFromUnreadCount,E=b.excludedFromLastMessage,R=b.excludedFromContentModeration;I===!0&&y.push("NoUnread"),E===!0&&y.push("NoLastMsg"),R===!0&&y.push("NoMsgCheck")}var F=this.isOnlineMessage(a,c)?0:void 0;return{protocolName:Mp,tjgID:this.generateTjgID(a),requestData:{fromAccount:this.getMyUserID(),toAccount:a.to,msgBody:a.getElements(),cloudCustomData:m,msgSeq:a.sequence,msgRandom:a.random,msgLifeTime:F,nick:a.nick,avatar:a.avatar,offlinePushInfo:h?{pushFlag:h.disablePush===!0?1:0,title:h.title||"",desc:h.description||"",ext:h.extension||"",apnsInfo:{badgeMode:h.ignoreIOSBadge===!0?1:0,isVoipPush:this._isVoipPush(h)},androidInfo:{OPPOChannelID:h.androidOPPOChannelID||""}}:void 0,messageControlInfo:F!==0?y:void 0,clientTime:a.clientTime,needReadReceipt:a.needReadReceipt===!0?1:0,isSupportExtension:a.isSupportExtension===!0?1:0}}}},{key:"_isVoipPush",value:function(a){var c=void 0;return Ge(a.disableVoipPush)||(c=a.disableVoipPush===!1?1:0),c}},{key:"isOnlineMessage",value:function(a,c){return!(!c||c.onlineUserOnly!==!0)}},{key:"revokeMessage",value:function(a){return this.request({protocolName:q0,requestData:{msgInfo:{fromAccount:a.from,toAccount:a.to,msgSeq:a.sequence,msgRandom:a.random,msgTimeStamp:a.time}}})}},{key:"deleteMessage",value:function(a){var c=a.to,h=a.keyList;return U.l("".concat(this._n,".deleteMessage toAccount:").concat(c," count:").concat(h.length)),this.request({protocolName:K0,requestData:{fromAccount:this.getMyUserID(),to:c,keyList:h}})}},{key:"modifyRemoteMessage",value:function(a){var c=a.from,h=a.to,m=a.version,y=m===void 0?0:m,b=a.sequence,I=a.random,E=a.time,R=a.payload,F=a.type,H=a.cloudCustomData,ee=void 0;return $u(F)&&(ee=[]).push({type:F,content:R}),this.request({protocolName:Og,requestData:{from:c,to:h,version:y,sequence:b,random:I,time:E,elements:ee,cloudCustomData:H}})}},{key:"setMessageRead",value:function(a){var c=this,h=a.conversationID,m=a.lastMessageTime,y="".concat(this._n,".setMessageRead");U.l("".concat(y," conversationID:").concat(h," lastMessageTime:").concat(m)),un(m)||this.outputWarning("DoNotModifyLastTime");var b=new We("setC2CMessageRead");return b.setMessage("conversationID:".concat(h," lastMessageTime:").concat(m)),this.request({protocolName:V0,requestData:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:h.replace("C2C",""),lastMessageTime:m,receipt:1}]}}}).then(function(){b.setNetworkType(c.getNetworkType()).end(),U.l("".concat(y," ok"));var I=c.getModule(ct);return I.updateIsReadAfterReadReport({conversationID:h,lastMessageTime:m}),I.updateUnreadCount(h),ht()}).catch(function(I){return c.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];b.setError(I,F,H).end()}),U.l("".concat(y," failed. error:"),I),Me(I)})}},{key:"getRoamingMessage",value:function(a){var c=this,h="".concat(this._n,".getRoamingMessage"),m=a.peerAccount,y=a.conversationID,b=a.count,I=a.lastMessageTime,E=a.messageKey,R="peerAccount:".concat(m," count:").concat(b||15," lastMessageTime:").concat(I||0," messageKey:").concat(E);U.l("".concat(h," ").concat(R));var F=new We("getC2CRoamingMessages");return this.request({protocolName:Tp,requestData:{peerAccount:m,count:b||15,lastMessageTime:I||0,messageKey:E}}).then(function(H){var ee=H.data,ge=ee.complete,be=ee.messageList,we=ee.messageKey,Ue=ee.lastMessageTime;Ge(be)?U.l("".concat(h," ok. complete:").concat(ge," but messageList is undefined!")):U.l("".concat(h," ok. complete:").concat(ge," count:").concat(be.length)),F.setNetworkType(c.getNetworkType()).setMessage("".concat(R," complete:").concat(ge," length:").concat(be.length)).end();var qe=c.getModule(ct);ge===1&&qe.setCompleted(y);var nt=qe.onRoamingMessage(be,y);qe.modifyMessageList(y),qe.updateIsRead(y),qe.updateRoamingMessageKeyAndTime(y,we,Ue);var mt=qe.getPeerReadTime(y);if(U.l("".concat(h," update isPeerRead property. conversationID:").concat(y," peerReadTime:").concat(mt)),mt)qe.updateMessageIsPeerReadProperty(y,mt);else{var Pt=y.replace(T.CONV_C2C,"");c.getRemotePeerReadTime([Pt]).then(function(){qe.updateMessageIsPeerReadProperty(y,qe.getPeerReadTime(y))})}var gn="";if(nt.length>0)gn=nt[0].ID;else{var _n=qe.getLocalOldestMessage(y);_n&&(gn=_n.ID)}return U.l("".concat(h," nextReqID:").concat(gn," stored message count:").concat(nt.length)),{nextReqID:gn,storedMessageList:nt}}).catch(function(H){return c.probeNetwork().then(function(ee){var ge=A(ee,2),be=ge[0],we=ge[1];F.setMessage(R).setError(H,be,we).end()}),U.w("".concat(h," failed. error:"),H),Me(H)})}},{key:"getRoamingMessagesHopping",value:function(a){var c=this,h="".concat(this._n,".getRoamingMessagesHopping"),m=a.peerAccount,y=a.time,b=y===void 0?0:y,I=a.count,E=a.direction,R="".concat(T.CONV_C2C).concat(m),F="peerAccount:".concat(m," count:").concat(I," time:").concat(b," direction:").concat(E);U.l("".concat(h," ").concat(F));var H=new We("getC2CRoamingMessagesHopping");return this.request({protocolName:Tp,requestData:{peerAccount:m,count:I+1,lastMessageTime:b,direction:E}}).then(function(ee){var ge=ee.data,be=ge.complete,we=ge.messageList,Ue=we===void 0?[]:we,qe=ge.lastMessageTime;U.l("".concat(h," ok. complete:").concat(be," count:").concat(Ue.length)),H.setNetworkType(c.getNetworkType()).setMessage("".concat(F," complete:").concat(be," length:").concat(Ue.length)).end(),be!==1&&(E===1?Ue.pop():Ue.shift());var nt=c.getModule(ct).onRoamingMessage(Ue,R,!1);c._modifyMessageList(R,nt);var mt=c._computeResult({complete:be,lastMessageTime:qe,resultList:nt});return ht(mt)}).catch(function(ee){return c.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];H.setMessage(F).setError(ee,we,Ue).end()}),U.w("".concat(h," failed. error:"),ee),Me(ee)})}},{key:"_computeResult",value:function(a){var c=a.complete,h=c===void 0?0:c,m=a.lastMessageTime,y=a.resultList,b={messageList:L(y===void 0?[]:y),isCompleted:!1,nextMessageTime:""};return h===1?(b.isCompleted=!0,b):(b.nextMessageTime=m,b)}},{key:"_modifyMessageList",value:function(a,c){var h=this.getModule(ct).getLocalConversation(a);if(h)for(var m=h.userProfile.nick,y=h.userProfile.avatar,b=this.getModule(pr).getNickAndAvatarByUserID(this.getMyUserID()),I=b.nick,E=b.avatar,R=c.length-1;R>=0;R--){var F=c[R];F.flow==="in"&&(F.nick!==m&&F.setNickAndAvatar({nick:m}),F.avatar!==y&&F.setNickAndAvatar({avatar:y})),F.flow==="out"&&(F.nick!==I&&F.setNickAndAvatar({nick:I}),F.avatar!==E&&F.setNickAndAvatar({avatar:E}))}}},{key:"getRemotePeerReadTime",value:function(a){var c=this,h="".concat(this._n,".getRemotePeerReadTime");if(Ye(a))return U.w("".concat(h," userIDList is empty!")),Promise.resolve();var m=new We("getPeerReadTime");return U.l("".concat(h," userIDList:").concat(a)),this.request({protocolName:W0,requestData:{userIDList:a}}).then(function(y){var b=y.data.peerReadTimeList;U.l("".concat(h," ok. peerReadTimeList:").concat(b));for(var I="",E=c.getModule(ct),R=0;R0&&E.recordPeerReadTime("C2C".concat(a[R]),b[R]);m.setNetworkType(c.getNetworkType()).setMessage(I).end()}).catch(function(y){c.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(h," failed. error:"),y)})}},{key:"sendReadReceipt",value:function(a){var c=this,h=a[0].conversationID.replace(T.CONV_C2C,""),m=new We("sendC2CReadReceipt");m.setMessage("peerAccount:".concat(h));var y=this.getMyUserID(),b=a.filter(function(E){return E.from!==y&&E.needReadReceipt===!0}).map(function(E){return{fromAccount:E.from,toAccount:E.to,sequence:E.sequence,random:E.random,time:E.time,clientTime:E.clientTime}});if(b.length===0)return Me({code:De.READ_RECEIPT_MSG_LIST_EMPTY});var I="".concat(this._n,".sendReadReceipt");return U.l("".concat(I,". peerAccount:").concat(h," messageInfoList length:").concat(b.length)),this.request({protocolName:v_,requestData:{peerAccount:h,messageInfoList:b}}).then(function(E){return m.end(),U.l("".concat(I," ok")),ht()}).catch(function(E){return c.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];m.setError(E,H,ee).end()}),U.w("".concat(I," failed. error:"),E),Me(E)})}},{key:"getReadReceiptList",value:function(a){var c="".concat(this._n,".getReadReceiptList"),h=this.getMyUserID(),m=a.filter(function(y){return y.from===h&&y.needReadReceipt===!0});return U.l("".concat(c," userID:").concat(h," messageList length:").concat(m.length)),At({messageList:m})}},{key:"getMessageExtensions",value:function(a,c){return U.l("".concat(this._n,".getMessageExtensions startSequence:").concat(c)),this.request({protocolName:J0,requestData:{from:a.from,to:a.to,messageKey:this._getMessageKey(a),startSequence:c}})}},{key:"modifyMessageExtensions",value:function(a,c){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return U.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(h)),this.request({protocolName:Y0,requestData:{from:a.from,to:a.to,messageKey:this._getMessageKey(a),extensionList:c,operateType:h}})}},{key:"_getMessageKey",value:function(a){var c=a.clientSequence,h=a.random,m=a.time;return"".concat(c,"_").concat(h,"_").concat(m)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._messageFromUnreadDBMap.clear(),this._noticeFromUnreadDBList.length=0}}]),p}(Sr),o6=function(){function k(){i(this,k),this.list=new Map,this._n="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}return u(k,[{key:"getLocalOldestMessageByConversationID",value:function(l){if(!l||!this.list.has(l))return null;var p=this.list.get(l).values();return p?p.next().value:null}},{key:"pushIn",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0&&arguments[1],a=l.conversationID,c=!0;this.list.has(a)||this.list.set(a,new Map);var h=this._getUniqueIDOfMessage(l),m=this.list.get(a).has(h);if(m){var y=this.list.get(a).get(h);if(!p||y.isModified===!0)return c=!1}return this.list.get(a).set(h,l),this._setLatestMessageSentByPeer(a,l),this._setLatestMessageSentByMe(a,l),c}},{key:"unshift",value:function(l,p){var a;if(rt(l)?l.length>0&&(a=l[0].conversationID,this._unshiftMultipleMessages(l,p)):(a=l.conversationID,this._unshiftSingleMessage(l,p)),a){var c=Array.from(this.list.get(a).values()),h=c.length;if(h===0)return;for(var m=h-1;m>=0;m--)if(c[m].flow==="out"){this._setLatestMessageSentByMe(a,c[m]);break}if(a.startsWith(T.CONV_C2C)){for(var y=h-1;y>=0;y--)if(c[y].flow==="in"){this._setLatestMessageSentByPeer(a,c[y]);break}}}}},{key:"_unshiftSingleMessage",value:function(l,p){var a=l.conversationID,c=this._getUniqueIDOfMessage(l);if(!this.list.has(a))return this.list.set(a,new Map),this.list.get(a).set(c,l),void p.push(l);var h=this.list.get(a),m=Array.from(h);h.has(c)||(m.unshift([c,l]),this.list.set(a,new Map(m)),p.push(l))}},{key:"_unshiftMultipleMessages",value:function(l,p){for(var a=l.length,c=[],h=l[0].conversationID,m=this.list.get(h),y=this.list.has(h)?Array.from(m):[],b=0;b=0;R--)m[R].flow==="in"&&((b=m[R]).nick!==a&&(b.setNickAndAvatar({nick:a}),E=!0),b.avatar!==c&&(b.setNickAndAvatar({avatar:c}),E=!0),E&&(I+=1));U.l("".concat(this._n,".modifyMessageSentByPeer conversationID:").concat(p," count:").concat(I))}}}},{key:"modifyMessageSentByMe",value:function(l){var p=l.conversationID,a=l.latestNick,c=l.latestAvatar,h=this.list.get(p);if(!Ye(h)){var m=Array.from(h.values()),y=m.length;if(y!==0){for(var b=null,I=0,E=!1,R=y-1;R>=0;R--)m[R].flow==="out"&&((b=m[R]).nick!==a&&(b.setNickAndAvatar({nick:a}),E=!0),b.avatar!==c&&(b.setNickAndAvatar({avatar:c}),E=!0),E&&(I+=1));U.l("".concat(this._n,".modifyMessageSentByMe conversationID:").concat(p," count:").concat(I))}}}},{key:"getTopicConversationIDList",value:function(l){return L(this.list.keys()).filter(function(p){return p.startsWith("".concat(T.CONV_GROUP).concat(l))})}},{key:"traversal",value:function(){if(this.list.size!==0&&U.getLevel()===-1){console.group("conversationID-messageCount");var l,p=G(this.list);try{for(p.s();!(l=p.n()).done;){var a=A(l.value,2),c=a[0],h=a[1];console.log("".concat(c,"-").concat(h.size))}}catch(m){p.e(m)}finally{p.f()}console.groupEnd()}}},{key:"onMessageModified",value:function(l,p){if(!this.list.has(l))return{isUpdated:!1,message:null};var a=this._getUniqueIDOfMessage(p),c=this.list.get(l).has(a);if(U.d("".concat(this._n,".onMessageModified conversationID:").concat(l," uniqueID:").concat(a," has:").concat(c)),c){var h=this.list.get(l).get(a),m=p.messageVersion,y=p.elements,b=p.cloudCustomData;return h.version1&&arguments[1]!==void 0&&arguments[1];if(p)return this._isReady?void(a?p.call(this):setTimeout(p,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(p))},l.triggerReady=function(){var p=this;this._isReady=!0,setTimeout(function(){var a=p._readyQueue;p._readyQueue=[],a&&a.length>0&&a.forEach(function(c){c.call(this)},p)},1)},l.resetReady=function(){this._isReady=!1,this._readyQueue=[]},l.isReady=function(){return this._isReady}};var i6=["jpg","jpeg","gif","png","bmp","image","webp"],s6=["mp4","quicktime","mov"],a6=1,l6=2,u6=3,c6=255,Ep=function(){function k(l){var p=this;i(this,k),Ye(l)||(this.userID=l.userID||"",this.nick=l.nick||"",this.gender=l.gender||"",this.birthday=l.birthday||0,this.location=l.location||"",this.selfSignature=l.selfSignature||"",this.allowType=l.allowType||T.ALLOW_TYPE_ALLOW_ANY,this.language=l.language||0,this.avatar=l.avatar||"",this.messageSettings=l.messageSettings||0,this.adminForbidType=l.adminForbidType||T.FORBID_TYPE_NONE,this.level=l.level||0,this.role=l.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],Ye(l.profileCustomField)||l.profileCustomField.forEach(function(a){p.profileCustomField.push({key:a.key,value:a.value})}))}return u(k,[{key:"validate",value:function(l){var p=!0,a="";if(Ye(l))return{valid:!1,tips:"empty options"};if(l.profileCustomField)for(var c=l.profileCustomField.length,h=null,m=0;m500&&(a="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Il(l[y])," bytes"),p=!1);break;case"gender":ea(Zo,l.gender)||(a="key:gender, invalid value:"+l.gender,p=!1);break;case"birthday":un(l.birthday)||(a="birthday must be a number",p=!1);break;case"location":Et(l.location)||(a="location must be a string",p=!1);break;case"selfSignature":Et(l.selfSignature)||(a="selfSignature must be a string",p=!1);break;case"allowType":ea(cs,l.allowType)||(a="key:allowType, invalid value:"+l.allowType,p=!1);break;case"language":un(l.language)||(a="language must be a number",p=!1);break;case"avatar":Et(l.avatar)||(a="avatar must be a string",p=!1);break;case"messageSettings":l.messageSettings!==0&&l.messageSettings!==1&&(a="messageSettings must be 0 or 1",p=!1);break;case"adminForbidType":ea(Ra,l.adminForbidType)||(a="key:adminForbidType, invalid value:"+l.adminForbidType,p=!1);break;case"level":un(l.level)||(a="level must be a number",p=!1);break;case"role":un(l.role)||(a="role must be a number",p=!1);break;default:a="unknown key:"+y+" "+l[y],p=!1}}return{valid:p,tips:a}}}]),k}(),d6=u(function k(l){i(this,k),this.value=l,this.next=null}),l1=function(){function k(l){i(this,k),this.MAX_LENGTH=l,this.pTail=null,this.pNodeToDel=null,this.map=new Map}return u(k,[{key:"set",value:function(l){var p=new d6(l);if(this.map.size0&&a.members.forEach(function(c){c.userID===p.selfInfo.userID&&Ri(p.selfInfo,c,["sequence"])})}},{key:"updateSelfInfo",value:function(l){var p={nameCard:l.nameCard,joinTime:l.joinTime,role:l.role,messageRemindType:l.messageRemindType,readedSequence:l.readedSequence,excludedUnreadSequenceList:l.excludedUnreadSequenceList};Ri(this.selfInfo,r({},p),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(l){this.selfInfo.nameCard=l}}]),k}(),Aw=function(k,l){return Ge(k)?{lastTime:0,lastSequence:0,fromAccount:0,messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1,revoker:null}:k instanceof Hr?{lastTime:k.time||0,lastSequence:k.sequence||0,fromAccount:k.from||"",messageForShow:Gu(k.type,k.payload,l),payload:k.payload||null,type:k.type||null,isRevoked:k.isRevoked||!1,cloudCustomData:k.cloudCustomData||"",onlineOnlyFlag:k._onlineOnlyFlag||!1,nick:k.nick||"",nameCard:k.nameCard||"",version:k.version||0,isPeerRead:k.isPeerRead||!1,revoker:k.revoker||null}:r(r({},k),{},{messageForShow:Gu(k.type,k.payload,l)})},om=function(){function k(l,p){i(this,k),this.conversationID=l.conversationID||"",this.unreadCount=l.unreadCount||0,this.type=l.type||"",this.lastMessage=Aw(l.lastMessage,p),l.lastMsgTime&&(this.lastMessage.lastTime=l.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=l.peerReadTime||0,this.groupAtInfoList=[],this.remark="",this.isPinned=l.isPinned||!1,this.messageRemindType=l.messageRemindType,this.markList=l.markList||[],this.customData=l.customData||"",this.conversationGroupList=l.conversationGroupList||[],this.draftText=l.draftText||"",this._initProfile(l)}return u(k,[{key:"toAccount",get:function(){return this.conversationID.startsWith(T.CONV_C2C)?this.conversationID.replace(T.CONV_C2C,""):this.conversationID.startsWith(T.CONV_GROUP)?this.conversationID.replace(T.CONV_GROUP,""):""}},{key:"subType",get:function(){return this.groupProfile?this.groupProfile.type:""}},{key:"_initProfile",value:function(l){var p=this;Object.keys(l).forEach(function(a){switch(a){case"userProfile":p.userProfile=l.userProfile;break;case"groupProfile":p.groupProfile=l.groupProfile}}),Ge(this.userProfile)&&this.type===T.CONV_C2C?this.userProfile=new Ep({userID:l.conversationID.replace("C2C","")}):Ge(this.groupProfile)&&this.type===T.CONV_GROUP&&(this.groupProfile=new wl({groupID:l.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(l){var p=l.nextUnreadCount,a=l.isFromGetConversations,c=l.isUnreadC2CMessage;Ge(p)||(Go(this.subType)?this.unreadCount=0:a&&this.type===T.CONV_GROUP||a&&this.type===T.CONV_TOPIC||c&&this.type===T.CONV_C2C?this.unreadCount=p:this.unreadCount=this.unreadCount+p)}},{key:"updateLastMessage",value:function(l){this.lastMessage=Aw(l)}},{key:"updateGroupAtInfoList",value:function(l){if(!this._isNeedMergeGroupAtInfo(l)){var p,a=(j(p=l.groupAtType)||V(p)||x(p)||z()).slice(0);a.indexOf(T.CONV_AT_ME)!==-1&&a.indexOf(T.CONV_AT_ALL)!==-1&&(a=[T.CONV_AT_ALL_AT_ME]);var c={from:l.from,groupID:l.groupID,topicID:l.topicID,messageSequence:l.sequence,atTypeArray:a,__random:l.__random,__sequence:l.__sequence};this.groupAtInfoList.push(c)}}},{key:"_isNeedMergeGroupAtInfo",value:function(l){var p=l.groupID,a=l.sequence;if(!go({groupID:p}))return!1;var c=!1;return this.groupAtInfoList.forEach(function(h){h.messageSequence===a&&(h.atTypeArray.indexOf(T.CONV_AT_ME)>-1&&l.groupAtType.indexOf(T.CONV_AT_ALL)>-1&&(h.atTypeArray=[T.CONV_AT_ALL_AT_ME]),h.atTypeArray.indexOf(T.CONV_AT_ALL)>-1&&l.groupAtType.indexOf(T.CONV_AT_ME)>-1&&(h.atTypeArray=[T.CONV_AT_ALL_AT_ME],h.__random=l.__random,h.__sequence=l.__sequence),c=!0)}),c}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(l){var p=l.sequence,a=l.time;return this.type===T.CONV_C2C&&p===this.lastMessage.lastSequence&&a===this.lastMessage.lastTime||this.type===T.CONV_GROUP&&p===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(l){this.lastMessage.isRevoked=l}},{key:"setLastMessageRevoker",value:function(l){this.lastMessage.revoker=l}},{key:"setDraftText",value:function(l){this.draftText=l}}]),k}(),p6=function(){function k(l){i(this,k),this._conversationModule=l,this._n="MessageRemindHandler"}return u(k,[{key:"getC2CMessageRemindType",value:function(l){var p=this,a="".concat(this._n,".getC2CMessageRemindType");return this._conversationModule.request({protocolName:j0,requestData:{toAccount:this._conversationModule.getMyUserID(),userIDList:l}}).then(function(c){U.l("".concat(a," ok. userIDList:").concat(l));var h=c.data.muteFlagList;p._conversationModule.onC2CMessageRemindTypeFetched(h)}).catch(function(c){U.e("".concat(a," failed. error:"),c)})}},{key:"set",value:function(l){return l.groupID?this._setGroupMessageRemindType(l):rt(l.userIDList)?this._setC2CMessageRemindType(l):void 0}},{key:"_setGroupMessageRemindType",value:function(l){var p=this,a="".concat(this._n,"._setGroupMessageRemindType"),c=l.groupID,h=l.messageRemindType,m="groupID:".concat(c," messageRemindType:").concat(h),y=new We("setMessageRemindType");y.setMessage(m);var b=this._getModule(Mt);return b?b.modifyGroupMemberInfo({groupID:c,messageRemindType:h,userID:this._conversationModule.getMyUserID()}).then(function(){y.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok. ").concat(m));var I=p.onGroupMessageRemindTypeUpdated(l);return p._conversationModule.emitTotalUnreadMessageCountUpdate(),ht(I)}).catch(function(I){return p._conversationModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setError(I,F,H).end()}),U.e("".concat(a," failed. error:"),I),Me(I)}):Me({code:De.CANNOT_FIND_MODULE})}},{key:"onGroupMessageRemindTypeUpdated",value:function(l){var p=l.groupID,a=l.messageRemindType;U.l("".concat(this._n,".onGroupMessageRemindTypeUpdated groupID:").concat(p," messageRemindType:").concat(a));var c=this._getModule(Mt).getLocalGroupProfile(p);if(c&&(c.selfInfo.messageRemindType=a),oo(p)){var h=p,m=Lr(h),y=this._getModule(sr).getLocalTopic(m,h);return y&&(y.updateSelfInfo({messageRemindType:a}),this._conversationModule.emitOuterEvent(O.TOPIC_UPDATED,{groupID:m,topic:y})),{topic:y}}return this._conversationModule.patchMessageRemindType({ID:p,isC2CConversation:!1,messageRemindType:a})&&this._emitConversationUpdate(),{group:c}}},{key:"_setC2CMessageRemindType",value:function(l){var p=this,a="".concat(this._n,"._setC2CMessageRemindType"),c=l.userIDList,h=l.messageRemindType,m=c.slice(0,30),y=0;h===T.MSG_REMIND_DISCARD?y=1:h===T.MSG_REMIND_ACPT_NOT_NOTE&&(y=2);var b="userIDList:".concat(m," messageRemindType:").concat(h),I=new We("setMessageRemindType");return I.setMessage(b),this._conversationModule.request({protocolName:z0,requestData:{userIDList:m,muteFlag:y}}).then(function(E){I.setNetworkType(p._conversationModule.getNetworkType()).end();var R=E.data.errorList,F=[],H=[];rt(R)&&R.forEach(function(be){F.push(be.userID),H.push({userID:be.userID,code:be.errorCode})});var ee=m.filter(function(be){return F.indexOf(be)===-1});U.l("".concat(a," ok. ").concat(b," successUserIDList:").concat(ee," failureUserIDList:").concat(JSON.stringify(H)));var ge=0;return ee.forEach(function(be){p._conversationModule.patchMessageRemindType({ID:be,isC2CConversation:!0,messageRemindType:h})&&(ge+=1)}),ge>=1&&p._emitConversationUpdate(),m.length=F.length=0,p._conversationModule.emitTotalUnreadMessageCountUpdate(),At({successUserIDList:ee.map(function(be){return{userID:be}}),failureUserIDList:H})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];I.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"_getModule",value:function(l){return this._conversationModule.getModule(l)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset"))}}]),k}(),h6=function(){function k(l){i(this,k),this._conversationModule=l,this._n="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=Tr.NOT_START}return u(k,[{key:"setConvCustomData",value:function(l){var p=this,a="".concat(this._n,".").concat("setConvCustomData"),c=l.conversationIDList,h=l.customData;U.l("".concat(a," options:"),l);var m=new We("setConvCustomData");m.setMessage(JSON.stringify(l));var y={fromAccount:this._getMyUserID(),itemList:[]},b=[],I=[];return c.forEach(function(E){if(!p._hasLocalConversation(E))return p._onConversationNotFound(I,E),!0;if(!mo(E)&&!io(E))return p._onConversationIDInvalid(I,E),!0;var R={operationType:2,contactItem:void 0,customMark:h};mo(E)?R.contactItem={type:1,toAccount:E.replace(T.CONV_C2C,"")}:io(E)&&(R.contactItem={type:2,groupID:E.replace(T.CONV_GROUP,"")}),y.itemList.push(R)}),I.length===c.length?At({successConversationIDList:b,failureConversationIDList:I}):this._conversationModule.request({protocolName:vw,requestData:y}).then(function(E){m.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var R=E.data.resultItem;if(rt(R)){var F,H,ee=!1;R.forEach(function(ge){F=p._concatConversationID(ge.contactItem),ge.resultCode===0?(b.push(F),(H=p._getLocalConversation(F))&&H.customData!==h&&(H.customData=h,ee=!0)):I.push({conversationID:F,code:ge.resultCode,message:ge.resultInfo})}),ee===!0&&p._emitConversationUpdate()}return ht({successConversationIDList:b,failureConversationIDList:I})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];m.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"markConversation",value:function(l){var p=this;if(!this._conversationModule.canIUse(ve.CONV_MARK))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("markConversation"),c=l.conversationIDList,h=l.markType,m=l.enableMark;U.l("".concat(a," options:"),l);var y=new We("markConversation");y.setMessage(JSON.stringify(l));var b=void 0,I=void 0,E=this._getFlagBit(h);m===!0?I=[E]:b=[E];var R={fromAccount:this._getMyUserID(),itemList:[]},F=[],H=[];return c.forEach(function(ee){if(!p._hasLocalConversation(ee))return p._onConversationNotFound(H,ee),!0;if(!mo(ee)&&!io(ee))return p._onConversationIDInvalid(H,ee),!0;var ge={operationType:1,contactItem:void 0,clearMark:b,setMark:I};mo(ee)?ge.contactItem={type:1,toAccount:ee.replace(T.CONV_C2C,"")}:io(ee)&&(ge.contactItem={type:2,groupID:ee.replace(T.CONV_GROUP,"")}),R.itemList.push(ge)}),H.length===c.length?At({successConversationIDList:F,failureConversationIDList:H}):this._conversationModule.request({protocolName:Rg,requestData:R}).then(function(ee){y.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var ge=ee.data.resultItem;if(rt(ge)){var be,we,Ue=!1;ge.forEach(function(qe){if(be=p._concatConversationID(qe.contactItem),qe.resultCode===0){if(F.push(be),we=p._getLocalConversation(be)){var nt=we.markList.indexOf(h);m===!0?nt===-1&&(we.markList.push(h),Ue=!0):nt!==-1&&(we.markList.splice(nt,1),Ue=!0)}}else H.push({conversationID:be,code:qe.resultCode,message:qe.resultInfo})}),Ue===!0&&p._emitConversationUpdate()}return ht({successConversationIDList:F,failureConversationIDList:H})}).catch(function(ee){return p._conversationModule.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];y.setError(ee,we,Ue).end()}),U.e("".concat(a," failed. error:"),ee),Me(ee)})}},{key:"getLocalConvGroupList",value:function(){var l=this;return U.l("".concat(this._n,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===Tr.REJECTED?this.getRemoteConvGroupList().then(function(){return ht(L(l._convGroupMap.values()))}):At(L(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var l=this,p="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=Tr.PENDING,this._conversationModule.request({protocolName:r_,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:Kr()}}).then(function(a){var c,h,m=a.data,y=m.completeFlag,b=m.contactItem,I=m.nextStartIndex,E=I===void 0?0:I,R=m.groupItem;if(l._startIndex=E,U.l("".concat(p," completeFlag:").concat(y," nextStartIndex:").concat(E)),rt(R)&&R.forEach(function(F){var H=F.convGroupID,ee=F.groupName;l._convGroupMap.set(H,ee)}),rt(b)&&b.forEach(function(F){var H=F.standardMark,ee=F.customData,ge=F.convGroupIDList;if(c=l._concatConversationID(F),(h=l._getLocalConversation(c))&&(h.markList=fs(H),h.customData=ee||"",rt(ge))){var be=[];ge.forEach(function(we){l._convGroupMap.has(we)&&be.push(l._convGroupMap.get(we))}),h.conversationGroupList=[].concat(be),be.length=0}}),y===0)return l.getRemoteConvGroupList();y===1&&(l._pagingStatus=Tr.RESOLVED,l._emitConversationUpdate(),l._emitConvGroupListUpdate())}).catch(function(a){l._pagingStatus=Tr.REJECTED,U.w("".concat(p," failed. error:"),a)})}},{key:"createConvGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(ve.CONV_GROUP))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("createConvGroup");U.l("".concat(a," options:"),l);var c=new We("createConvGroup");c.setMessage(JSON.stringify(l));var h=l.groupName,m=l.conversationIDList,y={fromAccount:this._getMyUserID(),itemList:[{groupName:h,contactItem:[]}]},b=[],I=[];return m.forEach(function(E){return p._hasLocalConversation(E)?mo(E)||io(E)?void(mo(E)?y.itemList[0].contactItem.push({type:1,toAccount:E.replace(T.CONV_C2C,"")}):io(E)&&y.itemList[0].contactItem.push({type:2,groupID:E.replace(T.CONV_GROUP,"")})):(p._onConversationIDInvalid(I,E),!0):(p._onConversationNotFound(I,E),!0)}),I.length===m.length?At({successConversationIDList:b,failureConversationIDList:I}):this._conversationModule.request({protocolName:yw,requestData:y}).then(function(E){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var R=E.data.groupResultItem[0],F=R.groupItem,H=R.resultItem;if(yn(F)&&(p._convGroupMap.set(F.convGroupID,F.groupName),p._emitConvGroupListUpdate()),rt(H)){var ee,ge,be=!1;H.forEach(function(we){ee=p._concatConversationID(we.contactItem),we.resultCode===0?(b.push(ee),(ge=p._getLocalConversation(ee))&&ge.conversationGroupList.indexOf(h)===-1&&(ge.conversationGroupList.push(h),be=!0)):I.push({conversationID:ee,code:we.resultCode,message:we.resultInfo})}),be===!0&&(p._emitConversationUpdate(),p._emitConvGroupListUpdate())}return ht({successConversationIDList:b,failureConversationIDList:I})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];c.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"deleteConvGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(ve.CONV_GROUP))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("deleteConvGroup");U.l("".concat(a," groupName:").concat(l));var c=new We("deleteConvGroup");return c.setMessage(l),this._conversationModule.request({protocolName:n_,requestData:{fromAccount:this._getMyUserID(),groupName:[l]}}).then(function(h){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var m=h.data.groupItem;if(rt(m)){var y=!1;m.forEach(function(b){p._convGroupMap.has(b.convGroupID)&&(p._convGroupMap.delete(b.convGroupID),y=!0)}),y===!0&&p._emitConvGroupListUpdate()}p._eraseFromConversationGroupList([l])}).catch(function(h){return p._conversationModule.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];c.setError(h,b,I).end()}),U.e("".concat(a," failed. error:"),h),Me(h)})}},{key:"renameConvGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(ve.CONV_GROUP))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("renameConvGroup");U.l("".concat(a," options:"),l);var c=new We("renameConvGroup");c.setMessage(JSON.stringify(l));var h=l.oldName,m=l.newName;return this._conversationModule.request({protocolName:Sd,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:h,newName:m}}}).then(function(y){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var b=y.data.updateGroupResult.convGroupID;p._convGroupMap.set(b,m),p._emitConvGroupListUpdate();var I,E,R=p._conversationModule.getLocalConversationList(),F=!1;R.forEach(function(H){I=H.conversationGroupList,(E=I.indexOf(h))!==-1&&(I.splice(E,1,m),F=!0)}),F===!0&&p._emitConversationUpdate()}).catch(function(y){return p._conversationModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];c.setError(y,E,R).end()}),U.e("".concat(a," failed. error:"),y),Me(y)})}},{key:"addConvsToGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(ve.CONV_GROUP))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("addConvsToGroup");U.l("".concat(a," options:"),l);var c=new We("addConvsToGroup");c.setMessage(JSON.stringify(l));var h=l.conversationIDList,m=l.groupName,y={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:m,updateItem:[]}},b=[],I=[];return h.forEach(function(E){return p._hasLocalConversation(E)?mo(E)||io(E)?void(mo(E)?y.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:E.replace(T.CONV_C2C,"")}}):io(E)&&y.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:E.replace(T.CONV_GROUP,"")}})):(p._onConversationIDInvalid(I,E),!0):(p._onConversationNotFound(I,E),!0)}),I.length===h.length?At({successConversationIDList:b,failureConversationIDList:I}):this._conversationModule.request({protocolName:_w,requestData:y}).then(function(E){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var R=E.data.updateGroupResult.contactResultItem;if(rt(R)){var F,H,ee=!1;R.forEach(function(ge){F=p._concatConversationID(ge.contactItem),ge.resultCode===0?(H=p._getLocalConversation(F))&&H.conversationGroupList.indexOf(m)===-1&&(H.conversationGroupList.push(m),b.push(F),ee=!0):I.push({conversationID:F,code:ge.resultCode,message:ge.resultInfo})}),ee===!0&&(p._emitConversationUpdate(),p._emitConvInGroupUpdate(m))}return ht({successConversationIDList:b,failureConversationIDList:I})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];c.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"deleteConvsFromGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(ve.CONV_GROUP))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("deleteConvsFromGroup");U.l("".concat(a," options:"),l);var c=new We("deleteConvsFromGroup");c.setMessage(JSON.stringify(l));var h=l.conversationIDList,m=l.groupName,y={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:m,updateItem:[]}},b=[],I=[];return h.forEach(function(E){return p._hasLocalConversation(E)?mo(E)||io(E)?void(mo(E)?y.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:E.replace(T.CONV_C2C,"")}}):io(E)&&y.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:E.replace(T.CONV_GROUP,"")}})):(p._onConversationIDInvalid(I,E),!0):(p._onConversationNotFound(I,E),!0)}),I.length===h.length?At({successConversationIDList:b,failureConversationIDList:I}):this._conversationModule.request({protocolName:bw,requestData:y}).then(function(E){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var R=E.data.updateGroupResult.contactResultItem;if(rt(R)){var F,H,ee=!1;R.forEach(function(ge){if(F=p._concatConversationID(ge.contactItem),ge.resultCode===0){if(H=p._getLocalConversation(F)){var be=H.conversationGroupList.indexOf(m);be!==-1&&(H.conversationGroupList.splice(be,1),b.push(F),ee=!0)}}else I.push({conversationID:F,code:ge.resultCode,message:ge.resultInfo})}),ee===!0&&(p._emitConversationUpdate(),p._emitConvInGroupUpdate(m))}return ht({successConversationIDList:b,failureConversationIDList:I})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];c.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"onConvMarkUpdated",value:function(l){var p=this;if(!Ye(l)){var a,c;U.d("".concat(this._n,".onConvMarkUpdated markItemList:"),l);var h=!1;l.forEach(function(m){var y=m.recentContactItem,b=m.optType,I=m.standardMark,E=m.customMark;if(a=p._concatConversationID(y),c=p._getLocalConversation(a))if(b===1){var R=fs(I);(function(F,H){if(F===H)return!0;if(!F||!H||F.length!==H.length)return!1;for(var ee=0,ge=F.length;ee=0;c--)if(p[c]==="1")return a-c-1}},{key:"_concatConversationID",value:function(l){var p,a=l.type,c=l.to,h=l.groupID,m=l.userID;return a===1?Ge(m)?Ge(c)||(p="".concat(T.CONV_C2C).concat(c)):p="".concat(T.CONV_C2C).concat(m):a===2&&(p="".concat(T.CONV_GROUP).concat(h)),p}},{key:"_getMyUserID",value:function(){return this._conversationModule.getMyUserID()}},{key:"_insertConversationGroup",value:function(l,p){var a=this._getLocalConversation(l);if(a){var c=a.conversationGroupList;c.indexOf(p)===-1&&c.push(p)}}},{key:"_getLocalConversation",value:function(l){return this._conversationModule.getLocalConversation(l)}},{key:"_hasLocalConversation",value:function(l){return this._conversationModule.hasLocalConversation(l)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._conversationModule.emitOuterEvent(O.CONVERSATION_GROUP_LIST_UPDATED,L(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(l){var p={groupName:l,conversationList:[]},a=this._conversationModule.getLocalConversationList();p.conversationList=a.filter(function(c){return c.conversationGroupList.includes(l)}),this._conversationModule.emitOuterEvent(O.CONVERSATION_IN_GROUP_UPDATED,p)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=Tr.NOT_START}}]),k}(),g6=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="ConversationModule",a1.mixin(w(c)),c._messageListHandler=new o6,c._messageRemindHandler=new p6(w(c)),c._convGroupHandler=new h6(w(c)),c.singlyLinkedList=new l1(100),c._pagingStatus=Tr.NOT_START,c._pagingTimeStamp=0,c._pagingStartIndex=0,c._pagingPinnedTimeStamp=0,c._pagingPinnedStartIndex=0,c._pagingConvIDMap=new Map,c._convIDFromUnreadDBMap=new Map,c._conversationMap=new Map,c._tmpGroupList=[],c._tmpGroupAtTipsList=[],c._peerReadTimeMap=new Map,c._completedMap=new Map,c._roamingMessageKeyAndTimeMap=new Map,c._roamingMessageSequenceMap=new Map,c._remoteGroupReadSequenceMap=new Map,c._convTotalUnreadCount=0,c._pagingGetCostList=[],c._initListeners(),c}return u(p,[{key:"_initListeners",value:function(){var a=this.getInnerEmitterInstance();a.on(nr.A2KEY_AND_TINYID_UPDATED,this._init,this),a.on(nr.PROFILE_UPDATED,this._onProfileUpdated,this)}},{key:"onCheckTimer",value:function(a){a%60==0&&this._messageListHandler.traversal()}},{key:"_init",value:function(){var a=this;U.l("".concat(this._n,"._init"));var c=this.getModule(na).getItem("conversationMap"),h=this.isIntl();if(c){for(var m=c.length,y=0;y0&&(a.updateConversationGroupProfile(a._tmpGroupList),a._tmpGroupList.length=0)}),this.syncConversationList()}},{key:"_isNonExistentAccount",value:function(a){var c;return a.startsWith(T.CONV_C2C)&&(c=a.replace(T.CONV_C2C,"")),c==="@TLS#ERROR"||c==="@TLS#NOT_FOUND"}},{key:"onMessageSent",value:function(a){this._onSendOrReceiveMessage({conversationOptionsList:a.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(a){this._onSendOrReceiveMessage(a)}},{key:"_onSendOrReceiveMessage",value:function(a){var c=this,h=a.conversationOptionsList,m=a.isInstantMessage,y=m===void 0||m,b=a.isUnreadC2CMessage,I=b!==void 0&&b,E=a.updateUnreadCount,R=E===void 0||E,F=a.isSyncingEnded,H=F!==void 0&&F;this._isReady?h.length!==0?(y===!0&&this._checkNewConversation(h),this._updateLocalConversationList({conversationOptionsList:h,isInstantMessage:y,isUnreadC2CMessage:I,isFromGetConversations:!1,updateUnreadCount:R}),y||(this._convIDFromUnreadDBMap=new Map([].concat(L(this._convIDFromUnreadDBMap),L(h.map(function(ee){return[ee.conversationID,1]})))),this._diffAndDeleteConversation(),H&&this.emitInnerEvent(nr.C2C_UNREAD_HANDLE_COMPLETED)),h.filter(function(ee){return ee.type===T.CONV_TOPIC}).length>0||this.emitConversationUpdate()):H&&this.emitInnerEvent(nr.C2C_UNREAD_HANDLE_COMPLETED):this.ready(function(){c._onSendOrReceiveMessage(a)})}},{key:"updateConversationGroupProfile",value:function(a){var c=this;if(!rt(a)||a.length!==0)if(this._conversationMap.size!==0){var h=!1;a.forEach(function(m){var y="GROUP".concat(m.groupID);if(c._conversationMap.has(y)){h=!0;var b=c._conversationMap.get(y);b.groupProfile=JSON.parse(JSON.stringify(m)),b.lastMessage.lastSequence=0;I--)if(!y[I].isDeleted){b=y[I];break}var E=this._conversationMap.get(m);if(E){var R=!1;E.lastMessage.lastSequence===b.sequence&&E.lastMessage.lastTime===b.time||(Ye(b)&&(b=void 0),E.updateLastMessage(b),E.type!==T.CONV_TOPIC&&(R=!0),U.l("".concat(this._n,".onMessageDeleted. update conversationID:").concat(m," with lastMessage:"),E.lastMessage)),m.startsWith(T.CONV_C2C)&&this.updateUnreadCount(m),R&&this.emitConversationUpdate(!0,!1)}}}},{key:"onMessageModified",value:function(a){var c=a.conversationType,h=a.from,m=a.to,y=a.time,b=a.sequence,I=a.elements,E=a.cloudCustomData,R=a.messageVersion,F=this.getMyUserID(),H="".concat(c).concat(m);m===F&&c===T.CONV_C2C&&(H="".concat(c).concat(h));var ee=this._messageListHandler.onMessageModified(H,a),ge=ee.isUpdated,be=ee.message;ge===!0&&this.emitOuterEvent(O.MESSAGE_MODIFIED,[be]);var we=this._isTopicConversation(H);if(U.l("".concat(this._n,".onMessageModified isUpdated:").concat(ge," isTopicMessage:").concat(we," from:").concat(h," to:").concat(m)),we)this.getModule(sr).onMessageModified(a);else{var Ue=this._conversationMap.get(H);if(Ue){var qe=Ue.lastMessage;U.d("".concat(this._n.onMessageModified," lastMessage:"),JSON.stringify(qe),"options:",JSON.stringify(a)),qe&&qe.lastTime===y&&qe.lastSequence===b&&qe.version!==R&&(qe.type=I[0].type,qe.payload=I[0].content,qe.messageForShow=Gu(qe.type,qe.payload,this.isIntl()),qe.cloudCustomData=E,qe.version=R,this.emitConversationUpdate(!0,!1))}}return be}},{key:"onNewGroupAtTips",value:function(a){var c=this,h=a.dataList,m=null;h.forEach(function(y){y.groupAtTips?m=y.groupAtTips:y.elements?m=r(r({},y.elements),{},{sync:!0}):y.groupAtType&&(m=r(r({},y),{},{sync:!0})),m.__random=y.random,m.__sequence=y.clientSequence,c._tmpGroupAtTipsList.push(m)}),U.d("".concat(this._n,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var a=this;if(this._tmpGroupAtTipsList.length!==0){var c=!1;this._tmpGroupAtTipsList.forEach(function(h){var m=h.groupID,y=h.from,b=h.topicID,I=b===void 0?void 0:b,E=h.sync,R=E!==void 0&&E;if(y!==a.getMyUserID())if(Ge(I)){var F=a._conversationMap.get("".concat(T.CONV_GROUP).concat(m));F&&(F.updateGroupAtInfoList(h),c=!0)}else{var H=a._conversationMap.get("".concat(T.CONV_GROUP).concat(I));if(H){H.updateGroupAtInfoList(h);var ee=a.getModule(sr),ge=H.groupAtInfoList;ee.onConversationProxy({topicID:I,groupAtInfoList:ge})}Ye(H)&&R&&(a.updateTopicConversation([{conversationID:"".concat(T.CONV_GROUP).concat(I),type:T.CONV_TOPIC}]),a._conversationMap.get("".concat(T.CONV_GROUP).concat(I)).updateGroupAtInfoList(h))}}),c&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:"_checkNewConversation",value:function(a){var c=this,h=[],m=[];a.forEach(function(y){c._conversationMap.has(y.conversationID)||(y.type===T.CONV_C2C?h.push(y.conversationID.replace(T.CONV_C2C,"")):y.type===T.CONV_GROUP&&m.push(y.conversationID.replace(T.CONV_GROUP,"")))}),h.length>0&&(this._onNewC2CConversation(h),h=null),m.length>0&&(this._onNewGroupConversation(m),m=null)}},{key:"_onNewC2CConversation",value:function(a){this.getModule(ao).getRemotePeerReadTime(a),this._messageRemindHandler.getC2CMessageRemindType(a)}},{key:"_onNewGroupConversation",value:function(a){var c=this.getModule(Mt);c&&c.getMessageRemindType(a)}},{key:"_setStorageConversationList",value:function(){var a=arguments.length>0&&arguments[0]!==void 0&&arguments[0],c=this.getLocalConversationList(),h=c.filter(function(y){return y.type===T.CONV_C2C||y.type===T.CONV_GROUP&&y.lastMessage.type!==T.MSG_GRP_TIP}).slice(0,20).map(function(y){return{conversationID:y.conversationID,type:y.type,subType:y.subType,lastMessage:y.lastMessage,groupProfile:y.groupProfile,userProfile:y.userProfile}}),m=this.getModule(na);m.setItem("conversationMap",h,a)}},{key:"emitConversationUpdate",value:function(){var a=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],c=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],h=this.getLocalConversationList();if(c){var m=this.getModule(Mt);m&&m.updateGroupLastMessage(h)}a&&this.emitOuterEvent(O.CONVERSATION_LIST_UPDATED)}},{key:"getLocalConversationList",value:function(){return L(this._conversationMap.values()).filter(function(a){return a.type!==T.CONV_TOPIC})}},{key:"getLocalConversation",value:function(a){return this._conversationMap.get(a)}},{key:"hasLocalConversation",value:function(a){return this._conversationMap.has(a)}},{key:"getLocalOldestMessage",value:function(a){return this._messageListHandler.getLocalOldestMessage(a)}},{key:"syncConversationList",value:function(){var a=this,c=new We("syncConversationList");return this._pagingStatus===Tr.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList().then(function(h){var m=cp(a._pagingGetCostList),y=ps(a._pagingGetCostList);a._pagingGetCostList.length=0,a._pagingStatus=Tr.RESOLVED,a._diffAndDeleteConversation(),a.emitConversationUpdate(!0,!1),a._setStorageConversationList(),a._handleC2CPeerReadTime(),a.emitInnerEvent(nr.CONV_SYNC_COMPLETED);var b="count:".concat(a._conversationMap.size," sum:").concat(y," avg:").concat(m);return U.l("".concat(a._n,".").concat("syncConversationList",". ").concat(b)),c.setMessage(b).setNetworkType(a.getNetworkType()).end(),h}).catch(function(h){return a._pagingStatus=Tr.REJECTED,c.setMessage(a._pagingTimeStamp),a.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];c.setError(h,b,I).end()}),Me(h)})}},{key:"_diffAndDeleteConversation",value:function(){var a=this;if(this._isSyncCompleted()){var c=[];this._conversationMap.forEach(function(h,m){!a._pagingConvIDMap.has(m)&&a._convIDFromUnreadDBMap.has(m)&&(a._conversationMap.delete(m),c.push(m))}),U.l("".concat(this._n,"._diffAndDeleteConversation list:").concat(c)),c=null}}},{key:"_pagingGetConversationList",value:function(){var a=this,c="".concat(this._n,"._pagingGetConversationList");U.l("".concat(c," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex));var h=Date.now();return this._pagingStatus=Tr.PENDING,this.request({protocolName:X0,requestData:{fromAccount:this.getMyUserID(),timeStamp:this._pagingTimeStamp,startIndex:this._pagingStartIndex,pinnedTimeStamp:this._pagingPinnedTimeStamp,pinnedStartIndex:this._pagingPinnedStartIndex,orderType:1}}).then(function(m){var y=m.data,b=y.completeFlag,I=y.conversations,E=I===void 0?[]:I,R=y.timeStamp,F=y.startIndex,H=y.pinnedTimeStamp,ee=y.pinnedStartIndex,ge=y.groupItem,be=Date.now()-h;if(a._pagingGetCostList.push(be),U.l("".concat(c," ok. completeFlag:").concat(b," count:").concat(E.length," cost ").concat(be," ms")),a._convGroupHandler.onConvGroupListSynced(ge),E.length>0){var we=a._getConversationOptions(E);a._pagingConvIDMap=new Map([].concat(L(a._pagingConvIDMap),L(we.map(function(Ue){return[Ue.conversationID,1]})))),a._updateLocalConversationList({conversationOptionsList:we,isFromGetConversations:!0}),a.isLoggedIn()&&a.emitConversationUpdate()}if(!a._isReady){if(!a.isLoggedIn())return At();a.triggerReady()}return a._pagingTimeStamp=R,a._pagingStartIndex=F,a._pagingPinnedTimeStamp=H,a._pagingPinnedStartIndex=ee,b!==1?a._pagingGetConversationList():(a._handleGroupAtTipsList(),a._convGroupHandler.getRemoteConvGroupList(),At())}).catch(function(m){throw a.isLoggedIn()&&(a._isReady||(U.w("".concat(c," failed. error:"),m),a.triggerReady())),m})}},{key:"_updateLocalConversationList",value:function(a){var c,h=a.isFromGetConversations,m=a.isInstantMessage,y=Date.now();c=this._getTmpConversationListMapping(a),this._conversationMap=new Map(this._sortConversationList([].concat(L(c.toBeUpdatedConversationList),L(this._conversationMap)))),h||(this._updateUserOrGroupProfile(c.newConversationList),m&&this.emitTotalUnreadMessageCountUpdate()),U.d("".concat(this._n,"._updateLocalConversationList cost ").concat(Date.now()-y," ms"))}},{key:"_getTmpConversationListMapping",value:function(a){for(var c=a.conversationOptionsList,h=a.isFromGetConversations,m=a.isInstantMessage,y=a.isUnreadC2CMessage,b=y!==void 0&&y,I=a.updateUnreadCount,E=[],R=[],F=this.getModule(Mt),H=this.getModule(hr),ee=this.isIntl(),ge=0,be=c.length;ge0&&y.getUserProfile({userIDList:h}).then(function(I){var E=I.data;rt(E)?E.forEach(function(R){c._doUpdateUserProfile("C2C".concat(R.userID),R)}):c._doUpdateUserProfile("C2C".concat(E.userID),E)}),m.length>0&&b.getGroupProfileAdvance({groupIDList:m,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then(function(I){I.data.successGroupList.forEach(function(E){var R="GROUP".concat(E.groupID);if(c._conversationMap.has(R)){var F=c._conversationMap.get(R);Ri(F.groupProfile,E,[],[null,void 0,"",0,NaN]),!F.subType&&E.type&&(F.subType=E.type)}})})}}},{key:"_doUpdateUserProfile",value:function(a,c){this.hasLocalConversation(a)&&(this.getLocalConversation(a).userProfile=c)}},{key:"_getConversationOptions",value:function(a){var c=this,h=[],m=a.filter(function(I){var E=I.type,R=I.userID;return E===1&&!c._isNonExistentAccount(R)||E===2}),y=this.getMyUserID(),b=m.map(function(I){if(Ge(I.lastMsg)&&(I.lastMsg={elements:[]}),I.type===1){var E={userID:I.userID,nick:I.peerNick,avatar:I.peerAvatar};return h.push(E),{conversationID:"C2C".concat(I.userID),type:"C2C",lastMessage:{lastTime:I.time,lastSequence:I.sequence,fromAccount:I.lastC2CMsgFromAccount,type:I.lastMsg.elements[0]?I.lastMsg.elements[0].type:null,payload:I.lastMsg.elements[0]?c._amendLayersOverLimitProperty(I.lastMsg.elements[0].content):null,cloudCustomData:I.lastMsg.cloudCustomData||"",isRevoked:I.lastMessageFlag===8,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:I.lastC2CMsgFromAccount===y&&I.time<=I.c2cPeerReadTime,revoker:I.lastMsg.revokerInfo?I.lastMsg.revokerInfo.revoker:null},userProfile:new Ep(E),peerReadTime:I.c2cPeerReadTime,isPinned:I.isPinned===1,customData:I.customMark||"",markList:fs(I.standardMark),conversationGroupList:c._convGroupHandler.getConvGroupListByID(I.contactGroupId),remark:I.friendRemark||"",messageRemindType:c._transMessageRemindType(I.messageRemindType)}}return{conversationID:"GROUP".concat(I.groupID),type:"GROUP",lastMessage:r(r({lastTime:I.time,lastSequence:I.sequence,fromAccount:I.msgGroupFromAccount},c._patchTypeAndPayload(I)),{},{cloudCustomData:I.lastMsg.cloudCustomData||"",isRevoked:I.lastMessageFlag===2,onlineOnlyFlag:!1,nick:I.senderNick||"",nameCard:I.senderNameCard||"",revoker:I.lastMsg.revokerInfo?I.lastMsg.revokerInfo.revoker:null}),groupProfile:new wl({groupID:I.groupID,name:I.groupNick,avatar:I.groupImage,type:I.groupType,nextMessageSeq:I.nextMessageSeq}),unreadCount:c._computeGroupUnreadCount(I),peerReadTime:0,isPinned:I.isPinned===1,version:0,customData:I.customMark||"",markList:fs(I.standardMark),conversationGroupList:c._convGroupHandler.getConvGroupListByID(I.contactGroupId),messageRemindType:c._transMessageRemindType(I.messageRemindType)}});return h.length>0&&this.getModule(pr).onConversationsProfileUpdated(h),b}},{key:"_transMessageRemindType",value:function(a){var c="";return a===0?c=T.MSG_REMIND_ACPT_AND_NOTE:a===1?c=T.MSG_REMIND_DISCARD:a===2&&(c=T.MSG_REMIND_ACPT_NOT_NOTE),c}},{key:"_computeGroupUnreadCount",value:function(a){var c=a.unreadCount,h=c===void 0?0:c,m=a.noUnreadCount,y=h-(m===void 0?0:m);return y>0?y:0}},{key:"_patchTypeAndPayload",value:function(a){var c=a.lastMsg,h=c.event,m=h===void 0?void 0:h,y=c.elements,b=y===void 0?[]:y,I=c.groupTips,E=I===void 0?{}:I;if(!Ge(m)&&!Ye(E)){var R=new Hr(E);R.setElement({type:T.MSG_GRP_TIP,content:r(r({},E.elements),{},{groupProfile:E.groupProfile})});var F=JSON.parse(JSON.stringify(R.payload));return R=null,{type:T.MSG_GRP_TIP,payload:F}}return{type:b[0]?b[0].type:null,payload:b[0]?this._amendLayersOverLimitProperty(b[0].content):null}}},{key:"_amendLayersOverLimitProperty",value:function(a){var c=a.layersOverLimit;return c===0?a.layersOverLimit=!1:c===1&&(a.layersOverLimit=!0),a}},{key:"getLocalMessageList",value:function(a){return this._messageListHandler.getLocalMessageList(a)}},{key:"deleteLocalMessage",value:function(a){a instanceof Hr&&this._messageListHandler.remove(a)}},{key:"onConversationDeleted",value:function(a){if(rt(a)){var c=a.map(function(h){var m=h.type,y=h.userID,b=h.groupID;return m===1?"".concat(T.CONV_C2C).concat(y):m===2?"".concat(T.CONV_GROUP).concat(b):void 0});U.l("".concat(this._n,".onConversationDeleted conversationIDList:").concat(c)),this.deleteLocalConversationList(c)}}},{key:"onConversationPinned",value:function(a){var c=this;if(rt(a)){var h=!1;a.forEach(function(m){var y,b=m.type,I=m.userID,E=m.groupID;b===1?y=c.getLocalConversation("".concat(T.CONV_C2C).concat(I)):b===2&&(y=c.getLocalConversation("".concat(T.CONV_GROUP).concat(E))),y&&(U.l("".concat(c._n,".onConversationPinned conversationID:").concat(y.conversationID," isPinned:").concat(y.isPinned)),y.isPinned||(y.isPinned=!0,h=!0))}),h&&this._sortConversationListAndEmitEvent()}}},{key:"onConversationUnpinned",value:function(a){var c=this;if(rt(a)){var h=!1;a.forEach(function(m){var y,b=m.type,I=m.userID,E=m.groupID;b===1?y=c.getLocalConversation("".concat(T.CONV_C2C).concat(I)):b===2&&(y=c.getLocalConversation("".concat(T.CONV_GROUP).concat(E))),y&&(U.l("".concat(c._n,".onConversationUnpinned conversationID:").concat(y.conversationID," isPinned:").concat(y.isPinned)),y.isPinned&&(y.isPinned=!1,h=!0))}),h&&this._sortConversationListAndEmitEvent()}}},{key:"getMessageList",value:function(a){var c=this,h=a.conversationID,m=a.nextReqMessageID,y=a.count,b="".concat(this._n,".getMessageList"),I=this.getLocalConversation(h),E="";if(I&&I.groupProfile&&(E=I.groupProfile.type),Go(E))return U.l("".concat(b," not available in avchatroom. conversationID:").concat(h)),At({messageList:[],nextReqMessageID:"",isCompleted:!0});(Ge(y)||y>15)&&(y=15),!m&&this._isNotInCommunity(h)&&(this._messageListHandler.removeByConversationID(h),this._completedMap.delete(h),this._roamingMessageSequenceMap.delete(h));var R=this._computeRemainingCount({conversationID:h,nextReqMessageID:m}),F=this._completedMap.has(h);if(U.l("".concat(b," conversationID:").concat(h," nextReqMessageID:").concat(m)+" remainingCount:".concat(R," count:").concat(y," isCompleted:").concat(F)),this._needGetHistory({conversationID:h,remainingCount:R,count:y}))return this.getHistoryMessages({conversationID:h,nextReqMessageID:m,count:20}).then(function(ee){var ge=ee.nextReqID,be=ee.storedMessageList,we=c._completedMap.has(h),Ue=be;R>0&&(Ue=c._messageListHandler.getLocalMessageList(h).slice(0,be.length+R));var qe={nextReqMessageID:we?"":ge,messageList:Ue,isCompleted:we};return U.l("".concat(b," ret.nextReqMessageID:").concat(qe.nextReqMessageID," ret.isCompleted:").concat(qe.isCompleted," ret.length:").concat(Ue.length)),ht(qe)});this.modifyMessageList(h);var H=this._getMessageListFromMemory({conversationID:h,nextReqMessageID:m,count:y});return At(H)}},{key:"_getMessageListFromMemory",value:function(a){var c=a.conversationID,h=a.nextReqMessageID,m=a.count,y="".concat(this._n,"._getMessageListFromMemory"),b=this._messageListHandler.getLocalMessageList(c),I=b.length,E=0,R={isCompleted:!1,nextReqMessageID:"",messageList:[]};return h?(E=b.findIndex(function(F){return F.ID===h}))>m?(R.messageList=b.slice(E-m,E),R.nextReqMessageID=b[E-m].ID):(R.messageList=b.slice(0,E),R.isCompleted=!0):I>m?(E=I-m,R.messageList=b.slice(E,I),R.nextReqMessageID=b[E].ID):(R.messageList=b.slice(0,I),R.isCompleted=!0),U.l("".concat(y," conversationID:").concat(c)+" ret.nextReqMessageID:".concat(R.nextReqMessageID," ret.isCompleted:").concat(R.isCompleted," ret.length:").concat(R.messageList.length)),R}},{key:"getMessageListHopping",value:function(a){var c=a.conversationID,h=a.sequence,m=a.time,y=a.count,b=a.direction,I=b===void 0?0:b;if((Ge(y)||y>15)&&(y=15),c.startsWith(T.CONV_C2C)){var E=this.getModule(ao),R=c.replace(T.CONV_C2C,"");return E.getRoamingMessagesHopping({peerAccount:R,time:m,count:y,direction:I})}if(c.startsWith(T.CONV_GROUP)){var F=this.getModule(Mt),H=c.replace(T.CONV_GROUP,"");return F.getRoamingMessagesHopping({groupID:H,sequence:h,count:y,direction:I})}}},{key:"_computeRemainingCount",value:function(a){var c=a.conversationID,h=a.nextReqMessageID,m=this._messageListHandler.getLocalMessageList(c),y=m.length;if(!h)return y;var b=0;return mo(c)?b=m.findIndex(function(I){return I.ID===h}):io(c)&&(b=h.indexOf("-")!==-1?m.findIndex(function(I){return I.ID===h}):m.findIndex(function(I){return I.sequence===h})),b===-1&&(b=0),b}},{key:"_getMessageListSize",value:function(a){return this._messageListHandler.getLocalMessageList(a).length}},{key:"_needGetHistory",value:function(a){var c=a.conversationID,h=a.remainingCount,m=a.count,y=this.getLocalConversation(c),b="";return y&&y.groupProfile&&(b=y.groupProfile.type),!Cd(c)&&!Go(b)&&!(io(c)&&this._isPagingGetGroupListCompleted()&&this._getLocalGroupCount()<=4e3&&!this._hasLocalGroup(c)&&!this._isTopicConversation(c))&&h<=m&&!this._completedMap.has(c)}},{key:"_isTopicConversation",value:function(a){var c=a.replace(T.CONV_GROUP,"");return oo(c)}},{key:"getHistoryMessages",value:function(a){var c=a.conversationID,h=a.count;if(c===T.CONV_SYSTEM)return At();var m=15;h>20&&(m=20);var y=null;if(mo(c)){var b=this._roamingMessageKeyAndTimeMap.has(c);return(y=this.getModule(ao))?y.getRoamingMessage({conversationID:c,peerAccount:c.replace(T.CONV_C2C,""),count:m,lastMessageTime:b?this._roamingMessageKeyAndTimeMap.get(c).lastMessageTime:0,messageKey:b?this._roamingMessageKeyAndTimeMap.get(c).messageKey:""}):Me({code:De.CANNOT_FIND_MODULE})}if(io(c)){if(!(y=this.getModule(Mt)))return Me({code:De.CANNOT_FIND_MODULE});var I=null;this._conversationMap.has(c)&&(I=this._conversationMap.get(c).lastMessage);var E=0;I&&(E=I.lastSequence);var R=this._roamingMessageSequenceMap.get(c);return y.getRoamingMessage({conversationID:c,groupID:c.replace(T.CONV_GROUP,""),count:m,sequence:R||E})}return At()}},{key:"patchConversationLastMessage",value:function(a){var c=this.getLocalConversation(a);if(c){var h=c.lastMessage,m=h.messageForShow,y=h.payload;if(Ye(m)||Ye(y)){var b=this._messageListHandler.getLocalMessageList(a);if(b.length===0)return;var I=b[b.length-1];U.l("".concat(this._n,".patchConversationLastMessage conversationID:").concat(a," payload:"),I.payload),c.updateLastMessage(I)}}}},{key:"onRoamingMessage",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c=arguments.length>1?arguments[1]:void 0,h=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],m=c.startsWith(T.CONV_C2C)?T.CONV_C2C:T.CONV_GROUP,y=null,b=[],I=[],E=0,R=a.length,F=null,H=m===T.CONV_GROUP,ee=this.getFileDownloadProxy(),ge=function(){E=H?a.length-1:0,R=H?0:a.length},be=function(){H?--E:++E},we=function(){return H?E>=R:E0&&arguments[0]!==void 0?arguments[0]:{},h="setAllMessageRead",m="".concat(this._n,".").concat(h);c.scope||(c.scope=T.READ_ALL_MSG),U.l("".concat(m," options:"),c);var y=this._createSetAllMessageReadPack(c);if(y.readAllC2CMessage===0&&y.groupMessageReadInfoList.length===0)return At();var b=new We(h);return this.request({protocolName:Ug,requestData:y}).then(function(I){var E=I.data,R=a._handleAllMessageRead(E);return b.setMessage("scope:".concat(c.scope," failureGroups:").concat(JSON.stringify(R))).setNetworkType(a.getNetworkType()).end(),At()}).catch(function(I){return a.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];b.setError(I,F,H).end()}),U.w("".concat(m," failed. error:"),I),Me({code:I&&I.code?I.code:De.MSG_UNREAD_ALL_FAIL,message:I&&I.message?I.message:void 0})})}},{key:"setConversationCustomData",value:function(a){return this._convGroupHandler.setConvCustomData(a)}},{key:"markConversation",value:function(a){return this._convGroupHandler.markConversation(a)}},{key:"getConversationGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConversationGroup",value:function(a){return this._convGroupHandler.createConvGroup(a)}},{key:"deleteConversationGroup",value:function(a){return this._convGroupHandler.deleteConvGroup(a)}},{key:"renameConversationGroup",value:function(a){return this._convGroupHandler.renameConvGroup(a)}},{key:"addConversationsToGroup",value:function(a){return this._convGroupHandler.addConvsToGroup(a)}},{key:"deleteConversationsFromGroup",value:function(a){return this._convGroupHandler.deleteConvsFromGroup(a)}},{key:"onConversationMarkUpdated",value:function(a){this._convGroupHandler.onConvMarkUpdated(a)}},{key:"onConversationGroupCreated",value:function(a){this._convGroupHandler.onConvGroupCreated(a)}},{key:"onConversationGroupDeleted",value:function(a){this._convGroupHandler.onConvGroupDeleted(a)}},{key:"onConversationGroupNameUpdated",value:function(a){this._convGroupHandler.onConvGroupNameUpdated(a)}},{key:"onConversationInGroupUpdated",value:function(a){this._convGroupHandler.onConvInGroupUpdated(a)}},{key:"onConversationAddedToOrDeletedFromGroup",value:function(a){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(a)}},{key:"_getConversationLastMessageSequence",value:function(a){var c=this._messageListHandler.getLocalLastMessage(a.conversationID),h=a.lastMessage.lastSequence;return c&&h0){if(b.type===T.CONV_C2C&&h.readAllC2CMessage===0){if(m===T.READ_ALL_MSG)h.readAllC2CMessage=1;else if(m===T.READ_ALL_C2C_MSG){h.readAllC2CMessage=1;break}}else if(b.type===T.CONV_GROUP&&(m===T.READ_ALL_GROUP_MSG||m===T.READ_ALL_MSG)){var I=this._getConversationLastMessageSequence(b);h.groupMessageReadInfoList.push({groupID:b.groupProfile.groupID,messageSequence:I})}}}}catch(E){y.e(E)}finally{y.f()}return h}},{key:"onPushedAllMessageRead",value:function(a){this._handleAllMessageRead(a)}},{key:"_handleAllMessageRead",value:function(a){var c=a.groupMessageReadInfoList,h=a.readAllC2CMessage,m=this._parseGroupReadInfo(c);return this._updateAllConversationUnreadCount({readAllC2CMessage:h})>=1&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate()),m}},{key:"_parseGroupReadInfo",value:function(a){var c=[];if(a&&a.length)for(var h=0,m=a.length;h=1){if(h===1&&E.type===T.CONV_C2C){var R=this._getConversationLastMessageTime(E);this.updateIsReadAfterReadReport({conversationID:I,lastMessageTime:R})}else if(E.type===T.CONV_GROUP){var F=I.replace(T.CONV_GROUP,"");if(this._remoteGroupReadSequenceMap.has(F)){var H=this._remoteGroupReadSequenceMap.get(F),ee=this._getConversationLastMessageSequence(E);this.updateIsReadAfterReadReport({conversationID:I,remoteReadSequence:H}),ee>=H&&this._remoteGroupReadSequenceMap.delete(F)}}this.updateUnreadCount(I,!1)&&(m+=1)}}}catch(ge){y.e(ge)}finally{y.f()}return m}},{key:"isRemoteRead",value:function(a){var c=a.conversationID,h=a.sequence,m=c.replace(T.CONV_GROUP,""),y=!1;if(this._remoteGroupReadSequenceMap.has(m)){var b=this._remoteGroupReadSequenceMap.get(m);h<=b&&(y=!0,U.l("".concat(this._n,".isRemoteRead conversationID:").concat(c," messageSequence:").concat(h," remoteReadSequence:").concat(b))),h>=b+10&&this._remoteGroupReadSequenceMap.delete(m)}return y}},{key:"updateIsReadAfterReadReport",value:function(a){var c=a.conversationID,h=a.lastMessageSeq,m=a.lastMessageTime,y=this._messageListHandler.getLocalMessageList(c);if(y.length!==0){for(var b,I=y.length-1;I>=0;I--)if(b=y[I],!(m&&b.time>m||h&&b.sequence>h)){if(b.flow==="in"&&b.isRead)break;b.setIsRead(!0)}}}},{key:"updateUnreadCount",value:function(a){var c=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],h=!1,m=this.getLocalConversation(a),y=this._messageListHandler.getLocalMessageList(a);if(m){var b=m.unreadCount,I=y.filter(function(H){return!H.isRead&&!H._onlineOnlyFlag&&!H.isDeleted}).length;if(b!==I&&(m.unreadCount=I,h=!0,U.l("".concat(this._n,".updateUnreadCount from ").concat(b," to ").concat(I,", conversationID:").concat(a)),c===!0&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())),h&&m.type===T.CONV_TOPIC){var E=m.unreadCount,R=this.getModule(sr),F=a.replace(T.CONV_GROUP,"");R.onConversationProxy({topicID:F,unreadCount:E})}return h}}},{key:"clearGroupAtInfoList",value:function(a){var c=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],h=this.getLocalConversation(a);if(h&&h.groupAtInfoList.length>0){if(h.clearGroupAtInfoList(),U.l("".concat(this._n,".clearGroupAtInfoList conversationID:").concat(a)),h.type===T.CONV_TOPIC){var m=h.groupAtInfoList,y=this.getModule(sr),b=a.replace(T.CONV_GROUP,"");y.onConversationProxy({topicID:b,groupAtInfoList:m})}c===!0&&this.emitConversationUpdate(!0,!1)}}},{key:"updateReadReceiptInfo",value:function(a){var c=this,h=a.userID,m=h===void 0?void 0:h,y=a.groupID,b=y===void 0?void 0:y,I=a.readReceiptList;if(!Ye(I)){var E=[];if(Ge(m)){if(!Ge(b)){var R="".concat(T.CONV_GROUP).concat(b);I.forEach(function(H){var ee=H.tinyID,ge=H.clientTime,be=H.random,we=H.readCount,Ue=H.unreadCount,qe="".concat(ee,"-").concat(ge,"-").concat(be),nt=c._messageListHandler.getLocalMessage(R,qe),mt={groupID:b,messageID:qe,readCount:0,unreadCount:0};nt&&(un(we)&&(nt.readReceiptInfo.readCount=we,mt.readCount=we),un(Ue)&&(nt.readReceiptInfo.unreadCount=Ue,mt.unreadCount=Ue),E.push(mt))})}}else{var F="".concat(T.CONV_C2C).concat(m);I.forEach(function(H){var ee=H.tinyID,ge=H.clientTime,be=H.random,we="".concat(ee,"-").concat(ge,"-").concat(be),Ue=c._messageListHandler.getLocalMessage(F,we);if(Ue){Ue.readReceiptInfo.isPeerRead=!0;var qe={userID:m,messageID:we,isPeerRead:!0};E.push(qe)}})}E.length>0&&this.emitOuterEvent(O.MESSAGE_READ_RECEIPT_RECEIVED,E)}}},{key:"updateIsRead",value:function(a){var c=this.getLocalConversation(a),h=this.getLocalMessageList(a);if(c&&h.length!==0&&!Cd(c.type)){for(var m=[],y=0,b=h.length;y0){var h=this._messageListHandler.updateMessageIsPeerReadProperty(a,c);if(h.length>0&&this.emitOuterEvent(O.MESSAGE_READ_BY_PEER,h),this._conversationMap.has(a)){var m=this._conversationMap.get(a).lastMessage;Ye(m)||m.fromAccount===this.getMyUserID()&&m.lastTime<=c&&!m.isPeerRead&&(m.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:"updateMessageIsModifiedProperty",value:function(a){this._messageListHandler.updateMessageIsModifiedProperty(a)}},{key:"setCompleted",value:function(a){U.l("".concat(this._n,".setCompleted. conversationID:").concat(a)),this._completedMap.set(a,!0)}},{key:"updateRoamingMessageKeyAndTime",value:function(a,c,h){this._roamingMessageKeyAndTimeMap.set(a,{messageKey:c,lastMessageTime:h})}},{key:"updateRoamingMessageSequence",value:function(a,c){this._roamingMessageSequenceMap.set(a,c)}},{key:"getConversationList",value:function(a){var c=this,h="".concat(this._n,".").concat("getConversationList"),m="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._conversationMap.size,", options:").concat(a);if(U.l("".concat(h,". ").concat(m)),this._pagingStatus===Tr.REJECTED){var y=new We("getConversationList");return y.setMessage(m),this.syncConversationList().then(function(){y.setNetworkType(c.getNetworkType()).end();var I=c._getConversationList(a);return ht({conversationList:I,isSyncCompleted:c._isSyncCompleted()})}).catch(function(I){return c.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setError(I,F,H).end()}),U.e("".concat(h," failed. error:"),I),Me(I)})}var b=this._getConversationList(a);return U.l("".concat(h,". returned conversation count:").concat(b.length)),At({conversationList:b,isSyncCompleted:this._isSyncCompleted()})}},{key:"_getConversationList",value:function(a){if(Ge(a))return this.getLocalConversationList();if(rt(a))return a.length===0?[]:this.getLocalConversationList().filter(function(y){return a.includes(y.conversationID)});if(yn(a)){var c=a.type,h=a.markType,m=a.groupName;return this.getLocalConversationList().filter(function(y){return(c!==T.CONV_C2C&&c!==T.CONV_GROUP||y.type===c)&&(!Et(m)||y.conversationGroupList.includes(m))&&(!un(h)||y.markList.includes(h))})}return[]}},{key:"_handleC2CPeerReadTime",value:function(){var a,c=G(this._conversationMap);try{for(c.s();!(a=c.n()).done;){var h=A(a.value,2),m=h[0],y=h[1];y.type===T.CONV_C2C&&(U.d("".concat(this._n,"._handleC2CPeerReadTime conversationID:").concat(m," peerReadTime:").concat(y.peerReadTime)),this.recordPeerReadTime(m,y.peerReadTime))}}catch(b){c.e(b)}finally{c.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){var a=this.getModule(Mt);return!a||a.isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){var a=this.getModule(Mt);return a?a.getLocalGroupList().length:0}},{key:"_hasLocalGroup",value:function(a){var c=this.getModule(Mt);return!!c&&c.hasLocalGroup(a.replace(T.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(a){var c,h=this;if((c=this._conversationMap.has(a)?this._conversationMap.get(a):new om({conversationID:a,type:a.slice(0,3)===T.CONV_C2C?T.CONV_C2C:T.CONV_GROUP},this.isIntl()))._isInfoCompleted||c.type===T.CONV_SYSTEM)return At({conversation:c});if(io(a)&&!this._hasLocalGroup(a))return At({conversation:c});var m="".concat(this._n,".").concat("getConversationProfile"),y=new We("getConversationProfile");return U.l("".concat(m,". conversationID:").concat(a," remark:").concat(c.remark," lastMessage:"),c.lastMessage),this._updateUserOrGroupProfileCompletely(c).then(function(b){y.setNetworkType(h.getNetworkType()).setMessage("conversationID:".concat(a," unreadCount:").concat(b.data.conversation.unreadCount)).end();var I=h.getModule(hr);if(I&&c.type===T.CONV_C2C){var E=a.replace(T.CONV_C2C,"");if(I.isMyFriend(E)){var R=I.getFriendRemark(E);c.remark!==R&&(c.remark=R,U.l("".concat(m,". conversationID:").concat(a," patch remark:").concat(c.remark)))}}return U.l("".concat(m," ok. conversationID:").concat(a)),b}).catch(function(b){return h.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).setMessage("conversationID:".concat(a)).end()}),U.e("".concat(m," failed. error:"),b),Me(b)})}},{key:"_updateUserOrGroupProfileCompletely",value:function(a){var c=this;return a.type===T.CONV_C2C?this.getModule(pr).getUserProfile({userIDList:[a.toAccount]}).then(function(h){var m=h.data;return m.length===0?Me(new Un({code:De.USER_OR_GRP_NOT_FOUND})):(a.userProfile=m[0],a._isInfoCompleted=!0,c._unshiftConversation(a),At({conversation:a}))}):this.getModule(Mt).getGroupProfile({groupID:a.toAccount}).then(function(h){return a.groupProfile=h.data.group,a._isInfoCompleted=!0,c._unshiftConversation(a),At({conversation:a})})}},{key:"_unshiftConversation",value:function(a){a instanceof om&&!this._conversationMap.has(a.conversationID)&&(this._conversationMap=new Map([[a.conversationID,a]].concat(L(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(a){var c=this;a.data.forEach(function(h){var m=h.userID;if(m===c.getMyUserID())c._onMyProfileModified({latestNick:h.nick,latestAvatar:h.avatar});else{var y=c._conversationMap.get("".concat(T.CONV_C2C).concat(m));y&&(y.userProfile=h)}})}},{key:"_isSyncCompleted",value:function(){return this._pagingStatus===Tr.RESOLVED}},{key:"_errorLog",value:function(a,c,h,m){var y=new Error("Params validate failed."),b="".concat(this.getErrorMessage("API_REFER")).concat(a);throw U.w("[".concat(a,"] | ").concat(c," | ").concat(this.getErrorMessage(h,m),", ").concat(b)),U.e("[".concat(a,"] Invalid ").concat(c,": type check failed for ").concat(c,".")),y}},{key:"_isValidConversationID",value:function(a){return mo(a)||io(a)||Cd(a)}},{key:"deleteConversation",value:function(a){var c=this,h="deleteConversation";return Et(a)||Xi(a)||this._errorLog(h,"options","StringOrObjectRequiredLog"),Et(a)?(this._isValidConversationID(a)||this._errorLog(h,"options","InvalidConversationID",a),U.l("".concat(this._n,".").concat(h," conversationID:").concat(a)),this.deleteConversationList({conversationIDList:[a],flag:1})):(rt(a.conversationIDList)||this._errorLog(h,"conversationIDList","ArrayRequiredLog"),a.conversationIDList.length===0&&this._errorLog(h,"conversationIDList","NonEmptyArrayLog"),a.conversationIDList.forEach(function(m){c._isValidConversationID(m)||c._errorLog(h,"conversationIDList","InvalidConversationID",m)}),"clearHistoryMessage"in a&&typeof a.clearHistoryMessage!="boolean"&&this._errorLog(h,"clearHistoryMessage","BooleanRequiredLog"),a.conversationIDList.length>100&&(a.conversationIDList=a.conversationIDList.slice(0,100)),this.deleteConversationList(a))}},{key:"deleteConversationList",value:function(a){var c=this,h=a.conversationIDList,m=h===void 0?[]:h,y=a.clearHistoryMessage,b=y===void 0||y,I=a.flag,E=I===void 0?0:I,R="".concat(this._n,".").concat("deleteConversationList");U.l("".concat(R," conversationIDList.length:").concat(m.length," clearHistoryMessage:").concat(b));var F=new We("deleteConversationList");return F.setMessage("conversationIDList:".concat(m)),Promise.all([this.rmLocalOnlyConversationList(m),this.rmLocalAndRemoteConversationList(m,b)]).then(function(H){F.setNetworkType(c.getNetworkType()).end();var ee=[].concat(L(H[0]),L(H[1]));return ee.length===0?Me(new Un({code:De.CONV_NOT_FOUND})):(U.l("".concat(R," ok")),At(E===1?{conversationID:ee[0]}:{conversationIDList:ee}))}).catch(function(H){return c.probeNetwork().then(function(ee){var ge=A(ee,2),be=ge[0],we=ge[1];F.setError(H,be,we).end()}),U.e("".concat(R," failed. error:"),H),Me(H)})}},{key:"rmLocalOnlyConversationList",value:function(a){var c=this;return a.filter(function(h){if(!c._conversationMap.has(h))return!1;var m=c.getLocalConversation(h).type;return m!==T.CONV_GROUP||c._hasLocalGroup(h)?m===T.CONV_SYSTEM&&(c.getModule(Mt).deleteGroupSystemNotice({messageList:c._messageListHandler.getLocalMessageList(h)}),c.deleteLocalConversation(h),!0):(c.deleteLocalConversation(h),!0)})}},{key:"rmLocalAndRemoteConversationList",value:function(a,c){var h=this,m={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:c?1:0};return a.forEach(function(y){if(h._conversationMap.has(y)){var b=h.getLocalConversation(y).type;b===T.CONV_C2C?m.conversationList.push({toAccount:y.replace(b,""),type:1}):b===T.CONV_GROUP&&h._hasLocalGroup(y)&&m.conversationList.push({toGroupID:y.replace(b,""),type:2})}}),m.conversationList.length===0?[]:this.request({protocolName:Z0,requestData:m}).then(function(y){var b=[];return y.data.resultList.length>0&&y.data.resultList.map(function(I){if(I.code===0){var E=I.type===1?"".concat(T.CONV_C2C).concat(I.to):"".concat(T.CONV_GROUP).concat(I.groupID);b.push(E)}}),h.deleteLocalConversationList(b),b})}},{key:"setConversationDraft",value:function(a){var c=a.conversationID,h=a.draftText,m="".concat(this._n,".").concat("setConversationDraft");if(U.l("".concat(m," conversationID:").concat(c," draftText:").concat(h)),!this._conversationMap.has(c))return Me({code:De.CONV_NOT_FOUND});var y=this._conversationMap.get(c);return y.setDraftText(h),At({code:0,conversation:y})}},{key:"clearHistoryMessage",value:function(a){var c=this,h={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(a))return Me({code:De.CONV_NOT_FOUND});var m=this._conversationMap.get(a).type;if(m===T.CONV_C2C)h.type=1,h.toAccount=a.replace(T.CONV_C2C,"");else{if(m!==T.CONV_GROUP)return m===T.CONV_SYSTEM?(this.getModule(Mt).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(a)}),At({conversationID:a})):Me({code:De.CONV_UN_RECORDED_TYPE});h.type=2,h.toGroupID=a.replace(T.CONV_GROUP,"")}var y="".concat(this._n,".").concat("clearHistoryMessage"),b=new We("clearHistoryMessage");return b.setMessage("conversationID:".concat(a)),U.l("".concat(y,". conversationID:").concat(a)),this.setMessageRead({conversationID:a}).then(function(){return c.request({protocolName:Q0,requestData:h})}).then(function(){b.setNetworkType(c.getNetworkType()).end(),U.l("".concat(y," ok")),c._messageListHandler.removeByConversationID(a),c.setCompleted(a);var I=c.getLocalConversation(a);return I&&(I.updateLastMessage(),c._sortConversationListAndEmitEvent()),At({conversationID:a})}).catch(function(I){return c.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];b.setError(I,F,H).end()}),U.e("".concat(y," failed. error:"),I),Me(I)})}},{key:"pinConversation",value:function(a){var c=this,h=a.conversationID,m=a.isPinned;if(!this._conversationMap.has(h))return Me({code:De.CONV_NOT_FOUND});var y=this.getLocalConversation(h);if(y.isPinned===m)return At({conversationID:h});var b="".concat(this._n,".").concat("pinConversation"),I=new We("pinConversation");I.setMessage("conversationID:".concat(h," isPinned:").concat(m)),U.l("".concat(b,". conversationID:").concat(h," isPinned:").concat(m));var E=null;return mo(h)?E={type:1,toAccount:h.replace(T.CONV_C2C,"")}:io(h)&&(E={type:2,groupID:h.replace(T.CONV_GROUP,"")}),this.request({protocolName:e_,requestData:{fromAccount:this.getMyUserID(),operationType:m===!0?1:2,itemList:[E]}}).then(function(){return I.setNetworkType(c.getNetworkType()).end(),U.l("".concat(b," ok")),y.isPinned!==m&&(y.isPinned=m,c._sortConversationListAndEmitEvent()),ht({conversationID:h})}).catch(function(R){return c.probeNetwork().then(function(F){var H=A(F,2),ee=H[0],ge=H[1];I.setError(R,ee,ge).end()}),U.e("".concat(b," failed. error:"),R),Me(R)})}},{key:"setMessageRemindType",value:function(a){return this._messageRemindHandler.set(a)}},{key:"patchMessageRemindType",value:function(a){var c=a.ID,h=a.isC2CConversation,m=a.messageRemindType,y=!1,b=this.getLocalConversation(h?"".concat(T.CONV_C2C).concat(c):"".concat(T.CONV_GROUP).concat(c));return b&&b.messageRemindType!==m&&(b.messageRemindType=m,y=!0),U.d("".concat(this._n,".patchMessageRemindType options:"),a,"ret:".concat(y)),y}},{key:"onC2CMessageRemindTypeFetched",value:function(a){var c=this;if(rt(a)&&a.length>0){var h=0;a.forEach(function(m){var y=m.userID,b=m.muteFlag,I=c._transMessageRemindType(b);c.patchMessageRemindType({ID:y,isC2CConversation:!0,messageRemindType:I})===!0&&(h+=1)}),U.l("".concat(this._n,".onC2CMessageRemindTypeFetched updateCount:").concat(h)),h>=1&&this.emitConversationUpdate(!0,!1)}}},{key:"onC2CMessageRemindTypeSynced",value:function(a){var c=this,h="".concat(this._n,".onC2CMessageRemindTypeSynced");U.d(h,a),a.dataList.forEach(function(m){if(!Ye(m.muteNotificationsSync)){var y=m.muteNotificationsSync,b=y.to,I=y.muteFlag,E=c._transMessageRemindType(I),R=0;c.patchMessageRemindType({ID:b,isC2CConversation:!0,messageRemindType:E})&&(R+=1),U.l("".concat(h," updateCount:").concat(R)),R>=1&&c.emitConversationUpdate(!0,!1)}})}},{key:"onGroupMessageRemindTypeUpdated",value:function(a){U.d("".concat(this._n,".onGroupMessageRemindTypeUpdated options:"),a),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(a)}},{key:"deleteLocalConversation",value:function(a){var c=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],h=this._conversationMap.has(a);if(U.d("".concat(this._n,".deleteLocalConversation conversationID:").concat(a," has:").concat(h)),h&&(this._conversationMap.delete(a),this._roamingMessageKeyAndTimeMap.has(a)&&this._roamingMessageKeyAndTimeMap.delete(a),this._roamingMessageSequenceMap.has(a)&&this._roamingMessageSequenceMap.delete(a),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(a),this._completedMap.delete(a),c)){var m=!this._isTopicConversation(a);this.emitConversationUpdate(m,!1)}}},{key:"deleteLocalConversationList",value:function(a){var c=this,h=0,m=!1;a.forEach(function(y){c._conversationMap.has(y)&&(h+=c._conversationMap.get(y).unreadCount||0,c.deleteLocalConversation(y,!1),m=!0)}),U.l("".concat(this._n,".deleteLocalConversationList conversationIDList.length:").concat(a.length," isConvIDExisted:").concat(m)),m&&(this.emitConversationUpdate(!0,!1),h>0&&this.emitTotalUnreadMessageCountUpdate())}},{key:"isMessageSentByCurrentInstance",value:function(a){return!(!this._messageListHandler.hasLocalMessage(a.conversationID,a.ID)&&!this.singlyLinkedList.has(a.random))}},{key:"modifyMessageList",value:function(a){if(a.startsWith(T.CONV_C2C)&&this._conversationMap.has(a)){var c=this._conversationMap.get(a),h=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:a,latestNick:c.userProfile.nick,latestAvatar:c.userProfile.avatar});var m=this.getModule(pr).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:a,latestNick:m.nick,latestAvatar:m.avatar}),U.l("".concat(this._n,".modifyMessageList conversationID:").concat(a," cost ").concat(Date.now()-h," ms"))}}},{key:"updateUserProfileSpecifiedKey",value:function(a){U.l("".concat(this._n,".updateUserProfileSpecifiedKey options:"),a);var c=a.conversationID,h=a.nick,m=a.avatar;if(this._conversationMap.has(c)){var y=this._conversationMap.get(c).userProfile;Et(h)&&y.nick!==h&&(y.nick=h),Et(m)&&y.avatar!==m&&(y.avatar=m),this.emitConversationUpdate(!0,!1)}}},{key:"_onMyProfileModified",value:function(a){var c=this,h=this.getLocalConversationList(),m=Date.now();h.forEach(function(y){c.modifyMessageSentByMe(r({conversationID:y.conversationID},a))}),U.l("".concat(this._n,"._onMyProfileModified. modify all messages sent by me, cost ").concat(Date.now()-m," ms"))}},{key:"modifyMessageSentByMe",value:function(a){this._messageListHandler.modifyMessageSentByMe(a)}},{key:"getLatestMessageSentByMe",value:function(a){return this._messageListHandler.getLatestMessageSentByMe(a)}},{key:"modifyMessageSentByPeer",value:function(a){this._messageListHandler.modifyMessageSentByPeer(a)}},{key:"getLatestMessageSentByPeer",value:function(a){return this._messageListHandler.getLatestMessageSentByPeer(a)}},{key:"pushIntoNoticeResult",value:function(a,c){return!(!this._messageListHandler.pushIn(c)||this.singlyLinkedList.has(c.random))&&(a.push(c),!0)}},{key:"getLocalLastMessage",value:function(a){return this._messageListHandler.getLocalLastMessage(a)}},{key:"checkAndPatchRemark",value:function(){var a=this.getModule(hr);if(this._conversationMap.size!==0&&a){var c=L(this._conversationMap.values()).filter(function(m){return m.type===T.CONV_C2C});if(c.length!==0){var h=0;c.forEach(function(m){var y=m.conversationID.replace(T.CONV_C2C,"");if(a.isMyFriend(y)){var b=a.getFriendRemark(y);m.remark!==b&&(m.remark=b,h+=1)}}),U.l("".concat(this._n,".checkAndPatchRemark. c2c conversation count:").concat(c.length,", patched count:").concat(h))}}}},{key:"updateTopicConversation",value:function(a){this._updateLocalConversationList({conversationOptionsList:a,isFromGetConversations:!0})}},{key:"sendReadReceipt",value:function(a){var c=a[0],h=null;return c.conversationType===T.CONV_C2C?h=this._m.getModule(ao):c.conversationType===T.CONV_GROUP&&(h=this._m.getModule(Mt)),h?h.sendReadReceipt(a):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getReadReceiptList",value:function(a){var c=a[0],h=null;return c.conversationType===T.CONV_C2C?h=this._m.getModule(ao):c.conversationType===T.CONV_GROUP&&(h=this._m.getModule(Mt)),h?h.getReadReceiptList(a):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getLastMessageTime",value:function(a){var c=this.getLocalConversation(a);return c?c.lastMessage.lastTime:0}},{key:"getTotalUnreadMessageCount",value:function(){var a=this.getLocalConversationList(),c=0;return a.forEach(function(h){h.type!==T.CONV_SYSTEM&&(h.messageRemindType!==""&&h.messageRemindType!==T.MSG_REMIND_ACPT_AND_NOTE||(c+=h.unreadCount))}),c}},{key:"emitTotalUnreadMessageCountUpdate",value:function(){var a=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==a&&(U.l("".concat(this._n,".emitTotalUnreadMessageCountUpdate from ").concat(this._convTotalUnreadCount," to ").concat(a)),this._convTotalUnreadCount=a,this.emitOuterEvent(O.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._setStorageConversationList(!0),this._pagingStatus=Tr.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this._pagingConvIDMap.clear(),this._convIDFromUnreadDBMap.clear(),this._pagingGetCostList.length=0,this.resetReady()}}]),p}(Sr),m6=function(){function k(l){i(this,k),this._groupModule=l,this._n="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return u(k,[{key:"onCheckTimer",value:function(l){l%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:"_checkCachedGroupTips",value:function(){var l=this;this._cachedGroupTipsMap.forEach(function(p,a){var c=l._checkCountMap.get(a),h=l._groupModule.hasLocalGroup(a);U.l("".concat(l._n,"._checkCachedGroupTips groupID:").concat(a," hasLocalGroup:").concat(h," checkCount:").concat(c)),h?(l._notifyCachedGroupTips(a),l._checkCountMap.delete(a),l._groupModule.deleteUnjoinedAVChatRoom(a)):c>=l.MAX_CHECK_COUNT?(l._deleteCachedGroupTips(a),l._checkCountMap.delete(a)):(c++,l._checkCountMap.set(a,c))})}},{key:"onNewGroupTips",value:function(l){U.d("".concat(this._n,".onReceiveGroupTips count:").concat(l.dataList.length));var p=this.newGroupTipsStoredAndSummary(l),a=p.eventDataList,c=p.result,h=p.AVChatRoomMessageList;h.length>0&&this._groupModule.onAVChatRoomMessage(h),a.length>0&&(this._groupModule.updateNextMessageSeq(a),this._groupModule.getModule(ct).onNewMessage({conversationOptionsList:a,isInstantMessage:!0})),c.length>0&&(this._groupModule.emitOuterEvent(O.MESSAGE_RECEIVED,c),this.handleMessageList(c))}},{key:"newGroupTipsStoredAndSummary",value:function(l){for(var p=this,a=l.event,c=l.dataList,h=null,m=[],y=[],b={},I=[],E=function(H,ee){var ge=Id(c[H]);if(a===6&&(p._groupModule.isGroupAttributesUpdatedNotice(ge)||p._groupModule.isGroupCountersNotice(ge)))return"continue";var be=ge.groupProfile,we=be.groupID,Ue=be.communityType,qe=Ue===void 0?0:Ue,nt=be.topicID,mt=nt===void 0?void 0:nt,Pt=be.invisible,gn=void 0,_n=p._groupModule.isMessageFromTopic(qe,mt);if(_n){gn=T.CONV_TOPIC,ge.to=mt;var Or=p._groupModule.getModule(sr);Or.hasLocalTopic(we,mt)||p._getTopicPendingMap.has(mt)||(p._getTopicPendingMap.set(mt,1),Or.getTopicList({groupID:we,topicIDList:[mt]}).finally(function(){p._getTopicPendingMap.delete(mt)}))}var lo=p._groupModule.hasLocalGroup(we);if(!lo&&p._groupModule.isUnjoinedAVChatRoom(we))return"continue";if(!lo&&!_n)return p._cacheGroupTipsAndProbe({groupID:we,event:a,item:ge}),"continue";if(p._groupModule.isMessageFromOrToAVChatroom(we))return ge.event=a,I.push(ge),"continue";if(ge.currentUser=p._groupModule.getMyUserID(),ge.conversationType=T.CONV_GROUP,(h=new Hr(ge)).setElement({type:T.MSG_GRP_TIP,content:r(r({},ge.elements),{},{groupProfile:ge.groupProfile})}),h.isSystemMessage=!1,Pt===1)return p._qualityStat(h),"continue";var Bo=p._groupModule.getModule(ct),ri=h,vo=ri.conversationID,Qi=ri.sequence;if(a===6)h._onlineOnlyFlag=!0,y.push(h);else if(!Bo.pushIntoNoticeResult(y,h))return"continue";if(p._groupModule.isMessageFromCommunityOfTopic(qe,mt)||a===6&&Bo.getLocalConversation(vo))return"continue";a!==6&&p._qualityStat(h);var _i=Bo.isRemoteRead({conversationID:vo,sequence:Qi});if(Ge(b[vo])){var hs=0;h.flow==="in"&&(h._isExcludedFromUnreadCount||h._onlineOnlyFlag||_i||(hs=1)),b[vo]=m.push({conversationID:vo,unreadCount:hs,type:Ge(gn)?h.conversationType:gn,subType:h.conversationSubType,lastMessage:h._isExcludedFromLastMessage?"":h})-1}else{var Ps=b[vo];m[Ps].type=h.conversationType,m[Ps].subType=h.conversationSubType,m[Ps].lastMessage=h._isExcludedFromLastMessage?"":h,h.flow==="in"&&(h._isExcludedFromUnreadCount||h._onlineOnlyFlag||_i||m[Ps].unreadCount++)}},R=0,F=c.length;R=0){I.updateSelfInfo({muteTime:F.muteTime}),E=!0;break}}E&&this._groupModule.emitOuterEvent(O.TOPIC_UPDATED,{groupID:b,topic:I})}}},{key:"_onTopicProfileUpdated",value:function(l){var p=l.payload,a=p.groupProfile.groupID,c=p.newTopicInfo;this._groupModule.getModule(sr).onTopicProfileUpdated(r({groupID:a,topicID:l.to},c))}},{key:"_cacheGroupTips",value:function(l,p){this._cachedGroupTipsMap.has(l)||this._cachedGroupTipsMap.set(l,[]),this._cachedGroupTipsMap.get(l).push(p)}},{key:"_deleteCachedGroupTips",value:function(l){this._cachedGroupTipsMap.has(l)&&this._cachedGroupTipsMap.delete(l)}},{key:"_notifyCachedGroupTips",value:function(l){var p=this,a=this._cachedGroupTipsMap.get(l)||[];a.forEach(function(c){p.onNewGroupTips(c)}),this._deleteCachedGroupTips(l),U.l("".concat(this._n,"._notifyCachedGroupTips groupID:").concat(l," count:").concat(a.length))}},{key:"_cacheGroupTipsAndProbe",value:function(l){var p=this,a=l.groupID,c=l.event,h=l.item;this._cacheGroupTips(a,{event:c,dataList:[h]}),this._groupModule.getGroupSimplifiedInfo(a).then(function(m){m.type===T.GRP_AVCHATROOM?p._groupModule.hasLocalGroup(a)?p._notifyCachedGroupTips(a):p._groupModule.setUnjoinedAVChatRoom(a):(p._groupModule.updateGroupMap([m]),p._notifyCachedGroupTips(a))}),this._checkCountMap.has(a)||this._checkCountMap.set(a,0),U.l("".concat(this._n,"._cacheGroupTipsAndProbe groupID:").concat(a))}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),k}(),v6=function(){function k(l){i(this,k),this._groupModule=l,this._n="CommonGroupHandler",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this.PAGING_GRP_COUNT_LIMIT=200,this._getTopicPendingMap=new Map,this._pagingStatus=Tr.NOT_START,this._pagingGetCostList=[],l.getInnerEmitterInstance().on(nr.A2KEY_AND_TINYID_UPDATED,this.syncGroupList,this)}return u(k,[{key:"onCheckTimer",value:function(l){l%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:"_checkCachedGroupMessage",value:function(){var l=this;this._cachedGroupMessageMap.forEach(function(p,a){var c=l._checkCountMap.get(a),h=l._groupModule.hasLocalGroup(a);U.l("".concat(l._n,"._checkCachedGroupMessage groupID:").concat(a," hasLocalGroup:").concat(h," checkCount:").concat(c)),h?(l._notifyCachedGroupMessage(a),l._checkCountMap.delete(a),l._groupModule.deleteUnjoinedAVChatRoom(a)):c>=l.MAX_CHECK_COUNT?(l._deleteCachedGroupMessage(a),l._checkCountMap.delete(a)):(c++,l._checkCountMap.set(a,c))})}},{key:"handleUpdateGroupLastMessage",value:function(l){var p="".concat(this._n,".handleUpdateGroupLastMessage");if(U.l("".concat(p," conversation count:").concat(l.length,", local group count:").concat(this._groupModule.getLocalGroupList().length)),this._groupModule.getGroupMap().size!==0){for(var a,c,h,m=!1,y=0,b=l.length;y0&&this._groupModule.onAVChatRoomMessage(h),this._groupModule.filterModifiedMessage(c),a.length>0&&(this._groupModule.updateNextMessageSeq(a),this._groupModule.getModule(ct).onNewMessage({conversationOptionsList:a,isInstantMessage:l.isInstantMessage||!0,updateUnreadCount:l.updateUnreadCount||!0}));var m=this._groupModule.filterUnmodifiedMessage(c);m.length>0&&this._groupModule.emitOuterEvent(O.MESSAGE_RECEIVED,m),c.length=0}},{key:"_newGroupMessageStoredAndSummary",value:function(l){var p=this,a=l.dataList,c=l.event,h=l.isInstantMessage,m=null,y=[],b=[],I=[],E={},R=this._groupModule.getFileDownloadProxy(),F=a.length;F>1&&a.sort(function(we,Ue){return we.sequence-Ue.sequence});for(var H=this._groupModule.getModule(ct),ee=this._groupModule.getModule(pr),ge=function(we){var Ue=Id(a[we]),qe=Ue.groupProfile,nt=qe.groupID,mt=qe.communityType,Pt=mt===void 0?0:mt,gn=qe.topicID,_n=gn===void 0?void 0:gn,Or=qe.invisible,lo=void 0,Bo=p._groupModule.isMessageFromTopic(Pt,_n);if(Bo){lo=T.CONV_TOPIC,Ue.to=_n;var ri=p._groupModule.getModule(sr);ri.hasLocalTopic(nt,_n)||p._getTopicPendingMap.has(_n)||(p._getTopicPendingMap.set(_n,1),ri.getTopicList({groupID:nt,topicIDList:[_n]}).finally(function(){p._getTopicPendingMap.delete(_n)}))}var vo=p._groupModule.hasLocalGroup(nt);if(!vo&&p._groupModule.isUnjoinedAVChatRoom(nt))return"continue";if(!vo&&!Bo)return p._cacheGroupMessageAndProbe({groupID:nt,event:c,item:Ue}),"continue";if(p._groupModule.isMessageFromOrToAVChatroom(nt))return Ue.event=c,I.push(Ue),"continue";if(Ue.currentUser=p._groupModule.getMyUserID(),Ue.conversationType=T.CONV_GROUP,Ue.isSystemMessage=!!Ue.isSystemMessage,(m=new Hr(Ue)).setElement(Ue.elements,R),Or===1)return p._qualityStat(h,m),"continue";var Qi=a[we].isModified===1;if(H.isMessageSentByCurrentInstance(m)?m.isModified=Qi:Qi=!1,Ue.onlineOnlyFlag===1)m._onlineOnlyFlag=!0,H.isMessageSentByCurrentInstance(m)||b.push(m);else{if(p._groupModule.isMessageFromCommunityOfTopic(Pt,_n))return b.push(m),"continue";if(m.from===p._groupModule.getMyUserID()){var _i=H.getLatestMessageSentByMe(m.conversationID);if(_i){var hs=_i.nick,Ps=_i.avatar;hs===m.nick&&Ps===m.avatar||(H.modifyMessageSentByMe({conversationID:Sl,latestNick:m.nick,latestAvatar:m.avatar}),ee.mockOnNickAvatarModified(m.nick,m.avatar))}}if(!H.pushIntoMessageList(b,m,Qi))return"continue";p._qualityStat(h,m);var Ld=m,Sl=Ld.conversationID,v1=Ld.sequence,Od=H.isRemoteRead({conversationID:Sl,sequence:v1});if(Ge(E[Sl])){var lm=0;m.flow==="in"&&(m._isExcludedFromUnreadCount||Od||(lm=1)),E[Sl]=y.push({conversationID:Sl,unreadCount:lm,type:Ge(lo)?m.conversationType:lo,subType:m.conversationSubType,lastMessage:m._isExcludedFromLastMessage?"":m})-1}else{var xi=E[Sl];y[xi].type=Ge(lo)?m.conversationType:lo,y[xi].subType=m.conversationSubType,y[xi].lastMessage=m._isExcludedFromLastMessage?"":m,m.flow==="in"&&(m._isExcludedFromUnreadCount||Od||y[xi].unreadCount++)}}},be=0;be0&&a.addMessageDelay(p.clientTime)}},{key:"onGroupMessageRevoked",value:function(l){var p=this._groupModule.getModule(ct),a=[],c=null,h=!0;l.dataList.forEach(function(m){var y=m.elements.revokedInfos;Ge(y)||y.forEach(function(b){var I=Ye(b.topicID)?"GROUP".concat(b.groupID):"GROUP".concat(b.topicID);c=p.revoke(I,b.sequence,b.random);var E=b.revokerInfo&&b.revokerInfo.revoker;if(c)c.revoker=E,a.push(c);else{var R={conversationID:I,to:b.topicID||"",sequence:b.sequence,time:b.time,revoker:E};p.isLastMessageRevoked(R)&&(a.push(R),h=!1)}})}),a.length!==0&&(p.onMessageRevoked(a),h===!0&&(U.l("".concat(this._n,".onGroupMessageRevoked count:").concat(a.length)),this._groupModule.emitOuterEvent(O.MESSAGE_REVOKED,a)))}},{key:"_groupListTreeShaking",value:function(l){for(var p=new Map(L(this._groupModule.getGroupMap())),a=0,c=l.length;a0&&arguments[0]!==void 0&&arguments[0];this._pagingStatus===Tr.NOT_START&&this._groupModule.clearGroupMap();var a=["Type","Name","FaceUrl","NextMsgSeq","LastMsgTime","AtInfoList","LastRecallTime"],c=this.PAGING_GRP_COUNT_LIMIT,h=0,m=[];if(p===!0)return this._pagingGetGroupListWithTopic({limit:c,offset:h,groupBaseInfoFilter:a,groupList:m});var y="syncGroupList",b="".concat(this._n,".").concat(y),I=new We(y);return this._pagingGetGroupList({limit:c,offset:h,groupBaseInfoFilter:a,groupList:m}).then(function(){var E=cp(l._pagingGetCostList),R=ps(l._pagingGetCostList);l._pagingGetCostList.length=0,l._pagingStatus=Tr.RESOLVED,l._groupListTreeShaking(m),l._groupModule.updateGroupMap(m);var F=l._groupModule.getLocalGroupList().length,H="count:".concat(F," sum:").concat(R," avg:").concat(E);return U.l("".concat(b," ok. ").concat(H)),I.setNetworkType(l._groupModule.getNetworkType()).setMessage(H).end(),l.tempConversationList&&(l.handleUpdateGroupLastMessage(l.tempConversationList),l.tempConversationList=null),l._groupModule.emitGroupListUpdate(!0,!0),ht({groupList:l._groupModule.getLocalGroupList()})}).catch(function(E){return l._pagingStatus=Tr.REJECTED,l._groupModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];I.setError(E,H,ee).end()}),U.e("".concat(b," failed. error:"),E),Me(E)})}},{key:"getGroupList",value:function(){var l=this,p="".concat(this._n,".").concat("getGroupList");if(U.l("".concat(p)),this._pagingStatus===Tr.REJECTED)return this.syncGroupList().then(function(){var c=l._groupModule.getLocalGroupList();return ht({groupList:c,isSyncCompleted:l.isPagingGetCompleted()})}).catch(function(c){return U.e("".concat(p," failed. error:"),c),Me(c)});var a=this._groupModule.getLocalGroupList();return U.l("".concat(p,". returned group count:").concat(a.length)),At({groupList:a,isSyncCompleted:this.isPagingGetCompleted()})}},{key:"isPagingGetCompleted",value:function(){return this._pagingStatus===Tr.RESOLVED}},{key:"_pagingGetGroupList",value:function(l){var p=this,a="".concat(this._n,".").concat("_pagingGetGroupList"),c=l.isCommunityRelay,h=c!==void 0&&c,m=l.limit,y=l.offset,b=l.groupBaseInfoFilter,I=l.groupList,E=Date.now();return this._groupModule.request({protocolName:Ng,requestData:{type:h?T.GRP_COMMUNITY:void 0,memberAccount:this._groupModule.getMyUserID(),limit:m,offset:y,responseFilter:{groupBaseInfoFilter:b,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]}}}).then(function(R){var F=R.data,H=F.groups,ee=H===void 0?[]:H,ge=F.totalCount;I.push.apply(I,L(ee)),p._handleGroupAtInfoWithoutTopic(h,ee);var be=y+m,we=!(ge>be),Ue="offset:".concat(y," limit:").concat(m," totalCount:").concat(ge," isCompleted:").concat(we," ")+"currentCount:".concat(I.length," isCommunityRelay:").concat(h),qe=Date.now()-E;return p._pagingGetCostList.push(qe),U.l("".concat(a," ok. ").concat(Ue," cost ").concat(qe," ms")),h||we?!h&&we?(U.l("".concat(a," start to get community list")),y=0,p._pagingGetGroupList({limit:m,offset:y,groupBaseInfoFilter:b,groupList:I,isCommunityRelay:!0})):h&&!we?(y=be,p._pagingGetGroupList({limit:m,offset:y,groupBaseInfoFilter:b,groupList:I,isCommunityRelay:!0})):ht({groupList:I}):(y=be,p._pagingGetGroupList({limit:m,offset:y,groupBaseInfoFilter:b,groupList:I}))}).catch(function(R){return R.code===10018?(U.w("".concat(p.logPrefix," response size exceeds the limit, request count:").concat(m)),m=50,p._pagingGetGroupList({limit:m,offset:y,groupBaseInfoFilter:b,groupList:I,isCommunityRelay:h})):h?(R.code===11e3&&U.l("".concat(a," ok. community unavailable")),At({groupList:I})):Me(R)})}},{key:"_pagingGetGroupListWithTopic",value:function(l){var p=this,a="".concat(this._n,"._pagingGetGroupListWithTopic"),c=l.limit,h=l.offset,m=l.groupBaseInfoFilter,y=l.groupList,b=Date.now();return this._groupModule.request({protocolName:Ng,requestData:{type:T.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:c,offset:h,responseFilter:{groupBaseInfoFilter:m,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]},isSupportTopic:1}}).then(function(I){var E=I.data,R=E.groups,F=R===void 0?[]:R,H=E.totalCount;y.push.apply(y,L(F));var ee=h+c,ge=!(H>ee);if(U.l("".concat(a," ok. offset:").concat(h," limit:").concat(c," totalCount:").concat(H," isCompleted:").concat(ge," currentCount:").concat(y.length," cost ").concat(Date.now()-b," ms")),!ge)return h=ee,p._pagingGetGroupListWithTopic({limit:c,offset:h,groupBaseInfoFilter:m,groupList:y});p._groupModule.updateGroupMap(y),p._groupModule.emitGroupListUpdate(!0,!1);var be=p._groupModule.getLocalGroupList().filter(function(we){return we.isSupportTopic===!0});return ht({groupList:be})}).catch(function(I){return I.code===10018?(U.w("".concat(p.logPrefix," response size exceeds the limit, request count:").concat(c)),c=50,p._pagingGetGroupListWithTopic({limit:c,offset:h,groupBaseInfoFilter:m,groupList:y})):Me(I)})}},{key:"_cacheGroupMessage",value:function(l,p){this._cachedGroupMessageMap.has(l)||this._cachedGroupMessageMap.set(l,[]),this._cachedGroupMessageMap.get(l).push(p)}},{key:"_deleteCachedGroupMessage",value:function(l){this._cachedGroupMessageMap.has(l)&&this._cachedGroupMessageMap.delete(l)}},{key:"_notifyCachedGroupMessage",value:function(l){var p=this,a=this._cachedGroupMessageMap.get(l)||[];a.forEach(function(c){p.onNewGroupMessage(c)}),this._deleteCachedGroupMessage(l),U.l("".concat(this._n,"._notifyCachedGroupMessage groupID:").concat(l," count:").concat(a.length))}},{key:"_cacheGroupMessageAndProbe",value:function(l){var p=this,a=l.groupID,c=l.event,h=l.item;this._cacheGroupMessage(a,{event:c,dataList:[h]}),this._groupModule.getGroupSimplifiedInfo(a).then(function(m){m.type===T.GRP_AVCHATROOM?p._groupModule.hasLocalGroup(a)?p._notifyCachedGroupMessage(a):p._groupModule.setUnjoinedAVChatRoom(a):(p._groupModule.updateGroupMap([m]),p._notifyCachedGroupMessage(a))}),this._checkCountMap.has(a)||this._checkCountMap.set(a,0),U.l("".concat(this._n,"._cacheGroupMessageAndProbe groupID:").concat(a))}},{key:"_handleGroupAtInfoWithoutTopic",value:function(l,p){var a=this;l&&p.length!==0&&p.forEach(function(c){var h=c.groupID,m=c.groupAtInfoList,y=[];Ge(m)||(m.forEach(function(b){y.push(r(r({},b),{},{groupID:h}))}),a._groupModule.getModule(ct).onNewGroupAtTips({dataList:y}))})}},{key:"setPagingGroupCount",value:function(l){Ge(l)||(this.PAGING_GRP_COUNT_LIMIT=parseInt(l,10))}},{key:"reset",value:function(){this.PAGING_GRP_COUNT_LIMIT=200,this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._pagingStatus=Tr.NOT_START,this._pagingGetCostList=[]}}]),k}(),Lw=1,y6=2,Ow=3,Rw=4,Nw=5,_6=function(){function k(l){i(this,k),this._groupModule=l,this._n="GroupAttributesHandler",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(nr.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return u(k,[{key:"_onCloudConfigUpdated",value:function(){var l=this._groupModule.getCloudConfig("grp_attr_cache_time");Ge(l)||(this.CACHE_EXPIRE_TIME=Number(l))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach(function(l){l.localMainSequence=0})}},{key:"isGroupAttributesUpdatedNotice",value:function(l){var p=l.to,a=l.elements.newGroupProfile,c=!Ge(a)&&!Ye(a.groupAttributeOption);return c&&this._onGroupAttributesUpdated({groupID:p,groupAttributeOption:a.groupAttributeOption}),c}},{key:"_onGroupAttributesUpdated",value:function(l){var p=this,a=l.groupID,c=l.groupAttributeOption,h=c.mainSequence,m=c.isWithChangedAttributeInfo,y=c.groupAttributeList,b=y===void 0?[]:y,I=c.operationType;if(U.l("".concat(this._n,".onGroupAttributesUpdated. ")+"groupID:".concat(a," isWithChangedAttributeInfo:").concat(m," operationType:").concat(I)),!Ge(I)){this._groupAttributesCopy=this._getCachedAttributes({groupID:a});var E=h-this._getLocalGroupAttributes(a).localMainSequence;if(E!==0){if(m===1&&E===1)return this._refreshCachedGroupAttributes({groupID:a,remoteMainSequence:h,groupAttributeList:b,operationType:I}),void this._emitGroupAttributesUpdated(a);if(this._hasLocalGroupAttributes(a)){var R=this._getLocalGroupAttributes(a).avChatRoomKey;this._getGroupAttributes({groupID:a,avChatRoomKey:R}).then(function(){p._emitGroupAttributesUpdated(a)})}}}}},{key:"initGroupAttributesCache",value:function(l){var p=l.groupID,a=l.avChatRoomKey,c=a===void 0?void 0:a;this._groupAttributesMap.set(p,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:c}),U.l("".concat(this._n,".initGroupAttributesCache groupID:").concat(p," avChatRoomKey:").concat(c))}},{key:"initGroupAttributes",value:function(l){var p=this,a=l.groupID,c=l.groupAttributes,h=this._getLocalGroupAttributes(a),m=h.remoteMainSequence,y=h.avChatRoomKey,b=new We("initGroupAttributes");return b.setMessage("groupID:".concat(a," avChatRoomKey:").concat(y," mainSequence:").concat(m)),this._groupModule.request({protocolName:Bg,requestData:{groupID:a,avChatRoomKey:y,mainSequence:m,groupAttributeList:this._transformGroupAttributes(c)}}).then(function(I){U.l("".concat(p._n,".").concat("initGroupAttributes"," ok. groupID:").concat(a));var E=I.data,R=E.mainSequence,F=L(E.groupAttributeList);return F.forEach(function(H){H.value=c[H.key]}),p._groupAttributesCopy=p._getCachedAttributes({groupID:a}),p._refreshCachedGroupAttributes({groupID:a,remoteMainSequence:R,groupAttributeList:F,operationType:Lw}),p._emitGroupAttributesUpdated(a),b.setNetworkType(p._groupModule.getNetworkType()).end(),ht({groupAttributes:c})}).catch(function(I){return p._groupModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];b.setError(I,F,H).end()}),Me(I)})}},{key:"setGroupAttributes",value:function(l){var p=this,a="".concat(this._n,".").concat("setGroupAttributes"),c=l.groupID,h=l.groupAttributes,m=this._getLocalGroupAttributes(c),y=m.remoteMainSequence,b=m.avChatRoomKey,I=m.attributes,E=this._transformGroupAttributes(h);E.forEach(function(F){var H=F.key;F.sequence=0,I.has(H)&&(F.sequence=I.get(H).sequence)});var R=new We("setGroupAttributes");return R.setMessage("groupID:".concat(c," groupAttributes:").concat(JSON.stringify(h))),U.l("".concat(a,". groupID:").concat(c," mainSequence:").concat(y)),this._groupModule.request({protocolName:Hg,requestData:{groupID:c,avChatRoomKey:b,mainSequence:y,groupAttributeList:E}}).then(function(F){U.l("".concat(a," ok."));var H=F.data,ee=H.mainSequence,ge=L(H.groupAttributeList);return ge.forEach(function(be){be.value=h[be.key]}),p._groupAttributesCopy=p._getCachedAttributes({groupID:c}),p._refreshCachedGroupAttributes({groupID:c,remoteMainSequence:ee,groupAttributeList:ge,operationType:y6}),p._emitGroupAttributesUpdated(c),R.setNetworkType(p._groupModule.getNetworkType()).end(),ht({groupAttributes:h})}).catch(function(F){return p._groupModule.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];R.setError(F,ge,be).end()}),Me(F)})}},{key:"deleteGroupAttributes",value:function(l){var p=this,a=l.groupID,c=l.keyList,h=c===void 0?[]:c,m=this._getLocalGroupAttributes(a),y=m.remoteMainSequence,b=m.avChatRoomKey,I=m.attributes,E=L(I.keys()),R=Vg,F=Ow,H={groupID:a,avChatRoomKey:b,mainSequence:y},ee=[];h.length>0&&(E=[],R=qg,F=Rw,h.forEach(function(be){var we=0;I.has(be)&&(we=I.get(be).sequence,E.push(be)),ee.push({key:be,sequence:we})}),H.groupAttributeList=ee);var ge=new We("deleteGroupAttributes");return ge.setMessage("groupID:".concat(a," mainSequence:").concat(y," keyList:").concat(h," protocolName:").concat(R)),this._groupModule.request({protocolName:R,requestData:H}).then(function(be){U.l("".concat(p._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(a));var we=be.data.mainSequence;return p._groupAttributesCopy=p._getCachedAttributes({groupID:a}),p._refreshCachedGroupAttributes({groupID:a,remoteMainSequence:we,groupAttributeList:ee,operationType:F}),p._emitGroupAttributesUpdated(a),ge.setNetworkType(p._groupModule.getNetworkType()).end(),ht({keyList:E})}).catch(function(be){return p._groupModule.probeNetwork().then(function(we){var Ue=A(we,2),qe=Ue[0],nt=Ue[1];ge.setError(be,qe,nt).end()}),Me(be)})}},{key:"getGroupAttributes",value:function(l){var p=this,a="".concat(this._n,".").concat("getGroupAttributes"),c=l.groupID,h=this._getLocalGroupAttributes(c),m=h.avChatRoomKey,y=h.lastUpdateTime,b=h.localMainSequence,I=h.remoteMainSequence,E=new We("getGroupAttributes");if(E.setMessage("groupID:".concat(c," localMainSequence:").concat(b," remoteMainSequence:").concat(I," keyList:").concat(l.keyList)),Date.now()-y>=this.CACHE_EXPIRE_TIME||b0)c.forEach(function(E){m.has(E)&&(h[E]=m.get(E).value)});else{var y,b=G(m.keys());try{for(b.s();!(y=b.n()).done;){var I=y.value;h[I]=m.get(I).value}}catch(E){b.e(E)}finally{b.f()}}}return h}},{key:"_updateCachedAttributes",value:function(l){var p=l.groupAttributes,a=l.groupAttributeList,c=l.operationType;c!==Ow?c!==Rw?(c===Lw&&p.attributes.clear(),a.forEach(function(h){var m=h.key,y=h.value,b=h.sequence;p.attributes.set(m,{value:y,sequence:b})})):a.forEach(function(h){p.attributes.delete(h.key)}):p.attributes.clear()}},{key:"_hasLocalGroupAttributes",value:function(l){return this._groupAttributesMap.has(l)}},{key:"_getLocalGroupAttributes",value:function(l){return this._hasLocalGroupAttributes(l)||this.initGroupAttributesCache({groupID:l}),this._groupAttributesMap.get(l)}},{key:"_transformGroupAttributes",value:function(l){var p=[];return Object.keys(l).forEach(function(a){p.push({key:a,value:l[a]})}),p}},{key:"_emitGroupAttributesUpdated",value:function(l){var p=this._getCachedAttributes({groupID:l}),a=this._computeAttrChangedInfo(p),c=a.updatedKeyList,h=a.deletedKeyList;U.l("".concat(this._n,"._emitGroupAttributesUpdated update:").concat(c.length,", delete:").concat(h.length)),c.length===0&&h.length===0||this._groupModule.emitOuterEvent(O.GROUP_ATTRIBUTES_UPDATED,{groupID:l,groupAttributes:p,updatedKeyList:c,deletedKeyList:h})}},{key:"_computeAttrChangedInfo",value:function(l){var p=this,a=[],c=[];return Object.keys(l).forEach(function(h){l[h]!==p._groupAttributesCopy[h]&&a.push(h)}),Object.keys(this._groupAttributesCopy).forEach(function(h){Ge(l[h])&&c.push(h)}),this._groupAttributesCopy={},{updatedKeyList:a,deletedKeyList:c}}},{key:"deleteLocalGroupAttributes",value:function(l){this._hasLocalGroupAttributes(l)&&this._groupAttributesMap.delete(l)}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),k}(),b6="Set",M6="Increase",I6="Decrease",C6=function(){function k(l){i(this,k),this._groupModule=l,this._n="GroupCountersHandler",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(nr.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return u(k,[{key:"_onCloudConfigUpdated",value:function(){var l=this._groupModule.getCloudConfig("grp_counter_expire_time");Ge(l)||(this.EXPIRE_TIME=Number(l))}},{key:"isGroupCountersNotice",value:function(l){var p=l.to,a=l.elements.groupCounterInfo,c=!1;return Ye(a)||(this._onGroupCountersUpdated({groupID:p,groupCounterInfo:a}),c=!0),c}},{key:"_onGroupCountersUpdated",value:function(l){var p=this,a=l.groupID;l.groupCounterInfo.forEach(function(c){var h=c.type,m=c.groupCounterSeq,y=c.counterList,b=y===void 0?[]:y;h!==0&&h!==2||(p._updateLocalGroupCounters({groupID:a,groupCounterSeq:m,counterList:b}),b.forEach(function(I){p._groupModule.emitOuterEvent(O.GROUP_COUNTER_UPDATED,{groupID:a,key:I.key,value:I.value})})),h===1&&p._deleteLocalGroupCounters({groupID:a,groupCounterSeq:m,counterList:b})}),U.l("".concat(this._n,"._onGroupCountersUpdated groupID:").concat(a))}},{key:"initGroupCountersCache",value:function(l){var p=l.groupID,a=l.avChatRoomKey;this._groupCountersMap.set(p,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:a}),U.l("".concat(this._n,".initGroupCountersCache groupID:").concat(p," avChatRoomKey:").concat(a))}},{key:"setGroupCounters",value:function(l){var p=this;if(!this._groupModule.canIUse(ve.GRP_COUNTER))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".setGroupCounters"),c=l.groupID,h=l.counters,m=this._convertObjectToList(h),y=this._getLocalGroupCounters(c).avChatRoomKey,b="groupID:".concat(c," count:").concat(m.length),I=new We("setGroupCounters");return I.setMessage("".concat(b)),U.l("".concat(a,". ").concat(b)),this._updateGroupCounters({groupID:c,counterList:m,avChatRoomKey:y,mode:b6}).then(function(E){return I.end(),U.l("".concat(a," ok.")),ht({counters:E})}).catch(function(E){return p._groupModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];I.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"increaseGroupCounter",value:function(l){var p=this;if(!this._groupModule.canIUse(ve.GRP_COUNTER))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".increaseGroupCounters"),c=l.groupID,h=l.key,m=l.value,y=this._getLocalGroupCounters(c).avChatRoomKey,b="groupID:".concat(c," key:").concat(h," value:").concat(m),I=new We("increaseGroupCounter");I.setMessage("".concat(b)),U.l("".concat(a,". ").concat(b));var E=[{key:h,value:m}];return this._updateGroupCounters({groupID:c,counterList:E,avChatRoomKey:y,mode:M6}).then(function(R){return I.end(),U.l("".concat(a," ok.")),ht({counters:R})}).catch(function(R){return p._groupModule.probeNetwork().then(function(F){var H=A(F,2),ee=H[0],ge=H[1];I.setError(R,ee,ge).end()}),U.e("".concat(a," failed. error:"),R),Me(R)})}},{key:"decreaseGroupCounter",value:function(l){var p=this;if(!this._groupModule.canIUse(ve.GRP_COUNTER))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".decreaseGroupCounter"),c=l.groupID,h=l.key,m=l.value,y=this._getLocalGroupCounters(c).avChatRoomKey,b="groupID:".concat(c," key:").concat(h," value:").concat(m),I=new We("decreaseGroupCounter");I.setMessage("".concat(b)),U.l("".concat(a,". ").concat(b));var E=[{key:h,value:m}];return this._updateGroupCounters({groupID:c,counterList:E,avChatRoomKey:y,mode:I6}).then(function(R){return I.end(),U.l("".concat(a," ok.")),ht({counters:R})}).catch(function(R){return p._groupModule.probeNetwork().then(function(F){var H=A(F,2),ee=H[0],ge=H[1];I.setError(R,ee,ge).end()}),U.e("".concat(a," failed. error:"),R),Me(R)})}},{key:"getGroupCounters",value:function(l){var p=this;if(!this._groupModule.canIUse(ve.GRP_COUNTER))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".getGroupCounters"),c=l.groupID,h=l.keyList,m=h===void 0?[]:h,y=this._getLocalGroupCounters(c),b=y.avChatRoomKey,I=y.lastUpdateTime,E=new We("getGroupCounters");if(E.setMessage("groupID:".concat(c)),Date.now()-I>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:c,avChatRoomKey:b}).then(function(F){E.setMoreMessage("from remote. count:".concat(F.length)).end(),U.l("".concat(a," from remote. groupID:").concat(c));var H=p._getLocalCounters(c,m);return ht({counters:H})}).catch(function(F){return p._groupModule.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];E.setError(F,ge,be).end()}),Me(F)});E.setMoreMessage("from cache").end(),U.l("".concat(a," from cache. groupID:").concat(c));var R=this._getLocalCounters(c,m);return At({counters:R})}},{key:"_getRemoteGroupCounters",value:function(l){var p=this;return this._groupModule.request({protocolName:Yg,requestData:r({},l)}).then(function(a){var c=a.data,h=c.counterList,m=h===void 0?[]:h,y=c.groupCounterSeq;return p._updateLocalGroupCounters({groupID:l.groupID,counterList:m,groupCounterSeq:y}),U.l("".concat(p._n,"._getRemoteGroupCounters ok. groupID:").concat(l.groupID)),m}).catch(function(a){return Me(a)})}},{key:"_convertObjectToList",value:function(l){var p=[];return Object.keys(l).forEach(function(a){p.push({key:a,value:l[a]})}),p}},{key:"_updateGroupCounters",value:function(l){var p="".concat(this._n,"._updateGroupCounters"),a=l.groupID,c=l.avChatRoomKey,h=l.mode;return U.l("".concat(p,". groupID:").concat(a," avChatRoomKey:").concat(c," mode:").concat(h)),this._groupModule.request({protocolName:Kg,requestData:r({},l)}).then(function(m){U.l("".concat(p," ok."));var y=m.data.counterList,b={};return(y===void 0?[]:y).forEach(function(I){var E=I.key,R=I.value;b[E]=R}),b}).catch(function(m){return Me(m)})}},{key:"_hasLocalGroupCounters",value:function(l){return this._groupCountersMap.has(l)}},{key:"_getLocalGroupCounters",value:function(l){return this._hasLocalGroupCounters(l)||this.initGroupCountersCache({groupID:l}),this._groupCountersMap.get(l)}},{key:"_updateLocalGroupCounters",value:function(l){var p=l.groupID,a=l.counterList,c=a===void 0?[]:a,h=l.groupCounterSeq;if(this._hasLocalGroupCounters(p)){var m=this._getLocalGroupCounters(p),y=m.counters,b=m.avChatRoomKey,I=m.groupCounterSeq;if(h>0&&h0)p.forEach(function(b){c.has(b)&&(a[b]=c.get(b))});else{var h,m=G(c.keys());try{for(m.s();!(h=m.n()).done;){var y=h.value;a[y]=c.get(y)}}catch(b){m.e(b)}finally{m.f()}}return a}},{key:"reset",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),k}(),T6=function(){function k(l){i(this,k);var p=l.manager,a=l.groupID,c=l.onInit,h=l.onSuccess,m=l.onFail;this._n="Polling",this._manager=p,this._groupModule=p._groupModule,this._onInit=c,this._onSuccess=h,this._onFail=m,this._groupID=a,this._timeoutID=-1,this._isRunning=!1,this._protocolName=Gg}return u(k,[{key:"start",value:function(){var l=this._groupModule.isLoggedIn();l||(this._protocolName=Iw),U.l("".concat(this._n,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(l)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var l=this,p=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:p}).then(function(a){l._onSuccess(l._groupID,a),l.isRunning()&&(clearTimeout(l._timeoutID),l._timeoutID=setTimeout(l._request.bind(l),l._manager.getPollingInterval()))}).catch(function(a){l._onFail(l._groupID,a),l.isRunning()&&(clearTimeout(l._timeoutID),l._timeoutID=setTimeout(l._request.bind(l),l._manager.MAX_POLLING_INTERVAL))})}},{key:"stop",value:function(){U.l("".concat(this._n,".stop")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:"getPollingTimerID",value:function(){return this._timeoutID}}]),k}(),Pw={3:!0,4:!0,5:!0,6:!0,17:!0},w6=function(){function k(l){i(this,k),this._groupModule=l,this._n="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new l1(200),this.messageIDLinkedList=new l1(100),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0,this._startBroadcastSeq=1,this._broadcastMessageIDMap=new Map,this.DEFAULT_POLLING_SIMPLIFIED_MSG=0}return u(k,[{key:"hasJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0}},{key:"checkJoinedAVChatRoomByID",value:function(l){return this._joinedGroupMap.has(l)}},{key:"getJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0?L(this._joinedGroupMap.keys()):[]}},{key:"_updateRequestData",value:function(l){var p=this._pollingRequestInfoMap.get(l);return l===L(this._pollingInstanceMap.keys())[0]?r(r({},p),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):r(r({},p),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:"_handleSuccess",value:function(l,p){var a=p.data,c=a.key,h=a.nextSeq,m=a.rspMsgList,y=a.errorCode,b=a.nextBroadcastSeq,I=a.broadcastMessageList;if(y!==0){var E=this._pollingRequestInfoMap.get(l),R=new We("longPollingAVError"),F=E?"".concat(E.key,"-").concat(E.startSeq):"requestInfo is undefined";R.setMessage("".concat(l,"-").concat(F,"-").concat(p.errorInfo)).setCode(p.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(l))return;Et(c)&&un(h)&&this._pollingRequestInfoMap.set(l,{key:c,startSeq:h}),un(b)&&b>this._startBroadcastSeq&&(this._startBroadcastSeq=b),rt(m)&&m.length>0?(m.forEach(function(H){H.to=H.groupID}),this.onMessage(m)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(I)}}},{key:"_handleFailure",value:function(l,p){}},{key:"onMessage",value:function(l){if(rt(l)&&l.length!==0){this._pollingNoMessageCount!==0&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var p=null,a=[],c=this._getModule(ct),h=this._getModule($o),m=l.length;m>1&&l.sort(function(qe,nt){return qe.sequence-nt.sequence});for(var y=this._getModule(pn),b=0;b1&&ee<=20?this._getModule(gp).onMessageMaybeLost(F,H+1,ee-1):ee<-1&&ee>=-20&&this._getModule(gp).onMessageMaybeLost(F,p.sequence+1,Math.abs(ee)-1)}this.sequencesLinkedList.set(p.sequence),this.messageIDLinkedList.set(p.ID);var ge=!1;if(this._isMessageSentByCurrentInstance(p)?E&&(ge=!0,p.isModified=E,c.updateMessageIsModifiedProperty(p)):ge=!0,ge){if(p.conversationType===T.CONV_SYSTEM&&p.payload.operationType===5&&this._onGroupDismissed(p.payload.groupProfile.groupID),!R&&p.conversationType!==T.CONV_SYSTEM){var be=p.conversationID.replace(T.CONV_GROUP,"");this._pollingInstanceMap.has(be)?this._groupModule.isLoggedIn()&&h.addMessageSequence({key:Dp,message:p}):(p.type!==T.MSG_GRP_TIP&&p.clientTime>0&&h.addMessageDelay(p.clientTime),h.addMessageSequence({key:kp,message:p}))}a.push(p)}}}else U.w("".concat(this._n,".onMessage unknown event:").concat(I.event))}if(a.length!==0){this._groupModule.filterModifiedMessage(a);var we=this.packConversationOption(a);we.length>0&&this._getModule(ct).onNewMessage({conversationOptionsList:we,isInstantMessage:!0}),U.d("".concat(this._n,".onMessage count:").concat(a.length)),this._checkMessageStacked(a);var Ue=this._groupModule.filterUnmodifiedMessage(a);Ue.length>0&&this._groupModule.emitOuterEvent(O.MESSAGE_RECEIVED,Ue),a.length=0}}}},{key:"isBroadcastOrNormal",value:function(l){return l===3||l===17}},{key:"isGroupTip",value:function(l){return l===4||l===6}},{key:"isGroupSystemNotice",value:function(l){return l===5}},{key:"restoreGroupTipElements",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};l.groupJoinType||(l.groupJoinType=1);var p=l.operatorInfo,a=p===void 0?{}:p,c=l.operatorID,h=l.userIDList,m=h===void 0?[]:h,y=a.userID,b=y===void 0?c:y,I=a.avatar,E=I===void 0?"":I,R=a.nick,F=R===void 0?"":R;l.operatorInfo={userID:b,avatar:E,nick:F};var H=m.map(function(ee){return{userID:ee}});return l.memberInfoList=l.memberInfoList||H,l}},{key:"restoreMessageFromSimplified",value:function(l){var p=l.event;if(this.isBroadcastOrNormal(p)&&(l.cloudCustomData=l.cloudCustomData||"",l.elements=l.elements.map(function(F){if(F.type===T.MSG_CUSTOM){var H=F.content,ee=H===void 0?{}:H;F.content=r({data:"",description:"",extension:""},ee)}return F})),(this.isGroupTip(p)||this.isGroupSystemNotice(p))&&(l.from=l.from||"@TIM#SYSTEM"),this.isGroupTip(p)){l.elements=this.restoreGroupTipElements(l.elements);var a=l.elements,c=a===void 0?{}:a,h=c.operationType,m=c.operatorInfo;if(h===1){var y=[{userID:(m===void 0?{}:m).userID}];c.memberInfoList=c.memberInfoList||y}}if(this.isGroupSystemNotice(p)){var b=l.elements,I=b.memberInfoList,E=b.operatorInfo;I||(I=E===void 0?{}:E),l.elements.memberInfoList=r({userID:l.elements.operatorID,avatar:"",nick:""},I),l.elements=r({authentication:"",remarkInfo:"",messageKey:1e3*l.time},l.elements);var R=Object.keys(l.elements).filter(function(F){return F!=="operatorInfo"}).reduce(function(F,H){return r(r({},F),{},d({},H,l.elements[H]))},{});l.elements=R}return l}},{key:"_onGroupDismissed",value:function(l){U.l("".concat(this._n,"._onGroupDismissed groupID:").concat(l)),this._groupModule.deleteLocalGroupAndConversation(l),this.reset(l)}},{key:"_checkMessageStacked",value:function(l){var p="MessageStacked",a=l.length;a>=100&&(this._groupModule.outputWarning(p,a),this._reportMessageStackedCount<5&&(new We(p).setNetworkType(this._groupModule.getNetworkType()).setMessage("count:".concat(a," groupID:").concat(L(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{key:"_isMessageSentByCurrentInstance",value:function(l){return!!this._getModule(ct).isMessageSentByCurrentInstance(l)}},{key:"packMessage",value:function(l,p){l.currentUser=this._groupModule.getMyUserID(),l.conversationType=p===5?T.CONV_SYSTEM:T.CONV_GROUP,l.isSystemMessage=!!l.isSystemMessage;var a=new Hr(l),c=this.packElements(l,p);return a.setElement(c,this._groupModule.getFileDownloadProxy()),a}},{key:"packElements",value:function(l,p){return p===4||p===6?(this._updateMemberCountByGroupTips(l),{type:T.MSG_GRP_TIP,content:r(r({},l.elements),{},{groupProfile:l.groupProfile})}):p===5?{type:T.MSG_GRP_SYS_NOTICE,content:r(r({},l.elements),{},{groupProfile:r(r({},l.groupProfile),{},{groupID:l.groupID})})}:l.elements}},{key:"packConversationOption",value:function(l){for(var p=new Map,a=0;a0&&this._groupModule.emitOuterEvent(O.MESSAGE_RECEIVED,p)}}},{key:"start",value:function(l){if(this._pollingInstanceMap.has(l)){var p=this._pollingInstanceMap.get(l);p.isRunning()||p.start()}else{var a=new T6({manager:this,groupID:l,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});a.start(),this._pollingInstanceMap.set(l,a),U.l("".concat(this._n,".start groupID:").concat(l))}}},{key:"handleJoinResult",value:function(l){var p=this;return this._preCheck().then(function(){var a=l.longPollingKey,c=l.group,h=c.groupID;return p._joinedGroupMap.set(h,c),p._groupModule.updateGroupMap([c]),p._groupModule.deleteUnjoinedAVChatRoom(h),p._groupModule.emitGroupListUpdate(!0,!1),Ge(a)?At({status:Ji,group:c}):Promise.resolve()})}},{key:"startRunLoop",value:function(l){var p=this;return this.handleJoinResult(l).then(function(){var a=l.longPollingKey,c=l.group,h=l.startSeq,m=h===void 0?0:h,y=c.groupID;return p._pollingRequestInfoMap.set(y,{key:a,startSeq:m}),p.start(y),p._groupModule.isLoggedIn()?At({status:Ji,group:c}):At({status:Ji})})}},{key:"_preCheck",value:function(){if(this._getModule(pn).isUnlimitedAVChatRoom()||!this.hasJoinedAVChatRoom())return Promise.resolve();var l=A(this._joinedGroupMap.entries().next().value,2),p=l[0],a=l[1];if(this._groupModule.isLoggedIn()){if(!(a.selfInfo.role===T.GRP_MBR_ROLE_OWNER||a.ownerID===this._groupModule.getMyUserID()))return this._groupModule.quitGroup(p);this._groupModule.deleteLocalGroupAndConversation(p)}else this._groupModule.deleteLocalGroupAndConversation(p);return this.reset(p),Promise.resolve()}},{key:"joinWithoutAuth",value:function(l){var p=this,a=l.groupID,c="".concat(this._n,".").concat("joinWithoutAuth"),h=new We("joinWithoutAuth");return this._groupModule.request({protocolName:Mw,requestData:l}).then(function(m){var y=m.data.longPollingKey;if(p._groupModule.probeNetwork().then(function(I){var E=A(I,2);E[0];var R=E[1];h.setNetworkType(R).setMessage("groupID:".concat(a," longPollingKey:").concat(y)).end(!0)}),Ge(y))return Me({code:De.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN});U.l("".concat(c," ok. groupID:").concat(a)),p._getModule(ct).setCompleted("".concat(T.CONV_GROUP).concat(a));var b=new wl({groupID:a});return p.startRunLoop({group:b,longPollingKey:y}),ht({status:Ji})}).catch(function(m){return U.e("".concat(c," failed. groupID:").concat(a," error:"),m),p._groupModule.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];h.setError(m,I,E).setMessage("groupID:".concat(a)).end(!0)}),Me(m)}).finally(function(){p._groupModule.getModule(_0).reportAtOnce()})}},{key:"getGroupOnlineMemberCount",value:function(l){var p=this._onlineMemberCountMap.get(l)||{},a=Date.now();return Ye(p)||a-p.lastSyncTime>1e3*p.expireTime&&a-p.latestUpdateTime>1e4&&a-p.lastReqTime>3e3?(p.lastReqTime=a,this._onlineMemberCountMap.set(l,p),this._getGroupOnlineMemberCount(l).then(function(c){return ht({memberCount:c.memberCount})}).catch(function(c){return Me(c)})):At({memberCount:p.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(l){var p=this,a="".concat(this._n,".").concat("_getGroupOnlineMemberCount");return this._groupModule.request({protocolName:b_,requestData:{groupID:l}}).then(function(c){var h=p._onlineMemberCountMap.get(l)||{},m=c.data,y=m.onlineMemberNum,b=y===void 0?0:y,I=m.expireTime,E=I===void 0?p.DEFAULT_EXPIRE_TIME:I;U.l("".concat(a," ok. groupID:").concat(l," memberCount:").concat(b," expireTime:").concat(E));var R=Date.now();return Ye(h)&&(h.lastReqTime=R),p._onlineMemberCountMap.set(l,Object.assign(h,{lastSyncTime:R,latestUpdateTime:R,memberCount:b,expireTime:E})),{memberCount:b}}).catch(function(c){return U.w("".concat(a," failed. error:"),c),new We("_getGroupOnlineMemberCount").setCode(c.code).setMessage("groupID:".concat(l," error:").concat(JSON.stringify(c))).setNetworkType(p._groupModule.getNetworkType()).end(),Promise.reject(c)})}},{key:"_getModule",value:function(l){return this._groupModule.getModule(l)}},{key:"setPollingInterval",value:function(l){Ge(l)||(un(l)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=l:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(l,10))}},{key:"setPollingIntervalPlus",value:function(l){Ge(l)||(un(l)?this.DEFAULT_POLLING_INTERVAL_PLUS=l:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(l,10))}},{key:"setPollingNoMessageCount",value:function(l){Ge(l)||(un(l)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=l:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(l,10))}},{key:"setPollingSimplifiedMessage",value:function(l){Ge(l)||l!=="0"&&l!=="1"||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(l,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(l){var p=l.payload.groupProfile.groupID;U.l("".concat(this._n,".onAVChatRoomMemberBanned groupID:").concat(p)),this._groupModule.deleteLocalGroupAndConversation(p),this.reset(p)}},{key:"restartPolling",value:function(){U.l("".concat(this._n,".restartPolling count:").concat(this._pollingInstanceMap.size));var l,p=G(this._pollingInstanceMap.values());try{for(p.s();!(l=p.n()).done;){var a=l.value;a.stop(),a.start()}}catch(c){p.e(c)}finally{p.f()}}},{key:"getPollingTimerID",value:function(l){if(!this._pollingInstanceMap.has(l))return-1;var p=this._pollingInstanceMap.get(l).getPollingTimerID();return U.l("".concat(this._n,".getPollingTimerID groupID:").concat(l," timerID:").concat(p)),p}},{key:"reset",value:function(l){if(l){U.l("".concat(this._n,".reset groupID:").concat(l));var p=this._pollingInstanceMap.get(l);p&&p.stop(),this._pollingInstanceMap.delete(l),this._joinedGroupMap.delete(l),this._pollingRequestInfoMap.delete(l),this._onlineMemberCountMap.delete(l)}else{U.l("".concat(this._n,".reset all"));var a,c=G(this._pollingInstanceMap.values());try{for(c.s();!(a=c.n()).done;)a.value.stop()}catch(h){c.e(h)}finally{c.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=300,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0}}]),k}(),S6=function(){function k(l){i(this,k),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this._initMember(l)}return u(k,[{key:"_initMember",value:function(l){this.updateMember(l)}},{key:"updateMember",value:function(l){var p=[null,void 0,"",0,NaN];l.memberCustomField&&Pu(this.memberCustomField,l.memberCustomField),Ri(this,l,["memberCustomField","marks"],p)}},{key:"updateRole",value:function(l){["Owner","Admin","Member"].indexOf(l)<0||(this.role=l)}},{key:"updateMuteUntil",value:function(l){Ge(l)||(this.muteUntil=Math.floor((Date.now()+1e3*l)/1e3))}},{key:"updateNameCard",value:function(l){Ge(l)||(this.nameCard=l)}},{key:"updateMemberCustomField",value:function(l){l&&Pu(this.memberCustomField,l)}}]),k}(),k6=function(){function k(l){i(this,k),this._groupModule=l,this._n="GroupMemberHandler",this.groupMemberListMap=new Map,this._groupModule.getInnerEmitterInstance().on(nr.PROFILE_UPDATED,this._onProfileUpdated,this)}return u(k,[{key:"_onProfileUpdated",value:function(l){for(var p=this,a=l.data,c=function(m){var y=a[m];p.groupMemberListMap.forEach(function(b){b.has(y.userID)&&b.get(y.userID).updateMember({nick:y.nick,avatar:y.avatar})})},h=0;h100?100:y};go({groupID:a})?ee.next="".concat(h):(ee.offset=h,H=h+y);var ge=[];return this._groupModule.request({protocolName:C_,requestData:ee}).then(function(be){var we=be.data,Ue=we.members,qe=we.memberNum,nt=we.next,mt=nt===void 0?void 0:nt;return Ge(mt)||(H=Ye(mt)?0:mt),rt(Ue)&&Ue.length!==0?(p._groupModule.hasLocalGroup(a)&&(p._groupModule.getLocalGroupProfile(a).memberNum=qe),ge=p._updateLocalGroupMemberMap(a,Ue),p._groupModule.getModule(pr).getUserProfile({userIDList:Ue.map(function(Pt){return Pt.userID}),tagList:[Gt.NICK,Gt.AVATAR]})):(H=0,Promise.resolve([]))}).then(function(be){var we=be.data;if(!rt(we)||we.length===0)return At({memberList:[],offset:H});var Ue=we.map(function(qe){return{userID:qe.userID,nick:qe.nick,avatar:qe.avatar}});return p._updateLocalGroupMemberMap(a,Ue),ge.length5?"userIDList.length:".concat(l.userIDList.length):"userIDList:".concat(l.userIDList)),U.l("".concat(a," groupID:").concat(l.groupID," userIDList:").concat(l.userIDList.join(","))),l.userIDList.length>50&&(l.userIDList=l.userIDList.slice(0,50));var h=l.groupID,m=l.userIDList;return this._getGroupMemberProfileAdvance(r(r({},l),{},{userIDList:m})).then(function(y){var b=y.data.members;return rt(b)&&b.length!==0?(p._updateLocalGroupMemberMap(h,b),p._groupModule.getModule(pr).getUserProfile({userIDList:b.map(function(I){return I.userID}),tagList:[Gt.NICK,Gt.AVATAR]})):At([])}).then(function(y){var b=y.data.map(function(E){return{userID:E.userID,nick:E.nick,avatar:E.avatar}});p._updateLocalGroupMemberMap(h,b);var I=m.filter(function(E){return p.hasLocalGroupMember(h,E)}).map(function(E){return p.getLocalGroupMemberInfo(h,E)});return c.setNetworkType(p._groupModule.getNetworkType()).end(),ht({memberList:I})})}},{key:"addGroupMember",value:function(l){var p=this,a="".concat(this._n,".").concat("addGroupMember"),c=l.groupID,h=this._groupModule.getLocalGroupProfile(c),m=h.type,y=new We("addGroupMember");if(y.setMessage("groupID:".concat(c," groupType:").concat(m)),Go(m)){var b=new Un({code:De.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return y.setError(b,!0,this._groupModule.getNetworkType()).end(),Me(b)}return l.userIDList=l.userIDList.map(function(I){return{userID:I}}),U.l("".concat(a," groupID:").concat(c)),this._groupModule.request({protocolName:w_,requestData:l}).then(function(I){var E=I.data.members;U.l("".concat(a," ok"));var R=E.filter(function(be){return be.result===1}).map(function(be){return be.userID}),F=E.filter(function(be){return be.result===0}).map(function(be){return be.userID}),H=E.filter(function(be){return be.result===2}).map(function(be){return be.userID}),ee=E.filter(function(be){return be.result===4}).map(function(be){return be.userID}),ge="groupID:".concat(l.groupID,", ")+"successUserIDList:".concat(R,", ")+"failureUserIDList:".concat(F,", ")+"existedUserIDList:".concat(H,", ")+"overLimitUserIDList:".concat(ee);return y.setNetworkType(p._groupModule.getNetworkType()).setMoreMessage(ge).end(),R.length===0?ht({successUserIDList:R,failureUserIDList:F,existedUserIDList:H,overLimitUserIDList:ee}):(h.memberCount+=R.length,p._updateConversationGroupProfile(h),ht({successUserIDList:R,failureUserIDList:F,existedUserIDList:H,overLimitUserIDList:ee,group:h}))}).catch(function(I){return p._groupModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setError(I,F,H).end()}),U.e("".concat(a," failed. error:"),I),Me(I)})}},{key:"deleteGroupMember",value:function(l){var p=this,a="".concat(this._n,".").concat("deleteGroupMember"),c=l.groupID,h=l.userIDList,m=this._groupModule.getLocalGroupProfile(c);if(Ge(m))return Me({code:De.CANNOT_FIND_GRP});if(Go(m.type))return this._groupModule.canIUse(ve.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(l):Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var y=new We("deleteGroupMember"),b="groupID:".concat(c," ").concat(h.length>5?"userIDList.length:".concat(h.length):"userIDList:".concat(h));return y.setMessage(b),U.l("".concat(a," groupID:").concat(c," userIDList:"),h),this._groupModule.request({protocolName:S_,requestData:l}).then(function(){return y.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(a," ok")),m.memberCount-=1,p._updateConversationGroupProfile(m),p.deleteLocalGroupMembers(c,h),ht({group:m,userIDList:h})}).catch(function(I){return p._groupModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setError(I,F,H).end()}),U.e("".concat(a," failed. error:"),I),Me(I)})}},{key:"_updateConversationGroupProfile",value:function(l){this._groupModule.getModule(ct).updateConversationGroupProfile([l])}},{key:"_banAVChatRoomMember",value:function(l){var p=this,a="".concat(this._n,".").concat("deleteGroupMember"),c=l.groupID,h=l.userIDList,m="groupID:".concat(c," ").concat(h.length>5?"userIDList.length:".concat(h.length):"userIDList:".concat(h)),y=new We("deleteGroupMember");y.setMessage(m),U.l("".concat(a," groupID:").concat(c," userIDList:"),h);var b=this._groupModule.getLocalGroupProfile(c);return Ge(l.duration)||l.duration===0?Me({code:De.BAN_DURATION_INVALID}):this._groupModule.request({protocolName:k_,requestData:l}).then(function(){return y.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(a," ok")),p.deleteLocalGroupMembers(c,h),ht({group:b,userIDList:h})}).catch(function(I){return p._groupModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setError(I,F,H).end()}),U.e("".concat(a," failed. error:"),I),Me(I)})}},{key:"setGroupMemberMuteTime",value:function(l){var p=this,a=l.groupID,c=l.userID,h=l.muteTime,m="setGroupMemberMuteTime",y="".concat(this._n,".").concat(m);if(c===this._groupModule.getMyUserID())return Me({code:De.CANNOT_MUTE_SELF});var b=this._groupModule.getLocalGroupProfile(a);if(b&&Go(b.type)){var I=De.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Me({code:I,message:this._groupModule.getErrorMessage(I,m)})}U.l("".concat(y," groupID:").concat(a," userID:").concat(c));var E=new We(m);return E.setMessage("groupID:".concat(a," userID:").concat(c," muteTime:").concat(h)),this.modifyGroupMemberInfo({groupID:a,userID:c,muteTime:h}).then(function(R){E.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(y," ok"));var F=p._groupModule.getLocalGroupProfile(a);return ht({group:F,member:R})}).catch(function(R){return p._groupModule.probeNetwork().then(function(F){var H=A(F,2),ee=H[0],ge=H[1];E.setError(R,ee,ge).end()}),U.e("".concat(y," failed. error:"),R),Me(R)})}},{key:"setGroupMemberRole",value:function(l){var p=this,a="".concat(this._n,".").concat("setGroupMemberRole"),c=l.groupID,h=l.userID,m=l.role,y=this._groupModule.getLocalGroupProfile(c);if([T.GRP_WORK,T.GRP_AVCHATROOM].includes(y.type))return Me({code:De.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});if(y&&y.selfInfo.role!==T.GRP_MBR_ROLE_OWNER)return Me({code:De.NOT_OWNER});var b=[T.GRP_MBR_ROLE_ADMIN,T.GRP_MBR_ROLE_MEMBER];if(go({groupID:c})&&b.push(T.GRP_MBR_ROLE_CUSTOM),b.indexOf(m)<0)return Me({code:De.INVALID_MEMBER_ROLE});if(h===this._groupModule.getMyUserID())return Me({code:De.CANNOT_SET_SELF_MEMBER_ROLE});var I=new We("setGroupMemberRole");return I.setMessage("groupID:".concat(c," userID:").concat(h," role:").concat(m)),U.l("".concat(a," groupID:").concat(c," userID:").concat(h)),this.modifyGroupMemberInfo({groupID:c,userID:h,role:m}).then(function(E){return I.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(a," ok")),ht({group:y,member:E})}).catch(function(E){return p._groupModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];I.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"_filterProfanity",value:function(l,p){var a=this._groupModule.getModule(Ga);if(!a)return!0;var c=a.filterText(p[l],Se),h=c.isAllowedToSend,m=c.modifiedText;return h===!0&&(p[l]=m,!0)}},{key:"setGroupMemberNameCard",value:function(l){var p=this,a="setGroupMemberNameCard",c="".concat(this._n,".").concat(a);if(l.nameCard&&this._filterProfanity("nameCard",l)===!1)return Me({code:De.PROFANITY_FOUND});var h=l.groupID,m=l.userID,y=m===void 0?this._groupModule.getMyUserID():m,b=l.nameCard;U.l("".concat(c," groupID:").concat(h," userID:").concat(y));var I=this._groupModule.getLocalGroupProfile(h);if(I&&Go(I.type)){var E=De.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Me({code:E,message:this._groupModule.getErrorMessage(E,a)})}var R=new We(a);return R.setMessage("groupID:".concat(h," userID:").concat(y," nameCard:").concat(b)),this.modifyGroupMemberInfo({groupID:h,userID:y,nameCard:b}).then(function(F){U.l("".concat(c," ok")),R.setNetworkType(p._groupModule.getNetworkType()).end();var H=p._groupModule.getLocalGroupProfile(h);return y===p._groupModule.getMyUserID()&&H&&H.setSelfNameCard(b),ht({group:H,member:F})}).catch(function(F){return p._groupModule.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];R.setError(F,ge,be).end()}),U.e("".concat(c," failed. error:"),F),Me(F)})}},{key:"setGroupMemberCustomField",value:function(l){var p=this,a="setGroupMemberCustomField",c="".concat(this._n,".").concat(a),h=l.groupID,m=l.userID,y=m===void 0?this._groupModule.getMyUserID():m,b=l.memberCustomField;U.l("".concat(c," groupID:").concat(h," userID:").concat(y));var I=this._groupModule.getLocalGroupProfile(h);if(I&&Go(I.type)){var E=De.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Me({code:E,message:this._groupModule.getErrorMessage(E,a)})}var R=new We(a);return R.setMessage("groupID:".concat(h," userID:").concat(y," memberCustomField:").concat(JSON.stringify(b))),this.modifyGroupMemberInfo({groupID:h,userID:y,memberCustomField:b}).then(function(F){R.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(c," ok"));var H=p._groupModule.getLocalGroupProfile(h);return ht({group:H,member:F})}).catch(function(F){return p._groupModule.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];R.setError(F,ge,be).end()}),U.e("".concat(c," failed. error:"),F),Me(F)})}},{key:"modifyGroupMemberInfo",value:function(l){var p=this,a=l.groupID,c=l.userID,h=void 0;return oo(a)&&(a=Lr(h=a)),this._groupModule.request({protocolName:D_,requestData:r(r({},l),{},{groupID:a,topicID:h})}).then(function(){if(p.hasLocalGroupMember(a,c)){var m=p.getLocalGroupMemberInfo(a,c);return Ge(l.muteTime)||m.updateMuteUntil(l.muteTime),Ge(l.role)||m.updateRole(l.role),Ge(l.nameCard)||m.updateNameCard(l.nameCard),Ge(l.memberCustomField)||m.updateMemberCustomField(l.memberCustomField),m}return p.getGroupMemberProfile({groupID:a,userIDList:[c]}).then(function(y){return A(y.data.memberList,1)[0]})})}},{key:"markGroupMemberList",value:function(l){var p=this,a="".concat(this._n,".").concat("markGroupMemberList"),c=l.groupID,h=l.markType,m=l.enableMark,y=l.userIDList,b=y===void 0?[]:y,I="groupID:".concat(c," markType:").concat(h," enableMark:").concat(m," userIDList count: ").concat(b.length);U.l("".concat(a," ").concat(I));var E=2,R=[];m===!0&&(E=1);var F=L(b);b.length>500&&(F=b.slice(0,500),U.w("".concat(a," ").concat(Pa(500)))),F.forEach(function(ee){R.push({userID:ee,markType:[h]})}),F=null;var H=new We("markGroupMemberList");return H.setMessage("".concat(I)),this._groupModule.request({protocolName:E_,requestData:{groupID:c,operationType:E,memberList:R}}).then(function(ee){var ge=ee.data.memberList,be=ge===void 0?[]:ge,we=[],Ue=[];be.length===b.length?we.push.apply(we,L(b)):(be.forEach(function(nt){we.push(nt.userID)}),b.forEach(function(nt){we.includes(nt)||Ue.push(nt)}));var qe="success count:".concat(we.length," fail count:").concat(Ue.length);return H.setNetworkType(p._groupModule.getNetworkType()).setMessage(qe).end(),U.l("".concat(a," ok. ").concat(qe)),ht({successUserIDList:we,failureUserIDList:Ue})}).catch(function(ee){return p._groupModule.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];H.setError(ee,we,Ue).end()}),U.e("".concat(a," failed. error:"),ee),Me(ee)})}},{key:"_getGroupMemberProfileAdvance",value:function(l){return this._groupModule.request({protocolName:T_,requestData:r(r({},l),{},{memberInfoFilter:l.memberInfoFilter?l.memberInfoFilter:["Role","JoinTime","NameCard","ShutUpUntil"]})})}},{key:"_updateLocalGroupMemberMap",value:function(l,p){var a=this;return rt(p)&&p.length!==0?p.map(function(c){return a.hasLocalGroupMember(l,c.userID)?a.getLocalGroupMemberInfo(l,c.userID).updateMember(c):a.setLocalGroupMember(l,new S6(c)),a.getLocalGroupMemberInfo(l,c.userID)}):[]}},{key:"deleteLocalGroupMembers",value:function(l,p){var a=this.groupMemberListMap.get(l);a&&p.forEach(function(c){a.delete(c)})}},{key:"getLocalGroupMemberInfo",value:function(l,p){return this.groupMemberListMap.has(l)?this.groupMemberListMap.get(l).get(p):null}},{key:"setLocalGroupMember",value:function(l,p){if(this.groupMemberListMap.has(l))this.groupMemberListMap.get(l).set(p.userID,p);else{var a=new Map().set(p.userID,p);this.groupMemberListMap.set(l,a)}}},{key:"getLocalGroupMemberList",value:function(l){return this.groupMemberListMap.get(l)}},{key:"hasLocalGroupMember",value:function(l,p){return this.groupMemberListMap.has(l)&&this.groupMemberListMap.get(l).has(p)}},{key:"hasLocalGroupMemberMap",value:function(l){return this.groupMemberListMap.has(l)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),k}(),D6=1,E6=15,A6=function(){function k(l){i(this,k),this._groupModule=l,this._n="GroupSystemNoticeHandler",this.pendencyMap=new Map}return u(k,[{key:"onNewGroupSystemNotice",value:function(l){var p=l.dataList,a=l.isSyncingEnded,c=l.isInstantMessage;U.d("".concat(this._n,".onReceiveSystemNotice count:").concat(p.length));var h=this.newSystemNoticeStoredAndSummary({notifiesList:p,isInstantMessage:c}),m=h.eventDataList,y=h.result;m.length>0&&(this._groupModule.getModule(ct).onNewMessage({conversationOptionsList:m,isInstantMessage:c}),this._onReceivedGroupSystemNotice({result:y,isInstantMessage:c})),c?y.length>0&&this._groupModule.emitOuterEvent(O.MESSAGE_RECEIVED,y):a===!0&&this._clearGroupSystemNotice()}},{key:"newSystemNoticeStoredAndSummary",value:function(l){var p=l.notifiesList,a=l.isInstantMessage,c=null,h=p.length,m=0,y=[],b={conversationID:T.CONV_SYSTEM,unreadCount:0,type:T.CONV_SYSTEM,subType:null,lastMessage:null};for(m=0;m0?[b]:[],result:y}}},{key:"_clearGroupSystemNotice",value:function(){var l=this;this._getPendencyList().then(function(p){p.forEach(function(h){l.pendencyMap.set("".concat(h.from,"_").concat(h.groupID,"_").concat(h.to),h)});var a=l._groupModule.getModule(ct).getLocalMessageList(T.CONV_SYSTEM),c=[];a.forEach(function(h){var m=h.payload,y=m.operatorID,b=m.operationType,I=m.groupProfile;if(b===D6){var E="".concat(y,"_").concat(I.groupID,"_").concat(I.to),R=l.pendencyMap.get(E);R&&un(R.handled)&&R.handled!==0&&c.push(h)}}),l.deleteGroupSystemNotice({messageList:c})})}},{key:"deleteGroupSystemNotice",value:function(l){var p=this,a="".concat(this._n,".deleteGroupSystemNotice");return rt(l.messageList)&&l.messageList.length!==0?(U.l("".concat(a," ")+l.messageList.map(function(c){return c.ID})),this._groupModule.request({protocolName:__,requestData:{messageListToDelete:l.messageList.map(function(c){return{from:T.CONV_SYSTEM,messageSeq:c.clientSequence,messageRandom:c.random}})}}).then(function(){U.l("".concat(a," ok"));var c=p._groupModule.getModule(ct);return l.messageList.forEach(function(h){c.deleteLocalMessage(h)}),ht()}).catch(function(c){return U.e("".concat(a," error:"),c),Me(c)})):At()}},{key:"_getPendencyList",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=p.type,c=a===void 0?void 0:a,h=p.startTime,m=h===void 0?0:h,y=p.limit,b=y===void 0?20:y;return this._groupModule.request({protocolName:Fg,requestData:{type:c,startTime:m,limit:b,handleAccount:this._groupModule.getMyUserID()}}).then(function(I){var E=I.data.pendencyList;return I.data.nextStartTime!==0?l._getPendencyList({startTime:I.data.nextStartTime}).then(function(R){return[].concat(L(E),L(R))}):E})}},{key:"getGroupApplicationList",value:function(){var l=this;return this._getPendencyList().then(function(p){return l._getPendencyList({type:T.GRP_COMMUNITY}).then(function(a){return p.push.apply(p,L(a)),l._handlePendencyResult(p)}).catch(function(a){return l._handlePendencyResult(p)})})}},{key:"_handlePendencyResult",value:function(l){var p=this,a=[];return l.forEach(function(c){p.pendencyMap.set("".concat(c.from,"_").concat(c.groupID,"_").concat(c.to),c),c.handled===0&&a.push({applicant:c.from,applicantNick:c.fromUserNickName,groupName:c.groupName,groupID:c.groupID,authentication:c.authentication,messageKey:c.time,applicationType:c.applicationType,userID:c.userID})}),At({applicationList:a})}},{key:"_onReceivedGroupSystemNotice",value:function(l){var p=this,a=l.result;l.isInstantMessage&&a.forEach(function(c){switch(c.payload.operationType){case 1:break;case 2:p._onApplyGroupRequestAgreed(c);break;case 3:break;case 4:p._onMemberKicked(c);break;case 5:p._onGroupDismissed(c);break;case 6:break;case 7:p._onInviteGroup(c);break;case 8:p._onQuitGroup(c);break;case 9:p._onSetManager(c);break;case 10:p._onDeleteManager(c);break;case 11:case 12:case 15:break;case 20:p._onMessageRemindTypeSynced(c);break;case 21:p._groupModule.onAVChatRoomMemberBanned(c)}})}},{key:"_onApplyGroupRequestAgreed",value:function(l){var p=this,a=l.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(a)||this._groupModule.getGroupProfile({groupID:a}).then(function(c){var h=c.data.group;if(h){p._groupModule.updateGroupMap([h]);var m=!h.isSupportTopic;p._groupModule.emitGroupListUpdate(!0,m)}})}},{key:"_onMemberKicked",value:function(l){var p=l.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(p)&&this._groupModule.deleteLocalGroupAndConversation(p)}},{key:"_onGroupDismissed",value:function(l){var p=l.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(p)&&this._groupModule.deleteLocalGroupAndConversation(p);var a=this._groupModule._AVChatRoomHandler;a&&a.checkJoinedAVChatRoomByID(p)&&a.reset(p)}},{key:"_onInviteGroup",value:function(l){var p=this,a=l.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(a)||this._groupModule.getGroupProfile({groupID:a}).then(function(c){var h=c.data.group;h&&(p._groupModule.updateGroupMap([h]),p._groupModule.emitGroupListUpdate())})}},{key:"_onQuitGroup",value:function(l){var p=l.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(p)&&this._groupModule.deleteLocalGroupAndConversation(p)}},{key:"_onSetManager",value:function(l){var p=l.payload.groupProfile,a=p.to,c=p.groupID,h=this._groupModule.getGroupMemberHandler().getLocalGroupMemberInfo(c,a);h&&h.updateRole(T.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(l){var p=l.payload.groupProfile,a=p.to,c=p.groupID,h=this._groupModule.getGroupMemberHandler().getLocalGroupMemberInfo(c,a);h&&h.updateRole(T.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(l){var p=l.payload.groupProfile.groupID,a=l.payload.messageRemindType;this._groupModule.getModule(ct).onGroupMessageRemindTypeUpdated({groupID:p,messageRemindType:a})}},{key:"_handleTopicSystemNotice",value:function(l){var p=l.groupProfile,a=p.groupID,c=p.topicID,h=l.elements,m=h.operationType,y=h.topicIDList,b=h.messageRemindType,I=this._groupModule.getModule(sr);m===17?I.onTopicCreated({groupID:a,topicID:c}):m===18?I.onTopicDeleted({groupID:a,topicIDList:y}):m===20&&I.onTopicMessageRemindTypeUpdated({groupID:a,topicID:c,messageRemindType:b})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),k}(),L6=["relayFlag"],O6=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="GroupModule",c._commonGroupHandler=new v6(w(c)),c._groupAttributesHandler=new _6(w(c)),c._groupCountersHandler=new C6(w(c)),c._AVChatRoomHandler=new w6(w(c)),c._groupTipsHandler=new m6(w(c)),c._groupSystemNoticeHandler=new A6(w(c)),c._groupMemberHandler=new k6(w(c)),c.groupMap=new Map,c._unjoinedAVChatRoomList=new Map,c._receiptDetailCompleteMap=new Map,c.getInnerEmitterInstance().on(nr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"_onCloudConfigUpdated",value:function(){var a=this.getCloudConfig("polling_interval"),c=this.getCloudConfig("polling_interval_plus"),h=this.getCloudConfig("polling_no_msg_count"),m=this.getCloudConfig("polling_simplified_msg"),y=this.getCloudConfig("paging_grp_count");U.l("".concat(this._n,"._onCloudConfigUpdated pollingInterval:").concat(a)+" pollingIntervalPlus:".concat(c," pollingNoMessageCount:").concat(h)+" pollingSimplifiedMessage:".concat(m," pagingGroupCount:").concat(y)),this._AVChatRoomHandler.setPollingInterval(a),this._AVChatRoomHandler.setPollingIntervalPlus(c),this._AVChatRoomHandler.setPollingNoMessageCount(h),this._AVChatRoomHandler.setPollingSimplifiedMessage(m),this._commonGroupHandler.setPagingGroupCount(y)}},{key:"onCheckTimer",value:function(a){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(a),this._groupTipsHandler.onCheckTimer(a))}},{key:"guardForAVChatRoom",value:function(a){var c=this;if(a.conversationType===T.CONV_GROUP){var h=oo(a.to)?Lr(a.to):a.to;return this.hasLocalGroup(h)?At():this.getGroupProfile({groupID:h}).then(function(m){var y=m.data.group.type;if(U.l("".concat(c._n,".guardForAVChatRoom. groupID:").concat(h," type:").concat(y)),y===T.GRP_AVCHATROOM){var b=De.MSG_SEND_FAIL_NOT_IN_AVCHATROOM;return Me(new Un({code:b,message:c.getErrorMessage(b,a.from,h),data:{message:a}}))}return At()})}return At()}},{key:"checkJoinedAVChatRoomByID",value:function(a){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(a)}},{key:"onNewGroupMessage",value:function(a){this._commonGroupHandler.onNewGroupMessage(a)}},{key:"updateNextMessageSeq",value:function(a){var c=this;if(rt(a)){var h=this.getModule(sr);a.forEach(function(m){var y=m.conversationID.replace(T.CONV_GROUP,"");oo(y)&&h.updateLastMessage(y,m.lastMessage),c.groupMap.has(y)&&(c.groupMap.get(y).nextMessageSeq=m.lastMessage.sequence+1)})}}},{key:"onNewGroupTips",value:function(a){this._groupTipsHandler.onNewGroupTips(a)}},{key:"onGroupMessageRevoked",value:function(a){this._commonGroupHandler.onGroupMessageRevoked(a)}},{key:"onNewGroupSystemNotice",value:function(a){this._groupSystemNoticeHandler.onNewGroupSystemNotice(a)}},{key:"onGroupMessageReadNotice",value:function(a){var c=this;a.dataList.forEach(function(h){var m=h.elements.groupMessageReadNotice;if(!Ge(m)){var y=c.getModule(ct);m.forEach(function(b){var I=b.groupID,E=b.topicID,R=E===void 0?void 0:E,F=b.lastMessageSeq;U.d("".concat(c._n,".onGroupMessageReadNotice groupID:").concat(I," lastMessageSeq:").concat(F));var H="".concat(T.CONV_GROUP).concat(I),ee=!0;Ye(R)||(H="".concat(T.CONV_GROUP).concat(R),ee=!1),y.updateIsReadAfterReadReport({conversationID:H,lastMessageSeq:F}),y.updateUnreadCount(H,ee),y.clearGroupAtInfoList(H,ee)})}})}},{key:"onReadReceiptList",value:function(a){var c=this;U.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(a)),a.dataList.forEach(function(h){var m=h.groupProfile,y=h.elements,b=m.groupID,I=c.getModule(ct),E=y.readReceiptList;I.updateReadReceiptInfo({groupID:b,readReceiptList:E})})}},{key:"onGroupMessageModified",value:function(a){U.d("".concat(this._n,".onGroupMessageModified options:"),JSON.stringify(a));var c=this.getModule(ct);a.dataList.forEach(function(h){c.onMessageModified(r(r({},h),{},{conversationType:T.CONV_GROUP,to:h.topicID?h.topicID:h.groupID}))})}},{key:"deleteGroupSystemNotice",value:function(a){this._groupSystemNoticeHandler.deleteGroupSystemNotice(a)}},{key:"initGroupMap",value:function(a){this.groupMap.set(a.groupID,new wl(a))}},{key:"clearGroupMap",value:function(){this.groupMap.clear()}},{key:"deleteGroup",value:function(a){this.groupMap.delete(a)}},{key:"updateGroupMap",value:function(a){var c,h=this,m=this.getModule(ct);a.forEach(function(R){c=R.groupID,h.groupMap.has(c)?h.groupMap.get(c).updateGroup(R):(h.groupMap.set(c,new wl(R)),m.deleteGroupRomaingMessageInfo(c))});var y,b=this.getMyUserID(),I=G(this.groupMap);try{for(I.s();!(y=I.n()).done;){var E=A(y.value,2)[1];E.selfInfo.userID=b,E.selfInfo.role==="Owner"&&(E.ownerID=b)}}catch(R){I.e(R)}finally{I.f()}}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return L(this.groupMap.values())}},{key:"getLocalGroupProfile",value:function(a){return this.groupMap.get(a)}},{key:"sortLocalGroupList",value:function(){var a=L(this.groupMap).filter(function(c){var h=A(c,2);return h[0],!Ye(h[1].lastMessage)});a.sort(function(c,h){return h[1].lastMessage.lastTime-c[1].lastMessage.lastTime}),this.groupMap=new Map(L(a))}},{key:"updateGroupLastMessage",value:function(a){this._commonGroupHandler.handleUpdateGroupLastMessage(a)}},{key:"emitGroupListUpdate",value:function(){var a=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],c=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],h=this.getLocalGroupList();if(a&&this.emitOuterEvent(O.GROUP_LIST_UPDATED),c){var m=JSON.parse(JSON.stringify(h)),y=this.getModule(ct);y.updateConversationGroupProfile(m)}}},{key:"getMyNameCardByGroupID",value:function(a){var c=this.getLocalGroupProfile(a);return c?c.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return this._commonGroupHandler.isPagingGetCompleted()}},{key:"getMessageRemindType",value:function(a){var c=this;rt(a)&&a.length!==0&&(U.l("".concat(this._n,".getMessageRemindType groupIDList:").concat(a)),this.getGroupProfileAdvance({groupIDList:a,responseFilter:{memberInfoFilter:["MsgFlag"]}}).then(function(h){var m=h.data.successGroupList,y=c.getModule(ct);m.forEach(function(b){y.onGroupMessageRemindTypeUpdated({groupID:b.groupID,messageRemindType:b.members[0].messageRemindType})})}))}},{key:"getGroupList",value:function(){return this._commonGroupHandler.getGroupList()}},{key:"syncCommunityWithTopic",value:function(){return this._commonGroupHandler.syncGroupList(!0)}},{key:"getGroupProfile",value:function(a){var c=this,h="".concat(this._n,".").concat("getGroupProfile"),m=new We("getGroupProfile"),y=a.groupID,b=a.groupCustomFieldFilter;U.l("".concat(h," groupID:").concat(y));var I={groupIDList:[y],responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],groupCustomFieldFilter:b,memberInfoFilter:["Role","JoinTime","MsgSeq","MsgFlag","NameCard"]}};return this.getGroupProfileAdvance(I).then(function(E){var R,F=E.data,H=F.successGroupList,ee=F.failureGroupList;return U.l("".concat(h," ok")),ee.length>0?Me(ee[0]):(Go(H[0].type)&&!c.hasLocalGroup(y)?R=new wl(H[0]):(c.updateGroupMap(H),R=c.getLocalGroupProfile(y)),R.isSupportTopic||c.getModule(ct).updateConversationGroupProfile([R]),m.setNetworkType(c.getNetworkType()).setMessage("groupID:".concat(y," type:").concat(R.type," muteAllMembers:").concat(R.muteAllMembers," ownerID:").concat(R.ownerID)).end(),ht({group:R}))}).catch(function(E){return c.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];m.setError(E,H,ee).setMessage("groupID:".concat(a.groupID)).end()}),U.e("".concat(h," failed. error:"),E),Me(E)})}},{key:"getGroupProfileAdvance",value:function(a){var c="".concat(this._n,".getGroupProfileAdvance"),h=a.groupIDList;rt(h)&&h.length>50&&(this.outputWarning("GetGroupProfileLimit"),h.length=50);var m=[],y=[];h.forEach(function(R){go({groupID:R})?y.push(R):m.push(R)});var b=[];if(m.length>0){var I=this._getGroupProfileAdvance(r(r({},a),{},{groupIDList:m}));b.push(I)}if(y.length>0){var E=this._getGroupProfileAdvance(r(r({},a),{},{groupIDList:y,relayFlag:m.length>0}));b.push(E)}return Promise.all(b).then(function(R){var F=[],H=[];return R.forEach(function(ee){F.push.apply(F,L(ee.successGroupList)),H.push.apply(H,L(ee.failureGroupList))}),ht({successGroupList:F,failureGroupList:H})}).catch(function(R){return U.e("".concat(c," failed. error:"),R),Me(R)})}},{key:"_getGroupProfileAdvance",value:function(a){var c=this,h=a.relayFlag,m=h!==void 0&&h,y=D(a,L6);return this.request({protocolName:Pg,requestData:y}).then(function(b){U.l("".concat(c._n,"._getGroupProfileAdvance ok."));var I=b.data.groups;return{successGroupList:I.filter(function(E){return Ge(E.errorCode)||E.errorCode===0}),failureGroupList:I.filter(function(E){return E.errorCode&&E.errorCode!==0}).map(function(E){return new Un({code:E.errorCode,message:E.errorInfo,data:{groupID:E.groupID}})})}}).catch(function(b){return m&&go({groupID:a.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Me(b)})}},{key:"createGroup",value:function(a){var c=this,h="".concat(this._n,".").concat("createGroup"),m=a.type,y=a.groupID;if(a.name&&this._filterProfanity("name",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return Me({code:De.PROFANITY_FOUND});if(!["Public","Private","ChatRoom","AVChatRoom","Community"].includes(m))return Me({code:De.ILLEGAL_GRP_TYPE});if(!go({type:m})){if(!Ye(y)&&go({groupID:y}))return Me({code:De.ILLEGAL_GRP_ID});a.isSupportTopic=void 0}if(Go(m)&&!Ge(a.memberList)&&a.memberList.length>0&&(a.memberList=void 0),this._canIUseJoinOption(m)||Ge(a.joinOption)||(a.joinOption=void 0),go({type:m})){if(!Ye(y)&&!go({groupID:y}))return Me({code:De.ILLEGAL_GRP_ID});a.isSupportTopic=a.isSupportTopic===!0?1:0}var b=new We("createGroup");U.l("".concat(h," options:"),a);var I=null,E=[];return this.request({protocolName:o_,requestData:r(r({},a),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then(function(R){var F=R.data,H=F.groupID,ee=F.overLimitUserIDList,ge=ee===void 0?[]:ee;if(I=H,E=ge,b.setNetworkType(c.getNetworkType()).setMessage("groupType:".concat(a.type," groupID:").concat(H," overLimitUserIDList:").concat(ge)).end(),U.l("".concat(h," ok groupID:").concat(H," overLimitUserIDList:").concat(ge)),a.type===T.GRP_AVCHATROOM)return c.getGroupProfile({groupID:H});if(a.type===T.GRP_COMMUNITY&&a.isSupportTopic===1)return c.getGroupProfile({groupID:H});Ye(a.memberList)||Ye(ge)||(a.memberList=a.memberList.filter(function(mt){return ge.indexOf(mt.userID)===-1})),c.updateGroupMap([r(r({},a),{},{groupID:H})]);var be=c.getModule(ir),we="",Ue=0;a.type===T.GRP_COMMUNITY?(we=c.isIntl()?"Create Community":"创建社群",Ue=1):we=c.isIntl()?"Create Group":"创建群组";var qe=c.getModule(pr).getMyNick(),nt=be.createCustomMessage({to:H,conversationType:T.CONV_GROUP,payload:{data:JSON.stringify({businessID:"group_create",content:we,cmd:Ue,opUser:qe||c.getMyUserID(),version:4})}});return be.sendMessageInstance(nt),c.emitGroupListUpdate(),c.getGroupProfile({groupID:H})}).then(function(R){var F=R.data.group,H=F.selfInfo,ee=H.nameCard,ge=H.joinTime;return F.updateSelfInfo({nameCard:ee,joinTime:ge,messageRemindType:T.MSG_REMIND_ACPT_AND_NOTE,role:T.GRP_MBR_ROLE_OWNER}),ht({group:F,overLimitUserIDList:E})}).catch(function(R){if(b.setMessage("groupType:".concat(a.type)),c.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];b.setError(R,ge,be).end()}),R.code===10010||R.code===10007){c.updateGroupMap([r(r({},a),{},{groupID:I})]);var F=c.getLocalGroupProfile(I);return U.l("".concat(h," success, but failed to get group profile.")),ht({group:F,overLimitUserIDList:E})}return U.e("".concat(h," failed. error:"),R),Me(R)})}},{key:"dismissGroup",value:function(a){var c=this,h="".concat(this._n,".").concat("dismissGroup");if(this.hasLocalGroup(a)&&this.getLocalGroupProfile(a).type===T.GRP_WORK)return Me(new Un({code:De.CANNOT_DISMISS_WORK}));var m=new We("dismissGroup");return m.setMessage("groupID:".concat(a)),U.l("".concat(h," groupID:").concat(a)),this.request({protocolName:i_,requestData:{groupID:a}}).then(function(){return m.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok")),c.deleteLocalGroupAndConversation(a),c.checkJoinedAVChatRoomByID(a)&&c._AVChatRoomHandler.reset(a),c._groupAttributesHandler.deleteLocalGroupAttributes(a),ht({groupID:a})}).catch(function(y){return c.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.e("".concat(h," failed. error:"),y),Me(y)})}},{key:"updateGroupProfile",value:function(a){var c=this,h="".concat(this._n,".").concat("updateGroupProfile");if(this.hasLocalGroup(a.groupID)){var m=this.getLocalGroupProfile(a.groupID).type;this._canIUseJoinOption(m)||Ge(a.joinOption)||(U.w("".concat(h," joinOption is unavailable for Work/Meeting/AVChatRoom")),a.joinOption=void 0)}if(Ge(a.muteAllMembers)||(a.muteAllMembers?a.muteAllMembers="On":a.muteAllMembers="Off"),a.name&&this._filterProfanity("name",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return Me({code:De.PROFANITY_FOUND});var y=new We("updateGroupProfile");return y.setMessage(JSON.stringify(a)),U.l("".concat(h," groupID:").concat(a.groupID)),this.request({protocolName:s_,requestData:a}).then(function(){return y.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok")),c.hasLocalGroup(a.groupID)&&c.groupMap.get(a.groupID).updateGroup(a),ht({group:c.groupMap.get(a.groupID)})}).catch(function(b){return c.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).end()}),U.l("".concat(h," failed. error:"),b),Me(b)})}},{key:"_filterProfanity",value:function(a,c){var h=this.getModule(Ga);if(!h)return!0;var m=h.filterText(c[a],ce),y=m.isAllowedToSend,b=m.modifiedText;return y===!0&&(c[a]=b,!0)}},{key:"joinGroup",value:function(a){var c=this,h=a.groupID,m=a.type,y="".concat(this._n,".joinGroup");if(m===T.GRP_WORK)return Me({code:De.CANNOT_JOIN_WORK});if(this.deleteUnjoinedAVChatRoom(h),this.hasLocalGroup(h)){if(!this.isLoggedIn())return At({status:T.JOIN_STATUS_ALREADY_IN_GROUP});var b=new We("applyJoinGroup");return this.getGroupProfile({groupID:h}).then(function(){return b.setNetworkType(c.getNetworkType()).setMessage("groupID:".concat(h," joinedStatus:").concat(T.JOIN_STATUS_ALREADY_IN_GROUP)).end(),At({status:T.JOIN_STATUS_ALREADY_IN_GROUP})}).catch(function(I){return b.setNetworkType(c.getNetworkType()).setMessage("groupID:".concat(h," unjoined")).end(),U.w("".concat(y," ").concat(h," was unjoined, now join!")),c.groupMap.delete(h),c.applyJoinGroup(a)})}return U.l("".concat(y," groupID:").concat(h)),this.isLoggedIn()?this.applyJoinGroup(a):this._AVChatRoomHandler.joinWithoutAuth(a)}},{key:"applyJoinGroup",value:function(a){var c=this,h="".concat(this._n,".").concat("applyJoinGroup"),m=a.groupID;if(!Ye(a.applyMessage)&&this._filterProfanity("applyMessage",a)===!1)return Me({code:De.PROFANITY_FOUND});var y=new We("applyJoinGroup"),b=r({},a),I=this.canIUse(ve.AVCHATROOM_HISTORY_MSG);return I&&(b.historyMessageFlag=1),this.getModule(ct).deleteTopicRoamingMessageInfo(m),this.request({protocolName:xg,requestData:b}).then(function(E){var R=E.data,F=R.joinedStatus,H=R.longPollingKey,ee=R.startSeq,ge=R.avChatRoomFlag,be=R.avChatRoomKey,we=R.messageList,Ue="groupID:".concat(m," joinedStatus:").concat(F," longPollingKey:").concat(H," startSeq:").concat(ee)+" avChatRoomFlag:".concat(ge," canGetAVChatRoomHistoryMessage:").concat(I,",")+" history message count:".concat(Ye(we)?0:we.length);switch(y.setNetworkType(c.getNetworkType()).setMessage("".concat(Ue)).end(),U.l("".concat(h," ok. ").concat(Ue)),F){case md:return ht({status:md});case Ji:return c.getGroupProfile({groupID:m}).then(function(nt){var mt=nt.data.group;return c._handleJoinResult({group:mt,avChatRoomFlag:ge,longPollingKey:H,startSeq:ee,avChatRoomKey:be,messageList:we})}).catch(function(){var nt=new wl({groupID:m});return c._handleJoinResult({group:nt,avChatRoomFlag:ge,longPollingKey:H,startSeq:ee,avChatRoomKey:be,messageList:we})});default:var qe=new Un({code:De.JOIN_GRP_FAIL});return U.e("".concat(h," failed. error:"),qe),Me(qe)}}).catch(function(E){return y.setMessage("groupID:".concat(m)),c.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];y.setError(E,H,ee).end()}),U.e("".concat(h," failed. error:"),E),Me(E)})}},{key:"_handleJoinResult",value:function(a){var c,h=this,m=a.group,y=a.avChatRoomFlag,b=a.longPollingKey,I=a.startSeq,E=a.avChatRoomKey,R=a.messageList,F=m.groupID;return y===1?(this.getModule(ct).setCompleted("".concat(T.CONV_GROUP).concat(F)),this._groupAttributesHandler.initGroupAttributesCache({groupID:F,avChatRoomKey:E}),this._groupCountersHandler.initGroupCountersCache({groupID:F,avChatRoomKey:E}),(c=Ge(b)?this._AVChatRoomHandler.handleJoinResult({group:m}):this._AVChatRoomHandler.startRunLoop({group:m,longPollingKey:b,startSeq:I})).then(function(){h._onAVChatRoomHistoryMessage(R)}),c):(this.emitGroupListUpdate(!0,!1),ht({status:Ji,group:m}))}},{key:"quitGroup",value:function(a){var c=this,h="".concat(this._n,".").concat("quitGroup");U.l("".concat(h," groupID:").concat(a));var m=this.checkJoinedAVChatRoomByID(a);if(!m&&!this.hasLocalGroup(a))return Me({code:De.MEMBER_NOT_IN_GRP});if(m&&!this.isLoggedIn())return U.l("".concat(h," anonymously ok. groupID:").concat(a)),this.deleteLocalGroupAndConversation(a),this._AVChatRoomHandler.reset(a),At({groupID:a});var y=new We("quitGroup");return y.setMessage("groupID:".concat(a)),this.request({protocolName:a_,requestData:{groupID:a}}).then(function(){return y.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok")),c.deleteLocalGroupAndConversation(a),m&&c._AVChatRoomHandler.reset(a),c._groupAttributesHandler.deleteLocalGroupAttributes(a),ht({groupID:a})}).catch(function(b){return c.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).end()}),U.e("".concat(h," failed. error:"),b),Me(b)})}},{key:"searchGroupByID",value:function(a){var c=this,h="".concat(this._n,".").concat("searchGroupByID"),m={groupIDList:[a]},y=new We("searchGroupByID");return y.setMessage("groupID:".concat(a)),U.l("".concat(h," groupID:").concat(a)),this.request({protocolName:l_,requestData:m}).then(function(b){var I=b.data.groupProfile;if(I[0].errorCode!==0)throw new Un({code:I[0].errorCode,message:I[0].errorInfo});return y.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok")),ht({group:new wl(I[0])})}).catch(function(b){return c.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).end()}),U.w("".concat(h," failed. error:"),b),Me(b)})}},{key:"changeGroupOwner",value:function(a){var c=this,h="".concat(this._n,".").concat("changeGroupOwner");if(this.hasLocalGroup(a.groupID)&&this.getLocalGroupProfile(a.groupID).type===T.GRP_AVCHATROOM)return Me({code:De.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(a.newOwnerID===this.getMyUserID())return Me({code:De.CANNOT_CHANGE_OWNER_TO_SELF});var m=new We("changeGroupOwner");return m.setMessage("groupID:".concat(a.groupID," newOwnerID:").concat(a.newOwnerID)),U.l("".concat(h," groupID:").concat(a.groupID)),this.request({protocolName:u_,requestData:a}).then(function(){m.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok"));var y=a.groupID,b=a.newOwnerID;c.groupMap.get(y).ownerID=b;var I=c._groupMemberHandler.getLocalGroupMemberList(y);if(I instanceof Map){var E=I.get(c.getMyUserID());Ge(E)||(E.updateRole("Member"),c.groupMap.get(y).selfInfo.role="Member");var R=I.get(b);Ge(R)||R.updateRole("Owner")}return c.emitGroupListUpdate(!0,!1),ht({group:c.groupMap.get(y)})}).catch(function(y){return c.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.e("".concat(h," failed. error:"),y),Me(y)})}},{key:"getGroupApplicationList",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:"handleGroupApplication",value:function(a){var c,h,m,y,b,I=this,E="".concat(this._n,".").concat("handleGroupApplication"),R=a.handleAction,F=a.handleMessage,H=a.message,ee=a.application;H?(c=H.payload.operatorID,h=H.payload.groupProfile.groupID,m=H.payload.authentication,y=H.payload.messageKey):ee&&(c=ee.applicant,h=ee.groupID,m=ee.authentication,y=ee.messageKey);var ge=c_;ee&&ee.applicationType===2&&(ge=d_,b=ee.userID);var be=new We("handleGroupApplication");return be.setMessage("groupID:".concat(h)),U.l("".concat(E," groupID:").concat(h)),this.request({protocolName:ge,requestData:{handleAction:R,handleMessage:F,applicant:c,invitee:b,groupID:h,authentication:m,messageKey:y}}).then(function(){return be.setNetworkType(I.getNetworkType()).end(),U.l("".concat(E," ok")),H&&I._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[a.message]}),ht({group:I.getLocalGroupProfile(h)})}).catch(function(we){return I.probeNetwork().then(function(Ue){var qe=A(Ue,2),nt=qe[0],mt=qe[1];be.setError(we,nt,mt).end()}),U.e("".concat(E," failed. error"),we),Me(we)})}},{key:"handleGroupInvitation",value:function(a){var c=this,h="".concat(this._n,".").concat("handleGroupInvitation"),m=a.message.payload,y=m.groupProfile.groupID,b=m.authentication,I=m.messageKey,E=m.operatorID,R=a.handleAction,F=new We("handleGroupInvitation");return F.setMessage("groupID:".concat(y," inviter:").concat(E," handleAction:").concat(R)),U.l("".concat(h," groupID:").concat(y," inviter:").concat(E," handleAction:").concat(R)),this.request({protocolName:f_,requestData:r(r({},a),{},{inviter:E,groupID:y,authentication:b,messageKey:I})}).then(function(){return F.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok")),c._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[a.message]}),ht({group:c.getLocalGroupProfile(y)})}).catch(function(H){return c.probeNetwork().then(function(ee){var ge=A(ee,2),be=ge[0],we=ge[1];F.setError(H,be,we).end()}),U.e("".concat(h," failed. error"),H),Me(H)})}},{key:"getGroupOnlineMemberCount",value:function(a){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(a)?this._AVChatRoomHandler.getGroupOnlineMemberCount(a):At({memberCount:0})}},{key:"hasLocalGroup",value:function(a){return this.groupMap.has(a)}},{key:"deleteLocalGroupAndConversation",value:function(a){var c=this.checkJoinedAVChatRoomByID(a);if(U.l("".concat(this._n,".deleteLocalGroupAndConversation isJoinedAVChatRoom:").concat(c)),c&&this.getModule(ct).deleteLocalConversation("".concat(T.CONV_GROUP).concat(a)),go({groupID:a})){var h=this.getLocalGroupProfile(a);h&&h.isSupportTopic===!0&&this.getModule(sr).deleteTopicListInCommunity(a)}this._deleteLocalGroup(a),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(a){this.groupMap.delete(a),this._groupMemberHandler.deleteGroupMemberList(a)}},{key:"sendMessage",value:function(a,c){if(rt(a._receiverList)&&a._receiverList.length>0&&!this.canIUse(ve.MSG_TO_SPECIFIED_GRP_MBR))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var h=this.createGroupMessagePack(a,c);return this.request(h)}},{key:"createGroupMessagePack",value:function(a,c){var h=null;c&&c.offlinePushInfo&&(h=c.offlinePushInfo);var m="";Et(a.cloudCustomData)&&a.cloudCustomData.length>0&&(m=a.cloudCustomData);var y=[];if(yn(c)&&yn(c.messageControlInfo)){var b=c.messageControlInfo,I=b.excludedFromUnreadCount,E=b.excludedFromLastMessage,R=b.excludedFromContentModeration;I===!0&&y.push("NoUnread"),E===!0&&y.push("NoLastMsg"),R===!0&&y.push("NoMsgCheck")}var F=void 0;rt(a._receiverList)&&a._receiverList.length>0&&(F=a._receiverList,a._receiverList.length>50&&(F=a._receiverList.slice(0,50),this.outputWarning("ReceiverListLimit")));var H=this.isOnlineMessage(a,c)?1:0,ee=a.getGroupAtInfoList(),ge={fromAccount:this.getMyUserID(),groupID:a.to,msgBody:a.getElements(),cloudCustomData:m,random:a.random,priority:a.priority,clientSequence:a.clientSequence,groupAtInfo:a.type!==T.MSG_TEXT||Ye(ee)?void 0:ee,onlineOnlyFlag:H,clientTime:a.clientTime,offlinePushInfo:h?{pushFlag:h.disablePush===!0?1:0,title:h.title||"",desc:h.description||"",ext:h.extension||"",apnsInfo:{badgeMode:h.ignoreIOSBadge===!0?1:0,isVoipPush:this._isVoipPush(h)},androidInfo:{OPPOChannelID:h.androidOPPOChannelID||""}}:void 0,messageControlInfo:H===0?y:void 0,needReadReceipt:a.needReadReceipt!==!0||this.isMessageFromOrToAVChatroom(a.to)?0:1,receiverList:F,isSupportExtension:a.isSupportExtension===!0?1:0};return oo(a.to)&&(ge.groupID=Lr(a.to),ge.topicID=a.to),{protocolName:Ip,tjgID:this.generateTjgID(a),requestData:ge}}},{key:"_isVoipPush",value:function(a){var c=void 0;return Ge(a.disableVoipPush)||(c=a.disableVoipPush===!1?1:0),c}},{key:"revokeMessage",value:function(a){var c={groupID:a.to,msgSeqList:[{msgSeq:a.sequence}]};return oo(a.to)&&(c.groupID=Lr(a.to),c.topicID=a.to),this.request({protocolName:p_,requestData:c})}},{key:"deleteMessage",value:function(a){var c=a.to,h=a.keyList;U.l("".concat(this._n,".deleteMessage groupID:").concat(c," count:").concat(h.length));var m={groupID:c,deleter:this.getMyUserID(),keyList:h};return oo(c)&&(m.groupID=Lr(c),m.topicID=c),this.request({protocolName:M_,requestData:m})}},{key:"modifyRemoteMessage",value:function(a){var c=a.to,h=a.sequence,m=a.payload,y=a.type,b=a.version,I=b===void 0?0:b,E=a.cloudCustomData,R=c,F=void 0;oo(c)&&(R=Lr(c),F=c);var H=void 0;return $u(y)&&(H=[]).push({type:y,content:m}),this.request({protocolName:$g,requestData:{groupID:R,topicID:F,sequence:h,version:I,elements:H,cloudCustomData:E}})}},{key:"getRoamingMessage",value:function(a){var c=this,h="".concat(this._n,".getRoamingMessage"),m=a.conversationID,y=a.groupID,b=a.sequence,I=new We("getGroupRoamingMessages"),E=0,R=void 0;return oo(y)&&(y=Lr(R=y)),this._computeLastSequence({groupID:y,topicID:R,sequence:b}).then(function(F){return E=F,U.l("".concat(h," groupID:").concat(y," startSequence:").concat(E)),c.request({protocolName:wp,requestData:{groupID:y,count:21,sequence:E,topicID:R}})}).then(function(F){var H=F.data,ee=H.messageList,ge=H.complete,be=H.invisibleSequenceList,we=be===void 0?[]:be;Ge(ee)?U.l("".concat(h," ok. complete:").concat(ge," but messageList is undefined!")):U.l("".concat(h," ok. complete:").concat(ge," count:").concat(ee.length));var Ue=c._getMinSequence(we,ee)-1;I.setNetworkType(c.getNetworkType()).setMessage("groupID:".concat(y," topicID:").concat(R," startSequence:").concat(E," complete:").concat(ge," nextSequence:").concat(Ue)).end();var qe=c.getModule(ct),nt=[];return Ye(ee)||(qe.updateRoamingMessageSequence(m,Ue),nt=qe.onRoamingMessage(ee,m),qe.updateIsRead(m),qe.patchConversationLastMessage(m)),(ge===2||Ue<=1)&&(qe.setCompleted(m),Ue=""),U.l("".concat(h," nextReqID:").concat(Ue,", stored message count:").concat(nt.length,", invisible sequence count:").concat(we.length)),{nextReqID:Ue+"",storedMessageList:nt}}).catch(function(F){return c.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];I.setError(F,ge,be).setMessage("groupID:".concat(y," topicID:").concat(R," startSequence:").concat(E)).end()}),U.w("".concat(h," failed. error:"),F),Me(F)})}},{key:"_getGroupIDOfMessage",value:function(a){return a.conversationID.replace(T.CONV_GROUP,"")}},{key:"_getMinSequence",value:function(a,c){var h=0;Ye(c)||(h=c[c.length-1].sequence);var m=0;return Ye(a)||(m=a[a.length-1]),U.l("".concat(this._n,"._getMinSequence minVisibleSequence:").concat(h," minInvisibleSequence:").concat(m)),m>0&&m=100?100:b,we="groupID:".concat(I," sequence:").concat(R," cursor:").concat(ge," filter:").concat(ee," completeFlag:").concat(H);U.l("".concat(F," ").concat(we));var Ue={cursor:"",isCompleted:!1,messageID:E,unreadUserIDList:[],readUserIDList:[]},qe=new We("getReadReceiptDetail");return qe.setMessage(we),this.request({protocolName:y_,requestData:{groupID:I,sequence:R,flag:ee,cursor:ge,count:be}}).then(function(nt){qe.end();var mt=nt.data,Pt=mt.cursor,gn=mt.isCompleted,_n=mt.unreadUserIDList,Or=mt.readUserIDList;return Ue.cursor=Pt,gn===1&&(Ue.isCompleted=!0,c._receiptDetailCompleteMap.set(E,!0)),ee===0?Ue.readUserIDList=Or.map(function(lo){return lo.userID}):ee===1&&(Ue.unreadUserIDList=_n.map(function(lo){return lo.userID})),U.l("".concat(F," ok")),ht(Ue)}).catch(function(nt){return c.probeNetwork().then(function(mt){var Pt=A(mt,2),gn=Pt[0],_n=Pt[1];qe.setError(nt,gn,_n).end()}),U.w("".concat(F," failed. error:"),nt),Me(nt)})}},{key:"getRoamingMessagesHopping",value:function(a){var c=this,h="".concat(this._n,".getRoamingMessagesHopping"),m=new We("getGroupRoamingMessagesHopping"),y=a.groupID,b=a.count,I=a.sequence,E=a.direction,R=I;E===1&&(R=I+b-1);var F=void 0;oo(y)&&(y=Lr(F=y));var H="".concat(F?"topicID:".concat(F):"groupID:".concat(y)," sequence:").concat(I," direction:").concat(E);return U.l("".concat(h," ").concat(H)),this.request({protocolName:wp,requestData:{groupID:y,topicID:F,count:b,sequence:R}}).then(function(ee){var ge=ee.data,be=ge.messageList,we=ge.complete,Ue="complete:".concat(we," count:").concat(be?be.length:0);if(U.l("".concat(h," ok. ").concat(Ue)),m.setNetworkType(c.getNetworkType()).setMessage("".concat(H," ").concat(Ue)).end(),we===2||Ye(be)){var qe=c._computeResult();return ht(qe)}var nt="".concat(T.CONV_GROUP).concat(a.groupID),mt=c.getModule(ct).onRoamingMessage(be,nt,!1),Pt=c._computeResult({direction:E,sequence:I,remoteMessageList:be,processedMessageList:mt});return ht(Pt)}).catch(function(ee){return c.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];m.setError(ee,we,Ue).setMessage("groupID:".concat(y," sequence:").concat(I," count:").concat(b)).end()}),U.w("".concat(h," failed. error:"),ee),Me(ee)})}},{key:"_computeResult",value:function(a){var c={messageList:[],isCompleted:!1,nextMessageSeq:""};if(Ge(a))return c.isCompleted=!0,c;var h=a.direction,m=a.sequence,y=a.remoteMessageList,b=y===void 0?[]:y,I=a.processedMessageList,E=I===void 0?[]:I,R=b.length;return h===1?(c.nextMessageSeq=b[0].sequence+1,E.forEach(function(F){F.sequence>=m&&c.messageList.push(F)}),c.messageList.length===0&&b[0].sequence0?Promise.resolve(y):Ge(m)||this.hasLocalGroup(c)?Ge(m)?this.getGroupLastSequence(c):this.getTopicLastSequence({groupID:c,topicID:m}):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(a){var c=this,h="".concat(this._n,".").concat("getGroupLastSequence"),m=new We("getGroupLastSequence"),y=0,b="";if(this.hasLocalGroup(a)){var I=this.getLocalGroupProfile(a),E=I.lastMessage;if(E.lastSequence>0&&E.onlineOnlyFlag===!1)return y=E.lastSequence,b="got lastSequence:".concat(y," from local group profile[lastMessage.lastSequence]. groupID:").concat(a),U.l("".concat(h," ").concat(b)),m.setNetworkType(this.getNetworkType()).setMessage("".concat(b)).end(),Promise.resolve(y);if(I.nextMessageSeq>1)return y=I.nextMessageSeq-1,b="got lastSequence:".concat(y," from local group profile[nextMessageSeq]. groupID:").concat(a),U.l("".concat(h," ").concat(b)),m.setNetworkType(this.getNetworkType()).setMessage("".concat(b)).end(),Promise.resolve(y)}var R="GROUP".concat(a),F=this.getModule(ct).getLocalConversation(R);if(F&&F.lastMessage.lastSequence&&F.lastMessage.onlineOnlyFlag===!1)return y=F.lastMessage.lastSequence,b="got lastSequence:".concat(y," from local conversation profile[lastMessage.lastSequence]. groupID:").concat(a),U.l("".concat(h," ").concat(b)),m.setNetworkType(this.getNetworkType()).setMessage("".concat(b)).end(),Promise.resolve(y);var H={groupIDList:[a],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}};return this.getGroupProfileAdvance(H).then(function(ee){var ge=ee.data.successGroupList;return Ye(ge)?U.l("".concat(h," successGroupList is empty. groupID:").concat(a)):(y=ge[0].nextMessageSeq-1,b="got lastSequence:".concat(y," from getGroupProfileAdvance. groupID:").concat(a),U.l("".concat(h," ").concat(b))),m.setNetworkType(c.getNetworkType()).setMessage("".concat(b)).end(),y}).catch(function(ee){return c.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];m.setError(ee,we,Ue).setMessage("get lastSequence failed from getGroupProfileAdvance. groupID:".concat(a)).end()}),U.w("".concat(h," failed. error:"),ee),Me(ee)})}},{key:"getTopicLastSequence",value:function(a){var c=this,h=a.groupID,m=a.topicID,y="".concat(this._n,".").concat("getTopicLastSequence"),b=new We("getTopicLastSequence"),I=0,E="",R=this.getModule(sr);return R.hasLocalTopic(h,m)?(I=R.getLocalTopic(h,m).nextMessageSeq-1,E="get lastSequence:".concat(I," from local topic info[nextMessageSeq]. topicID:").concat(m),U.l("".concat(y," ").concat(E)),b.setNetworkType(this.getNetworkType()).setMessage("".concat(E)).end(),Promise.resolve(I)):R.getTopicList({groupID:h,topicIDList:[m]}).then(function(F){var H=F.data.successTopicList;return Ye(H)?U.l("".concat(y," successTopicList is empty. topicID:").concat(m)):(I=H[0].nextMessageSeq-1,E="get lastSequence:".concat(I," from getTopicList. topicID:").concat(m),U.l("".concat(y," ").concat(E))),b.setNetworkType(c.getNetworkType()).setMessage("".concat(E)).end(),I}).catch(function(F){return c.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];b.setError(F,ge,be).setMessage("get lastSequence failed from getTopicList. topicID:".concat(m)).end()}),U.w("".concat(y," failed. error:"),F),Me(F)})}},{key:"isMessageFromOrToAVChatroom",value:function(a){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(a)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.hasJoinedAVChatRoom()}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.getJoinedAVChatRoom()}},{key:"isOnlineMessage",value:function(a,c){return!(!this._canIUseOnlineOnlyFlag(a)||!c||c.onlineUserOnly!==!0)}},{key:"_canIUseOnlineOnlyFlag",value:function(a){var c=this.getJoinedAVChatRoom();return!c||!c.includes(a.to)||a.conversationType!==T.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(a){if(!Ye(a)){U.l("".concat(this._n,"._onAVChatRoomHistoryMessage count:").concat(a.length));var c=[];a.forEach(function(h){c.push(r(r({},h),{},{isHistoryMessage:1}))}),this.onAVChatRoomMessage(c)}}},{key:"onAVChatRoomMessage",value:function(a){this._AVChatRoomHandler.onMessage(a)}},{key:"onAVChatRoomMemberBanned",value:function(a){this._AVChatRoomHandler.onAVChatRoomMemberBanned(a)}},{key:"getGroupSimplifiedInfo",value:function(a){var c=this,h=new We("getGroupSimplifiedInfo"),m={groupIDList:[a],responseFilter:{groupBaseInfoFilter:["Type","Name"]}};return this.getGroupProfileAdvance(m).then(function(y){var b=y.data.successGroupList;return h.setNetworkType(c.getNetworkType()).setMessage("groupID:".concat(a," type:").concat(b[0].type)).end(),b[0]}).catch(function(y){c.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];h.setError(y,E,R).setMessage("groupID:".concat(a)).end()})})}},{key:"setUnjoinedAVChatRoom",value:function(a){this._unjoinedAVChatRoomList.set(a,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(a){this._unjoinedAVChatRoomList.has(a)&&this._unjoinedAVChatRoomList.delete(a)}},{key:"isUnjoinedAVChatRoom",value:function(a){return this._unjoinedAVChatRoomList.has(a)}},{key:"isGroupAttributesUpdatedNotice",value:function(a){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(a)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(a){return this._groupAttributesHandler.initGroupAttributes(a)}},{key:"setGroupAttributes",value:function(a){return this._groupAttributesHandler.setGroupAttributes(a)}},{key:"deleteGroupAttributes",value:function(a){return this._groupAttributesHandler.deleteGroupAttributes(a)}},{key:"getGroupAttributes",value:function(a){return this._groupAttributesHandler.getGroupAttributes(a)}},{key:"isMessageFromTopic",value:function(a,c){return a===2&&!Ye(c)}},{key:"isMessageFromCommunityOfTopic",value:function(a,c){return a===2&&Ye(c)}},{key:"getMessageExtensions",value:function(a,c){return U.l("".concat(this._n,".getMessageExtensions startSequence:").concat(c)),this.request({protocolName:Wg,requestData:{groupID:a.to,messageSequence:a.sequence,startSequence:c}})}},{key:"modifyMessageExtensions",value:function(a,c){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return U.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(h)),this.request({protocolName:jg,requestData:{groupID:a.to,messageSequence:a.sequence,extensionList:c,operateType:h}})}},{key:"_genNotifyReqList",value:function(a){for(var c=[],h=0,m=a.length;h0&&c.getGroupNotify(E);var F="nextGroupIDList.length:".concat(E.length);E.length<=10&&(F="nextGroupIDList:".concat(JSON.stringify(E))),U.l("".concat(h," ").concat(F))}).catch(function(b){U.e("".concat(h," failed. error:"),b)})}},{key:"_genRevokedInfos",value:function(a){var c=a.notifyList,h=a.groupID,m=[];return rt(c)&&c.forEach(function(y){m.push({groupID:h,sequence:y.sequence,random:y.random,revokerInfo:r({},y.revokerInfo)})}),m}},{key:"_getGroupLastRevokedTime",value:function(a){return this.hasLocalGroup(a)?this.getLocalGroupProfile(a)._lastRevokedTime:0}},{key:"_setGroupLastRevokedTime",value:function(a,c){this.hasLocalGroup(a)&&(this.getLocalGroupProfile(a)._lastRevokedTime=c)}},{key:"isGroupCountersNotice",value:function(a){return this._groupCountersHandler.isGroupCountersNotice(a)}},{key:"setGroupCounters",value:function(a){return this._groupCountersHandler.setGroupCounters(a)}},{key:"increaseGroupCounter",value:function(a){return this._groupCountersHandler.increaseGroupCounter(a)}},{key:"decreaseGroupCounter",value:function(a){return this._groupCountersHandler.decreaseGroupCounter(a)}},{key:"getGroupCounters",value:function(a){return this._groupCountersHandler.getGroupCounters(a)}},{key:"getGroupMemberHandler",value:function(){return this._groupMemberHandler}},{key:"getGroupMemberList",value:function(a){return this._groupMemberHandler.getGroupMemberList(a)}},{key:"getGroupMemberProfile",value:function(a){return this._groupMemberHandler.getGroupMemberProfile(a)}},{key:"addGroupMember",value:function(a){return this._groupMemberHandler.addGroupMember(a)}},{key:"deleteGroupMember",value:function(a){return this._groupMemberHandler.deleteGroupMember(a)}},{key:"setGroupMemberMuteTime",value:function(a){return this._groupMemberHandler.setGroupMemberMuteTime(a)}},{key:"setGroupMemberRole",value:function(a){return this._groupMemberHandler.setGroupMemberRole(a)}},{key:"setGroupMemberNameCard",value:function(a){return this._groupMemberHandler.setGroupMemberNameCard(a)}},{key:"setGroupMemberCustomField",value:function(a){return this._groupMemberHandler.setGroupMemberCustomField(a)}},{key:"markGroupMemberList",value:function(a){return this._groupMemberHandler.markGroupMemberList(a)}},{key:"modifyGroupMemberInfo",value:function(a){return this._groupMemberHandler.modifyGroupMemberInfo(a)}},{key:"restartPolling",value:function(){this._AVChatRoomHandler.restartPolling()}},{key:"getPollingTimerID",value:function(a){if(!a)return-1;var c=this.getLocalGroupProfile(a);return c&&Go(c.type)?this._AVChatRoomHandler.getPollingTimerID(a):-1}},{key:"_canIUseJoinOption",value:function(a){return function(c){return c===T.GRP_PUBLIC}(a)||go({type:a})}},{key:"reset",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._groupAttributesHandler.reset(),this._groupCountersHandler.reset(),this._AVChatRoomHandler.reset(),this._groupMemberHandler.reset()}}]),p}(Sr),R6=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],xw=function(k,l){return Ye(k)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",version:0,cloudCustomData:"",isRevoked:!1,revoker:null}:{lastTime:k.time||0,lastSequence:k.sequence||0,fromAccount:k.from||"",payload:k.payload||null,type:k.type||"",messageForShow:Gu(k.type,k.payload,l),nick:k.nick||"",version:k.version||0,cloudCustomData:k.cloudCustomData||"",isRevoked:k.isRevoked||!1,revoker:k.revoker||null}},N6=function(){function k(l,p){i(this,k),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=xw(l.lastMessage,p),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:"",excludedUnreadSequenceList:void 0},this._initTopic(l)}return u(k,[{key:"_initTopic",value:function(l){for(var p in l)R6.indexOf(p)<0||(p==="selfInfo"?this.updateSelfInfo(l[p]):this[p]=p==="muteAllMembers"?l[p]===1:l[p])}},{key:"updateUnreadCount",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.unreadCount=l}},{key:"updateNextMessageSeq",value:function(l){this.nextMessageSeq=l}},{key:"updateLastMessage",value:function(l){this.lastMessage=xw(l)}},{key:"updateGroupAtInfoList",value:function(l){this.groupAtInfoList=JSON.parse(JSON.stringify(l))}},{key:"updateTopic",value:function(l){Ge(l.selfInfo)||this.updateSelfInfo(l.selfInfo),Ge(l.muteAllMembers)||(this.muteAllMembers=l.muteAllMembers===1),Ri(this,l,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(l){return Ri(this.selfInfo,l,[],[""])!==0}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(l){return l.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(l){this.lastMessage.isRevoked=l}},{key:"setLastMessageRevoker",value:function(l){this.lastMessage.revoker=l}}]),k}(),P6=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="TopicModule",c._topicMap=new Map,c._getTopicTimeMap=new Map,c.TOPIC_CACHE_TIME=300,c.TOPIC_LAST_ACTIVE_TIME=3600,c.getInnerEmitterInstance().on(nr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"_onCloudConfigUpdated",value:function(){var a=this.getCloudConfig("topic_cache_time"),c=this.getCloudConfig("topic_last_active_time");Ge(a)||(this.TOPIC_CACHE_TIME=Number(a)),Ge(c)||(this.TOPIC_LAST_ACTIVE_TIME=Number(c))}},{key:"onTopicCreated",value:function(a){var c=a.groupID;this.resetGetTopicTime(c),this.emitOuterEvent(O.TOPIC_CREATED,a)}},{key:"onTopicDeleted",value:function(a){var c=this,h=a.groupID,m=a.topicIDList;(m===void 0?[]:m).forEach(function(y){c._deleteLocalTopic(h,y)}),this.emitOuterEvent(O.TOPIC_DELETED,a)}},{key:"onTopicMessageRemindTypeUpdated",value:function(a){var c=a.groupID,h=a.topicID,m=a.messageRemindType,y=this.getLocalTopic(c,h);if(y){var b=y.updateSelfInfo({messageRemindType:m});b&&this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:c,topic:y}),U.d("".concat(this._n,".onTopicMessageRemindTypeUpdated topicID:").concat(h)+" messageRemindType:".concat(m," isTopicUpdated:").concat(b))}}},{key:"onTopicProfileUpdated",value:function(a){var c=a.groupID,h=a.topicID,m=this.getLocalTopic(c,h);m&&(m.updateTopic(a),this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:c,topic:m}))}},{key:"onConversationProxy",value:function(a){var c=a.topicID,h=a.unreadCount,m=a.groupAtInfoList,y=Lr(c),b=this.getLocalTopic(y,c),I=!1;b&&(Ge(h)||b.unreadCount===h||(b.updateUnreadCount(h),I=!0),Ge(m)||(b.updateGroupAtInfoList(m),I=!0)),I&&this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:y,topic:b})}},{key:"onMessageSent",value:function(a){var c=a.groupID,h=a.topicID,m=a.lastMessage,y=this.getLocalTopic(c,h);y&&(y.nextMessageSeq+=1,y.updateLastMessage(m),this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:c,topic:y}))}},{key:"onMessageModified",value:function(a){var c=a.to,h=a.time,m=a.sequence,y=a.elements,b=a.cloudCustomData,I=a.messageVersion,E=Lr(c),R=this.getLocalTopic(E,c);if(R){var F=R.lastMessage;U.d("".concat(this._n,".onMessageModified topicID:").concat(c," lastMessage:"),JSON.stringify(F),"options:",JSON.stringify(a)),F&&(F.payload===null||F.lastTime===h&&F.lastSequence===m&&F.version!==I)&&(F.type=y[0].type,F.payload=y[0].content,F.messageForShow=Gu(F.type,F.payload,this.isIntl()),F.cloudCustomData=b,F.version=I,F.lastSequence=m,F.lastTime=h,this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:E,topic:R}))}}},{key:"onMessageRevoked",value:function(a){var c=this;if(a.length!==0){var h=null,m=null,y=!1;a.forEach(function(b){var I=b.to;m=Lr(I),(h=c.getLocalTopic(m,I))&&(h.reduceUnreadCount()&&(y=!0),h.isLastMessageRevoked(b)&&(h.setLastMessageRevoked(!0),h.setLastMessageRevoker(b.revoker),y=!0))}),y&&this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:m,topic:h})}}},{key:"isLastMessageRevoked",value:function(a){var c=a.topicID,h=a.sequence,m=Lr(c),y=this.getLocalTopic(m,c),b=!1;return y&&(b=y.isLastMessageRevoked({sequence:h})),b}},{key:"getJoinedCommunityList",value:function(){return this.getModule(Mt).syncCommunityWithTopic()}},{key:"createTopicInCommunity",value:function(a){var c=this,h="".concat(this._n,".").concat("createTopicInCommunity"),m=a.topicID;if(!Ge(m)&&!oo(m))return Me({code:De.ILLEGAL_TOPIC_ID});if(a.topicName&&this._filterProfanity("topicName",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return Me({code:De.PROFANITY_FOUND});var y=new We("createTopicInCommunity");return this.request({protocolName:B_,requestData:r({},a)}).then(function(b){var I=b.data.topicID;return y.setMessage("topicID:".concat(I)).setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok. topicID:").concat(I)),c._updateTopicMap([r(r({},a),{},{topicID:I})]),ht({topicID:I})}).catch(function(b){return c.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).end()}),U.e("".concat(h," failed. error:"),b),Me(b)})}},{key:"deleteTopicFromCommunity",value:function(a){var c=this,h="".concat(this._n,".").concat("deleteTopicFromCommunity"),m=a.groupID,y=a.topicIDList,b=y===void 0?[]:y,I=new We("deleteTopicFromCommunity");return I.setMessage("groupID:".concat(m," topicIDList:").concat(b)),this.request({protocolName:H_,requestData:{groupID:m,topicIDList:b}}).then(function(E){var R=E.data.resultList,F=[],H=[];(R===void 0?[]:R).forEach(function(ge){var be=ge.topicID,we=ge.errorCode,Ue=ge.errorInfo;we===0?F.push({topicID:be}):H.push({topicID:be,code:we,message:Ue})});var ee="success count:".concat(F.length,", fail count:").concat(H.length);return I.setMoreMessage(ee).setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok. ").concat(ee)),F.forEach(function(ge){c._deleteLocalTopic(m,ge.topicID)}),ht({successTopicList:F,failureTopicList:H})}).catch(function(E){return c.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];I.setError(E,H,ee).end()}),U.e("".concat(h," failed. error:"),E),Me(E)})}},{key:"updateTopicProfile",value:function(a){var c=this,h="".concat(this._n,".").concat("updateTopicProfile");if(U.l("".concat(h," options:"),a),a.topicName&&this._filterProfanity("topicName",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return Me({code:De.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return Me({code:De.PROFANITY_FOUND});var m=new We("updateTopicProfile");return m.setMessage("groupID:".concat(a.groupID," topicID:").concat(a.topicID)),Ge(a.muteAllMembers)||(a.muteAllMembers=a.muteAllMembers===!0?"On":"Off"),this.request({protocolName:q_,requestData:r({},a)}).then(function(){return m.setNetworkType(c.getNetworkType()).end(),U.l("".concat(h," ok")),c._updateTopicMap([a]),ht({topic:c.getLocalTopic(a.groupID,a.topicID)})}).catch(function(y){return c.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.e("".concat(h," failed. error:"),y),Me(y)})}},{key:"getTopicList",value:function(a){var c=this,h="".concat(this._n,".").concat("getTopicList"),m=a.groupID,y=a.topicIDList,b=y===void 0?[]:y,I=b.length===0,E=new We("getTopicList");if(E.setMessage("groupID:".concat(m)),this._getTopicTimeMap.has(m)){var R=this._getTopicTimeMap.get(m),F=R.isGetAll,H=R.time;if((F||!F&&!I)&&Date.now()-H<1e3*this.TOPIC_CACHE_TIME){var ee=this._getLocalTopicList(m,b);if(I||ee.length===b.length)return E.setNetworkType(this.getNetworkType()).setMoreMessage("from cache, topic count:".concat(ee.length)).end(),U.l("".concat(h," groupID:").concat(m," from cache, topic count:").concat(ee.length)),At({successTopicList:ee,failureTopicList:[]})}}return this.request({protocolName:Qg,requestData:{groupID:m,topicIDList:b}}).then(function(ge){var be=ge.data.topicInfoList,we=[],Ue=[],qe=[];(be===void 0?[]:be).forEach(function(Pt){var gn=Pt.topic,_n=Pt.selfInfo,Or=Pt.errorCode,lo=Pt.errorInfo,Bo=gn.topicID;Or===0?(we.push(r(r({},gn),{},{selfInfo:_n})),Ue.push(Bo)):qe.push({topicID:Bo,code:Or,message:lo})}),c._updateTopicMap(we),c._handleTopicAtInfo(we);var nt="success count:".concat(Ue.length,", fail count:").concat(qe.length);E.setNetworkType(c.getNetworkType()).setMoreMessage(nt).end(),U.l("".concat(h," groupID:").concat(m," from remote, ").concat(nt));var mt=[];return Ye(Ue)||(c._getTopicTimeMap.set(m,{time:Date.now(),isGetAll:I}),mt=c._getLocalTopicList(m,Ue)),ht({successTopicList:mt,failureTopicList:qe})}).catch(function(ge){return c.probeNetwork(ge).then(function(be){var we=A(be,2),Ue=we[0],qe=we[1];E.setError(ge,Ue,qe).end()}),U.e("".concat(h," failed. error:"),ge),Me(ge)})}},{key:"hasLocalTopic",value:function(a,c){return!!this._topicMap.has(a)&&this._topicMap.get(a).has(c)}},{key:"getLocalTopic",value:function(a,c){var h=null;return this._topicMap.has(a)&&(h=this._topicMap.get(a).get(c)),h}},{key:"_getLocalTopicList",value:function(a){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],h=this._topicMap.get(a),m=[];return h&&(m=L(h.values())),c.length===0?m:m.filter(function(y){return c.includes(y.topicID)})}},{key:"_deleteLocalTopic",value:function(a,c){this._topicMap.has(a)&&this._topicMap.get(a).has(c)&&(this._topicMap.get(a).delete(c),U.l("".concat(this._n,"._deleteLocalTopic groupID:").concat(a," topicID:").concat(c)))}},{key:"_updateTopicMap",value:function(a){var c=this,h=[];a.forEach(function(m){var y=m.groupID,b=m.topicID,I=null;c._topicMap.has(y)||c._topicMap.set(y,new Map),c._topicMap.get(y).has(b)?(I=c._topicMap.get(y).get(b)).updateTopic(m):(c._getTopicLastMessage(m),I=new N6(m,c.isIntl()),c._topicMap.get(y).set(b,I));var E=c._computeUnreadCount(I);I.updateUnreadCount(E),h.push({conversationID:"".concat(T.CONV_GROUP).concat(b),type:T.CONV_TOPIC,unreadCount:E})}),h.length>0&&this.getModule(ct).updateTopicConversation(h)}},{key:"resetGetTopicTime",value:function(a){var c=this;Ge(a)?L(this._getTopicTimeMap.keys()).forEach(function(h){c._getTopicTimeMap.set(h,0)}):this._getTopicTimeMap.set(a,0)}},{key:"getTopicListOnReconnected",value:function(){var a=this,c=L(this._topicMap.keys()),h=[],m=this.getModule(ct);c.forEach(function(y){var b=[],I=a._getLocalTopicList(y);m.deleteTopicRoamingMessageInfo(y),I.forEach(function(E){var R=E.lastMessage.lastTime,F=R===void 0?0:R;Date.now()-1e3*F<1e3*a.TOPIC_LAST_ACTIVE_TIME&&b.push(E.topicID)}),b.length>0&&h.push({groupID:y,topicIDList:b})}),U.l("".concat(this._n,".getTopicListOnReconnected. active community count:").concat(h.length)),this._relayGetTopicList(h)}},{key:"_relayGetTopicList",value:function(a){var c=this;if(a.length!==0){var h=a.shift(),m=h.topicIDList.length>5?"topicIDList.length:".concat(h.topicIDList.length):"topicIDList:".concat(h.topicIDList),y=new We("relayGetTopicList");y.setMessage(m),U.l("".concat(this._n,"._relayGetTopicList. ").concat(m)),this.getTopicList(h).then(function(){y.setNetworkType(c.getNetworkType()).end(),c._relayGetTopicList(a)}).catch(function(b){c.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).end()}),c._relayGetTopicList(a)})}}},{key:"_handleTopicAtInfo",value:function(a){var c=this;a.length!==0&&a.forEach(function(h){var m=h.groupID,y=h.topicID,b=h.groupAtInfoList,I=[];Ge(b)||(b.forEach(function(E){I.push(r(r({},E),{},{groupID:m,topicID:y}))}),c.getModule(ct).onNewGroupAtTips({dataList:I}))})}},{key:"_getTopicLastMessage",value:function(a){if(!Ge(a.lastMsg)){var c={time:a.lastMsg.time,sequence:a.lastMsg.sequence,from:a.lastMsg.from,payload:a.lastMsg.elements[0]?a.lastMsg.elements[0].content:null,type:a.lastMsg.elements[0]?a.lastMsg.elements[0].type:"",nick:a.lastMsg.nick,version:a.lastMsg.messageVersion,cloudCustomData:a.lastMsg.cloudCustomData,isRevoked:a.lastMsg.isPlaceMessage===2,revoker:Ye(a.lastMsg.revokerInfo)?null:a.lastMsg.revokerInfo.revoker};a.lastMessage=c}}},{key:"deleteTopicListInCommunity",value:function(a){var c=this,h=this._getLocalTopicList(a),m=this.getModule(ct);h.forEach(function(y){var b=y.topicID;c._deleteLocalTopic(a,b),c._getTopicTimeMap.delete(a),m.deleteLocalConversation("".concat(T.CONV_GROUP).concat(b))})}},{key:"_computeUnreadCount",value:function(a){var c=a.selfInfo,h=c.excludedUnreadSequenceList,m=c.readedSequence,y=a.nextMessageSeq-a.selfInfo.readedSequence-1;if(rt(h)){var b=0;h.forEach(function(I){I>=m&&I<=a.nextMessageSeq-1&&(b+=1)}),b>=1&&(y-=b)}return y<0?0:y}},{key:"_filterProfanity",value:function(a,c){var h=this.getModule(Ga);if(!h)return!0;var m=h.filterText(c[a],ce),y=m.isAllowedToSend,b=m.modifiedText;return y===!0&&(c[a]=b,!0)}},{key:"updateLastMessage",value:function(a,c){var h=Lr(a),m=this.getLocalTopic(h,a);if(m){var y=c.sequence+1;m.updateNextMessageSeq(y),m.updateLastMessage(c),this.emitOuterEvent(O.TOPIC_UPDATED,{groupID:h,topic:m})}}},{key:"getMessageExtensions",value:function(a,c){U.l("".concat(this._n,".getMessageExtensions startSequence:").concat(c));var h=Lr(a.to);return this.request({protocolName:Wg,requestData:{groupID:h,topicID:a.to,messageSequence:a.sequence,startSequence:c}})}},{key:"modifyMessageExtensions",value:function(a,c){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;U.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(h));var m=Lr(a.to);return this.request({protocolName:jg,requestData:{groupID:m,topicID:a.to,messageSequence:a.sequence,extensionList:c,operateType:h}})}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),p}(Sr),x6=function(){function k(l){i(this,k),this._userModule=l,this._n="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}return u(k,[{key:"setExpirationTime",value:function(l){this.expirationTime=l}},{key:"getUserProfile",value:function(l){var p=this,a="".concat(this._n,".").concat("getUserProfile"),c=l.userIDList;l.fromAccount=this._userModule.getMyAccount(),c.length>100&&(U.w("".concat(a," ").concat(Pa(100))),c.length=100);for(var h,m=[],y=[],b=0,I=c.length;b5?"userIDList.length:".concat(c.length):"userIDList:".concat(c)),this._userModule.request({protocolName:S0,requestData:l}).then(function(H){F.setNetworkType(p._userModule.getNetworkType()).end(),U.i("".concat(a," ok"));var ee=p._handleResponse(H).concat(y);return ht(E?ee[0]:ee)}).catch(function(H){return p._userModule.probeNetwork().then(function(ee){var ge=A(ee,2),be=ge[0],we=ge[1];F.setError(H,be,we).end()}),U.e("".concat(a," failed. error:"),H),Me(H)})}},{key:"getMyProfile",value:function(){var l=this._userModule.getMyAccount(),p="".concat(this._n,".getMyProfile");if(U.l("".concat(p," myAccount:").concat(l)),this._fill(),this._contains(l)){var a=this._getProfileFromMap(l);return U.d("".concat(p," from cache, myProfile:").concat(JSON.stringify(a))),At(a)}return this.getUserProfile({fromAccount:l,userIDList:[l],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(l){var p=l.data.userProfileItem;if(!rt(p))return[];for(var a=[],c=Date.now(),h=0,m=p.length;h-1)a.profileCustomField.push({key:p[c].tag,value:p[c].value});else switch(p[c].tag){case Gt.NICK:a.nick=p[c].value;break;case Gt.GENDER:a.gender=p[c].value;break;case Gt.BIRTHDAY:a.birthday=p[c].value;break;case Gt.LOCATION:a.location=p[c].value;break;case Gt.SELFSIGNATURE:a.selfSignature=p[c].value;break;case Gt.ALLOWTYPE:a.allowType=p[c].value;break;case Gt.LANGUAGE:a.language=p[c].value;break;case Gt.AVATAR:a.avatar=p[c].value;break;case Gt.MESSAGESETTINGS:a.messageSettings=p[c].value;break;case Gt.ADMINFORBIDTYPE:a.adminForbidType=p[c].value;break;case Gt.LEVEL:a.level=p[c].value;break;case Gt.ROLE:a.role=p[c].value;break;default:U.w("".concat(this._n,"._getLatestProfileFromResponse unknown tag:"),p[c].tag,p[c].value)}return a}},{key:"updateMyProfile",value:function(l){var p=this,a="".concat(this._n,".").concat("updateMyProfile");if(l.nick&&this._userModule.filterProfanity("nick",l)===!1)return Me({code:De.PROFANITY_FOUND});if(l.selfSignature&&this._userModule.filterProfanity("selfSignature",l)===!1)return Me({code:De.PROFANITY_FOUND});var c=new We("updateMyProfile");c.setMessage(JSON.stringify(l));var h=new Ep().validate(l);if(!h.valid)return c.setCode(De.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(h.tips)).setNetworkType(this._userModule.getNetworkType()).end(),U.e("".concat(a," info:").concat(h.tips)),Me({code:De.UPDATE_PROFILE_INVALID_PARAM});var m=[];for(var y in l)Object.prototype.hasOwnProperty.call(l,y)&&(y==="profileCustomField"?l.profileCustomField.forEach(function(E){m.push({tag:E.key,value:E.value})}):m.push({tag:Gt[y.toUpperCase()],value:l[y]}));if(m.length===0){var b=new Un({code:De.UPDATE_PROFILE_NO_KEY});return c.setError(b,!0,this._userModule.getNetworkType()).end(),U.e("".concat(a," failed. error:"),b),Me(b)}var I=this._userModule.getMyAccount();return this._userModule.request({protocolName:k0,requestData:{fromAccount:I,profileItem:m}}).then(function(E){c.setNetworkType(p._userModule.getNetworkType()).end(),U.i("".concat(a," ok"));var R=p._update(I,l),F=R.isProfileUpdated,H=R.latestProfile;return F===!0&&p._userModule.emitOuterEvent(O.PROFILE_UPDATED,[H]),At(H)}).catch(function(E){return p._userModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];c.setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"onProfileModified",value:function(l){var p=l.dataList;if(!Ye(p)){var a,c=p.length;U.d("".concat(this._n,".onProfileModified count:").concat(c," dataList:"),l.dataList);for(var h=[],m=0;m0&&(this._userModule.emitInnerEvent(nr.PROFILE_UPDATED,h),this._userModule.emitOuterEvent(O.PROFILE_UPDATED,h))}}},{key:"_fill",value:function(){if(this.accountProfileMap.size===0){for(var l=this._getCachedProfiles(),p=Date.now(),a=0,c=l.length;a0&&(a.lastUpdatedTime=h,c=!0)):(a=new Ep(p),(this._userModule.isMyFriend(l)||l===this._userModule.getMyAccount())&&(a.lastUpdatedTime=h,c=!0,this.accountProfileMap.set(l,a))),this._flush(l===this._userModule.getMyAccount()),c===!0&&U.l("".concat(this._n,"._update account:").concat(l," isProfileUpdated:").concat(c)),{isProfileUpdated:c,latestProfile:a}}},{key:"_flush",value:function(l){var p=L(this.accountProfileMap.values()),a=this._userModule.getStorageModule();U.d("".concat(this._n,"._flush length:").concat(p.length," flushAtOnce:").concat(l)),a.setItem(this.TAG,p,l)}},{key:"_contains",value:function(l){return this.accountProfileMap.has(l)}},{key:"_getProfileFromMap",value:function(l){return this.accountProfileMap.get(l)}},{key:"_getCachedProfiles",value:function(){var l=this._userModule.getStorageModule().getItem(this.TAG);return Ye(l)?[]:l}},{key:"onConversationsProfileUpdated",value:function(l){for(var p,a,c,h=[],m=0,y=l.length;m0&&h.push(a)):h.push(p.userID));h.length!==0&&(U.i("".concat(this._n,".onConversationsProfileUpdated toAccountList:").concat(h)),this.getUserProfile({userIDList:h}))}},{key:"getNickAndAvatarByUserID",value:function(l){if(this._contains(l)){var p=this._getProfileFromMap(l);return{nick:p.nick,avatar:p.avatar}}return{nick:"",avatar:""}}},{key:"reset",value:function(){this._flush(!0),this.accountProfileMap.clear()}}]),k}(),Uw=u(function k(l){i(this,k),Ye||(this.userID=l.userID||"",this.timeStamp=l.timeStamp||0)}),U6=function(){function k(l){i(this,k),this._userModule=l,this._n="BlacklistHandler",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}return u(k,[{key:"getLocalBlacklist",value:function(){return L(this._blacklistMap.keys())}},{key:"getBlacklist",value:function(){var l=this,p="".concat(this._n,".getBlacklist"),a={fromAccount:this._userModule.getMyAccount(),maxLimited:this.maxLimited,startIndex:0,lastSequence:this.currentSequence},c=new We("getBlacklist");return this._userModule.request({protocolName:D0,requestData:a}).then(function(h){var m=h.data,y=m.blackListItem,b=m.currentSequence,I=Ye(y)?0:y.length;c.setNetworkType(l._userModule.getNetworkType()).setMessage("count:".concat(I)).end(),U.i("".concat(p," ok")),l.currentSequence=b,l._handleResponse(y,!0),l._userModule.emitOuterEvent(O.BLACKLIST_UPDATED,L(l._blacklistMap.keys()))}).catch(function(h){return l._userModule.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];c.setError(h,b,I).end()}),U.e("".concat(p," failed. error:"),h),Me(h)})}},{key:"addBlacklist",value:function(l){var p=this,a=new We("addToBlacklist"),c="".concat(this._n,".addBlacklist"),h=this._userModule.getMyAccount();if(l.userIDList.length===1&&l.userIDList[0]===h){var m=De.CANNOT_ADD_SELF_TO_BLACKLIST,y=this._userModule.getErrorMessage(m);a.setCode(m).setMessage(y).setNetworkType(this._userModule.getNetworkType()).end();var b=new Un({code:m});return U.e("".concat(c," failed. error:"),b),Me(b)}return l.userIDList.includes(h)&&(l.userIDList=l.userIDList.filter(function(I){return I!==h})),l.fromAccount=this._userModule.getMyAccount(),l.toAccount=l.userIDList,this._userModule.request({protocolName:E0,requestData:l}).then(function(I){return a.setNetworkType(p._userModule.getNetworkType()).setMessage(l.userIDList.length>5?"userIDList.length:".concat(l.userIDList.length):"userIDList:".concat(l.userIDList)).end(),U.i("".concat(c," ok")),p._handleResponse(I.resultItem,!0),ht(L(p._blacklistMap.keys()))}).catch(function(I){return p._userModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];a.setError(I,F,H).end()}),U.e("".concat(c," failed. error:"),I),Me(I)})}},{key:"_handleResponse",value:function(l,p){if(!Ye(l))for(var a,c,h,m=0,y=l.length;m5?"userIDList.length:".concat(l.userIDList.length):"userIDList:".concat(l.userIDList)).end(),U.i("".concat(a," ok")),p._handleResponse(h.data.resultItem,!1),ht(L(p._blacklistMap.keys()))}).catch(function(h){return p._userModule.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];c.setError(h,b,I).end()}),U.e("".concat(a," failed. error:"),h),Me(h)})}},{key:"onAccountDeleted",value:function(l){for(var p,a=[],c=0,h=l.length;c0&&(U.l("".concat(this._n,".onAccountDeleted count:").concat(a.length," userIDList:"),a),this._userModule.emitOuterEvent(O.BLACKLIST_UPDATED,L(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(l){for(var p,a=[],c=0,h=l.length;c0&&(U.l("".concat(this._n,".onAccountAdded count:").concat(a.length," userIDList:"),a),this._userModule.emitOuterEvent(O.BLACKLIST_UPDATED,L(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),k}(),u1=function(k){var l=String(k).replace(/[=]+$/,""),p="";if(l.length%4==1)return"";for(var a,c,h=0,m=0;c=l.charAt(m++);~c&&(a=h%4?64*a+c:c,h++%4)?p+=String.fromCharCode(255&a>>(-2*h&6)):0)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c);try{return decodeURIComponent(escape(p))}catch{return""}},F6=function(){function k(l){i(this,k),this._userModule=l,this._n="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on(nr.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return u(k,[{key:"_onCloudConfigUpdated",value:function(){var l=this._userModule.getCloudConfig("status_query_count"),p=this._userModule.getCloudConfig("status_sub_count"),a=this._userModule.getCloudConfig("status_unsub_count");U.l("".concat(this._n,"._onCloudConfigUpdated statusQueryCount:").concat(l," statusSubscribeCount:").concat(p)+" statusUnsubscribeCount:".concat(a)),Ge(l)||(this.MAX_QUERY_USER_COUNT=parseInt(l,10)),Ge(l)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(p,10)),Ge(l)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(a,10))}},{key:"onUserStatusUpdated",value:function(l){var p=l.dataList,a=this._userModule.getMyUserID(),c=this._userModule.getModule(pn),h=p.map(function(m){var y=m.to,b=m.statusType,I=m.customStatus,E=u1(I);return y===a&&c.setCustomStatus(E),{userID:y,statusType:b,customStatus:E}});this._userModule.emitOuterEvent(O.USER_STATUS_UPDATED,h)}},{key:"setSelfStatus",value:function(l){var p=this,a="".concat(this._n,".setSelfStatus");if(this._userModule.filterProfanity("customStatus",l)===!1)return Me({code:De.PROFANITY_FOUND});var c=new We("setSelfStatus"),h=l.customStatus;return this._userModule.request({protocolName:V_,requestData:{customStatus:h}}).then(function(m){return c.setNetworkType(p._userModule.getNetworkType()).setMessage("customStatus:".concat(h)).end(),U.l("".concat(a," ok. customStatus:").concat(h)),p._userModule.getModule(pn).setCustomStatus(h),ht({userID:p._userModule.getMyUserID(),statusType:1,customStatus:h})}).catch(function(m){return p._userModule.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];c.setError(m,I,E).end()}),U.e("".concat(a," failed. error:"),m),Me(m)})}},{key:"getUserStatus",value:function(l){var p=this,a="".concat(this._n,".").concat("getUserStatus"),c=l.userIDList,h=c===void 0?[]:c,m=this._userModule.getMyUserID(),y=L(h),b=void 0,I=y.indexOf(m);if(I>-1){y.splice(I,1);var E=this._userModule.getModule(pn).getCustomStatus();b={userID:m,statusType:1,customStatus:E}}if(y.length===0)return At({successUserList:[b],failureUserList:[]});if(!this._userModule.canIUse(ve.USER_STATUS))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});y.length>this.MAX_QUERY_USER_COUNT&&(U.w("".concat(a," ").concat(Pa(this.MAX_QUERY_USER_COUNT))),y=h.slice(0,this.MAX_QUERY_USER_COUNT));var R=new We("getUserStatus");return this._userModule.request({protocolName:em,requestData:{userIDList:y}}).then(function(F){var H=F.data,ee=H.successUserList,ge=ee===void 0?[]:ee,be=H.failureUserList,we=be===void 0?[]:be,Ue=ge.map(function(mt){var Pt=mt.userID,gn=mt.statusType,_n=mt.customStatus;return{userID:Pt,statusType:gn,customStatus:u1(_n)}}),qe=we.map(function(mt){var Pt=mt.userID,gn=mt.invalidUserID,_n=mt.errorCode,Or=mt.errorInfo;return{userID:Ye(gn)?Pt:gn,code:_n,message:Or}});Ge(b)||Ue.unshift(b);var nt="userID count:".concat(h.length,", success count:").concat(Ue.length,", fail count:").concat(qe.length);return R.setNetworkType(p._userModule.getNetworkType()).setMessage("".concat(nt)).end(),U.l("".concat(a," ok. ").concat(nt,".")),ht({successUserList:Ue,failureUserList:qe})}).catch(function(F){return p._userModule.probeNetwork().then(function(H){var ee=A(H,2),ge=ee[0],be=ee[1];R.setMessage("userID count:".concat(h.length)).setError(F,ge,be).end()}),U.e("".concat(a," failed. error:"),F),Me(F)})}},{key:"subscribeUserStatus",value:function(l){var p=this;if(!this._userModule.canIUse(ve.USER_STATUS))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("subscribeUserStatus"),c=l.userIDList,h=c===void 0?[]:c,m=L(h);m.length>this.MAX_SUBSCRIBE_USER_COUNT&&(U.w("".concat(a," ").concat(Pa(this.MAX_SUBSCRIBE_USER_COUNT))),m=h.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var y=new We("subscribeUserStatus"),b="userID count:".concat(h.length);return U.l("".concat(a," ").concat(b)),this._userModule.request({protocolName:tm,requestData:{userIDList:m}}).then(function(I){var E=I.data.failureUserList,R=(E===void 0?[]:E).map(function(F){var H=F.userID,ee=F.invalidUserID,ge=F.errorCode,be=F.errorInfo;return{userID:Ye(ee)?H:ee,code:ge,message:be}});return y.setNetworkType(p._userModule.getNetworkType()).setMessage("".concat(b," fail count:").concat(R.length)).end(),U.l("".concat(a," ok. fail count:").concat(R.length,".")),ht({failureUserList:R})}).catch(function(I){return p._userModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setMessage("".concat(b)).setError(I,F,H).end()}),U.e("".concat(a," failed. error:"),I),Me(I)})}},{key:"unsubscribeUserStatus",value:function(l){var p=this;if(!this._userModule.canIUse(ve.USER_STATUS))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".unsubscribeUserStatus"),c=(l||{}).userIDList,h=c===void 0?[]:c,m=L(h);h.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(U.w("".concat(a," ").concat(Pa(this.MAX_UNSUBSCRIBE_USER_COUNT))),m=h.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var y=new We("unsubscribeUserStatus"),b="userID count:".concat(h.length);U.l("".concat(a," ").concat(b));var I={userIDList:m};return m.length===0&&(I.userIDList=void 0,I.unsubscribeAll=1),this._userModule.request({protocolName:nm,requestData:I}).then(function(E){var R=E.data.failureUserList,F=(R===void 0?[]:R).map(function(H){var ee=H.userID,ge=H.invalidUserID,be=H.errorCode,we=H.errorInfo;return{userID:Ye(ge)?ee:ge,code:be,message:we}});return y.setNetworkType(p._userModule.getNetworkType()).setMessage("".concat(b," fail count:").concat(F.length)).end(),U.l("".concat(a," ok. fail count:").concat(F.length,".")),ht({failureUserList:F})}).catch(function(E){return p._userModule.probeNetwork().then(function(R){var F=A(R,2),H=F[0],ee=F[1];y.setMessage("".concat(b)).setError(E,H,ee).end()}),U.e("".concat(a," failed. error:"),E),Me(E)})}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),k}(),G6=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="UserModule",c._profileHandler=new x6(w(c)),c._blacklistHandler=new U6(w(c)),c._userStatusHandler=new F6(w(c)),c.getInnerEmitterInstance().on(nr.A2KEY_AND_TINYID_UPDATED,c.onContextUpdated,w(c)),c}return u(p,[{key:"onContextUpdated",value:function(a){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"mockOnNickAvatarModified",value:function(a,c){U.l("".concat(this._n,"._mockOnNickAvatarModified nick:").concat(a," avatar:").concat(c)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:Gt.NICK,value:a},{tag:Gt.AVATAR,value:c}]}]})}},{key:"onProfileModified",value:function(a){this._profileHandler.onProfileModified(a)}},{key:"onRelationChainModified",value:function(a){var c=a.dataList;if(!Ye(c)){var h=[];c.forEach(function(y){y.blackListDelAccount&&h.push.apply(h,L(y.blackListDelAccount))}),h.length>0&&this._blacklistHandler.onAccountDeleted(h);var m=[];c.forEach(function(y){y.blackListAddAccount&&m.push.apply(m,L(y.blackListAddAccount))}),m.length>0&&this._blacklistHandler.onAccountAdded(m)}}},{key:"onConversationsProfileUpdated",value:function(a){this._profileHandler.onConversationsProfileUpdated(a)}},{key:"getMyAccount",value:function(){return this.getMyUserID()}},{key:"getMyNick",value:function(){return this._profileHandler.getNickAndAvatarByUserID(this.getMyUserID()).nick}},{key:"getMyProfile",value:function(){return this._profileHandler.getMyProfile()}},{key:"getStorageModule",value:function(){return this.getModule(na)}},{key:"filterProfanity",value:function(a,c){var h=this.getModule(Ga);if(!h)return!0;var m=h.filterText(c[a],se),y=m.isAllowedToSend,b=m.modifiedText;return y===!0&&(c[a]=b,!0)}},{key:"isMyFriend",value:function(a){var c=this.getModule(hr);return!!c&&c.isMyFriend(a)}},{key:"getUserProfile",value:function(a){return this._profileHandler.getUserProfile(a)}},{key:"updateMyProfile",value:function(a){return this._profileHandler.updateMyProfile(a)}},{key:"getNickAndAvatarByUserID",value:function(a){return this._profileHandler.getNickAndAvatarByUserID(a)}},{key:"getLocalBlacklist",value:function(){var a=this._blacklistHandler.getLocalBlacklist();return At(a)}},{key:"addBlacklist",value:function(a){return this._blacklistHandler.addBlacklist(a)}},{key:"deleteBlacklist",value:function(a){return this._blacklistHandler.deleteBlacklist(a)}},{key:"onUserStatusUpdated",value:function(a){this._userStatusHandler.onUserStatusUpdated(a)}},{key:"setSelfStatus",value:function(a){return this._userStatusHandler.setSelfStatus(a)}},{key:"getUserStatus",value:function(a){return this._userStatusHandler.getUserStatus(a)}},{key:"subscribeUserStatus",value:function(a){return this._userStatusHandler.subscribeUserStatus(a)}},{key:"unsubscribeUserStatus",value:function(a){return this._userStatusHandler.unsubscribeUserStatus(a)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),p}(Sr),$6=function(){function k(l,p){i(this,k),this._m=l,this._isLoggedIn=!1,this._SDKAppID=p.SDKAppID,this._userID=p.userID||"",this._userSig=p.userSig||"",this._version="3.1.1",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=p.unlimitedAVChatRoom,this._scene=p.scene||"",this._oversea=p.oversea,this._instanceID=p.instanceID,this._statusInstanceID=0,this._isDevMode=p.devMode,this._proxyServer=p.proxyServer,this._fileUploadProxy=p.fileUploadProxy,this._fileDownloadProxy=p.fileDownloadProxy}return u(k,[{key:"isLoggedIn",value:function(){return this._isLoggedIn}},{key:"isOversea",value:function(){return this._oversea}},{key:"isPrivateNetWork",value:function(){return this._proxyServer}},{key:"isDevMode",value:function(){return this._isDevMode}},{key:"isSingaporeSite",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7||this._SDKAppID>=172e7&&this._SDKAppID<173e7}},{key:"isKoreaSite",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7||this._SDKAppID>=173e7&&this._SDKAppID<174e7}},{key:"isGermanySite",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7||this._SDKAppID>=174e7&&this._SDKAppID<175e7}},{key:"isIndiaSite",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7||this._SDKAppID>=175e7&&this._SDKAppID<176e7}},{key:"isJapanSite",value:function(){return this._SDKAppID>=6e7&&this._SDKAppID<7e7||this._SDKAppID>=176e7&&this._SDKAppID<177e7}},{key:"isUSASite",value:function(){return this._SDKAppID>=7e7&&this._SDKAppID<8e7||this._SDKAppID>=177e7&&this._SDKAppID<178e7}},{key:"isIntl",value:function(){return(l=this._SDKAppID)===0||l>=2e7&&l<8e7||l>=172e7&&l<178e7;var l}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"setUserID",value:function(l){this._userID=l}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(l){this._userSig=l}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(l){this._tinyID=l,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(l){this._customStatus=l}},{key:"getCustomStatus",value:function(){return this._customStatus}},{key:"getScene",value:function(){return Xo?window.tencent_cloud_im_csig_flutter_for_web_25F_cy:this._isTUIKit()?"tuikit":this._scene}},{key:"getInstanceID",value:function(){return this._instanceID}},{key:"getStatusInstanceID",value:function(){return this._statusInstanceID}},{key:"setStatusInstanceID",value:function(l){this._statusInstanceID=l}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(l){this._a2Key=l}},{key:"getContentType",value:function(){return this._contentType}},{key:"getProxyServer",value:function(){return this._proxyServer}},{key:"getFileUploadProxy",value:function(){return this._fileUploadProxy}},{key:"getFileDownloadProxy",value:function(){return this._fileDownloadProxy}},{key:"_isTUIKit",value:function(){var l=!1,p=!1,a=!1,c=!1,h=[];je&&(h=Object.keys(Fe)),lt&&(h=Object.keys(Be?uni:window));for(var m=0,y=h.length;m"u"&&__wxConfig&&(I=__wxConfig.pages),xe&&typeof uni>"u"&&__qqConfig&&(I=__qqConfig.pages),rt(I)&&I.length>0){for(var E=0,R=I.length;E0&&arguments[0]!==void 0?arguments[0]:0;if(!this.isLoggedIn())return Me({code:De.USER_NOT_LOGGED_IN});var h=new We("logout");h.setNetworkType(this.getNetworkType()).setMessage("identifier:".concat(this.getMyUserID())).end(!0);var m="".concat(this._n,".logout");return U.i("".concat(m," type:").concat(c)),c===0&&this._m.setNotReadyReason(De.LOGGED_OUT),this.request({protocolName:I0,requestData:{type:c}}).then(function(){return a.resetReady(),At({})}).catch(function(y){return U.e("".concat(m," error:"),y),a.resetReady(),At({})})}},{key:"_fetchCloudControlConfig",value:function(){this.getModule(mp).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")}},{key:"_hello",value:function(){var a=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:C0,requestData:{isWebUniapp:this._isWebUniapp}}).catch(function(c){U.w("".concat(a._n,"._hello error:"),c)})}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(a){var c=0;return Ye(this.getModule(pn).getSDKAppID())?c=De.NO_SDKAPPID:Ye(a.userID)?c=De.NO_IDENTIFIER:Ye(a.userSig)&&(c=De.NO_USERSIG),{code:c}}},{key:"_isReactUIKit",value:function(){return lt&&window.tencent_cloud_im_csig_react_uikit_23F_xa!==void 0}},{key:"onMultipleAccountKickedOut",value:function(a){var c=this;new We("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(T.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(a))).end(!0),U.w("".concat(this._n,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),a),this.logout(1).then(function(){c.emitOuterEvent(O.KICKED_OUT,{type:T.KICKED_OUT_MULT_ACCOUNT}),c._m.setNotReadyReason(De.KICKED_OUT_MULT_ACCOUNT),c._m.reset()})}},{key:"onMultipleDeviceKickedOut",value:function(a){var c=this;new We("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(T.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(a))).end(!0),U.w("".concat(this._n,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),a),this.logout(1).then(function(){c.emitOuterEvent(O.KICKED_OUT,{type:T.KICKED_OUT_MULT_DEVICE}),c._m.setNotReadyReason(De.KICKED_OUT_MULT_DEVICE),c._m.reset()})}},{key:"onUserSigExpired",value:function(){new We("kickedOut").setNetworkType(this.getNetworkType()).setMessage(T.KICKED_OUT_USERSIG_EXPIRED).end(!0),U.w("".concat(this._n,".onUserSigExpired userID:").concat(this.getMyUserID())),this.getModule(pn).getStatusInstanceID()!==0&&(this.emitOuterEvent(O.KICKED_OUT,{type:T.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(De.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:"onRestApiKickedOut",value:function(a){new We("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(T.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(a))).end(!0),U.w("".concat(this._n,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),a),this.getModule(pn).getStatusInstanceID()!==0&&(this.emitOuterEvent(O.KICKED_OUT,{type:T.KICKED_OUT_REST_API}),this._m.setNotReadyReason(De.KICKED_OUT_REST_API),this._m.reset(),this.getModule(Ns).onRestApiKickedOut())}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),p}(Sr);function im(){return null}var q6=function(){function k(l){i(this,k),this._m=l,this._n="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}return u(k,[{key:"_errorTolerantHandle",value:function(){je||!Ge(window)&&this._canIUseCookies()||(this.getItem=im,this.setItem=im,this.removeItem=im,this.clear=im)}},{key:"onCheckTimer",value:function(l){if(l%20==0){if(this._storageQueue.size===0)return;this._doFlush()}}},{key:"_doFlush",value:function(){try{var l,p=G(this._storageQueue);try{for(p.s();!(l=p.n()).done;){var a=A(l.value,2),c=a[0],h=a[1];this._setStorageSync(this._getKey(c),h)}}catch(m){p.e(m)}finally{p.f()}this._storageQueue.clear()}catch(m){U.w("".concat(this._n,"._doFlush error:"),m)}}},{key:"_getPrefix",value:function(){var l=this._m.getModule(pn);return"TIM_".concat(l.getSDKAppID(),"_").concat(l.getUserID(),"_")}},{key:"_getKey",value:function(l){return"".concat(this._getPrefix()).concat(l)}},{key:"getItem",value:function(l){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];try{var a=p?this._getKey(l):l;return this.getStorageSync(a)}catch(c){return U.w("".concat(this._n,".getItem error:"),c),{}}}},{key:"setItem",value:function(l,p){var a=arguments.length>2&&arguments[2]!==void 0&&arguments[2],c=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];if(a){var h=c?this._getKey(l):l;this._setStorageSync(h,p)}else this._storageQueue.set(l,p)}},{key:"clear",value:function(){try{je?Fe.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(l){U.w("".concat(this._n,".clear error:"),l)}}},{key:"removeItem",value:function(l){var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];try{var a=p?this._getKey(l):l;this._removeStorageSync(a)}catch(c){U.w("".concat(this._n,".removeItem error:"),c)}}},{key:"getSize",value:function(l){var p=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"b";try{var c={size:0,limitSize:5242880,unit:a};if(Object.defineProperty(c,"leftSize",{enumerable:!0,get:function(){return c.limitSize-c.size}}),je&&(c.limitSize=1024*Fe.getStorageInfoSync().limitSize),l)c.size=JSON.stringify(this.getItem(l)).length+this._getKey(l).length;else if(je){var h=Fe.getStorageInfoSync(),m=h.keys;m.forEach(function(b){c.size+=JSON.stringify(p.getStorageSync(b)).length+p._getKey(b).length})}else if(this._canIUseCookies())for(var y in localStorage)localStorage.hasOwnProperty(y)&&(c.size+=localStorage.getItem(y).length+y.length);return this._convertUnit(c)}catch(b){U.w("".concat(this._n," error:"),b)}}},{key:"_convertUnit",value:function(l){var p={},a=l.unit;for(var c in p.unit=a,l)typeof l[c]=="number"&&(a.toLowerCase()==="kb"?p[c]=Math.round(l[c]/1024):a.toLowerCase()==="mb"?p[c]=Math.round(l[c]/1024/1024):p[c]=l[c]);return p}},{key:"_setStorageSync",value:function(l,p){je?q?my.setStorageSync({key:l,data:p}):Fe.setStorageSync(l,p):this._canIUseCookies()&&localStorage.setItem(l,JSON.stringify(p))}},{key:"getStorageSync",value:function(l){return je?q?my.getStorageSync({key:l}).data:Fe.getStorageSync(l):this._canIUseCookies()?JSON.parse(localStorage.getItem(l)):{}}},{key:"_removeStorageSync",value:function(l){je?q?my.removeStorageSync({key:l}):Fe.removeStorageSync(l):this._canIUseCookies()&&localStorage.removeItem(l)}},{key:"_canIUseCookies",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._doFlush()}}]),k}(),V6=function(){function k(l){i(this,k),this._n="SSOLogBody",this._report=[]}return u(k,[{key:"pushIn",value:function(l){U.d("".concat(this._n,".pushIn"),this._report.length,l),this._report.push(l)}},{key:"backfill",value:function(l){var p;rt(l)&&l.length!==0&&(U.d("".concat(this._n,".backfill"),this._report.length,l.length),(p=this._report).unshift.apply(p,L(l)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return this._report.length===0}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var l=this._report.slice();return this._reset(),l}}]),k}(),Fw=function(k){var l=k.getModule(pn);return{SDKType:10,SDKAppID:l.getSDKAppID(),SDKVersion:l.getVersion(),tinyID:Number(l.getTinyID()),userID:l.getUserID(),platform:k.getPlatform(),instanceID:l.getInstanceID(),traceID:Mn()}},z6=function(k){f(p,k);var l=N(p);function p(a){var c;i(this,p),(c=l.call(this,a))._n="EventStatModule",c.TAG="im-ssolog-event",c._reportBody=new V6,c.MIN_THRESHOLD=20,c.MAX_THRESHOLD=100,c.WAITING_TIME=6e4,c.REPORT_LEVEL=[4,5,6],c.REPORT_SDKAPPID_BLACKLIST=[],c.REPORT_TINYID_WHITELIST=[],c._lastReportTime=Date.now();var h=c.getInnerEmitterInstance();return h.on(nr.A2KEY_AND_TINYID_UPDATED,c._onLoginSuccess,w(c)),h.on(nr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"reportAtOnce",value:function(){U.d("".concat(this._n,".reportAtOnce")),this._report()}},{key:"_onLoginSuccess",value:function(){var a=this,c=this.getModule(na),h=c.getItem(this.TAG,!1);!Ye(h)&&Fo(h.forEach)&&(U.l("".concat(this._n,"._onLoginSuccess get ssolog in storage, count:").concat(h.length)),h.forEach(function(m){a._reportBody.pushIn(m)}),c.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var a=this.getCloudConfig("evt_rpt_threshold"),c=this.getCloudConfig("evt_rpt_waiting"),h=this.getCloudConfig("evt_rpt_level"),m=this.getCloudConfig("evt_rpt_sdkappid_bl"),y=this.getCloudConfig("evt_rpt_tinyid_wl");Ge(a)||(this.MIN_THRESHOLD=Number(a)),Ge(c)||(this.WAITING_TIME=Number(c)),Ge(h)||(this.REPORT_LEVEL=h.split(",").map(function(b){return Number(b)})),Ge(m)||(this.REPORT_SDKAPPID_BLACKLIST=m.split(",").map(function(b){return Number(b)})),Ge(y)||(this.REPORT_TINYID_WHITELIST=y.split(","))}},{key:"pushIn",value:function(a){a instanceof We&&(a.updateTimeStamp(),this._reportBody.pushIn(a),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:"onCheckTimer",value:function(){Date.now()a.MAX_THRESHOLD&&a._flushAtOnce()})}else this._lastReportTime=Date.now()}}},{key:"_flushAtOnce",value:function(){var a=this.getModule(na),c=a.getItem(this.TAG,!1),h=this._reportBody.getLogsInMemory(),m="".concat(this._n,"._flushAtOnce");if(Ye(c))U.l("".concat(m," count:").concat(h.length)),a.setItem(this.TAG,h,!0,!1);else{var y=h.concat(c);y.length>this.MAX_THRESHOLD&&(y=y.slice(0,this.MAX_THRESHOLD)),U.l("".concat(m," count:").concat(y.length)),a.setItem(this.TAG,y,!0,!1)}}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),p}(Sr),Ap="none",c1="online",j6=[De.OVER_FREQUENCY_LIMIT,De.OPEN_SERVICE_OVERLOAD_ERROR],W6=function(){function k(l){i(this,k),this._m=l,this._networkType="",this._n="NetMonitorModule",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return u(k,[{key:"start",value:function(){var l=this;je?(Fe.getNetworkType({success:function(p){l._networkType=p.networkType||p.subtype||"",p.networkType===Ap?U.w("".concat(l._n,".start no network, please check!")):U.i("".concat(l._n,".start networkType:").concat(p.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),Fe.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=c1,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback)))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:c1})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:Ap})}},{key:"_onNetworkStatusChange",value:function(l){var p=l.isConnected,a=l.networkType,c="".concat(this._n,"._onNetworkStatusChange"),h=!1;p?(U.i("".concat(c," previous:").concat(this._networkType," current:").concat(a)),this._networkType!==a&&(h=!0,this._m.getModule(Ns).reConnect(!0))):this._networkType!==a&&(h=!0,U.w("".concat(c," no network, please check!")),this._m.getModule(Ns).offline()),h&&(new We("networkChange").setMessage("isConnected:".concat(p," previousNetworkType:").concat(this._networkType," networkType:").concat(a)).end(),this._networkType=a)}},{key:"probe",value:function(l){var p=this;if(!Ge(l)&&j6.includes(l.code))return Promise.resolve([!0,this._networkType]);var a="".concat(this._n,".probe");return new Promise(function(c,h){je?Fe.getNetworkType({success:function(m){p._networkType=m.networkType,m.networkType===Ap?(U.w("".concat(a," no network, please check!")),c([!1,m.networkType])):(U.i("".concat(a," networkType:").concat(m.networkType)),c([!0,m.networkType]))}}):p._networkType===Ap?c([!1,Ap]):c([!0,c1])})}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),je?this._mpNetworkStatusCallback!==null&&(Fe.offNetworkStatusChange&&(_e||He?Fe.offNetworkStatusChange(this._mpNetworkStatusCallback):Fe.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(this._webOnlineCallback!==null&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),this._onWebOffline!==null&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null))}}]),k}(),d1=function(k,l){return k(l={exports:{}},l.exports),l.exports}(function(k){var l=Object.prototype.hasOwnProperty,p="~";function a(){}function c(b,I,E){this.fn=b,this.context=I,this.once=E||!1}function h(b,I,E,R,F){if(typeof E!="function")throw new TypeError("The listener must be a function");var H=new c(E,R||b,F),ee=p?p+I:I;return b._events[ee]?b._events[ee].fn?b._events[ee]=[b._events[ee],H]:b._events[ee].push(H):(b._events[ee]=H,b._eventsCount++),b}function m(b,I){--b._eventsCount==0?b._events=new a:delete b._events[I]}function y(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(p=!1)),y.prototype.eventNames=function(){var b,I,E=[];if(this._eventsCount===0)return E;for(I in b=this._events)l.call(b,I)&&E.push(p?I.slice(1):I);return Object.getOwnPropertySymbols?E.concat(Object.getOwnPropertySymbols(b)):E},y.prototype.listeners=function(b){var I=p?p+b:b,E=this._events[I];if(!E)return[];if(E.fn)return[E.fn];for(var R=0,F=E.length,H=new Array(F);R=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:"_getAuthorization",value:function(a,c){c({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(a){if(a.getRelayFlag()===!0)return Promise.resolve();var c=this.getModule($o);switch(a.type){case T.MSG_IMAGE:return c.addTotalCount(yi),this._uploadImage(a);case T.MSG_FILE:return c.addTotalCount(yi),this._uploadFile(a);case T.MSG_AUDIO:return c.addTotalCount(yi),this._uploadAudio(a);case T.MSG_VIDEO:return c.addTotalCount(yi),this._uploadVideo(a);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(a){var c=this,h=this.getModule(ir),m=a.getElements()[0],y=h.getMessageOption(a.clientSequence);return this.doUploadImage({file:y.payload.file,to:y.to,onProgress:function(b){if(m.updatePercent(b),Fo(y.onProgress))try{y.onProgress(b)}catch{return Me({code:De.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I,E,R=b.location,F=b.fileType,H=b.fileSize,ee=b.width,ge=b.height,be=b.smallImageUrl,we=b.smallImageWidth,Ue=b.smallImageHeight,qe=b.largeImageUrl,nt=b.largeImageWidth,mt=b.largeImageHeight,Pt=c.isPrivateNetWork()?R:Tl(R);return m.updateImageFormat(F),be&&qe?(I={url:be,width:we,height:Ue},E={url:qe,width:nt,height:mt}):(I=Td({originUrl:Pt,originWidth:ee,originHeight:ge,min:198}),E=Td({originUrl:Pt,originWidth:ee,originHeight:ge,min:720})),m.updateImageInfoArray([{size:H,url:Pt,width:ee,height:ge},r({},E),r({},I)]),a})}},{key:"_uploadFile",value:function(a){var c=this,h=this.getModule(ir),m=a.getElements()[0],y=h.getMessageOption(a.clientSequence);return this.doUploadFile({file:y.payload.file,to:y.to,onProgress:function(b){if(m.updatePercent(b),Fo(y.onProgress))try{y.onProgress(b)}catch{return Me({code:De.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I=b.location,E=c.isPrivateNetWork()?I:Tl(I);return m.updateFileUrl(E),a})}},{key:"_uploadAudio",value:function(a){var c=this,h=this.getModule(ir),m=a.getElements()[0],y=h.getMessageOption(a.clientSequence);return this.doUploadAudio({file:y.payload.file,to:y.to,onProgress:function(b){if(m.updatePercent(b),Fo(y.onProgress))try{y.onProgress(b)}catch{return Me({code:De.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I=b.location,E=c.isPrivateNetWork()?I:Tl(I);return m.updateAudioUrl(E),a})}},{key:"_uploadVideo",value:function(a){var c=this,h=this.getModule(ir),m=a.getElements()[0],y=h.getMessageOption(a.clientSequence);return this.doUploadVideo({file:y.payload.file,to:y.to,onProgress:function(b){if(m.updatePercent(b),Fo(y.onProgress))try{y.onProgress(b)}catch{return Me({code:De.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I=b.location,E=b.snapshotInfo,R=c.isPrivateNetWork()?I:Tl(I);return m.updateVideoUrl(R),Ye(E)||m.updateSnapshotInfo(E),a})}},{key:"_checkSizeError",value:function(a){var c="";return a==="A"?c="audio":a==="I"?c="image":a==="V"?c="video":a==="F"&&(c="file"),Me({code:De["MSG_".concat(a,"_SIZE_LIMIT")],message:this.getErrorMessage("UploadSizeLimit",c,"".concat(this.UPLOAD_SIZE_LIMIT[a]/1048576,"MB"))})}},{key:"doUploadImage",value:function(a){var c=this;if(!a.file||this._isEmptyFileList(a.file.files))return Me({code:De.MSG_I_SELECT_F_FIRST});var h=this._checkImageType(a.file);if(h!==!0)return h;var m=this._checkImageSize(a.file);if(m!==!0)return m;var y=null;return this._setUploadFileType(a6),this.uploadByCOS(a).then(function(b){return y=b,c.isPrivateNetWork()?Uu(b.location):Uu("https://".concat(b.location))}).then(function(b){return y.width=b.width,y.height=b.height,Promise.resolve(y)})}},{key:"_checkImageType",value:function(a){var c="";return c=je?a.url.slice(a.url.lastIndexOf(".")+1):a.files[0].name.slice(a.files[0].name.lastIndexOf(".")+1),i6.indexOf(c.toLowerCase())>=0||Me({code:De.MSG_I_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(a){var c=0;return(c=je?a.size:a.files[0].size)===0?Me({code:De.MSG_F_IS_EMPTY}):cthis.UPLOAD_SIZE_LIMIT.F?this._checkSizeError("F"):a.file.files[0].size===0?Me({code:De.MSG_F_IS_EMPTY}):(this._setUploadFileType(c6),this.uploadByCOS(a))}},{key:"doUploadVideo",value:function(a){return a.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError("V"):a.file.videoFile.size===0?Me({code:De.MSG_F_IS_EMPTY}):s6.indexOf(a.file.videoFile.type)===-1?Me({code:De.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(l6),je?this.handleVideoUpload({file:a.file.videoFile,onProgress:a.onProgress}):lt?this.handleVideoUpload(a):void 0)}},{key:"handleVideoUpload",value:function(a){var c=this;return new Promise(function(h,m){c.uploadByCOS(a).then(function(y){h(y)}).catch(function(){c.uploadByCOS(a).then(function(y){h(y)}).catch(function(){m(new Un({code:De.MSG_V_UPLOAD_FAIL}))})})})}},{key:"doUploadAudio",value:function(a){return a.file?a.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError("A"):a.file.size===0?Me({code:De.MSG_F_IS_EMPTY}):(this._setUploadFileType(u6),this.uploadByCOS(a)):Me({code:De.MSG_A_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(a){var c=this;if(!Fo(this._cosUploadMethod))return this.outputWarning("PluginUndetected"),Me({code:De.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(a);var h=new We("upload"),m="".concat(this._n,".uploadByCOS"),y=Date.now(),b=this._getFile(a);return new Promise(function(I,E){var R=je?c._createCosOptionsWXMiniApp(a):c._createCosOptionsWeb(a),F=c;c._cosUploadMethod(R,function(H,ee){var ge=Object.create(null);if(ee){if(H||rt(ee.files)&&ee.files[0].error){var be=new Un({code:De.MSG_F_UPLOAD_FAIL});return h.setError(be,!0,c.getNetworkType()).end(),U.l("".concat(m," failed. error:"),ee.files[0].error),ee.files[0].error.statusCode===403&&(U.w("".concat(m," failed. cos AccessKeyId was invalid, regain auth key!")),c._getAuthorizationKey()),void E(be)}ge.fileName=b.name,ge.fileSize=b.size,ge.fileType=b.type.slice(b.type.indexOf("/")+1).toLowerCase(),ge.location=je?ee.Location:ee.files[0].data.Location;var we=Date.now()-y,Ue=F._formatFileSize(b.size),qe=F._formatSpeed(1e3*b.size/we),nt="size:".concat(Ue," time:").concat(we,"ms speed:").concat(qe);U.l("".concat(m," success. name:").concat(b.name," ").concat(nt)),I(ge);var mt=c.getModule($o);return mt.addCost(yi,we),mt.addFileSize(yi,b.size),void h.setNetworkType(c.getNetworkType()).setMessage(nt).end()}var Pt=new Un({code:De.MSG_F_UPLOAD_FAIL});h.setError(Pt,!0,F.getNetworkType()).end(),U.w("".concat(m," failed. error:"),H),H.statusCode===403&&(U.w("".concat(m," failed. cos AccessKeyId was invalid, regain auth key!")),c._getAuthorizationKey()),E(Pt)})})}},{key:"_uploadWithPreSigUrl",value:function(a){var c=this,h="".concat(this._n,"._uploadWithPreSigUrl"),m=this._getFile(a);return this._createCosOptionsPreSigUrl(a).then(function(y){return new Promise(function(b,I){var E=new We("upload"),R=y.requestSnapshotUrl,F=R===void 0?void 0:R,H=D(y,K6),ee=Date.now();c._cosUploadMethod(H,function(ge,be){if(ge||be.statusCode===403)return E.setError(new Un(ge),!0,c.getNetworkType()).end(),U.l("".concat(h," failed, error:"),ge),void I(new Un({code:De.MSG_F_UPLOAD_FAIL}));var we=Object.create(null),Ue=be.data.location||"";c.isPrivateNetWork()||Ue.indexOf("https://")!==0&&Ue.indexOf("http://")!==0||(Ue=Ue.split("//")[1]),we.fileName=m.name,we.fileSize=m.size,we.fileType=m.type.slice(m.type.indexOf("/")+1).toLowerCase(),we.location=Ue;var qe=Date.now()-ee,nt=c._formatFileSize(m.size),mt=c._formatSpeed(1e3*m.size/qe),Pt="size:".concat(nt,",time:").concat(qe,"ms,speed:").concat(mt," res:").concat(JSON.stringify(be.data));U.l("".concat(h," success name:").concat(m.name,",").concat(Pt)),E.setNetworkType(c.getNetworkType()).setMessage(Pt).end();var gn=c.getModule($o);gn.addCost(yi,qe),gn.addFileSize(yi,m.size);var _n=[];if(H.thumbUrl&&H.largeUrl&&(_n=[c._getSmallImageInfoByUrl(H.thumbUrl,we),c._getLargeImageInfoByUrl(H.largeUrl,we)]),F&&_n.push(c._getSnapshotInfoByUrl(F,we)),_n.length>0)return Promise.all(_n).then(function(){b(we)});b(we)})})})}},{key:"_getRawOrUploadProxyUrl",value:function(a){var c=this.getModule(pn).getFileUploadProxy(),h=a;return c&&(h=a.replace(/^https:\/\/[^/]+/,c)),h}},{key:"_getFile",value:function(a){return rt(a.file.files)||_d(a.file.files)?a.file.files[0]:a.file}},{key:"_formatFileSize",value:function(a){return a<1024?a+"B":a<1048576?Math.floor(a/1024)+"KB":Math.floor(a/1048576)+"MB"}},{key:"_formatSpeed",value:function(a){return a<=1048576?Zi(a/1024,1)+"KB/s":Zi(a/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(a){var c=this._getFile(a),h=c.name,m=h.slice(h.lastIndexOf(".")),y=this._genFileName("".concat(Qo(999999)).concat(m));return{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(y),Body:c}],SliceSize:1048576,onProgress:function(b){if(typeof a.onProgress=="function")try{a.onProgress(b.percent)}catch(I){U.w("onProgress callback error:",I)}},onFileFinish:function(b,I,E){}}}},{key:"_createCosOptionsWXMiniApp",value:function(a){var c=this._getFile(a),h=this._genFileName(c.name),m=c.url;return{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(h),FilePath:m,onProgress:function(y){if(U.l(JSON.stringify(y)),typeof a.onProgress=="function")try{a.onProgress(y.percent)}catch(b){U.w("onProgress callback error:",b)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(a){var c=this,h="",m="",y=0,b=this._getFile(a);if(je)h=this._genFileName(b.name),m=b.url,y=1;else{var I=b.name,E=I.slice(I.lastIndexOf("."));h=this._genFileName("".concat(Qo(999999)).concat(E)),m=b,y=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:h,uploadMethod:y,duration:this.duration}).then(function(R){var F=R.uploadUrl,H=R.downloadUrl,ee=R.requestSnapshotUrl,ge=ee===void 0?void 0:ee,be=R.thumbUrl,we=R.largeUrl,Ue=R.fileKey;return{url:c._getRawOrUploadProxyUrl(F),fileType:c.uploadFileType,fileName:h,resources:m,downloadUrl:H,requestSnapshotUrl:ge,thumbUrl:be,largeUrl:we,fileKey:Ue,onProgress:function(qe){if(typeof a.onProgress=="function")try{a.onProgress(qe.percent)}catch(nt){U.w("onProgress callback error:",nt),U.e(nt)}}}})}},{key:"_genFileName",value:function(a){return"".concat(Na(),"-").concat(a)}},{key:"_setUploadFileType",value:function(a){this.uploadFileType=a}},{key:"_getSnapshotInfoByUrl",value:function(a,c){var h=this,m=new We("getSnapshotInfo");return this.request({protocolName:O_,requestData:{platform:this.getPlatform(),coverName:this._genFileName(Qo(99999)),requestSnapshotUrl:a}}).then(function(y){var b=(y.data||{}).snapshotUrl;return m.setMessage("snapshotUrl:".concat(b)).end(),Ye(b)?{}:Uu(b).then(function(I){c.snapshotInfo={snapshotUrl:b,snapshotWidth:I.width,snapshotHeight:I.height}})}).catch(function(y){return U.w("".concat(h._n,"._getSnapshotInfoByUrl failed. error:"),y),m.setCode(y.errorCode).setMessage(y.errorInfo).end(),{}})}},{key:"_getSmallImageInfoByUrl",value:function(a,c){return Uu(a).then(function(h){c.smallImageUrl=a,c.smallImageWidth=h.width,c.smallImageHeight=h.height})}},{key:"_getLargeImageInfoByUrl",value:function(a,c){return Uu(a).then(function(h){c.largeImageUrl=a,c.largeImageWidth=h.width,c.largeImageHeight=h.height})}},{key:"_isEmptyFileList",value:function(a){return!(!_d(a)||a.length!==0)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset"))}}]),p}(Sr),J6=["downloadKey","pbDownloadKey","messageList"],X6=function(){function k(l){i(this,k),this._n="MergerMessageHandler",this._messageModule=l}return u(k,[{key:"uploadMergerMessage",value:function(l,p){var a=this,c="".concat(this._n,".").concat("uploadMergerMessage");U.d("".concat(c," message:"),l,"messageBytes:".concat(p));var h=l.payload.messageList,m=h.length,y=new We("uploadMergerMessage");return this._messageModule.request({protocolName:N_,requestData:{messageList:h}}).then(function(b){U.d("".concat(c," ok. response:"),b.data);var I=b.data,E=I.pbDownloadKey,R=I.downloadKey,F={pbDownloadKey:E,downloadKey:R,messageNumber:m};return y.setNetworkType(a._messageModule.getNetworkType()).setMessage("".concat(m,"-").concat(p,"-").concat(R)).end(),F}).catch(function(b){throw U.w("".concat(c," failed. error:"),b),a._messageModule.probeNetwork().then(function(I){var E=A(I,2),R=E[0],F=E[1];y.setError(b,R,F).end()}),b})}},{key:"downloadMergerMessage",value:function(l){var p=this,a="".concat(this._n,".").concat("downloadMergerMessage");U.d("".concat(a," message:"),l);var c=l.payload.downloadKey,h=this._messageModule.getFileDownloadProxy(),m=new We("downloadMergerMessage");return m.setMessage("downloadKey:".concat(c)),this._messageModule.request({protocolName:P_,requestData:{downloadKey:c}}).then(function(y){if(U.d("".concat(a," ok. response:"),y.data),Fo(l.clearElement)){var b=l.payload;b.downloadKey,b.pbDownloadKey,b.messageList;var I=D(b,J6);l.clearElement(),l.setElement({type:l.type,content:r({messageList:y.data.messageList},I)},h)}else{var E=[];y.data.messageList.forEach(function(R){if(!Ye(R)){var F=new Ew(R,h);E.push(F)}}),l.payload.messageList=E,l.payload.downloadKey="",l.payload.pbDownloadKey=""}return m.setNetworkType(p._messageModule.getNetworkType()).end(),l}).catch(function(y){throw U.w("".concat(a," failed. key:").concat(c," error:"),y),p._messageModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),y})}},{key:"createMergerMessagePack",value:function(l,p,a){return l.conversationType===T.CONV_C2C?this._createC2CMergerMessagePack(l,p,a):this._createGroupMergerMessagePack(l,p,a)}},{key:"_createC2CMergerMessagePack",value:function(l,p,a){var c=null;p&&(p.offlinePushInfo&&(c=p.offlinePushInfo),p.onlineUserOnly===!0&&(c?c.disablePush=!0:c={disablePush:!0}));var h=[];if(yn(p)&&yn(p.messageControlInfo)){var m=p.messageControlInfo,y=m.excludedFromUnreadCount,b=m.excludedFromLastMessage,I=m.excludedFromContentModeration;y===!0&&h.push("NoUnread"),b===!0&&h.push("NoLastMsg"),I===!0&&h.push("NoMsgCheck")}var E="";Et(l.cloudCustomData)&&l.cloudCustomData.length>0&&(E=l.cloudCustomData);var R=a.pbDownloadKey,F=a.downloadKey,H=a.messageNumber,ee=l.payload,ge=ee.title,be=ee.abstractList,we=ee.compatibleText,Ue=this._messageModule.getModule(ao),qe=Ue&&Ue.isOnlineMessage(l,p)?0:void 0;return{protocolName:Mp,tjgID:this._messageModule.generateTjgID(l),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:l.to,msgBody:[{msgType:l.type,msgContent:{pbDownloadKey:R,downloadKey:F,title:ge,abstractList:be,compatibleText:we,messageNumber:H}}],cloudCustomData:E,clientTime:l.clientTime,msgSeq:l.sequence,msgRandom:l.random,msgLifeTime:qe,offlinePushInfo:c?{pushFlag:c.disablePush===!0?1:0,title:c.title||"",desc:c.description||"",ext:c.extension||"",apnsInfo:{badgeMode:c.ignoreIOSBadge===!0?1:0},androidInfo:{OPPOChannelID:c.androidOPPOChannelID||""}}:void 0,messageControlInfo:qe!==0?h:void 0,isSupportExtension:l.isSupportExtension===!0?1:0}}}},{key:"_createGroupMergerMessagePack",value:function(l,p,a){var c=null;p&&p.offlinePushInfo&&(c=p.offlinePushInfo);var h=[];if(yn(p)&&yn(p.messageControlInfo)){var m=p.messageControlInfo,y=m.excludedFromUnreadCount,b=m.excludedFromLastMessage,I=m.excludedFromContentModeration;y===!0&&h.push("NoUnread"),b===!0&&h.push("NoLastMsg"),I===!0&&h.push("NoMsgCheck")}var E="";Et(l.cloudCustomData)&&l.cloudCustomData.length>0&&(E=l.cloudCustomData);var R=a.pbDownloadKey,F=a.downloadKey,H=a.messageNumber,ee=l.payload,ge=ee.title,be=ee.abstractList,we=ee.compatibleText,Ue=this._messageModule.getModule(Mt),qe=Ue&&Ue.isOnlineMessage(l,p)?1:0;return{protocolName:Ip,tjgID:this._messageModule.generateTjgID(l),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:l.to,msgBody:[{msgType:l.type,msgContent:{pbDownloadKey:R,downloadKey:F,title:ge,abstractList:be,compatibleText:we,messageNumber:H}}],random:l.random,priority:l.priority,clientSequence:l.clientSequence,groupAtInfo:void 0,cloudCustomData:E,onlineOnlyFlag:qe,offlinePushInfo:c?{pushFlag:c.disablePush===!0?1:0,title:c.title||"",desc:c.description||"",ext:c.extension||"",apnsInfo:{badgeMode:c.ignoreIOSBadge===!0?1:0},androidInfo:{OPPOChannelID:c.androidOPPOChannelID||""}}:void 0,clientTime:l.clientTime,needReadReceipt:l.needReadReceipt!==!0||Ue.isMessageFromOrToAVChatroom(l.to)?0:1,messageControlInfo:qe===0?h:void 0,isSupportExtension:l.isSupportExtension===!0?1:0}}}}]),k}(),Z6={ERR_SVR_COMM_SENSITIVE_TEXT:80001,ERR_SVR_COMM_BODY_SIZE_LIMIT:80002,OPEN_SERVICE_OVERLOAD_ERROR:60022,ERR_SVR_MSG_PKG_PARSE_FAILED:20001,ERR_SVR_MSG_INTERNAL_AUTH_FAILED:20002,ERR_SVR_MSG_INVALID_ID:20003,ERR_SVR_MSG_PUSH_DENY:20006,ERR_SVR_MSG_IN_PEER_BLACKLIST:20007,ERR_SVR_MSG_BOTH_NOT_FRIEND:20009,ERR_SVR_MSG_NOT_PEER_FRIEND:20010,ERR_SVR_MSG_NOT_SELF_FRIEND:20011,ERR_SVR_MSG_SHUTUP_DENY:20012,ERR_SVR_GROUP_INVALID_PARAMETERS:10004,ERR_SVR_GROUP_PERMISSION_DENY:10007,ERR_SVR_GROUP_NOT_FOUND:10010,ERR_SVR_GROUP_INVALID_GROUPID:10015,ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY:10016,ERR_SVR_GROUP_SHUTUP_DENY:10017,MSG_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},Q6=[De.MSG_ONPROGRESS_FUNCTION_ERROR,De.MSG_I_SELECT_F_FIRST,De.MSG_I_TYPES_LIMIT,De.MSG_F_IS_EMPTY,De.MSG_I_SIZE_LIMIT,De.MSG_F_SELECT_F_FIRST,De.MSG_F_SIZE_LIMIT,De.MSG_V_SIZE_LIMIT,De.MSG_V_TYPES_LIMIT,De.MSG_A_UPLOAD_FAIL,De.MSG_A_SIZE_LIMIT,De.COS_UNDETECTED];function Gw(k){var l=!1;return Object.values(Z6).includes(k)&&(l=!0),(k>=120001&&k<=13e4||k>=10100&&k<=10200)&&(l=!0),l}var e8=["conversationID","timePosition","timePeriod"],t8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="MessageModule",c._messageOptionsMap=new Map,c._mergerMessageHandler=new X6(w(c)),c}return u(p,[{key:"createTextMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=new Hr(a),m=Et(a.payload)?a.payload:a.payload.text,y=new Z_({text:m}),b=this._getNickAndAvatarByUserID(c);return h.setElement(y),h.setNickAndAvatar(b),h.setNameCard(this._getNameCardByGroupID(h)),h}},{key:"createImageMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=new Hr(a);if(je){var m=a.payload.file;if($r(m))return void this.outputWarning("FileUnsupportedInMP","createImageMessage");var y=m.tempFiles[0].path||m.tempFiles[0].tempFilePath,b={url:y,name:y.slice(y.lastIndexOf("/")+1),size:m.tempFiles&&m.tempFiles[0].size||1,type:y.slice(y.lastIndexOf(".")+1).toLowerCase()};a.payload.file=b}else if(lt){if($r(a.payload.file)){var I=a.payload.file;a.payload.file={files:[I]}}else if(yn(a.payload.file)&&typeof uni<"u"){var E=a.payload.file.tempFiles[0];a.payload.file={files:[E]}}}var R=new Q_({imageFormat:us.UNKNOWN,uuid:this._generateUUID(a.payload.file),file:a.payload.file}),F=this._getNickAndAvatarByUserID(c);return h.setElement(R),h.setNickAndAvatar(F),h.setNameCard(this._getNameCardByGroupID(h)),this._messageOptionsMap.set(h.clientSequence,a),h}},{key:"createAudioMessage",value:function(a){var c=a.payload.file;if(je){var h={url:c.tempFilePath,name:c.tempFilePath.slice(c.tempFilePath.lastIndexOf("/")+1),size:c.fileSize,second:parseInt(c.duration)/1e3,type:c.tempFilePath.slice(c.tempFilePath.lastIndexOf(".")+1).toLowerCase()};a.payload.file=h}var m=this.getMyUserID();a.currentUser=m,a.senderTinyID=this.getMyTinyID();var y=new Hr(a),b=new t1({second:Math.floor(c.duration/1e3),size:c.fileSize||c.size,url:c.tempFilePath,uuid:this._generateUUID(a.payload.file)}),I=this._getNickAndAvatarByUserID(m);return y.setElement(b),y.setNickAndAvatar(I),y.setNameCard(this._getNameCardByGroupID(y)),this._messageOptionsMap.set(y.clientSequence,a),y}},{key:"createVideoMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID(),a.payload.file.thumbUrl="",a.payload.file.thumbSize=0;var h={};if(je){if(q)return void this.outputWarning("VideoUnsupportedInAlipay");if($r(a.payload.file))return void this.outputWarning("FileUnsupportedInMP","createVideoMessage");var m=a.payload.file;rt(m.tempFiles)&&(m=m.tempFiles[0]),h.url=m.tempFilePath,h.name=m.tempFilePath.slice(m.tempFilePath.lastIndexOf("/")+1),h.size=m.size||1,h.second=m.duration||0,h.type=m.tempFilePath.slice(m.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else if(lt){if($r(a.payload.file)){var y=a.payload.file;a.payload.file.files=[y]}else if(yn(a.payload.file)&&typeof uni<"u"){var b=a.payload.file.tempFile;a.payload.file.files=[b]}var I=a.payload.file;h.url=window.URL.createObjectURL(I.files[0]),h.name=I.files[0].name,h.size=I.files[0].size||1,h.second=I.files[0].duration||0,h.type=I.files[0].type.split("/")[1]}a.payload.file.videoFile=h;var E=new Hr(a),R=new o1({videoFormat:h.type,videoSecond:Zi(h.second,0),videoSize:h.size,remoteVideoUrl:"",videoUrl:h.url,videoUUID:this._generateUUID(a.payload.file.videoFile),thumbUUID:this._generateUUID(a.payload.file.videoFile),thumbWidth:a.payload.file.width||200,thumbHeight:a.payload.file.height||200,thumbUrl:a.payload.file.thumbUrl,thumbSize:a.payload.file.thumbSize,thumbFormat:a.payload.file.thumbUrl.slice(a.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),F=this._getNickAndAvatarByUserID(c);return E.setElement(R),E.setNickAndAvatar(F),E.setNameCard(this._getNameCardByGroupID(E)),this._messageOptionsMap.set(E.clientSequence,a),E}},{key:"createCustomMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=new Hr(a),m=new r1({data:a.payload.data,description:a.payload.description,extension:a.payload.extension}),y=this._getNickAndAvatarByUserID(c);return h.setElement(m),h.setNickAndAvatar(y),h.setNameCard(this._getNameCardByGroupID(h)),h}},{key:"createFaceMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=new Hr(a),m=new e1(a.payload),y=this._getNickAndAvatarByUserID(c);return h.setElement(m),h.setNickAndAvatar(y),h.setNameCard(this._getNameCardByGroupID(h)),h}},{key:"createMergerMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=this._getNickAndAvatarByUserID(c),m=new Hr(a),y=new rm(a.payload);return m.setElement(y),m.setNickAndAvatar(h),m.setNameCard(this._getNameCardByGroupID(m)),m.setRelayFlag(!0),m}},{key:"createForwardMessage",value:function(a){var c=a.to,h=a.conversationType,m=a.priority,y=a.payload,b=a.needReadReceipt,I=a.receiverList,E=this.getMyUserID(),R=this._getNickAndAvatarByUserID(E);if(y.type===T.MSG_GRP_TIP)return Me({code:De.MSG_FORWARD_TYPE_INVALID});var F={to:c,conversationType:h,conversationID:"".concat(h).concat(c),priority:m,isPlaceMessage:0,status:so.UNSEND,currentUser:E,senderTinyID:this.getMyTinyID(),cloudCustomData:a.cloudCustomData||y.cloudCustomData||"",needReadReceipt:b,receiverList:I,isSupportExtension:a.isSupportExtension||!1},H=new Hr(F);return H.setElement(y.getElements()[0]),H.setNickAndAvatar(R),H.setNameCard(this._getNameCardByGroupID(y)),H.setRelayFlag(!0),H}},{key:"downloadMergerMessage",value:function(a){return this._mergerMessageHandler.downloadMergerMessage(a)}},{key:"createFileMessage",value:function(a){if(je){if(!Pe&&!xe&&!_e)return;var c=Fe.getSystemInfoSync().SDKVersion;if(Pe&&Dg(c,"2.5.0")<0)return void this.outputWarning("WXChooseMessageFile");if(xe&&Dg(c,"1.18.0")<0)return void this.outputWarning("QQChooseMessageFile")}if(lt||_e){if($r(a.payload.file)){var h=a.payload.file;a.payload.file={files:[h]}}else if(yn(a.payload.file)&&typeof uni<"u"){var m=a.payload.file,y=m.tempFiles,b=m.files,I=null;rt(y)?I=y[0]:rt(b)&&(I=b[0]),a.payload.file={files:[I]}}}else if(Pe||xe){var E=a.payload.file.tempFiles,R=r(r({},E[0]),{},{url:E[0].path});a.payload.file={files:[R]}}var F=this.getMyUserID();a.currentUser=F,a.senderTinyID=this.getMyTinyID();var H=new Hr(a),ee=new n1({uuid:this._generateUUID(a.payload.file),file:a.payload.file}),ge=this._getNickAndAvatarByUserID(F);return H.setElement(ee),H.setNickAndAvatar(ge),H.setNameCard(this._getNameCardByGroupID(H)),this._messageOptionsMap.set(H.clientSequence,a),H}},{key:"createLocationMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=new Hr(a),m=new i1(a.payload),y=this._getNickAndAvatarByUserID(c);return h.setElement(m),h.setNickAndAvatar(y),h.setNameCard(this._getNameCardByGroupID(h)),h}},{key:"_onCannotFindModule",value:function(){return Me({code:De.CANNOT_FIND_MODULE})}},{key:"sendMessageInstance",value:function(a,c){var h=this;if(this.getModule(Ga).filterMessage(a,c)===!1)return this._onSendMessageFailed(a,new Un({code:De.PROFANITY_FOUND}));var m=null;if(a.conversationType===T.CONV_C2C)m=this.getModule(ao);else{if(a.conversationType!==T.CONV_GROUP)return Me({code:De.MSG_INVALID_CONV_TYPE});m=this.getModule(Mt)}var y,b="".concat(this._n,".sendMessageInstance"),I=this.getModule(ct),E=m.isOnlineMessage(a,c);return this.getModule(pw).upload(a).then(function(){return h._getSendMessageSpecifiedKey(a)===Vu&&h.getModule($o).addSuccessCount(yi),h._guardForGroup(a).then(function(){if(!a.isSendable())return Me({code:De.MSG_F_URL_IS_EMPTY});h._addSendMessageTotalCount(a),y=Date.now();var R=function(F){var H="utf-8";lt&&document&&(H=document.charset.toLowerCase());var ee,ge,be=0;if(ge=F.length,H==="utf-8"||H==="utf8")for(var we=0;we11264?h._mergerMessageHandler.uploadMergerMessage(a,R).then(function(F){var H=h._mergerMessageHandler.createMergerMessagePack(a,c,F);return h.request(H)}):(I.setMessageRandom(a),m.sendMessage(a,c))}).then(function(R){var F=R.data,H=F.time,ee=F.sequence,ge=F.readReceiptCode;if(un(ge)&&ge!==0&&(new We("sendMessageWithReceipt").setMessage("from:".concat(a.from," to:").concat(a.to," sequence:").concat(ee," readReceiptCode:").concat(ge)).end(),U.w("".concat(b," readReceiptCode:").concat(ge," message:").concat(h.getErrorMessage(ge)))),h._addSendMessageSuccessCount(a,y),h._messageOptionsMap.delete(a.clientSequence),a.isResend===!0){var be=I.findMessage(a.ID);be&&(U.l("".concat(b," resend ok. ID:").concat(be.ID)),I.deleteLocalMessage(be))}a.status=so.SUCCESS,a.time=H;var we=!1;if(a.conversationType===T.CONV_GROUP)a.sequence=ee;else if(a.conversationType===T.CONV_C2C){var Ue=I.getLatestMessageSentByMe(a.conversationID);if(Ue){var qe=Ue.nick,nt=Ue.avatar;qe===a.nick&&nt===a.avatar||(we=!0)}}if(we&&I.modifyMessageSentByMe({conversationID:a.conversationID,latestNick:a.nick,latestAvatar:a.avatar}),E===!0)a._onlineOnlyFlag=!0;else{I.appendToMessageList(a);var mt=a;yn(c)&&yn(c.messageControlInfo)&&(c.messageControlInfo.excludedFromLastMessage===!0&&(a._isExcludedFromLastMessage=!0,mt=""),c.messageControlInfo.excludedFromUnreadCount===!0&&(a._isExcludedFromUnreadCount=!0));var Pt=a.conversationType;oo(a.to)&&(Pt=T.CONV_TOPIC,h.getModule(sr).onMessageSent({groupID:Lr(a.to),topicID:a.to,lastMessage:mt})),I.onMessageSent({conversationOptionsList:[{conversationID:a.conversationID,unreadCount:0,type:Pt,subType:a.conversationSubType,lastMessage:mt}]})}return a.getRelayFlag()||a.type!=="TIMImageElem"||Fu(a.payload.imageInfoArray),ht({message:a})})}).catch(function(R){return h._onSendMessageFailed(a,R,E)})}},{key:"_guardForGroup",value:function(a){if(a.conversationType!==T.CONV_GROUP)return Promise.resolve();var c=this.getModule(Mt);if(!c)return this._onCannotFindModule();if(go({groupID:a.to})){var h=c.getLocalGroupProfile(a.to);if(h&&h.isSupportTopic)return Me({code:De.MSG_SEND_GRP_WITH_TOPIC_FAIL})}return c.guardForAVChatRoom(a)}},{key:"_onSendMessageFailed",value:function(a,c){var h=arguments.length>2&&arguments[2]!==void 0&&arguments[2],m="".concat(this._n,"._onSendMessageFailed");a.status=so.FAIL;var y=this.getModule(ct);if(y.deleteMessageRandom(a),!h){var b=y.appendToMessageList(a);b===!0&&U.l("".concat(m," message stored, ID:").concat(a.ID))}this._addSendMessageFailCountOnUser(a,c);var I=new We("sendMessage");return I.setMessage("tjg_id:".concat(this.generateTjgID(a)," type:").concat(a.type," from:").concat(a.from," to:").concat(a.to)),this.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];I.setError(c,F,H).end()}),U.e("".concat(m," error:"),c),Me(new Un({code:c&&c.code?c.code:De.MSG_SEND_FAIL,message:c&&c.message?c.message:void 0,data:{message:a}}))}},{key:"_getSendMessageSpecifiedKey",value:function(a){if([T.MSG_IMAGE,T.MSG_AUDIO,T.MSG_VIDEO,T.MSG_FILE].includes(a.type))return Vu;if(a.conversationType===T.CONV_C2C)return kd;if(a.conversationType===T.CONV_GROUP){var c=this.getModule(Mt);if(!c)return;var h=c.getLocalGroupProfile(a.to);if(!h)return;var m=h.type;return Go(m)?Ed:Dd}}},{key:"_addSendMessageTotalCount",value:function(a){var c=this._getSendMessageSpecifiedKey(a);c&&this.getModule($o).addTotalCount(c)}},{key:"_addSendMessageSuccessCount",value:function(a,c){var h=Math.abs(Date.now()-c),m=this._getSendMessageSpecifiedKey(a);if(m){var y=this.getModule($o);y.addSuccessCount(m),y.addCost(m,h)}}},{key:"_addSendMessageFailCountOnUser",value:function(a,c){var h,m,y=c.code,b=y===void 0?-1:y,I=this.getModule($o),E=this._getSendMessageSpecifiedKey(a);E===Vu&&(h=b,m=!1,Q6.includes(h)&&(m=!0),m)?I.addFailedCountOfUserSide(yi):Gw(b)&&E&&I.addFailedCountOfUserSide(E)}},{key:"resendMessage",value:function(a,c){return a.isResend=!0,a.status=so.UNSEND,this.sendMessageInstance(a,c)}},{key:"revokeMessage",value:function(a){var c=this,h=null;if(a.conversationType===T.CONV_C2C?h=this.getModule(ao):a.conversationType===T.CONV_GROUP&&(h=this.getModule(Mt)),!h)return this._onCannotFindModule();var m=new We("revokeMessage");m.setMessage("tjg_id:".concat(this.generateTjgID(a)," type:").concat(a.type," from:").concat(a.from," to:").concat(a.to));var y="".concat(this._n,".").concat("revokeMessage");return h.revokeMessage(a).then(function(b){var I=b.data.recallRetList;if(!Ye(I)&&I[0].retCode!==0){var E=new Un({code:I[0].retCode,data:{message:a}});return m.setCode(E.code).setMoreMessage(E.message).end(),Me(E)}return U.i("".concat(y," ok. ID:").concat(a.ID)),a.isRevoked=!0,m.end(),c.getModule(ct).onMessageRevoked([a]),ht({message:a})}).catch(function(b){c.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];m.setError(b,F,H).end()});var I=new Un({code:b&&b.code?b.code:De.MSG_REVOKE_FAIL,message:b&&b.message?b.message:void 0,data:{message:a}});return U.w("".concat(y," failed. error:"),b),Me(I)})}},{key:"deleteMessage",value:function(a){var c=this,h=null,m=a[0],y=m.conversationID,b="",I=[],E=[];if(m.conversationType===T.CONV_C2C)h=this.getModule(ao),b=y.replace(T.CONV_C2C,""),a.forEach(function(H){H&&H.status===so.SUCCESS&&H.conversationID===y&&(H._onlineOnlyFlag||I.push("".concat(H.sequence,"_").concat(H.random,"_").concat(H.time)),E.push(H))});else if(m.conversationType===T.CONV_GROUP)h=this.getModule(Mt),b=y.replace(T.CONV_GROUP,""),a.forEach(function(H){H&&H.status===so.SUCCESS&&H.conversationID===y&&(H._onlineOnlyFlag||I.push("".concat(H.sequence)),E.push(H))});else if(m.conversationType===T.CONV_SYSTEM)return Me({code:De.CANNOT_DELETE_GRP_SYSTEM_NOTICE});if(!h)return this._onCannotFindModule();if(I.length===0)return this._onMessageDeleted(E);I.length>30&&(I=I.slice(0,30),E=E.slice(0,30));var R=new We("deleteMessage");R.setMessage("to:".concat(b," count:").concat(I.length));var F="".concat(this._n,".").concat("deleteMessage");return h.deleteMessage({to:b,keyList:I}).then(function(H){return R.end(),U.i("".concat(F," ok")),c._onMessageDeleted(E)}).catch(function(H){c.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];R.setError(H,we,Ue).end()}),U.w("".concat(F," failed. error:"),H);var ee=new Un({code:H&&H.code?H.code:De.MSG_DELETE_FAIL,message:H&&H.message?H.message:void 0});return Me(ee)})}},{key:"_onMessageDeleted",value:function(a){return this.getModule(ct).onMessageDeleted(a),At({messageList:a})}},{key:"translateText",value:function(a){var c="".concat(this._n,".").concat("translateText"),h=a.sourceTextList,m=a.sourceLanguage,y=a.targetLanguage,b=new We("translateText");return b.setMessage("sourceLanguage:".concat(m," targetLanguage:").concat(y)),this.request({protocolName:Y_,requestData:{sourceTextList:h,source:m||"auto",target:y,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then(function(I){var E=I.data,R=E.error,F=E.requestID,H=E.translatedTextList;if(R.code===0)return b.end(),U.i("".concat(c," ok. requestID:").concat(F)),ht({translatedTextList:H});throw r(r({},R),{},{requestID:F})}).catch(function(I){return b.setCode(I.code).setMoreMessage(I.requestID).end(),U.w("".concat(c," failed. error:"),I),Me({code:De.TRANSLATE_TEXT_FAIL})})}},{key:"modifyRemoteMessage",value:function(a){var c=this,h=null,m=a.conversationType,y=a.to,b=this.getModule(Mt);if(!b)return this._onCannotFindModule();if(b.isMessageFromOrToAVChatroom(y))return Me({code:De.MSG_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:a}});if(this.getModule(Ga).filterMessage(a)===!1)return Me({code:De.PROFANITY_FOUND,data:{message:a}});m===T.CONV_C2C?h=this.getModule(ao):m===T.CONV_GROUP&&(h=this.getModule(Mt));var I=new We("modifyMessage");I.setMessage("to:".concat(y));var E="".concat(this._n,".modifyRemoteMessage");return h.modifyRemoteMessage(a).then(function(R){I.end(),U.i("".concat(E," ok"));var F=c._onModifyRemoteMessageResp(a,R.data);return ht({message:F})}).catch(function(R){if(I.setCode(R.code).setMoreMessage(R.message).end(),U.w("".concat(E," failed. error:"),R),R.code===20027){var F=c._onModifyRemoteMessageResp(a,R.data);return Me({code:De.MSG_MODIFY_CONFLICT,data:{message:F}})}return Me({code:R.code,message:R.message,data:{message:a}})})}},{key:"_generateSearchRequestData",value:function(a){var c=a.conversationID,h=a.timePosition,m=a.timePeriod,y=r(r({},D(a,e8)),{},{endTime:h});return Ge(c)||(mo(c)&&(y.account=c.replace(T.CONV_C2C,"")),io(c)&&(y.groupID=c.replace(T.CONV_GROUP,""))),un(m)&&(y.startTime=h?h-(m||0):Number((new Date().getTime()/1e3).toFixed(0))-(m||0)),un(y.count)&&(y.count=Math.min(y.count,100)),y}},{key:"searchCloudMessages",value:function(a){var c=this,h="searchCloudMessages",m="".concat(this._n,".").concat(h);if(!a)return Me({code:De.OPTIONS_IS_EMPTY,message:this.getErrorMessage(De.OPTIONS_IS_EMPTY,h)});var y=a.keywordList,b=a.keywordListMatchType,I=a.conversationID,E=a.cursor,R=rt(a.senderUserIDList)&&a.senderUserIDList.length>0,F=rt(a.messageTypeList)&&a.messageTypeList.length>0;if(!(y||R&&F))throw U.e("[".concat(h,'] Missing required params: "keywordList".')),new Error("Params validate failed.");var H=Date.now(),ee=new We(h),ge="keywordList:".concat(y," keywordListMatchType:").concat(b," ")+"conversationID:".concat(I," cursor:").concat(E);return U.l("".concat(m," ").concat(ge)),this.request({protocolName:Xg,requestData:this._generateSearchRequestData(a)}).then(function(be){var we=be.data,Ue=we.errorCode,qe=we.errorInfo,nt=Date.now()-H;if(Ue!==0){if(Ue===De.ERR_SVR_COMM_INVALID_SERVICE||Ue===De.MSG_SEARCH_CURSOR_INVALID||Ue===De.MSG_SEARCH_CURSOR_EXPIRED)return Me({code:Ue});throw new Un({code:Ue,message:qe})}var mt=be.data,Pt=mt.cursor,gn=mt.totalCount,_n=mt.searchResult;ee.setNetworkType(c.getNetworkType()).setMessage("".concat(ge," totalCount:").concat(gn," cost ").concat(nt," ms")).end();var Or=c._handleSearchResults(_n,!a.conversationID);return U.l("".concat(m," ok. cursor:").concat(Pt," totalCount:").concat(gn," cost ").concat(nt," ms")),ht({searchResultList:Or,cursor:Pt,totalCount:gn})}).catch(function(be){return c.probeNetwork().then(function(we){var Ue=A(we,2),qe=Ue[0],nt=Ue[1];ee.setMessage(ge).setError(be,qe,nt).end()}),Me(be)})}},{key:"_handleSearchResults",value:function(a,c){var h=this.getModule(ct);return rt(a)&&a.length!==0?a.map(function(m){var y=m.groupID,b=m.userID,I=m.messageCount,E=m.messageList,R=y?"".concat(T.CONV_GROUP).concat(y):"".concat(T.CONV_C2C).concat(b),F={conversationID:R,messageCount:I,messageList:[]};return c&&I>1||E&&E.length>0&&(F.messageList=h.onRoamingMessage(E,R,!1)),F}):[]}},{key:"_onModifyRemoteMessageResp",value:function(a,c){U.d("".concat(this._n,"._onModifyRemoteMessageResp options:"),c);var h=a.conversationType,m=a.from,y=a.to,b=a.random,I=a.sequence,E=a.time,R=c.elements,F=c.messageVersion,H=c.cloudCustomData,ee=H===void 0?"":H;return this.getModule(ct).onMessageModified({conversationType:h,from:m,to:y,time:E,random:b,sequence:I,elements:R,cloudCustomData:ee,messageVersion:F})}},{key:"_generateUUID",value:function(a){var c=this.getModule(pn),h="".concat(c.getSDKAppID(),"-").concat(c.getUserID(),"-").concat(function(){for(var b="",I=32;I>0;--I)b+=Md[Math.floor(Math.random()*ap)];return b}()),m=a.name||a.value||a.url||a.tempFilePath,y=m&&m.slice(m.lastIndexOf(".")+1);return y&&(h="".concat(h,".").concat(y)),h}},{key:"getMessageOption",value:function(a){return this._messageOptionsMap.get(a)}},{key:"_getNickAndAvatarByUserID",value:function(a){return this.getModule(pr).getNickAndAvatarByUserID(a)}},{key:"_getNameCardByGroupID",value:function(a){if(a.conversationType===T.CONV_GROUP){var c=this.getModule(Mt);if(c)return c.getMyNameCardByGroupID(a.to)}return""}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),p}(Sr),n8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="MessageExtensionModule",c.messageExtensionMap=new Map,c.globalSeqMap=new Map,c.getMessageExtensionsMap=new Map,c}return u(p,[{key:"onMessageExtensionNotify",value:function(a){var c=this,h=a.dataList,m=h.messageInfo,y=h.operateType,b=h.operateResultList,I=h.tinyID,E=h.globalSequence,R=m.clientTime,F=m.random,H="".concat(I,"-").concat(R,"-").concat(F),ee=[],ge=[];U.l("".concat(this._n,".onMessageExtensionNotify messageID:").concat(H," operateType:").concat(y," globalSequence:").concat(E)),this._updateGlobalSequence(H,E);var be=!1,we=!1;b.forEach(function(Ue){var qe=Ue.extensions,nt=qe===void 0?[]:qe,mt=Ue.clearSequence;y===1?(be=!0,nt.forEach(function(Pt){ee.push({key:Pt.key,value:Pt.value})}),c._updateLocalExtension(H,nt)):y===2?(we=!0,nt.forEach(function(Pt){ge.push(Pt.key)}),c._updateLocalExtension(H,nt)):y===3&&(we=!0,c._hasLocalExtension(H)&&c._getLocalExtension(H).forEach(function(Pt,gn){Pt.seq<=mt&&!Ye(Pt.value)&&ge.push(gn)}),c._clearLocalExtension(H,mt))}),be&&this.emitOuterEvent(O.MESSAGE_EXTENSIONS_UPDATED,{messageID:H,extensions:ee}),we&&this.emitOuterEvent(O.MESSAGE_EXTENSIONS_DELETED,{messageID:H,keyList:ge})}},{key:"setMessageExtensions",value:function(a,c){var h=this;if(!this.canIUse(ve.MSG_EXT))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var m="".concat(this._n,".").concat("setMessageExtensions"),y=a.ID,b=a.conversationID,I=a.sequence,E=a.time,R=L(c);c.length>20&&(R=c.slice(0,20),U.w("".concat(m,". the length of extensions cannot exceed 20.")));var F="conversationID:".concat(b," messageID:").concat(y," sequence:").concat(I," time:").concat(E," count:").concat(R.length),H=new We("setMessageExtensions");return H.setMessage(F),U.l("".concat(m," ").concat(F)),this._modifyMessageExtensions(a,R).then(function(ee){var ge=ee.resultList,be=ee.successCount,we=ee.failureCount,Ue="success count:".concat(be," fail count:").concat(we);return H.setMoreMessage(Ue).end(),U.l("".concat(m," ok. ").concat(Ue)),ht({extensions:ge})}).catch(function(ee){return h.probeNetwork().then(function(ge){var be=A(ge,2),we=be[0],Ue=be[1];H.setError(ee,we,Ue).end()}),U.e("".concat(m," failed. error:"),ee),Me(ee)})}},{key:"getMessageExtensions",value:function(a){var c=this;if(!this.canIUse(ve.MSG_EXT))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var h="".concat(this._n,".").concat("getMessageExtensions"),m=a.ID,y=a.conversationID,b=a.sequence,I=a.time,E="conversationID:".concat(y," messageID:").concat(m," sequence:").concat(b," time:").concat(I),R=new We("getMessageExtensions");R.setMessage(E),U.l("".concat(h," ").concat(E));var F=void 0;return this.getMessageExtensionsMap.has(m)&&(F=this._getGlobalSequence(m)),this._getMessageExtensions(a,F).then(function(H){return R.end(),U.l("".concat(h," ok. total count:").concat(H.length)),Ge(F)&&H.length>0&&c.getMessageExtensionsMap.set(m,1),ht({extensions:H})}).catch(function(H){return c.probeNetwork().then(function(ee){var ge=A(ee,2),be=ge[0],we=ge[1];R.setError(H,be,we).end()}),U.e("".concat(h," failed. error:"),H),Me(H)})}},{key:"deleteMessageExtensions",value:function(a,c){var h=this;if(!this.canIUse(ve.MSG_EXT))return Me({code:De.CANNOT_USE_COMMERCIAL_ABILITY});var m="".concat(this._n,".").concat("deleteMessageExtensions"),y=[],b=3;Ye(c)||(b=2,c.forEach(function(ge){y.push({key:ge,value:"",seq:0})}));var I=a.ID,E=a.conversationID,R=a.sequence,F=a.time,H="conversationID:".concat(E," messageID:").concat(I," sequence:").concat(R," time:").concat(F," operateType:").concat(b),ee=new We("deleteMessageExtensions");return ee.setMessage(H),U.l("".concat(m," ").concat(H)),this._modifyMessageExtensions(a,y,b).then(function(ge){var be=ge.resultList,we=ge.successCount,Ue=ge.failureCount,qe="";return b===2&&(qe="success count:".concat(we," fail count:").concat(Ue)),ee.setMoreMessage("".concat(qe)).end(),U.l("".concat(m," ok. ").concat(qe)),ht({extensions:be})}).catch(function(ge){return h.probeNetwork().then(function(be){var we=A(be,2),Ue=we[0],qe=we[1];ee.setError(ge,Ue,qe).end()}),U.e("".concat(m," failed. error:"),ge),Me(ge)})}},{key:"_modifyMessageExtensions",value:function(a,c){var h=this,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=oo(a.to)?T.CONV_TOPIC:a.conversationType,b=void 0;m!==3&&(b=this._getRequestExtensions(a,c));var I=null;switch(y){case T.CONV_C2C:I=this.getModule(ao);break;case T.CONV_GROUP:I=this.getModule(Mt);break;case T.CONV_TOPIC:I=this.getModule(sr);break;default:return Me({code:De.CANNOT_FIND_MODULE})}return I.modifyMessageExtensions(a,b,m).then(function(E){var R=E.data,F=R.extensions,H=R.seq,ee=[],ge=0,be=0,we=[];return(F=Ye(F)?[]:F).forEach(function(Ue){var qe=Ue.errorCode,nt=Ue.extension,mt=nt.key,Pt=nt.value,gn=nt.seq;ee.push({code:qe,key:mt,value:Pt}),qe===0?ge++:be++,we.push({key:mt,value:Pt,seq:gn})}),h._updateGlobalSequence(a.ID,H),we.length>0&&(h._updateLocalExtension(a.ID,we),we=null),{resultList:ee,successCount:ge,failureCount:be}}).catch(function(E){return Me(E)})}},{key:"_getRequestExtensions",value:function(a,c){var h=[];if(this._hasLocalExtension(a.ID)){var m=this._getLocalExtension(a.ID);return c.forEach(function(y){var b=y.key,I=y.value,E=0;m.has(b)&&(E=m.get(b).seq),h.push({key:b,value:I,seq:E})}),h}return c.forEach(function(y){var b=y.key,I=y.value;h.push({key:b,value:I,seq:0})}),h}},{key:"_getMessageExtensions",value:function(a,c){var h=this,m="".concat(this._n,"._getMessageExtensions"),y=a.ID,b=a.to,I=null;switch(oo(b)?T.CONV_TOPIC:a.conversationType){case T.CONV_C2C:I=this.getModule(ao);break;case T.CONV_GROUP:I=this.getModule(Mt);break;case T.CONV_TOPIC:I=this.getModule(sr);break;default:return Me({code:De.CANNOT_FIND_MODULE})}return I.getMessageExtensions(a,c).then(function(E){var R=E.data,F=R.extensions,H=R.completeFlag,ee=R.globalSequence,ge=R.clearSequence;if(F=Ye(F)?[]:F,U.l("".concat(m," ok. completeFlag:").concat(H," globalSequence:").concat(ee," clearSequence:").concat(ge," count:").concat(F.length)),h._updateLocalExtension(y,F),h._clearLocalExtension(y,ge),h._updateGlobalSequence(y,ee),H!==1){var be=F.slice(-1)[0].seq+1;return h._getMessageExtensions(a,be)}return h._getLocalExtensions(y)}).catch(function(E){return Me(E)})}},{key:"_hasLocalExtension",value:function(a){return this.messageExtensionMap.has(a)}},{key:"_getLocalExtension",value:function(a){return this.messageExtensionMap.get(a)}},{key:"_updateLocalExtension",value:function(a,c){this._hasLocalExtension(a)||this.messageExtensionMap.set(a,new Map);var h=this._getLocalExtension(a);c.forEach(function(m){var y=m.key,b=m.value,I=b===void 0?"":b,E=m.seq;h.set(y,{value:I,seq:E})})}},{key:"_clearLocalExtension",value:function(a,c){if(!(c<=0)&&this._hasLocalExtension(a)){var h=this._getLocalExtension(a);h.forEach(function(m,y){m.seq<=c&&h.delete(y)})}}},{key:"_getLocalExtensions",value:function(a){var c=[];return this._hasLocalExtension(a)&&this._getLocalExtension(a).forEach(function(h,m){var y=h.value;Ye(y)||c.push({key:m,value:y})}),c}},{key:"_getGlobalSequence",value:function(a){return this.globalSeqMap.get(a)}},{key:"_updateGlobalSequence",value:function(a,c){this.globalSeqMap.set(a,c)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),p}(Sr),r8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="ComboMessageModule",c}return u(p,[{key:"sendMessage",value:function(a){var c=this,h=this._constructMessageInstance(a);if(h===null)return Me({code:De.MSG_SEND_FAIL});this._addSendMessageTotalCount(h);var m=Date.now();return this.getModule(ct).setMessageRandom(h),this._sendComboMessage(h,a).then(function(y){var b=y.data,I=b.time,E=b.sequence,R=b.readReceiptCode;un(R)&&R!==0&&(new We("sendMessageWithReceipt").setMessage("from:".concat(h.from," to:").concat(h.to," sequence:").concat(E," readReceiptCode:").concat(R)).end(),U.w("".concat(c._n,".sendMessage readReceiptCode:").concat(R," message:").concat(c.getErrorMessage(R)))),c._addSendMessageSuccessCount(h,m);var F=c.getModule(ct);h.status=so.SUCCESS,h.time=I,h.conversationType===T.CONV_GROUP&&(h.sequence=E),F.appendToMessageList(h);var H=h;return h._isExcludedFromLastMessage===!0&&(H=""),F.onMessageSent({conversationOptionsList:[{conversationID:h.conversationID,unreadCount:0,type:h.conversationType,subType:h.conversationSubType,lastMessage:H}]}),ht({message:h})}).catch(function(y){return c._onSendMessageFailed(h,y)})}},{key:"_sendComboMessage",value:function(a,c){var h=this._m.getModule(Pi),m="";return a.conversationType===T.CONV_C2C&&(m="".concat(Q.NAME.OPEN_IM,".").concat(Mp)),a.conversationType===T.CONV_GROUP&&(m="".concat(Q.NAME.GROUP,".").concat(Ip)),h.sendComboMessage({servcmd:m,data:c})}},{key:"_constructMessageInstance",value:function(a){var c="".concat(this._n,"._constructMessageInstance"),h=null;try{var m=this.getMyUserID(),y={};if(y.senderTinyID=this.getMyTinyID(),y.currentUser=m,y.from=a.From_Account||m,a.GroupId?(y.conversationID="".concat(T.CONV_GROUP).concat(a.GroupId),y.conversationType=T.CONV_GROUP,y.to=a.GroupId):a.To_Account&&(y.conversationID="".concat(T.CONV_C2C).concat(a.To_Account),y.conversationType=T.CONV_C2C,y.to=a.To_Account),y.time=a.MsgTimeStamp||0,y.random=a.Random||a.MsgRandom||0,y.priority=a.MsgPriority,Et(a.CloudCustomData)&&a.CloudCustomData.length>0&&(y.cloudCustomData=a.CloudCustomData),rt(a.SendMsgControl)&&(y.messageControlInfo={},a.SendMsgControl.includes("NoUnread")&&(y.messageControlInfo.excludedFromUnreadCount=1),a.SendMsgControl.includes("NoLastMsg")&&(y.messageControlInfo.excludedFromLastMessage=1)),y.conversationType===T.CONV_GROUP&&rt(a.To_Account)&&a.To_Account.length>0){var b=a.To_Account;a.To_Account.length>50&&(b=a.To_Account.slice(0,50),U.w("".concat(c," To_Account must be less than or equal to 50."))),y.receiverList=L(b),a.To_Account=L(b)}a.IsNeedReadReceipt!==1&&a.NeedReadReceipt!==1||(y.needReadReceipt=!0),a.SupportMessageExtension===1&&(y.isSupportExtension=!0),(h=new Hr(y)).status=so.UNSEND,a.MsgClientTime=h.clientTime,h.conversationType===T.CONV_C2C&&(a.MsgSeq=h.sequence);for(var I,E=a.MsgBody.length,R=0;R100)return p--,c;if(rt(c)){var m=c.map(function(R){return Xi(R)?a(R,h):R});return p--,m}if(Xi(c)){var y=(b=c,I=function(R,F){if(!bd(F))return!1;if((ee=F)!==f1(ee))for(var H=0;H65535)return h1(240|l>>>18,128|l>>>12&63,128|l>>>6&63,128|63&l)}else l=65533}else l<=57343&&(l=65533);return l<=2047?h1(192|l>>>6,128|63&l):h1(224|l>>>12,128|l>>>6&63,128|63&l)},g1=function(k){for(var l=k===void 0?"":(""+k).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,l8),p=0|l.length,a=new Uint8Array(p),c=0;c0)for(var b=0;b=m&&(U.l("".concat(l._n,"._checkPromiseMap request timeout, delete requestID:").concat(a)),l._promiseMap.delete(a),c(new Un({code:De.NETWORK_TIMEOUT})),l._channelModule.onRequestTimeout(a))})}},{key:"onOpen",value:function(l){if(this._readyState!==""){this._onOpenTs=Date.now();var p=l.id;this._socketID=p;var a=Date.now()-this._startTs;U.l("".concat(this._n,"._onOpen cost ").concat(a," ms. socketID:").concat(p)),new We("wsOnOpen").setMessage(a).setCostTime(a).setMoreMessage("socketID:".concat(p)).end(),l.id===this._socketID&&(this._readyState=Lp,this._reConnectCount=0,this._resend(),this._reConnectFlag===!0&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:"onClose",value:function(l){var p=new We("wsOnClose"),a=l.id,c=l.e,h="sourceSocketID:".concat(a," currentSocketID:").concat(this._socketID," code:").concat(c.code," reason:").concat(c.reason),m=0;this._onOpenTs!==0&&(m=Date.now()-this._onOpenTs),p.setMessage(m).setCostTime(m).setMoreMessage(h).setCode(c.code).end(),U.l("".concat(this._n,"._onClose ").concat(h," onlineTime:").concat(m)),a===this._socketID&&(this._readyState=am,m<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:"onError",value:function(l){var p=l.id,a=l.e,c="sourceSocketID:".concat(p," currentSocketID:").concat(this._socketID);new We("wsOnError").setMessage(a.errMsg||Ml(a)).setMoreMessage(c).setLevel("error").end(),U.w("".concat(this._n,"._onError"),a,c),p===this._socketID&&(this._readyState="",this._channelModule.onError())}},{key:"onMessage",value:function(l){var p;try{p=JSON.parse(l.data)}catch{new We("jsonParseError").setMessage(l.data).end()}if(p&&p.head){var a=this._getRequestIDFromHead(p.head),c=p.body;if(!this._isTRTCCommand(a)){var h=lp(p.head);c=p1(p.body,this._getResponseKeyMap(h))}if(U.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(c)," requestID:").concat(a," has:").concat(this._promiseMap.has(a))),this._setNextPingTs(),this._promiseMap.has(a)){var m=this._promiseMap.get(a),y=m.resolve,b=m.reject,I=m.timestamp;return this._promiseMap.delete(a),this._calcRTT(I),void(c.errorCode&&c.errorCode!==0?(this._channelModule.onErrorCodeNotZero(c),b(new Un({code:c.errorCode,message:c.errorInfo||"",data:a.includes(Og)||a.includes($g)?{elements:c.elements,messageVersion:c.messageVersion,cloudCustomData:c.cloudCustomData}:void 0}))):y(ht(c)))}this._channelModule.onMessage({head:p.head,body:c})}}},{key:"_isTRTCCommand",value:function(l){for(var p=this._channelModule.getModule(M0).getCommandList(),a=!1,c=0;c0&&this._promiseMap.forEach(function(y,b){var I=y.uplinkData,E=y.resolve,R=y.reject;l._promiseMap.set(b,{resolve:E,reject:R,timestamp:Date.now(),uplinkData:I}),l._execute(b,I)}),this._simpleRequestMap.size>0){var p,a=G(this._simpleRequestMap);try{for(a.s();!(p=a.n()).done;){var c=A(p.value,2),h=c[0],m=c[1];this._execute(h,m)}}catch(y){a.e(y)}finally{a.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(l){var p=this;l.head.seq=this._getSequence(),l.head.reqtime=Math.floor(Date.now()/1e3),l.keyMap;var a=D(l,f8),c=this._getRequestIDFromHead(l.head),h=JSON.stringify(a);return new Promise(function(m,y){p._promiseMap.set(c,{resolve:m,reject:y,timestamp:Date.now(),uplinkData:h}),U.d("".concat(p._n,".send uplinkData:").concat(JSON.stringify(a)," requestID:").concat(c," readyState:").concat(p._readyState)),p._readyState!==Lp?p._reConnect():(p._execute(c,h),p._channelModule.getModule($o).addRequestCount())})}},{key:"simplySend",value:function(l){l.head.seq=this._getSequence(),l.head.reqtime=Math.floor(Date.now()/1e3),l.keyMap;var p=D(l,p8),a=this._getRequestIDFromHead(l.head),c=JSON.stringify(p);this._readyState!==Lp?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(a)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(a){this.getModule(Pi).onErrorCodeNotZero(a)}},{key:"onMessage",value:function(a){this.getModule(Pi).onMessage(a)}},{key:"send",value:function(a){return this._socketHandler?this._previousState!==T.NET_STATE_CONNECTED&&a.head.servcmd.includes(Sp)?(this.reConnect(),this._sendLogViaHTTP(a)):this._socketHandler.send(a):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(a){var c=Q.HOST.CURRENT.STAT;return new Promise(function(h,m){var y="".concat(c,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(a.head.sdkappid,"&reqtime=").concat(Date.now()),b=JSON.stringify(a.body),I="application/x-www-form-urlencoded;charset=UTF-8";if(je)Fe.request({url:y,data:b,method:"POST",timeout:3e3,header:{"content-type":I},success:function(){h()},fail:function(){m(new Un({code:De.NETWORK_ERROR}))}});else{var E=new XMLHttpRequest,R=setTimeout(function(){E.abort(),m(new Un({code:De.NETWORK_TIMEOUT}))},3e3);E.onreadystatechange=function(){E.readyState===4&&(clearTimeout(R),E.status===200||E.status===304?h():m(new Un({code:De.NETWORK_ERROR})))},E.open("POST",y,!0),E.setRequestHeader("Content-type",I),E.send(b)}})}},{key:"simplySend",value:function(a){return this._socketHandler?this._socketHandler.simplySend(a):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED),this.reConnect()}},{key:"onError",value:function(){je&&!_e&&this.outputWarning("DomainNameInMP"),this._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(a){return this.getModule(Pi).getKeyMap(a)}},{key:"_onAppHide",value:function(){this._isAppShowing=!1}},{key:"_onAppShow",value:function(){this._isAppShowing=!0}},{key:"onRequestTimeout",value:function(a){}},{key:"onReconnected",value:function(){U.l("".concat(this._n,".onReconnected")),this._m.restartTimer(),this.getModule(Pi).onReconnected(),this._emitNetStateChangeEvent(T.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){U.l("".concat(this._n,".onReconnectFailed")),this._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(a){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var a=arguments.length>0&&arguments[0]!==void 0&&arguments[0],c=!1;this._socketHandler&&(c=this._socketHandler.getReconnectFlag());var h="forcedFlag:".concat(a," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(c);if(U.l("".concat(this._n,".reConnect ").concat(h)),!this._fatalErrorFlag&&this._socketHandler){if(a===!0)this._socketHandler.forcedReconnect();else{if(this._previousState===T.NET_STATE_CONNECTING&&c)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(T.NET_STATE_CONNECTING)}}},{key:"_emitNetStateChangeEvent",value:function(a){this._previousState!==a&&(U.l("".concat(this._n,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(a)),this._previousState=a,this.emitOuterEvent(O.NET_STATE_CHANGE,{state:a}))}},{key:"_ping",value:function(){var a=this;if(this._probing!==!0){this._probing=!0;var c=this.getModule(Pi).getProtocolData({protocolName:R_});this.send(c).then(function(){a._probing=!1}).catch(function(h){if(U.w("".concat(a._n,"._ping failed. error:"),h),a._probing=!1,h&&h.code===60002)return new We("error").setMessage("code:".concat(h.code," message:").concat(h.message)).setNetworkType(a.getModule(Fa).getNetworkType()).end(),a._fatalErrorFlag=!0,void a._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED);a.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];U.l("".concat(a._n,"._ping failed. probe network, isAppShowing:").concat(a._isAppShowing," online:").concat(b," networkType:").concat(I)),b?a.reConnect():a._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED)})})}}},{key:"_checkNextPing",value:function(){this._socketHandler&&this._socketHandler.isConnected()&&Date.now()>=this._socketHandler.getNextPingTs()&&this._ping()}},{key:"dealloc",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._previousState=T.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3)}}]),p}(Sr),m8=["a2","tinyid"],v8=["a2","tinyid"],y8=function(){function k(l){i(this,k),this._n="ProtocolHandler",this._sessionModule=l,this._configMap=new Map,this._fillConfigMap()}return u(k,[{key:"_fillConfigMap",value:function(){this._configMap.clear();var l=this._sessionModule.genCommonHead(),p=this._sessionModule.genCosSpecifiedHead(),a=this._sessionModule.genSSOReportHead();this._configMap.set(bp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(bp)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}}(l)),this._configMap.set(I0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(I0)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}}(l)),this._configMap.set(C0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(C0)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}}(l)),this._configMap.set(T0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.STAT_SERVICE,".").concat(T0)}),body:{}}}(l)),this._configMap.set(A_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_COS_SIGN,".").concat(A_)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{request:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},response:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}}(p)),this._configMap.set(L_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.CUSTOM_UPLOAD,".").concat(L_)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},response:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}}(p)),this._configMap.set(O_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.CUSTOM_UPLOAD,".").concat(O_)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},response:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}}(p)),this._configMap.set(F_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_CONFIG_MANAGER,".").concat(F_)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:"uint32_sdkappid"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(l)),this._configMap.set(G_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_CONFIG_MANAGER,".").concat(G_)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(l)),this._configMap.set(x_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_CONFIG_MANAGER,".").concat(x_)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(l)),this._configMap.set(U_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_CONFIG_MANAGER,".").concat(U_)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(l)),this._configMap.set($_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OVERLOAD_PUSH,".").concat($_)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}}(l)),this._configMap.set(w0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(w0)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},response:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"to",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}}(l)),this._configMap.set(K_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_MSG_AUDIT_MGR,".").concat(K_)}),body:{version:0,deviceID:"",startIndex:void 0},keyMap:{request:{version:"uint64_version",deviceID:"str_device_id",startIndex:"uint64_start_index"},response:{msg_cmd_error_code:"errorInfo",str_err_msg:"errorMessage",uint32_code:"errorCode",msg_scene_ctl_config:"filterConfig",uint64_c2c_custom_msg_flag:"c2c_custom_message",uint64_c2c_text_msg_flag:"c2c_text_message",uint64_group_custom_msg_flag:"group_custom_message",uint64_group_text_msg_flag:"group_text_message",uint64_group_info_flag:"group_profile",uint64_group_member_info_flag:"group_member_profile",uint64_relation_chain_flag:"sns",uint64_user_info_flag:"user_profile",rpt_msg_dirty_word:"lexicon",str_dirty_word:"profanity",str_replaced_content:"replacement",uint64_filter_type:"filterType",uint64_id:"id",uint64_word_type:"profanityType",uint64_complete_flag:"completeFlag",uint64_next_start_index:"nextStartIndex",uint64_version:"version",uint64_expired_time:"expiredTime"}}}}(l)),this._configMap.set(Mp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(Mp)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",nick:"From_AccountNick",avatar:"From_AccountHeadurl",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"IsNeedReadReceipt"}}}}(l)),this._configMap.set(Ip,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Ip)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0},keyMap:{request:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",clientSequence:"ClientSeq",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"NeedReadReceipt",receiverList:"To_Account"},response:{MsgTime:"time",MsgSeq:"sequence"}}}}(l)),this._configMap.set(q0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(q0)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}}(l)),this._configMap.set(p_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(p_)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}}(l)),this._configMap.set(Tp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(Tp)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},response:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer"}}}}(l)),this._configMap.set(Og,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(Og)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(l)),this._configMap.set(wp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(wp)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{request:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},response:{Random:"random",MsgTime:"time",MsgSeq:"sequence",ReqMsgSeq:"sequence",RspMsgList:"messageList",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgPriority:"priority",MsgBody:"elements",MsgType:"type",MsgContent:"content",IsFinished:"complete",Download_Flag:"downloadFlag",ClientSeq:"clientSequence",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList"}}}}(l)),this._configMap.set(V0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(V0)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}}(l)),this._configMap.set(z0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(z0)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}}(l)),this._configMap.set(j0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(j0)}),body:{toAccount:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Peer_Account"},response:{MuteNotificationsList:"muteFlagList"}}}}(l)),this._configMap.set(h_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(h_)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:"MsgReadedSeq"}}}}(l)),this._configMap.set(Ug,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(Ug)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},response:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}}(l)),this._configMap.set(K0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(K0)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}}(l)),this._configMap.set(M_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(M_)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}}(l)),this._configMap.set(Y_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_TRANSLATE,".").concat(Y_)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:"",target:""},keyMap:{request:{sourceTextList:"SourceText",SDKAppID:"SdkAppId",from:"FromAccount"},response:{TargetText:"translatedTextList",RequestId:"requestID",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}}(l)),this._configMap.set($g,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat($g)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(l)),this._configMap.set(g_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(g_)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}}(l)),this._configMap.set(v_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(v_)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{request:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}}(l)),this._configMap.set(m_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(m_)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}}(l)),this._configMap.set(y_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(y_)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:"MsgSeq",count:"Num"},response:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}}(l)),this._configMap.set(Y0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM_MSG_EXT,".").concat(Y0)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(l)),this._configMap.set(J0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM_MSG_EXT,".").concat(J0)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}}(l)),this._configMap.set(jg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM_MSG_EXT,".").concat(jg)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}}(l)),this._configMap.set(Wg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM_MSG_EXT,".").concat(Wg)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}}(l)),this._configMap.set(Xg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.MESSAGE_SEARCH,".").concat(Xg)}),body:{keywordList:void 0,keywordListMatchType:"or",account:void 0,groupID:void 0,count:100,cursor:void 0,messageTypeList:void 0,senderUserIDList:void 0,startTime:void 0,endTime:void 0},keyMap:{request:{keywordListMatchType:"MatchType",account:"PeerAccount",groupID:"GroupID",messageTypeList:"MsgTypeList",senderUserIDList:"SendUserIDList"},response:{GroupID:"groupID",UserID:"userID",Count:"messageCount",LastMsgTime:"lastMessageTime",ConversationMsgs:"searchResult",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer",MsgSeq:"sequence",ReqMsgSeq:"sequence",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgContent:"content",ClientSeq:"clientSequence",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList"}}}}(l)),this._configMap.set(W0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(W0)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}}(l)),this._configMap.set(X0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(X0)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:15,assistFlag:31},keyMap:{request:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime",LastMsgFlags:"lastMessageFlag",TopFlags:"isPinned",TopTimeStamp:"pinnedTimeStamp",TopStartIndex:"pinnedStartIndex",GroupId:"convGroupID",C2cRemark:"friendRemark",MsgRecvOption:"messageRemindType",GroupIgnoredUnreadSeqCount:"noUnreadCount",GroupNextMsgSeq:"nextMessageSeq"}}}}(l)),this._configMap.set(Z0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Z0)}),body:{fromAccount:"",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble",conversationList:"ContactItem"},response:{ResultItem:"resultList",ToGroupid:"groupID",ResultCode:"code",ResultInfo:"info"}}}}(l)),this._configMap.set(Q0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Q0)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:"ToGroupid"}}}}(l)),this._configMap.set(e_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(e_)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}}(l)),this._configMap.set(t_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(t_)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(l)),this._configMap.set(vw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Rg)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(l)),this._configMap.set(Rg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Rg)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(l)),this._configMap.set(yw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Sd)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}}(l)),this._configMap.set(n_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(n_)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}}(l)),this._configMap.set(Sd,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Sd)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},response:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}}(l)),this._configMap.set(_w,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Sd)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(l)),this._configMap.set(bw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(Sd)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(l)),this._configMap.set(r_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.RECENT_CONTACT,".").concat(r_)}),body:{fromAccount:"",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}}(l)),this._configMap.set(S0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.PROFILE,".").concat(S0)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(l)),this._configMap.set(k0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.PROFILE,".").concat(k0)}),body:{fromAccount:"",profileItem:[{tag:Gt.NICK,value:""},{tag:Gt.GENDER,value:""},{tag:Gt.ALLOWTYPE,value:""},{tag:Gt.AVATAR,value:""}]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(l)),this._configMap.set(D0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(D0)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}}(l)),this._configMap.set(E0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(E0)}),body:{fromAccount:"",toAccount:[]}}}(l)),this._configMap.set(A0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(A0)}),body:{fromAccount:"",toAccount:[]}}}(l)),this._configMap.set(V_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(V_)}),body:{customStatus:""},keyMap:{}}}(l)),this._configMap.set(em,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(em)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}}(l)),this._configMap.set(tm,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(tm)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(l)),this._configMap.set(nm,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(nm)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(l)),this._configMap.set(L0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(L0)}),body:{fromAccount:"",startIndex:0,standardSequence:0,customSequence:0},keyMap:{response:{FriendNum:"friendCount",UserDataItem:"resultList",ValueItem:"tagValueList"}}}}(l)),this._configMap.set(P0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(P0)}),body:{fromAccount:"",addFriendItem:[],type:""},keyMap:{request:{source:"AddSource",wording:"AddWording",type:"AddType"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(x0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(x0)}),body:{fromAccount:"",updateItem:void 0},keyMap:{request:{snsItem:"SnsItem"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(N0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(N0)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"DeleteType"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(O0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(O0)}),body:{fromAccount:"",userIDList:void 0},keyMap:{response:{InfoItem:"resultList",SnsProfileItem:"tagValueList"}}}}(l)),this._configMap.set(R0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(R0)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"CheckType"},response:{InfoItem:"resultList"}}}}(l)),this._configMap.set(U0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(U0)}),body:{fromAccount:"",applicationType:"",startTime:0,maxLimited:0,lastSequence:0},keyMap:{response:{PendencyItem:"resultList",AddSource:"source",AddTime:"time",AddWording:"wording",Image:"avatar",UnreadPendencyCount:"unreadCount",To_Account:"userID",PendencyType:"type"}}}}(l)),this._configMap.set(Lg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(Lg)}),body:{fromAccount:"",responseFriendItem:[]},keyMap:{request:{tag:"TagName",action:"ResponseAction"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(F0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(F0)}),body:{fromAccount:"",type:"",userIDList:void 0},keyMap:{request:{type:"PendencyType",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(G0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(G0)}),body:{fromAccount:"",latestTimeStamp:""},keyMap:{request:{latestTimeStamp:"LatestPendencyTimeStamp"}}}}(l)),this._configMap.set(B0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(B0)}),body:{fromAccount:"",groupName:void 0,userIDList:void 0},keyMap:{request:{groupName:"GroupName",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(H0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(H0)}),body:{fromAccount:"",nameList:void 0},keyMap:{request:{nameList:"GroupName"}}}}(l)),this._configMap.set($0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat($0)}),body:{fromAccount:"",lastSequence:0,needFriend:"Need_Friend_Type_Yes"},keyMap:{response:{ResultItem:"resultList",GroupName:"name",FriendNumber:"friendCount",To_Account:"userIDList"}}}}(l)),this._configMap.set(Cp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.FRIEND,".").concat(Cp)}),body:{fromAccount:"",oldName:"",newName:void 0,updateGroupItem:void 0},keyMap:{request:{oldName:"GroupOldName",newName:"GroupNewName"},response:{UpdateType:"type",ResultItem:"resultList"}}}}(l)),this._configMap.set(Ng,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Ng)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:"Member_Account"},response:{GroupIdList:"groups",NoUnreadSeqList:"excludedUnreadSequenceList",MsgSeq:"readedSequence",LastRecallTime:"_lastRevokedTime"}}}}(l)),this._configMap.set(Pg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Pg)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:void 0,groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}}(l)),this._configMap.set(o_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(o_)}),body:{type:void 0,name:void 0,groupID:void 0,ownerID:void 0,introduction:void 0,notification:void 0,maxMemberNum:void 0,joinOption:void 0,memberList:void 0,groupCustomField:void 0,memberCustomField:void 0,webPushFlag:1,avatar:"",isSupportTopic:void 0,inviteOption:void 0},keyMap:{request:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",inviteOption:"InviteJoinOption"},response:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}}(l)),this._configMap.set(i_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(i_)}),body:{groupID:void 0}}}(l)),this._configMap.set(s_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(s_)}),body:{groupID:void 0,name:void 0,introduction:void 0,notification:void 0,avatar:void 0,joinOption:void 0,groupCustomField:void 0,muteAllMembers:void 0,inviteOption:void 0},keyMap:{request:{groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl",inviteOption:"InviteJoinOption"},response:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}}(l)),this._configMap.set(xg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(xg)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},response:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}}(l)),this._configMap.set(Mw,function(c){return c.a2,c.tinyid,{head:r(r({},D(c,m8)),{},{servcmd:"".concat(Q.NAME.BIG_GROUP_NO_AUTH,".").concat(xg)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:"ApplyMsg"},response:{HugeGroupFlag:"avChatRoomFlag"}}}}(l)),this._configMap.set(a_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(a_)}),body:{groupID:void 0}}}(l)),this._configMap.set(l_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(l_)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption","InviteJoinOption"]}},keyMap:{response:{}}}}(l)),this._configMap.set(u_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(u_)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}}(l)),this._configMap.set(c_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(c_)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(l)),this._configMap.set(d_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(d_)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",invitee:"Invited_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg"}}}}(l)),this._configMap.set(f_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(f_)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(l)),this._configMap.set(Fg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Fg)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:"Handle_Account"},response:{To_Account:"userID"}}}}(l)),this._configMap.set(__,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(__)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(l)),this._configMap.set(Gg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.BIG_GROUP_LONG_POLLING,".").concat(Gg)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(l)),this._configMap.set(Iw,function(c){return c.a2,c.tinyid,{head:r(r({},D(c,v8)),{},{servcmd:"".concat(Q.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,".").concat(Gg)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(l)),this._configMap.set(b_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(b_)}),body:{groupID:void 0}}}(l)),this._configMap.set(Bg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Bg)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(l)),this._configMap.set(Hg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Hg)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(l)),this._configMap.set(qg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(qg)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key"}}}}(l)),this._configMap.set(Vg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Vg)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}}(l)),this._configMap.set(zg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_ATTR,".").concat(zg)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}}(l)),this._configMap.set(I_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(I_)}),body:{notifyReqList:[]},keyMap:{request:{notifyReqList:"NotifyReqList"},response:{NextMsgTime:"nextRevokedTime",NotifyMsgList:"notifyList",NotifyRspList:"notifyRspList"}}}}(l)),this._configMap.set(Kg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Kg)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:"GroupCounter"}}}}(l)),this._configMap.set(Yg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(Yg)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:"GroupCounterKeys"}}}}(l)),this._configMap.set(B_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_COMMUNITY,".").concat(B_)}),body:{groupID:void 0,topicName:void 0,avatar:void 0,customData:void 0,topicID:void 0,notification:void 0,introduction:void 0},keyMap:{request:{avatar:"FaceUrl"}}}}(l)),this._configMap.set(H_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_COMMUNITY,".").concat(H_)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}}(l)),this._configMap.set(q_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_COMMUNITY,".").concat(q_)}),body:{groupID:void 0,topicID:void 0,avatar:void 0,customData:void 0,notification:void 0,introduction:void 0,muteAllMembers:void 0,topicName:void 0},keyMap:{request:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}}(l)),this._configMap.set(Qg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_COMMUNITY,".").concat(Qg)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:["NoUnreadSeqList"]},keyMap:{request:{topicIDList:"TopicIdList"},response:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence",NoUnreadSeqList:"excludedUnreadSequenceList"}}}}(l)),this._configMap.set(C_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(C_)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:["Role","NameCard","ShutUpUntil","JoinTime"],memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}}(l)),this._configMap.set(Jg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_AVCHATROOM,".").concat(Jg)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:"Timestamp",filter:"Mark"},response:{NextTimestamp:"offset"}}}}(l)),this._configMap.set(T_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(T_)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}}(l)),this._configMap.set(w_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(w_)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}}(l)),this._configMap.set(S_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(S_)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}}(l)),this._configMap.set(k_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(k_)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}}(l)),this._configMap.set(D_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP,".").concat(D_)}),body:{groupID:void 0,topicID:void 0,userID:void 0,messageRemindType:void 0,nameCard:void 0,role:void 0,memberCustomField:void 0,muteTime:void 0},keyMap:{request:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}}(l)),this._configMap.set(E_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.GROUP_AVCHATROOM,".").concat(E_)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:"CommandType",memberList:"MemberList",markType:"Marks",userID:"Member_Account"},response:{CommandType:"operationType",Marks:"markType",Member_Account:"userID"}}}}(l)),this._configMap.set(Sp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STAT,".").concat(Sp)}),body:{header:{},event:[],quality:[]},keyMap:{request:{SDKType:"sdk_type",SDKVersion:"sdk_version",deviceType:"device_type",platform:"platform",instanceID:"instance_id",traceID:"trace_id",SDKAppID:"sdk_app_id",userID:"user_id",tinyID:"tiny_id",extension:"extension",timestamp:"timestamp",networkType:"network_type",eventType:"event_type",code:"error_code",message:"error_message",moreMessage:"more_message",duplicate:"duplicate",costTime:"cost_time",level:"level",qualityType:"quality_type",reportIndex:"report_index",wholePeriod:"whole_period",totalCount:"total_count",rttCount:"success_count_business",successRateOfRequest:"percent_business",countLessThan1Second:"success_count_business",percentOfCountLessThan1Second:"percent_business",countLessThan3Second:"success_count_platform",percentOfCountLessThan3Second:"percent_platform",successCountOfBusiness:"success_count_business",successRateOfBusiness:"percent_business",successCountOfPlatform:"success_count_platform",successRateOfPlatform:"percent_platform",successCountOfMessageReceived:"success_count_business",successRateOfMessageReceived:"percent_business",avgRTT:"average_value",avgDelay:"average_value",avgValue:"average_value",uiPlatform:"ui_platform"}}}}(a)),this._configMap.set(R_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.HEARTBEAT,".").concat(R_)}),body:{}}}(l)),this._configMap.set(Cw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_PUSH,".").concat(Cw)}),body:{},keyMap:{response:{C2cMsgArray:"C2CMessageArray",GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",C2cNotifyMsgArray:"C2CNotifyMessageArray",C2cMsgInfo:"C2CReadReceiptArray",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyAdd_Account:"userID",ProfileImNick:"nick",PendencyType:"applicationType",C2CReadAllMsg:"readAllC2CMessage",IsNeedReadReceipt:"needReadReceipt",Status:"statusType"}}}}(l)),this._configMap.set(Tw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_PUSH,".").concat(Tw)}),body:{},keyMap:{response:{GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyType:"applicationType"}}}}(l)),this._configMap.set(Zg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.OPEN_IM,".").concat(Zg)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}}(l)),this._configMap.set(ww,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(ww)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}}(l)),this._configMap.set(P_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_LONG_MESSAGE,".").concat(P_)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}}(l)),this._configMap.set(N_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_LONG_MESSAGE,".").concat(N_)}),body:{messageList:[]},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",type:"MsgType",content:"MsgContent",data:"Data",description:"Desc",extension:"Ext",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody"}}}}(l)),this._configMap.set(W_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(W_)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns"}}}}(l)),this._configMap.set(j_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(j_)}),body:{isWebUniapp:0}}}(l)),this._configMap.set(z_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(Q.NAME.IM_OPEN_STATUS,".").concat(z_)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}}(l))}},{key:"has",value:function(l){return this._configMap.has(l)}},{key:"get",value:function(l){return this._configMap.get(l)}},{key:"update",value:function(){this._fillConfigMap()}},{key:"getKeyMap",value:function(l){return this.has(l)?this.get(l).keyMap||{}:(U.w("".concat(this._n,".getKeyMap unknown protocolName:").concat(l)),{})}},{key:"getProtocolData",value:function(l){var p=l.protocolName,a=l.requestData,c=this.get(p),h=null;if(a){var m=this._simpleDeepCopy(c),y=this._updateService(a,m),b=y.body,I=Object.create(null);for(var E in b)if(Object.prototype.hasOwnProperty.call(b,E)){if(I[E]=b[E],a[E]===void 0)continue;I[E]=a[E]}y.body=I,h=this._getUplinkData(y)}else h=this._getUplinkData(c);return h}},{key:"_getUplinkData",value:function(l){var p=this._requestDataCleaner(l),a=lp(p.head),c=a8(p.body,this._getRequestKeyMap(a));return p.body=c,p}},{key:"_updateService",value:function(l,p){var a=lp(p.head);if(this._isFromGroupRequest(p)){var c=l.type,h=l.groupID,m=h===void 0?void 0:h,y=l.groupIDList,b=y===void 0?[]:y;Ge(m)&&(m=b[0]||""),go({type:c,groupID:m})&&(p.head.servcmd="".concat(Q.NAME.GROUP_COMMUNITY,".").concat(a))}return p}},{key:"_isFromGroupRequest",value:function(l){return l.head.servcmd.includes(Q.NAME.GROUP)||l.head.servcmd.includes(Q.NAME.GROUP_ATTR)}},{key:"_getRequestKeyMap",value:function(l){var p=this.getKeyMap(l);return r(r({},sm.request),p.request)}},{key:"_requestDataCleaner",value:function(l){var p=Array.isArray(l)?[]:Object.create(null);for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&bd(a)&&l[a]!==null&&l[a]!==void 0&&(o(l[a])!=="object"?p[a]=l[a]:p[a]=this._requestDataCleaner.bind(this)(l[a]));return p}},{key:"_simpleDeepCopy",value:function(l){for(var p,a=Object.keys(l),c={},h=0,m=a.length;h1e3*y)return this._commandRequestInfoMap.set(c,{startTime:Date.now(),requestCount:1}),!1;E+=1,this._commandRequestInfoMap.set(c,{startTime:I,requestCount:E});var R=!1;return E>m&&(R=!0),R}},{key:"_isServerOverload",value:function(a){if(!this._serverOverloadInfoMap.has(a))return!1;var c=this._serverOverloadInfoMap.get(a),h=c.overloadTime,m=c.waitingTime,y=!1;return Date.now()-h<=1e3*m?y=!0:(this._serverOverloadInfoMap.delete(a),y=!1),y}},{key:"onPushedServerOverload",value:function(a){var c=a.overloadCommand,h=a.waitingTime;this._serverOverloadInfoMap.set(c,{overloadTime:Date.now(),waitingTime:h}),U.w("".concat(this._n,".onPushedServerOverload waitingTime:").concat(h,"s"))}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._updateCommandFrequencyLimitMap(Hw),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear()}}]),p}(Sr),I8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="MessageLossDetectionModule",c._maybeLostSequencesMap=new Map,c._firstRoundRet=[],c}return u(p,[{key:"onMessageMaybeLost",value:function(a,c,h){this._maybeLostSequencesMap.has(a)||this._maybeLostSequencesMap.set(a,[]);for(var m=this._maybeLostSequencesMap.get(a),y=0;y=this._expiredTime}},{key:"fetchConfig",value:function(){var a=this,c=this._canFetchConfig();if(U.l("".concat(this._n,".fetchConfig canFetchConfig:").concat(c)),c){var h=new We("fetchCloudControlConfig"),m=this.getModule(pn).getSDKAppID();this._isFetching=!0,this.request({protocolName:x_,requestData:{SDKAppID:m,version:this._version}}).then(function(y){a._isFetching=!1,h.setMessage("version:".concat(a._version," newVersion:").concat(y.data.version," config:").concat(y.data.cloudControlConfig)).setNetworkType(a.getNetworkType()).end(),U.l("".concat(a._n,".fetchConfig ok")),a._parseCloudControlConfig(y.data)}).catch(function(y){a._isFetching=!1,a.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];h.setError(y,E,R).end()}),U.l("".concat(a._n,".fetchConfig failed. error:"),y),a._setExpiredTimeOnResponseError(12e4)})}}},{key:"onPushedCloudControlConfig",value:function(a){U.l("".concat(this._n,".onPushedCloudControlConfig")),new We("pushedCloudControlConfig").setNetworkType(this.getNetworkType()).setMessage("newVersion:".concat(a.version," config:").concat(a.cloudControlConfig)).end(),this._parseCloudControlConfig(a)}},{key:"onCheckTimer",value:function(a){this._canFetchConfig()&&this.fetchConfig()}},{key:"_parseCloudControlConfig",value:function(a){var c=this,h="".concat(this._n,"._parseCloudControlConfig"),m=a.errorCode,y=a.errorMessage,b=a.cloudControlConfig,I=a.version,E=a.expiredTime;if(m===0){if(this._version!==I){var R=null;try{R=JSON.parse(b)}catch{this.isPrivateNetWork()||U.e("".concat(h," JSON parse error. cloudControlConfig:"),b)}R&&(this._cloudConfig.clear(),Object.keys(R).forEach(function(F){c._cloudConfig.set(F,R[F])}),this._version=I,this.emitInnerEvent(nr.CLOUD_CONFIG_UPDATED))}this._expiredTime=Date.now()+1e3*E}else Ge(m)?(U.l("".concat(h," failed. Invalid message format:"),a),this._setExpiredTimeOnResponseError(36e5)):(U.e("".concat(h," errorCode:").concat(m," errorMessage:").concat(y)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(a){this._expiredTime=Date.now()+a}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),p}(Sr),T8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="RecoverMessageModule",c.PULL_LIMIT_COUNT=15,c}return u(p,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var a,c,h=this,m=this._getLocalConversationList().filter(function(F){return F.type===T.CONV_GROUP&&F.groupProfile.type!==T.GRP_AVCHATROOM}),y=this.getModule(ct),b=0,I=0,E=0,R=[];m.forEach(function(F){var H=F.conversationID,ee=F.lastMessage;c=H.replace(T.CONV_GROUP,""),a=y.getLocalLastMessage(H),ee&&ee.lastSequence!==0&&a?(I=ee.lastSequence,b=a.sequence,E=I-b,b>0&&E>=1&&E<300?h._recoverGroupMessage({groupID:c,localLastMessageSequence:b,remoteLastMessageSequence:I}):R.push(c)):R.push(c)}),this._getGroupNotify(R)}},{key:"_recoverC2CChat",value:function(){var a,c=this,h=this._getLocalConversationList().filter(function(R){return R.type===T.CONV_C2C}),m=this.getModule(ct),y=0,b=0,I=0,E=[Promise.resolve()];h.forEach(function(R){var F=R.conversationID,H=R.lastMessage;a=m.getLocalLastMessage(F),H&&H.lastTime!==0&&a&&(b=H.lastTime,y=a.time,I=b-y,y>0&&I>=1&&I<=600&&E.push(c._recoverC2CMessage({conversationID:F,localLastMessageTime:y,remoteLastMessageTime:b})))}),Promise.all(E).then(function(){U.l("".concat(c._n,"._recoverC2CChat all promise fulfilled, start to sync unread messages")),c.getModule(b0).startSyncOnReconnected()})}},{key:"_getLocalConversationList",value:function(){return this.getModule(ct).getLocalConversationList()}},{key:"_recoverGroupMessage",value:function(a){var c=this,h="".concat(this._n,"._recoverGroupMessage");U.l("".concat(h," options:"),a);var m=a.groupID,y=a.localLastMessageSequence,b=a.remoteLastMessageSequence;this._getGroupRoamingMessage({groupID:m,sequence:y}).then(function(I){var E=I.data,R=E.complete,F=E.messageList;if(!Ge(F)){var H=F[0].sequence,ee="groupID:".concat(m," pkgLastSequence:").concat(H," remoteLastSequence:").concat(b," complete:").concat(R," count:").concat(F.length);U.l("".concat(h," ").concat(ee)),H1&&F.sort(function(Ue,qe){return Ue.sequence-qe.sequence});for(var be=0;be1?c:1,m=a.length,y=[];if(m>0)for(var b=0;b0)for(var h=this.getModule(Mt),m=0,y=c.length;m=0&&this._e2eDelayArray.push(p)}},{key:"_calcAvg",value:function(l,p){if(p===0)return 0;var a=0;return l.forEach(function(c){a+=c}),Zi(a/p,1)}},{key:"_calcCountWithLimit",value:function(l){var p=l.e2eDelayArray,a=l.min,c=l.max;return p.filter(function(h){return a<=h&&h100&&(a=100),a}},{key:"_checkE2EDelayException",value:function(l,p){var a=l.filter(function(I){return I>p});if(a.length>0){var c=a.length,h=Math.min.apply(Math,L(a)),m=Math.max.apply(Math,L(a)),y=this._calcAvg(a,c),b=Zi(c/l.length*100,2);b>50&&new We("messageE2EDelayException").setMessage("count:".concat(c," min:").concat(h," max:").concat(m," avg:").concat(y," percent:").concat(b)).setLevel("warning").end()}}},{key:"getStatResult",value:function(){var l=this._e2eDelayArray.length;if(l===0)return null;var p=L(this._e2eDelayArray),a=this._calcCountWithLimit({e2eDelayArray:p,min:0,max:1}),c=this._calcCountWithLimit({e2eDelayArray:p,min:1,max:3}),h=this._calcPercent(a,l),m=this._calcPercent(c,l),y=this._calcAvg(p,l);return this._checkE2EDelayException(p,3),p.length=0,this.reset(),{totalCount:l,countLessThan1Second:a,percentOfCountLessThan1Second:h,countLessThan3Second:c,percentOfCountLessThan3Second:m,avgDelay:y}}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),k}(),S8=function(){function k(){i(this,k),this._n="AvgRTT",this._requestCount=0,this._rttArray=[]}return u(k,[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(l){this._rttArray.push(l)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(l){return l.length}},{key:"_calcSuccessRateOfRequest",value:function(l,p){if(p===0)return 0;var a=Zi(l/p*100,2);return a>100&&(a=100),a}},{key:"_calcAvg",value:function(l,p){if(p===0)return 0;var a=0;return l.forEach(function(c){a+=c}),parseInt(a/p)}},{key:"_calcMax",value:function(){return Math.max.apply(Math,L(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,L(this._rttArray))}},{key:"getStatResult",value:function(){var l=this._calcTotalCount(),p=L(this._rttArray);if(l===0)return null;var a=this._calcRTTCount(p),c=this._calcSuccessRateOfRequest(a,l),h=this._calcAvg(p,a);return U.l("".concat(this._n,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(h)),this.reset(),{totalCount:l,rttCount:a,successRateOfRequest:c,avgRTT:h}}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),k}(),k8=function(){function k(){i(this,k),this._map=new Map}return u(k,[{key:"initMap",value:function(l){var p=this;l.forEach(function(a){p._map.set(a,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})})}},{key:"addTotalCount",value:function(l){return!(Ge(l)||!this._map.has(l))&&(this._map.get(l).totalCount+=1,!0)}},{key:"addSuccessCount",value:function(l){return!(Ge(l)||!this._map.has(l))&&(this._map.get(l).successCount+=1,!0)}},{key:"addFailedCountOfUserSide",value:function(l){return!(Ge(l)||!this._map.has(l))&&(this._map.get(l).failedCountOfUserSide+=1,!0)}},{key:"addCost",value:function(l,p){return!(Ge(l)||!this._map.has(l))&&(this._map.get(l).costArray.push(p),!0)}},{key:"addFileSize",value:function(l,p){return!(Ge(l)||!this._map.has(l))&&(this._map.get(l).fileSizeArray.push(p),!0)}},{key:"_calcSuccessRateOfBusiness",value:function(l){if(Ge(l)||!this._map.has(l))return-1;var p=this._map.get(l),a=Zi(p.successCount/p.totalCount*100,2);return a>100&&(a=100),a}},{key:"_calcSuccessRateOfPlatform",value:function(l){if(Ge(l)||!this._map.has(l))return-1;var p=this._map.get(l),a=this._calcSuccessCountOfPlatform(l)/p.totalCount*100;return(a=Zi(a,2))>100&&(a=100),a}},{key:"_calcTotalCount",value:function(l){return Ge(l)||!this._map.has(l)?-1:this._map.get(l).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(l){return Ge(l)||!this._map.has(l)?-1:this._map.get(l).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(l){if(Ge(l)||!this._map.has(l))return-1;var p=this._map.get(l);return p.successCount+p.failedCountOfUserSide}},{key:"_calcAvg",value:function(l){return Ge(l)||!this._map.has(l)?-1:l===yi?this._calcAvgSpeed(l):this._calcAvgCost(l)}},{key:"_calcAvgCost",value:function(l){var p=this._map.get(l).costArray.length;if(p===0)return 0;var a=0;return this._map.get(l).costArray.forEach(function(c){a+=c}),parseInt(a/p)}},{key:"_calcAvgSpeed",value:function(l){var p=0,a=0;return this._map.get(l).costArray.forEach(function(c){p+=c}),this._map.get(l).fileSizeArray.forEach(function(c){a+=c}),parseInt(1e3*a/p)}},{key:"getStatResult",value:function(l){var p=this._calcTotalCount(l);if(p===0)return null;var a=this._calcSuccessCountOfBusiness(l),c=this._calcSuccessRateOfBusiness(l),h=this._calcSuccessCountOfPlatform(l),m=this._calcSuccessRateOfPlatform(l),y=this._calcAvg(l);return this.reset(l),{totalCount:p,successCountOfBusiness:a,successRateOfBusiness:c,successCountOfPlatform:h,successRateOfPlatform:m,avgValue:y}}},{key:"reset",value:function(l){Ge(l)?this._map.clear():this._map.set(l,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),k}(),D8=function(){function k(){i(this,k),this._lastMap=new Map,this._currentMap=new Map}return u(k,[{key:"initMap",value:function(l){var p=this;l.forEach(function(a){p._lastMap.set(a,new Map),p._currentMap.set(a,new Map)})}},{key:"addMessageSequence",value:function(l){var p=l.key,a=l.message;if(Ge(p)||!this._lastMap.has(p)||!this._currentMap.has(p))return!1;var c=a.conversationID,h=a.sequence,m=c.replace(T.CONV_GROUP,"");if(this._lastMap.get(p).size===0)this._addCurrentMap(l);else if(this._lastMap.get(p).has(m)){var y=this._lastMap.get(p).get(m),b=y.length-1;h>y[0]&&h100&&(c=100),this._copyData(l),{totalCount:p,successCountOfMessageReceived:a,successRateOfMessageReceived:c}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),k}(),E8=function(k){f(p,k);var l=N(p);function p(a){var c;i(this,p),(c=l.call(this,a))._n="QualityStatModule",c.TAG="im-ssolog-quality-stat",c.reportIndex=0,c.wholePeriod=!1,c._qualityItems=[J_,X_,kd,Dd,Ed,Vu,yi,Ad,kp,Dp],c._messageSentItems=[kd,Dd,Ed,Vu,yi],c._messageReceivedItems=[Ad,kp,Dp],c.REPORT_INTERVAL=120,c.REPORT_SDKAPPID_BLACKLIST=[],c.REPORT_TINYID_WHITELIST=[],c._statInfoArr=[],c._avgRTT=new S8,c._avgE2EDelay=new w8,c._rateMessageSent=new k8,c._rateMessageReceived=new D8;var h=c.getInnerEmitterInstance();return h.on(nr.A2KEY_AND_TINYID_UPDATED,c._onLoginSuccess,w(c)),h.on(nr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"_onLoginSuccess",value:function(){var a=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var c=this.getModule(na),h=c.getItem(this.TAG,!1);!Ye(h)&&Fo(h.forEach)&&(U.l("".concat(this._n,"._onLoginSuccess get quality stat logs from local storage, count:").concat(h.length)),h.forEach(function(m){a._statInfoArr.push(m)}),c.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var a=this.getCloudConfig("q_rpt_interval"),c=this.getCloudConfig("q_rpt_sdkappid_bl"),h=this.getCloudConfig("q_rpt_tinyid_wl");Ge(a)||(this.REPORT_INTERVAL=Number(a)),Ge(c)||(this.REPORT_SDKAPPID_BLACKLIST=c.split(",").map(function(m){return Number(m)})),Ge(h)||(this.REPORT_TINYID_WHITELIST=h.split(","))}},{key:"onCheckTimer",value:function(a){this.isLoggedIn()&&a%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(a){this._avgRTT.addRTT(a)}},{key:"addMessageDelay",value:function(a){this._avgE2EDelay.addMessageDelay(a)}},{key:"addTotalCount",value:function(a){this._rateMessageSent.addTotalCount(a)||U.w("".concat(this._n,".addTotalCount invalid key:"),a)}},{key:"addSuccessCount",value:function(a){this._rateMessageSent.addSuccessCount(a)||U.w("".concat(this._n,".addSuccessCount invalid key:"),a)}},{key:"addFailedCountOfUserSide",value:function(a){this._rateMessageSent.addFailedCountOfUserSide(a)||U.w("".concat(this._n,".addFailedCountOfUserSide invalid key:"),a)}},{key:"addCost",value:function(a,c){this._rateMessageSent.addCost(a,c)||U.w("".concat(this._n,".addCost invalid key or cost:"),a,c)}},{key:"addFileSize",value:function(a,c){this._rateMessageSent.addFileSize(a,c)||U.w("".concat(this._n,".addFileSize invalid key or size:"),a,c)}},{key:"addMessageSequence",value:function(a){this._rateMessageReceived.addMessageSequence(a)||U.w("".concat(this._n,".addMessageSequence invalid key:"),a.key)}},{key:"_getQualityItem",value:function(a){var c={},h=Sw[this.getNetworkType()];Ge(h)&&(h=8);var m={qualityType:X3[a],timestamp:Mn(),networkType:h,extension:""};switch(a){case J_:c=this._avgRTT.getStatResult();break;case X_:c=this._avgE2EDelay.getStatResult();break;case kd:case Dd:case Ed:case Vu:case yi:c=this._rateMessageSent.getStatResult(a);break;case Ad:case kp:case Dp:c=this._rateMessageReceived.getStatResult(a)}return c===null?null:r(r({},m),c)}},{key:"_report",value:function(a){var c=this,h=[],m=null;Ge(a)?this._qualityItems.forEach(function(E){(m=c._getQualityItem(E))!==null&&(m.reportIndex=c.reportIndex,m.wholePeriod=c.wholePeriod,h.push(m))}):(m=this._getQualityItem(a))!==null&&(m.reportIndex=this.reportIndex,m.wholePeriod=this.wholePeriod,h.push(m)),U.d("".concat(this._n,"._report"),h),this._statInfoArr.length>0&&(h=h.concat(this._statInfoArr),this._statInfoArr=[]);var y=this.getModule(pn),b=y.getSDKAppID(),I=y.getTinyID();Eg(this.REPORT_SDKAPPID_BLACKLIST,b)&&!up(this.REPORT_TINYID_WHITELIST,I)&&(h=[]),h.length>0&&this._doReport(h)}},{key:"_doReport",value:function(a){var c=this,h={header:Fw(this),quality:a};this.request({protocolName:Sp,requestData:r({},h)}).then(function(){c.reportIndex++,c.wholePeriod=!1}).catch(function(m){U.w("".concat(c._n,"._doReport, online:").concat(c.getNetworkType()," error:"),m),c._statInfoArr=c._statInfoArr.concat(a),c._flushAtOnce()})}},{key:"_flushAtOnce",value:function(){var a=this.getModule(na),c=a.getItem(this.TAG,!1),h=this._statInfoArr,m="".concat(this._n,"._flushAtOnce");if(Ye(c))U.l("".concat(m," count:").concat(h.length)),a.setItem(this.TAG,h,!0,!1);else{var y=h.concat(c);y.length>10&&(y=y.slice(0,10)),U.l("".concat(m," count:").concat(y.length)),a.setItem(this.TAG,y,!0,!1)}this._statInfoArr=[]}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),p}(Sr),qw=u(function k(l){i(this,k),Ye(l)||(this.userID=l.userID||"",this.nick=l.nick||"",this.avatar=l.avatar||"",this.time=l.time||0,this.source=l.source||"",this.wording=l.wording||"",this.type=l.type||"")}),A8=function(){function k(l){i(this,k),this._snsModule=l,this._n="FriendApplicationHandler",this._startTime=0,this._maxLimited=100,this._currentSequence=0,this._friendApplicationMap=new Map,this._unreadCount=0}return u(k,[{key:"getLocalFriendApplicationList",value:function(){return{friendApplicationList:L(this._friendApplicationMap.values()),unreadCount:this._unreadCount}}},{key:"_onFriendApplicationListUpdated",value:function(){this._snsModule.emitOuterEvent(O.FRIEND_APPLICATION_LIST_UPDATED,{friendApplicationList:L(this._friendApplicationMap.values()),unreadCount:this._unreadCount})}},{key:"onFriendApplicationRead",value:function(){this._unreadCount=0,this._onFriendApplicationListUpdated()}},{key:"onFriendApplicationAdded",value:function(l,p){var a=this;if(!Ye(l)){var c="";c=p===this._snsModule.getMyUserID()?T.SNS_APPLICATION_SENT_BY_ME:T.SNS_APPLICATION_SENT_TO_ME;var h=!1;l.forEach(function(m){var y="".concat(m.userID,"_").concat(c);c!==T.SNS_APPLICATION_SENT_TO_ME||a._friendApplicationMap.has(y)||(a._unreadCount+=1),a._friendApplicationMap.set(y,new qw(r(r({},m),{},{type:c}))),h=!0}),h&&this._onFriendApplicationListUpdated()}}},{key:"onFriendApplicationDeleted",value:function(l){Ye(l)||this.getFriendApplicationList()}},{key:"getFriendApplicationList",value:function(){var l=this,p="".concat(this._n,".").concat("getFriendApplicationList"),a=new We("getFriendApplicationList");return this._snsModule.request({protocolName:U0,requestData:{applicationType:T.SNS_APPLICATION_TYPE_BOTH,fromAccount:this._snsModule.getMyUserID(),maxLimited:this._maxLimited,startTime:this._startTime,lastSequence:this._currentSequence}}).then(function(c){var h=c.data,m=h.resultList,y=h.unreadCount,b=h.startTime,I=h.currentSequence;l._startTime=b,l._currentSequence=I,l._unreadCount=y;var E=rt(m)?m.length:0;a.setNetworkType(l._snsModule.getNetworkType()).setMessage("applicationCount:".concat(E," unreadCount:").concat(y)).end(),U.i("".concat(p," ok. applicationCount:").concat(E," unreadCount:").concat(y)),l._friendApplicationMap.clear(),rt(m)&&m.forEach(function(R){var F=R.userID,H=R.type,ee=new qw(R);l._friendApplicationMap.set("".concat(F,"_").concat(H),ee)}),l._onFriendApplicationListUpdated()}).catch(function(c){return l._snsModule.probeNetwork().then(function(h){var m=A(h,2),y=m[0],b=m[1];a.setError(c,y,b).end()}),U.w("".concat(p," failed. error:"),c),Me(c)})}},{key:"deleteFriendApplication",value:function(l){var p=this,a="".concat(this._n,".").concat("deleteFriendApplication"),c=l.userID,h=l.type;if((!h||h!==T.SNS_APPLICATION_SENT_BY_ME&&h!==T.SNS_APPLICATION_SENT_TO_ME)&&(h=T.SNS_APPLICATION_SENT_TO_ME),!this._friendApplicationMap.has("".concat(c,"_").concat(h)))return Me({code:De.FRIEND_APPLICATION_NOT_EXIST});var m=new We("deleteFriendApplication");return m.setMessage("userID:".concat(c," type:").concat(h)),this._snsModule.request({protocolName:F0,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:[c],type:h}}).then(function(y){var b=y.data.resultList,I=b[0],E=I.to,R=I.resultCode,F=I.resultInfo;return m.setNetworkType(p._snsModule.getNetworkType()).setMoreMessage("resultList:".concat(JSON.stringify(b))).end(),U.i("".concat(a," ok. userID:").concat(c," type:").concat(h)),R===0?ht():Me({userID:E,code:R,message:F})}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(a," failed. error:"),y),Me(y)})}},{key:"acceptFriendApplication",value:function(l){var p=this,a="".concat(this._n,".").concat("acceptFriendApplication"),c=l.userID,h=l.remark,m=l.tag,y=l.type;(!y||y!==T.SNS_APPLICATION_AGREE&&y!==T.SNS_APPLICATION_AGREE_AND_ADD)&&(y=T.SNS_APPLICATION_AGREE_AND_ADD);var b=new We("acceptFriendApplication");return b.setMessage("userID:".concat(c," type:").concat(y)),this._snsModule.request({protocolName:Lg,requestData:{fromAccount:this._snsModule.getMyUserID(),responseFriendItem:[{userID:c,remark:h,tag:m,action:y}]}}).then(function(I){b.setNetworkType(p._snsModule.getNetworkType()).end();var E=I.data.resultList[0],R=E.resultCode,F=E.resultInfo;if(R!==0)return Me({code:R,message:F});U.i("".concat(a," ok. userID:").concat(c," type:").concat(y))}).catch(function(I){return p._snsModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];b.setError(I,F,H).end()}),U.w("".concat(a," failed. error:"),I),Me(I)})}},{key:"refuseFriendApplication",value:function(l){var p=this,a="".concat(this._n,".").concat("refuseFriendApplication"),c=l.userID,h=new We("refuseFriendApplication");return h.setMessage("userID:".concat(c)),this._snsModule.request({protocolName:Lg,requestData:{fromAccount:this._snsModule.getMyUserID(),responseFriendItem:[{userID:c,action:"Response_Action_Reject"}]}}).then(function(m){h.setNetworkType(p._snsModule.getNetworkType()).end();var y=m.data.resultList[0],b=y.resultCode,I=y.resultInfo;if(b!==0)return Me({code:b,message:I});U.i("".concat(a," ok. userID:").concat(c))}).catch(function(m){return p._snsModule.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];h.setError(m,I,E).end()}),U.w("".concat(a," failed. error:"),m),Me(m)})}},{key:"_onFriendApplicationProcessed",value:function(l){var p=this;if(l.length!==0){var a=!1;l.forEach(function(c){var h="".concat(c.to,"_").concat(T.SNS_APPLICATION_SENT_TO_ME);p._friendApplicationMap.has(h)&&(p._friendApplicationMap.delete(h),p._unreadCount-=1,a=!0)}),this._unreadCount<0&&(this._unreadCount=0),a&&this._onFriendApplicationListUpdated()}}},{key:"setFriendApplicationRead",value:function(){var l=this,p="".concat(this._n,".").concat("setFriendApplicationRead"),a=new We("setFriendApplicationRead");return this._snsModule.request({protocolName:G0,requestData:{fromAccount:this._snsModule.getMyUserID(),latestTimeStamp:Zi(Mn()/1e3,0)}}).then(function(c){a.setNetworkType(l._snsModule.getNetworkType()).end(),U.i("".concat(p," ok")),l._unreadCount=0}).catch(function(c){return l._snsModule.probeNetwork().then(function(h){var m=A(h,2),y=m[0],b=m[1];a.setError(c,y,b).end()}),U.w("".concat(p," failed. error:"),c),Me(c)})}},{key:"reset",value:function(){this._startIndex=0,this._maxLimited=100,this._currentSequence=0,this._unreadCount=0,this._friendApplicationMap.clear()}}]),k}(),m1=function(){function k(l,p){i(this,k),this.userID=l,this.remark="",this.groupList=[],this.source="",this.addTime=0,this.friendCustomField=[],this.timestamp=0;var a={},c=[];if(a.userID=l,!Ye(p))for(var h="",m="",y=0,b=p.length;y-1)this.friendCustomField.push({key:h,value:m});else if(h.indexOf("Tag_Profile_Custom")>-1)c.push({key:h,value:m});else switch(h){case Gt.NICK:a.nick=m;break;case Gt.GENDER:a.gender=m;break;case Gt.BIRTHDAY:a.birthday=m;break;case Gt.LOCATION:a.location=m;break;case Gt.SELFSIGNATURE:a.selfSignature=m;break;case Gt.ALLOWTYPE:a.allowType=m;break;case Gt.LANGUAGE:a.language=m;break;case Gt.AVATAR:a.avatar=m;break;case Gt.MESSAGESETTINGS:a.messageSettings=m;break;case Gt.ADMINFORBIDTYPE:a.adminForbidType=m;break;case Gt.LEVEL:a.level=m;break;case Gt.ROLE:a.role=m;break;case Zs:this.remark=m;break;case Oa:this.addTime=m;break;case yl:this.groupList=JSON.parse(JSON.stringify(m));break;case _l:this.source=m;break;case bl:break;default:U.l("snsProfileItem unknown tag->",p[y].tag)}this.profile=new Ep(r(r({},a),{},{profileCustomField:c}))}return u(k,[{key:"validate",value:function(l){var p=!0,a="";if(Ye(l))return{valid:!1,tips:"empty options"};if(l.profileCustomField)for(var c=l.profileCustomField.length,h=null,m=0;m500&&(a="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Il(l[y])," bytes"),p=!1);break;case"gender":ea(Zo,l.gender)||(a="key:gender, invalid value:"+l.gender,p=!1);break;case"birthday":un(l.birthday)||(a="birthday must be a number",p=!1);break;case"location":Et(l.location)||(a="location must be a string",p=!1);break;case"selfSignature":Et(l.selfSignature)||(a="selfSignature must be a string",p=!1);break;case"allowType":ea(cs,l.allowType)||(a="key:allowType, invalid value:"+l.allowType,p=!1);break;case"language":un(l.language)||(a="language must be a number",p=!1);break;case"avatar":Et(l.avatar)||(a="avatar must be a string",p=!1);break;case"messageSettings":l.messageSettings!==0&&l.messageSettings!==1&&(a="messageSettings must be 0 or 1",p=!1);break;case"adminForbidType":ea(Ra,l.adminForbidType)||(a="key:adminForbidType, invalid value:"+l.adminForbidType,p=!1);break;case"level":un(l.level)||(a="level must be a number",p=!1);break;case"role":un(l.role)||(a="role must be a number",p=!1);break;default:a="unknown key:"+y+" "+l[y],p=!1}}return{valid:p,tips:a}}},{key:"update",value:function(l){var p="",a="",c=[];this.friendCustomField.forEach(function(b){c.push(b.key)});for(var h=0,m=l.length;h-1)c.indexOf(p)>-1?this.friendCustomField.forEach(function(b){b.key===p&&(b.value=a)}):this.friendCustomField.push({key:p,value:a});else if(p.indexOf("Tag_Profile_Custom")>-1){var y=!1;this.profile.profileCustomField.forEach(function(b){b.key===p&&(b.value=a,y=!0)}),y||this.profile.profileCustomField.push({key:p,value:a})}else switch(p){case Gt.NICK:this.profile.nick=a;break;case Gt.GENDER:this.profile.gender=a;break;case Gt.BIRTHDAY:this.profile.birthday=a;break;case Gt.LOCATION:this.profile.location=a;break;case Gt.SELFSIGNATURE:this.profile.selfSignature=a;break;case Gt.ALLOWTYPE:this.profile.allowType=a;break;case Gt.LANGUAGE:this.profile.language=a;break;case Gt.AVATAR:this.profile.avatar=a;break;case Gt.MESSAGESETTINGS:this.profile.messageSettings=a;break;case Gt.ADMINFORBIDTYPE:this.profile.adminForbidType=a;break;case Gt.LEVEL:this.profile.level=a;break;case Gt.ROLE:this.profile.role=a;break;case Zs:this.remark=a;break;case Oa:this.addTime=a;break;case yl:this.groupList=JSON.parse(JSON.stringify(a));break;case _l:this.source=a;break;case bl:break;default:U.d("snsProfileItem unkown tag->",l[h].tag)}this.timestamp=Date.now(),c.length=0}},{key:"updateProfile",value:function(l){this.profile=JSON.parse(JSON.stringify(l)),this.timestamp=Date.now()}},{key:"addToGroupList",value:function(l){this.groupList.indexOf(l)===-1&&(this.groupList.push(l),this.count=this.groupList.length)}},{key:"removeFromGroupList",value:function(l){var p=this.groupList.indexOf(l);p>-1&&(this.groupList.splice(p,1),this.count=this.groupList.length)}}]),k}(),L8=function(){function k(l){i(this,k),this._snsModule=l,this._n="FriendHandler",this._friendMap=new Map,this._startIndex=0,this._standardSequence=0,this._customSequence=0,this._expirationTime=18e4}return u(k,[{key:"getLocalFriendList",value:function(){return L(this._friendMap.values())}},{key:"getFriendRemark",value:function(l){return this._friendMap.has(l)?this._friendMap.get(l).remark:""}},{key:"onFriendProfileModified",value:function(l){var p=this,a=l.dataList;if(!Ye(a)){var c=this._snsModule.getModule(ct);a.forEach(function(h){var m=h.userID,y=h.profileList;if(p.isMyFriend(m)){U.l("".concat(p._n,".onFriendProfileModified. friend account:").concat(m,", profileList:").concat(JSON.stringify(y)));var b=p._friendMap.get(m);b.update(y),c.modifyMessageSentByPeer({conversationID:"".concat(T.CONV_C2C).concat(m),latestNick:b.profile.nick,latestAvatar:b.profile.avatar})}}),this._onFriendListUpdated()}}},{key:"onFriendAdded",value:function(l){var p=this;l.length!==0&&(U.l("".concat(this._n,".onFriendAdded userIDList:").concat(l)),l.forEach(function(a){p._friendMap.set(a,new m1(a))}),this.getFriendProfile({userIDList:l}).then(function(a){l.forEach(function(c){var h=p._friendMap.get(c);h.groupList.length>0&&p._snsModule.updateWhenFriendAdded({nameList:h.groupList,userID:c})}),p._onFriendListUpdated()}))}},{key:"onFriendDeleted",value:function(l){var p=this;l.length!==0&&(U.l("".concat(this._n,".onFriendDeleted userIDList:").concat(l)),l.forEach(function(a){var c=p._friendMap.get(a);c.groupList.length>0&&p._snsModule.updateWhenFriendDeleted({nameList:c.groupList,userID:a}),p._friendMap.delete(a)}),this._onFriendListUpdated())}},{key:"_onFriendListUpdated",value:function(){this._snsModule.emitOuterEvent(O.FRIEND_LIST_UPDATED),this._snsModule.getModule(ct).checkAndPatchRemark()}},{key:"getFriendProfile",value:function(l){var p=this,a="".concat(this._n,".").concat("getFriendProfile"),c=l.userIDList,h=[],m=[],y=[];if(c.forEach(function(I){if(p._friendMap.has(I)){var E=p._friendMap.get(I);Date.now()-E.timestamp1e3&&(U.w("".concat(a," ").concat(Pa(1e3))),c.length=1e3);var m=[],y=[],b=[];if(c.forEach(function(R){p._friendMap.has(R)?b.push(R):m.push({userID:R,code:De.NOT_MY_FRIEND,message:p._snsModule.getErrorMessage(De.NOT_MY_FRIEND)})}),b.length===0)return At({successUserIDList:y,failureUserIDList:m});var I=h;(!I||I!==T.SNS_DELETE_TYPE_SINGLE&&I!==T.SNS_DELETE_TYPE_BOTH)&&(I=T.SNS_DELETE_TYPE_BOTH);var E=new We("deleteFriend");return E.setMessage("userIDList:".concat(b," type:").concat(I)),this._snsModule.request({protocolName:N0,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:b,type:I}}).then(function(R){E.setNetworkType(p._snsModule.getNetworkType()).end(),U.i("".concat(a," ok"));var F=R.data.resultList;return Ye(F)||F.forEach(function(H){var ee=H.to,ge=H.resultCode,be=H.resultInfo;Ge(ge)||ge===0?y.push({userID:ee}):m.push({userID:ee,code:ge,message:be})}),ht({successUserIDList:y,failureUserIDList:m})}).catch(function(R){return p._snsModule.probeNetwork().then(function(F){var H=A(F,2),ee=H[0],ge=H[1];E.setError(R,ee,ge).end()}),U.w("".concat(a," error:"),R),Me(R)})}},{key:"updateFriend",value:function(l){var p=this,a=l.userID,c=l.remark,h=l.friendCustomField;if(!this._friendMap.has(a))return Me({code:De.NOT_MY_FRIEND});var m="".concat(this._n,".").concat("updateFriend"),y=new We("updateFriend");y.setMessage("userID:".concat(a," remark:").concat(c," friendCustomField:").concat(h));var b=[];return Ge(c)||b.push({tag:Zs,value:c}),rt(h)&&h.length>0&&h.forEach(function(I){b.push({tag:I.key,value:I.value})}),this._snsModule.request({protocolName:x0,requestData:{fromAccount:this._snsModule.getMyUserID(),updateItem:[{to:a,snsItem:b}]}}).then(function(I){y.setNetworkType(p._snsModule.getNetworkType()).end(),U.i("".concat(m," ok"));var E=I.data.resultList[0],R=E.to,F=E.resultCode,H=E.resultInfo;if(Ge(F)||F===0){var ee=p._friendMap.get(R);return ee&&(Ge(c)||(ee.remark=c),rt(h)&&h.length>0&&Pu(ee.friendCustomField,h),p._onFriendListUpdated()),ht(ee)}return Me({code:F,message:H})}).catch(function(I){return p._snsModule.probeNetwork().then(function(E){var R=A(E,2),F=R[0],H=R[1];y.setError(I,F,H).end()}),U.w("".concat(m," failed. error:"),I),Me(I)})}},{key:"checkFriend",value:function(l){var p=this,a="".concat(this._n,".").concat("checkFriend"),c=l.userIDList,h=l.type;(!h||h!==T.SNS_CHECK_TYPE_SINGLE&&h!==T.SNS_CHECK_TYPE_BOTH)&&(h=T.SNS_CHECK_TYPE_BOTH);var m=new We("checkFriend");return m.setMessage("userIDList:".concat(c," type:").concat(h)),this._snsModule.request({protocolName:R0,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:c,type:h}}).then(function(y){m.setNetworkType(p._snsModule.getNetworkType()).end(),U.i("".concat(a," ok. userIDList:").concat(c," type:").concat(h));var b=[],I=[],E=y.data.resultList;return rt(E)&&E.forEach(function(R){var F=R.to,H=R.relation,ee=R.resultCode,ge=R.resultInfo;Ge(ee)||ee===0?b.push({userID:F,code:0,relation:H}):I.push({userID:F,code:ee,message:ge})}),ht({successUserIDList:b,failureUserIDList:I})}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(a," failed. error:"),y),Me(y)})}},{key:"updateWhenAddedToFriendGroup",value:function(l){var p=this,a=l.name,c=l.userIDList;U.l("".concat(this._n,".updateWhenAddedToFriendGroup groupName:").concat(a," userIDList:").concat(c)),a&&!Ye(c)&&c.forEach(function(h){p._friendMap.has(h)&&p._friendMap.get(h).addToGroupList(a)})}},{key:"updateWhenRemovedFromFriendGroup",value:function(l){var p=this,a=l.name,c=l.userIDList;U.l("".concat(this._n,".updateWhenRemovedFromFriendGroup groupName:").concat(a," userIDList:").concat(c)),a&&!Ye(c)&&c.forEach(function(h){p._friendMap.has(h)&&p._friendMap.get(h).removeFromGroupList(a)})}},{key:"reset",value:function(){this._friendMap.clear(),this._startIndex=0,this._standardSequence=0,this._customSequence=0}}]),k}(),Vw=function(){function k(l){i(this,k),Ye(l)||(this.name=l.name||"",this.userIDList=l.userIDList||[],this.count=this.userIDList.length||0)}return u(k,[{key:"addToUserIDList",value:function(l){this.userIDList.indexOf(l)===-1&&(this.userIDList.push(l),this.count=this.userIDList.length)}},{key:"removeFromUserIDList",value:function(l){var p=this.userIDList.indexOf(l);p>-1&&(this.userIDList.splice(p,1),this.count=this.userIDList.length)}}]),k}(),O8=function(){function k(l){i(this,k),this._snsModule=l,this._n="FriendGroupHandler",this._friendGroupMap=new Map}return u(k,[{key:"getLocalFriendGroupList",value:function(){return L(this._friendGroupMap.values())}},{key:"_emitFriendGroupListUpdated",value:function(){var l=L(this._friendGroupMap.values());this._snsModule.emitOuterEvent(O.FRIEND_GROUP_LIST_UPDATED,l)}},{key:"getFriendGroupList",value:function(){var l=this,p="".concat(this._n,".").concat("getFriendGroupList"),a=new We("getFriendGroupList");return this._snsModule.request({protocolName:$0,requestData:{fromAccount:this._snsModule.getMyUserID()}}).then(function(c){a.setNetworkType(l._snsModule.getNetworkType()).end();var h=c.data.resultList;Ye(h)?U.i("".concat(p," ok. friend group count:0")):(U.i("".concat(p," ok. friend group count:").concat(h.length)),l._friendGroupMap.clear(),h.forEach(function(m){var y=new Vw(m);l._friendGroupMap.set(m.name,y)}),l._emitFriendGroupListUpdated())}).catch(function(c){return l._snsModule.probeNetwork().then(function(h){var m=A(h,2),y=m[0],b=m[1];a.setError(c,y,b).end()}),U.w("".concat(p," error:"),c),Me(c)})}},{key:"createFriendGroup",value:function(l){var p=this,a="".concat(this._n,".").concat("createFriendGroup"),c=l.name,h=l.userIDList;if(this._friendGroupMap.has(c))return Me({code:De.FRIEND_GRP_EXISTED});var m=new We("createFriendGroup");return m.setMessage("name:".concat(c," userIDList:").concat(h)),this._snsModule.request({protocolName:B0,requestData:{fromAccount:this._snsModule.getMyUserID(),groupName:[c],userIDList:rt(h)?h:void 0}}).then(function(y){m.setNetworkType(p._snsModule.getNetworkType()).end(),U.l("".concat(a," ok. name:").concat(c," userIDList:").concat(h));var b=y.data.resultList,I=[],E=[];b&&b.forEach(function(F){var H=F.to,ee=F.resultCode,ge=F.resultInfo;if(Ge(ee)||ee===0)I.push(H);else{var be={userID:F.to,code:ee,message:ge};E.push(be)}});var R=new Vw({name:c,userIDList:I});return p._friendGroupMap.set(c,R),p._snsModule.updateWhenAddedToFriendGroup({name:c,userIDList:I}),p._emitFriendGroupListUpdated(),ht({friendGroup:R,failureUserIDList:E})}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(a," failed. error:"),y),Me(y)})}},{key:"deleteFriendGroup",value:function(l){var p=this,a="".concat(this._n,".").concat("deleteFriendGroup"),c=l.name;if(!this._friendGroupMap.has(c))return Me({code:De.FRIEND_GRP_NOT_EXIST});var h=new We("deleteFriendGroup");return h.setMessage("name:".concat(c)),this._snsModule.request({protocolName:H0,requestData:{fromAccount:this._snsModule.getMyUserID(),nameList:[c]}}).then(function(m){h.setNetworkType(p._snsModule.getNetworkType()).end(),U.l("".concat(a," ok. name:").concat(c));var y=p._friendGroupMap.get(c);return y&&(p._snsModule.updateWhenRemovedFromFriendGroup({name:c,userIDList:y.userIDList}),p._friendGroupMap.delete(c),y.userIDList.length=0),p._emitFriendGroupListUpdated(),ht(y)}).catch(function(m){return p._snsModule.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];h.setError(m,I,E).end()}),U.w("".concat(a," failed. error:"),m),Me(m)})}},{key:"renameFriendGroup",value:function(l){var p=this,a="".concat(this._n,".").concat("renameFriendGroup"),c=l.oldName,h=l.newName;if(!this._friendGroupMap.has(c))return Me({code:De.FRIEND_GRP_NOT_EXIST});var m=new We("renameFriendGroup");return m.setMessage("oldName:".concat(c," newName:").concat(h)),this._snsModule.request({protocolName:Cp,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:c,newName:h}}).then(function(){if(m.setNetworkType(p._snsModule.getNetworkType()).end(),U.l("".concat(a," ok. oldName:").concat(c," newName:").concat(h)),p._friendGroupMap.has(c)){var y=p._friendGroupMap.get(c);return y.name=h,p._friendGroupMap.delete(c),p._friendGroupMap.set(h,y),p._snsModule.updateWhenRemovedFromFriendGroup({name:c,userIDList:y.userIDList}),p._snsModule.updateWhenAddedToFriendGroup({name:h,userIDList:y.userIDList}),p._emitFriendGroupListUpdated(),ht(y)}return ht()}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(a," failed. error:"),y),Me(y)})}},{key:"addToFriendGroup",value:function(l){var p=this,a="".concat(this._n,".").concat("addToFriendGroup"),c=l.name,h=l.userIDList;if(!this._friendGroupMap.has(c))return this._onFriendGroupNotExist(c);var m=new We("addToFriendGroup");return m.setMessage("name:".concat(c," userIDList:").concat(h)),U.l("".concat(a," name:").concat(c," userIDList:").concat(h)),this._snsModule.request({protocolName:Cp,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:c,updateGroupItem:h.filter(function(y){return p._snsModule.isMyFriend(y)}).map(function(y){return{to:y,updateType:"Update_Type_Add"}})}}).then(function(y){return m.setNetworkType(p._snsModule.getNetworkType()).end(),p._onFriendGroupUpdated(c,y)}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(a," failed. error:"),y),Me(y)})}},{key:"removeFromFriendGroup",value:function(l){var p=this,a="".concat(this._n,".").concat("removeFromFriendGroup"),c=l.name,h=l.userIDList;if(!this._friendGroupMap.has(c))return this._onFriendGroupNotExist(c);var m=new We("removeFromFriendGroup");return m.setMessage("name:".concat(c," userIDList:").concat(h)),U.l("".concat(a," name:").concat(c," userIDList:").concat(h)),this._snsModule.request({protocolName:Cp,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:c,updateGroupItem:h.filter(function(y){return p._snsModule.isMyFriend(y)}).map(function(y){return{to:y,updateType:"Update_Type_Delete"}})}}).then(function(y){return m.setNetworkType(p._snsModule.getNetworkType()).end(),p._onFriendGroupUpdated(c,y)}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],R=I[1];m.setError(y,E,R).end()}),U.w("".concat(a," failed. error:"),y),Me(y)})}},{key:"_onFriendGroupUpdated",value:function(l,p){var a=p.data.resultList,c=this._friendGroupMap.get(l),h=[],m=[],y=[];return rt(a)&&a.forEach(function(b){var I=b.to,E=b.resultCode,R=b.resultInfo,F=b.type;E===0?F==="Update_Type_Add"?c&&(c.addToUserIDList(I),m.push(I)):F==="Update_Type_Delete"&&c&&(c.removeFromUserIDList(I),y.push(I)):h.push({to:b.to,code:E,message:R})}),U.l("".concat(this._n,"._onFriendGroupUpdated name:").concat(l," userIDList:").concat(c.userIDList)),m.length>0&&this._snsModule.updateWhenAddedToFriendGroup({name:l,userIDList:m}),y.length>0&&this._snsModule.updateWhenRemovedFromFriendGroup({name:l,userIDList:y}),ht({friendGroup:c,failureUserIDList:h})}},{key:"updateWhenFriendAdded",value:function(l){var p=this,a=l.nameList,c=l.userID;U.l("".concat(this._n,".updateWhenFriendAdded userID:").concat(c," nameList:").concat(a)),Ye(a)||a.forEach(function(h){p._friendGroupMap.has(h)&&p._friendGroupMap.get(h).addToUserIDList(c)})}},{key:"updateWhenFriendDeleted",value:function(l){var p=this,a=l.nameList,c=l.userID;U.l("".concat(this._n,".updateWhenFriendDeleted userID:").concat(c," nameList:").concat(a)),Ye(a)||a.forEach(function(h){p._friendGroupMap.has(h)&&p._friendGroupMap.get(h).removeFromUserIDList(c)})}},{key:"reset",value:function(){this._friendGroupMap.clear()}}]),k}(),R8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="SnsModule",c._friendHandler=new L8(w(c)),c._friendApplicationHandler=new A8(w(c)),c._friendGroupHandler=new O8(w(c)),c.getInnerEmitterInstance().on(nr.A2KEY_AND_TINYID_UPDATED,c.onContextUpdated,w(c)),c}return u(p,[{key:"onContextUpdated",value:function(a){this._friendHandler.pagingGetFriendList(),this._friendGroupHandler.getFriendGroupList(),this._friendApplicationHandler.getFriendApplicationList()}},{key:"onRelationChainModified",value:function(a){var c=this,h=a.dataList;if(!Ye(h)){var m=[],y=[],b=[],I=[],E=!1,R="";h.forEach(function(F){if(F.pushType!==3&&F.pushType!==4||!F.from||(R=F.from),F.friendAddAccount&&(m.push.apply(m,L(F.friendAddAccount)),I.push.apply(I,L(F.friendAddAccount))),F.friendDelAccount&&y.push.apply(y,L(F.friendDelAccount)),F.friendApplicationAdded&&b.push.apply(b,L(F.friendApplicationAdded)),F.friendApplicationDeletedUserIDList&&I.push.apply(I,L(F.friendApplicationDeletedUserIDList)),F.reportTime&&F.pushType===7&&(E=!0),F.friendUpInfo){var H={dataList:[]};F.friendUpInfo.forEach(function(ee){H.dataList.push({userID:ee.friendAccount,profileList:L(ee.sns)})}),c.onFriendProfileModified(H)}}),E&&this._friendApplicationHandler.onFriendApplicationRead(),this._friendApplicationHandler.onFriendApplicationAdded(b,R),this._friendApplicationHandler.onFriendApplicationDeleted(I),this._friendHandler.onFriendAdded(m),this._friendHandler.onFriendDeleted(y)}}},{key:"isMyFriend",value:function(a){return this._friendHandler.isMyFriend(a)}},{key:"filterProfanity",value:function(a,c){var h=this.getModule(Ga);if(!h)return!0;var m=h.filterText(c[a],Te),y=m.isAllowedToSend,b=m.modifiedText;return y===!0&&(c[a]=b,!0)}},{key:"onFriendProfileModified",value:function(a){this._friendHandler.onFriendProfileModified(a)}},{key:"getLocalFriendList",value:function(){var a=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],c=this._friendHandler.getLocalFriendList();return a?At(c):c}},{key:"getFriendRemark",value:function(a){return this._friendHandler.getFriendRemark(a)}},{key:"getFriendList",value:function(){return this._friendHandler.pagingGetFriendList()}},{key:"addFriend",value:function(a){return this._friendHandler.addFriend(a)}},{key:"deleteFriend",value:function(a){return this._friendHandler.deleteFriend(a)}},{key:"checkFriend",value:function(a){return this._friendHandler.checkFriend(a)}},{key:"getFriendProfile",value:function(a){return this._friendHandler.getFriendProfile(a)}},{key:"updateFriend",value:function(a){return this._friendHandler.updateFriend(a)}},{key:"updateWhenAddedToFriendGroup",value:function(a){this._friendHandler.updateWhenAddedToFriendGroup(a)}},{key:"updateWhenRemovedFromFriendGroup",value:function(a){this._friendHandler.updateWhenRemovedFromFriendGroup(a)}},{key:"getLocalFriendApplicationList",value:function(){var a=this._friendApplicationHandler.getLocalFriendApplicationList();return At(a)}},{key:"deleteFriendApplication",value:function(a){return this._friendApplicationHandler.deleteFriendApplication(a)}},{key:"refuseFriendApplication",value:function(a){return this._friendApplicationHandler.refuseFriendApplication(a)}},{key:"acceptFriendApplication",value:function(a){return this._friendApplicationHandler.acceptFriendApplication(a)}},{key:"setFriendApplicationRead",value:function(a){return this._friendApplicationHandler.setFriendApplicationRead(a)}},{key:"getLocalFriendGroupList",value:function(){var a=this._friendGroupHandler.getLocalFriendGroupList();return At(a)}},{key:"createFriendGroup",value:function(a){return this._friendGroupHandler.createFriendGroup(a)}},{key:"deleteFriendGroup",value:function(a){return this._friendGroupHandler.deleteFriendGroup(a)}},{key:"addToFriendGroup",value:function(a){return this._friendGroupHandler.addToFriendGroup(a)}},{key:"removeFromFriendGroup",value:function(a){return this._friendGroupHandler.removeFromFriendGroup(a)}},{key:"renameFriendGroup",value:function(a){return this._friendGroupHandler.renameFriendGroup(a)}},{key:"onAddToFriendGroup",value:function(a){return this._friendGroupHandler.onAddToFriendGroup(a)}},{key:"updateWhenFriendAdded",value:function(a){this._friendGroupHandler.updateWhenFriendAdded(a)}},{key:"updateWhenFriendDeleted",value:function(a){this._friendGroupHandler.updateWhenFriendDeleted(a)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._friendHandler.reset(),this._friendGroupHandler.reset(),this._friendApplicationHandler.reset()}}]),p}(Sr),N8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="WorkerTimerModule",c._isWorkerEnabled=!0,c._workerTimer=null,c._timerID=-1,c._init(),c.getInnerEmitterInstance().on(nr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&mr}},{key:"startWorkerTimer",value:function(){U.l("".concat(this._n,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){U.l("".concat(this._n,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){if(mr){var a=URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 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(a);var c=this;this._workerTimer.onmessage=function(h){h.data?(c._timerID=h.data,U.l("".concat(c._n,"._init seed:").concat(c._timerID))):c._m.onCheckTimer()}}}},{key:"_onCloudConfigUpdated",value:function(){var a=this.getCloudConfig("enable_worker");U.l("".concat(this._n,"._onCloudConfigUpdated enableWorker:").concat(a)),Ge(a)||a==="1"?!this._isWorkerEnabled&&mr&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&mr&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){U.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(){U.l("".concat(this._n,".reset"))}}]),p}(Sr),P8=function(){function k(){i(this,k),this._n="PurchasedFeatureHandler",this._purchasedFeatureMap=new Map}return u(k,[{key:"isValidPurchaseBits",value:function(l){return l&&typeof l=="string"&&l.length>=1&&l.length<=64&&/[01]{1,64}/.test(l)}},{key:"parsePurchaseBits",value:function(l){if(this.isValidPurchaseBits(l)){this._purchasedFeatureMap.clear();for(var p=null,a=l.length-1,c=0;a>=0;a--,c++)p=c<32?new K(0,Math.pow(2,c)).toString():new K(Math.pow(2,c-32),0).toString(),l[a]==="1"?this._purchasedFeatureMap.set(p,!0):this._purchasedFeatureMap.set(p,!1)}else U.w("".concat(this._n,".parsePurchaseBits invalid purchasebits:").concat(l))}},{key:"hasPurchasedFeature",value:function(l){return!!this._purchasedFeatureMap.get(l)}},{key:"isFeatureEnabled",value:function(l){for(var p=parseInt(l).toString(2),a=void 0,c=!0,h=p.length-1,m=0;h>=0;h--,m++)if(p.charAt(h)==="1"&&(a=m<32?new K(0,Math.pow(2,m)).toString():new K(Math.pow(2,m-32),0).toString(),!this._purchasedFeatureMap.get(a))){c=!1;break}return U.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(l," binaryString:").concat(p," ret:").concat(c)),At({enabled:c})}},{key:"clear",value:function(){this._purchasedFeatureMap.clear()}}]),k}(),x8=function(){function k(l){i(this,k),this._m=l,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new P8}return u(k,[{key:"_canFetch",value:function(){return this._getModule(pn).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(l){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var l=this,p=this._canFetch(),a="".concat(this._n,".fetchConfig");if(U.l("".concat(a," canFetch:").concat(p)),p){var c=this._getModule(Fa),h=new We("fetchCommercialConfig");h.setNetworkType(c.getNetworkType());var m=this._getModule(pn).getSDKAppID(),y=this._getModule(Pi);this._isFetching=!0,y.request({protocolName:F_,requestData:{SDKAppID:m}}).then(function(b){h.setMessage("purchaseBits:".concat(b.data.purchaseBits)).end(),U.l("".concat(a," ok.")),l._parseConfig(b.data),l._isFetching=!1}).catch(function(b){c.probe().then(function(I){var E=A(I,2),R=E[0],F=E[1];h.setError(b,R,F).end()}),l._isFetching=!1})}}},{key:"onPushedConfig",value:function(l){var p="".concat(this._n,".onPushedConfig data:").concat(JSON.stringify(l));U.l("".concat(p)),new We("pushedCommercialConfig").setNetworkType(this._getModule(Fa).getNetworkType()).setMessage("purchaseBits:".concat(l.purchaseBits)).end(),this._parseConfig(l)}},{key:"_parseConfig",value:function(l){var p="".concat(this._n,"._parseConfig"),a=l.errorCode,c=l.errorMessage,h=l.purchaseBits,m=l.expiredTime;a===0?(this._purchasedFeatureHandler.parsePurchaseBits(h),this._expiredTime=Date.now()+1e3*m):Ge(a)?(U.l("".concat(p," failed. Invalid message format:"),l),this._setExpiredTimeOnResponseError(36e5)):(U.e("".concat(p," errorCode:").concat(a," errorMessage:").concat(c)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(l){this._expiredTime=Date.now()+l}},{key:"canIUse",value:function(l){return this._purchasedFeatureHandler.hasPurchasedFeature(l)}},{key:"isFeatureEnabled",value:function(l){return this._purchasedFeatureHandler.isFeatureEnabled(l)}},{key:"_getModule",value:function(l){return this._m.getModule(l)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),k}(),U8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._m=a,c._n="OfflinePushModule",c._offlinePushPlugin=void 0,c._androidPushConfig={huaweiPushBussinessId:"",xiaomiPushBussinessId:"",xiaomiPushAppId:"",xiaomiPushAppKey:"",meizuPushBussinessId:"",meizuPushAppId:"",meizuPushAppKey:"",vivoPushBussinessId:"",fcmPushBussinessId:"",oppoPushBussinessId:"",oppoPushAppKey:"",oppoPushAppSecret:"",honorPushBussinessId:""},c._deviceToken="",c._businessID=0,c._iosBusinessID=0,c._c2cUnreadCount=0,c._groupUnreadCount=0,c._isWebUniapp=0,c}return u(p,[{key:"registerPlugin",value:function(a){if(_e){this._offlinePushPlugin=a["tim-offline-push-plugin"];var c=a.offlinePushConfig||{},h=c.huaweiBusinessID,m=c.xiaomiBusinessID,y=c.xiaomiAppID,b=c.xiaomiAppKey,I=c.meizuBusinessID,E=c.meizuAppID,R=c.meizuAppKey,F=c.vivoBusinessID,H=c.oppoBusinessID,ee=c.oppoAppKey,ge=c.oppoAppSecret,be=c.honorBusinessID,we=c.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=h,this._androidPushConfig.xiaomiPushBussinessId=m,this._androidPushConfig.xiaomiPushAppId=y,this._androidPushConfig.xiaomiPushAppKey=b,this._androidPushConfig.meizuPushBussinessId=I,this._androidPushConfig.meizuPushAppId=E,this._androidPushConfig.meizuPushAppKey=R,this._androidPushConfig.vivoPushBussinessId=F,this._androidPushConfig.oppoPushBussinessId=H,this._androidPushConfig.oppoPushAppKey=ee,this._androidPushConfig.oppoPushAppSecret=ge,this._androidPushConfig.honorPushBussinessId=be,new We("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!Ge(this._offlinePushPlugin))).end(!0),U.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(a.offlinePushConfig))),this._iosBusinessID=we,this._setAppShowListener()}else this.outputWarning("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var a=this,c="".concat(this._n,".").concat("_getDeviceToken");if(Fo(this._offlinePushPlugin.getDeviceToken)){var h="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID);U.l("".concat(c," start. ").concat(h)),new We("_getDeviceToken").setMessage("".concat(h)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,function(m){var y=new We("getDeviceTokenRes"),b=m.code,I=m.msg;if(b===0){var E=m.data,R=E.deviceToken,F=E.deviceBrand,H=E.deviceType,ee=E.bussinessId;a._deviceToken=R,a._businessID=ee||a._iosBusinessID,h="deviceToken:".concat(R,", deviceBrand:").concat(F||H,", businessID:").concat(a._businessID),U.l("".concat(c," ok. ").concat(h)),y.setMessage(h).end(!0),a._setToken()}else y.setMessage("code:".concat(b,", msg:").concat(I)).end(!0),U.e("".concat(c," failed. error:"),m)})}else U.e("".concat(c," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return _e&&!Ge(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var a=this,c="".concat(this._n,".").concat("_setAppShowListener");Ge(this._offlinePushPlugin)?U.e("".concat(c," offlinePushPlugin is undefined")):Fo(this._offlinePushPlugin.setAppShowListener)?(new We("_setAppShowListener").end(!0),U.l("".concat(c," start")),this._offlinePushPlugin.setAppShowListener(function(h){var m=(h||{}).appShow;new We("setAppShowListenerRes").setMessage("appShow:".concat(m)).end(!0),U.l("".concat(c," ok. appShow:").concat(m)),a._m.isReady()&&(m===0?(a._getConvUnreadCount(),a._onBackground()):m===1&&a._onForeground())})):U.e("".concat(c," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){if(!Ge(this._offlinePushPlugin)&&Fo(this._offlinePushPlugin.getDeviceType)){var a=(this._offlinePushPlugin.getDeviceType()||{}).deviceType;return U.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(a)),a}}},{key:"_setToken",value:function(){var a,c=this,h="".concat(this._n,"._setToken"),m=this.getModule(pn),y=1,b="",I="";Ye(this._deviceToken)&&(y=0);var E=this.getUniAppPlatform(),R=this.getDeviceBrand();E===J.IOS||E===J.IPAD||E===J.MAC?I=this._deviceToken:E===J.ANDROID&&(b=this._deviceToken);var F=new We("offlinePushSetToken");return a="deviceToken:".concat(I||b,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(R,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(y,", platform:").concat(E),F.setMessage("".concat(a)),U.l("".concat(h," ").concat(a)),this.request({protocolName:W_,requestData:{tokenID:b,pushMsg:y,sdkAppID:m.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:R,deviceToken:I,isWebUniapp:this._isWebUniapp}}).then(function(H){return F.end(),U.l("".concat(h," ok")),H}).catch(function(H){return c.probeNetwork().then(function(ee){var ge=A(ee,2),be=ge[0],we=ge[1];F.setError(H,be,we).end()}),U.e("".concat(h," failed. error:"),H),Me(H)})}},{key:"_getConvUnreadCount",value:function(){var a=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(ct).getLocalConversationList().forEach(function(c){c.type===T.CONV_C2C&&(a._c2cUnreadCount+=c.unreadCount),c.type===T.CONV_GROUP&&(a._groupUnreadCount+=c.unreadCount)})}},{key:"_onBackground",value:function(){var a=this,c="".concat(this._n,".").concat("_onBackground"),h=new We("_onBackground");this.request({protocolName:z_,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then(function(m){return h.setMessage("c2cUnreadCount: ".concat(a._c2cUnreadCount,", groupUnreadCount: ").concat(a._groupUnreadCount)).end(),U.l("".concat(c," ok")),m}).catch(function(m){a.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];h.setError(m,I,E).end()}),U.e("".concat(c," failed. error:"),m)})}},{key:"_onForeground",value:function(){var a=this,c="".concat(this._n,".").concat("_onForeground"),h=new We("_onForeground");this.request({protocolName:j_,requestData:{isWebUniapp:this._isWebUniapp}}).then(function(m){return h.end(),U.l("".concat(c," ok")),m}).catch(function(m){a.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];h.setError(m,I,E).end()}),U.e("".concat(c," failed. error:"),m)})}},{key:"getUniAppPlatform",value:function(){var a=uni.getSystemInfoSync().platform,c=this.getDeviceBrand();return a==="ios"?J.IOS:a==="android"?J.ANDROID:c===1002?J.IPAD:c===1001?J.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,U.l("".concat(this._n,".reset"))}}]),p}(Sr),F8=function(k){f(p,k);var l=N(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="ProfanityFilterModule",c._plugin=null,c._filterConfigMap=new Map,c._startIndex=0,c._version=0,c._canIUseLexicon=!1,c._isFetching=!1,c._expiredTime=0,c}return u(p,[{key:"init",value:function(){var a=this.getModule(Ag).getPlugin("tim-profanity-filter-plugin");a?(this._plugin=new a({logger:U,isArray:rt,isMap:yd,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning("ProfanityPluginNotFound")}},{key:"onCheckTimer",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(a,c){var h=!0;if(!this._plugin||!this._canIUseLexicon||c&&c.messageControlInfo&&c.messageControlInfo.excludedFromContentModeration===!0)return h;var m=a.type,y=a.conversationType;if(m!==T.MSG_TEXT&&m!==T.MSG_CUSTOM)return h;var b,I="".concat(this._n,".filterMessage");if(U.l("".concat(I)),m===T.MSG_TEXT){if(y===T.CONV_C2C?b=Le:y===T.CONV_GROUP&&(b=W),!this._isConfigOn(b))return h;var E=this._plugin.filter(a.payload.text),R=E.type,F=E.modifiedText;R===1?h=!1:R===2&&(a.payload.text=F)}else if(m===T.MSG_CUSTOM){if(y===T.CONV_C2C?b=me:y===T.CONV_GROUP&&(b=te),!this._isConfigOn(b))return h;var H=this._plugin.filter(a.payload.data),ee=this._plugin.filter(a.payload.description),ge=this._plugin.filter(a.payload.extension);H.type===1||ee.type===1||ge.type===1?h=!1:(H.type===2&&(a.payload.data=H.modifiedText),ee.type===2&&(a.payload.description=ee.modifiedText),ge.type===2&&(a.payload.extension=ge.modifiedText))}return U.l("".concat(I," done. isAllowedToSend:").concat(h)),h}},{key:"filterText",value:function(a,c){var h="".concat(this._n,".filterText"),m={isAllowedToSend:!0,modifiedText:a};if(!this._plugin||!this._canIUseLexicon||!this._isConfigOn(c))return m;U.l("".concat(h));var y=this._plugin.filter(a),b=y.type,I=y.modifiedText;return b===1?m.isAllowedToSend=!1:b===2&&(m.modifiedText=I),U.l("".concat(h," done. ret:"),m),m}},{key:"_getLexicon",value:function(){var a=this,c=new We("profanityFilter"),h="".concat(this._n,"._getLexicon");this._isFetching=!0,this.request({protocolName:K_,requestData:{startIndex:this._startIndex,version:this._version}}).then(function(m){var y=m.data,b=y.errorInfo,I=y.filterConfig,E=y.lexicon,R=y.strToken,F=y.completeFlag,H=y.nextStartIndex,ee=y.version,ge=y.expiredTime,be=b.errorCode,we=b.errorMessage;return be!==0?(a._isFetching=!1,U.w("".concat(h," failed. error:"),b),void c.setCode(be).setMessage(we).end()):(a._onFilterConfig(I),a._getToken(R),F===1?(U.l("".concat(h," done. version:").concat(ee," expiredTime:").concat(ge)),a._version=ee,a._canIUseLexicon=!0,a._isFetching=!1,a._expiredTime=Date.now()+1e3*ge,void a._plugin.onLexiconCompleted(E)):(a._startIndex=H,a._plugin.onLexiconSliced(E),void a._getLexicon()))}).catch(function(m){a.probeNetwork().then(function(y){var b=A(y,2),I=b[0],E=b[1];c.setError(m,I,E).end()}),a._isFetching=!1,U.l("".concat(h," failed. error:"),m)})}},{key:"_onFilterConfig",value:function(a){var c=this;Ye(a)||(this._filterConfigMap.clear(),Object.keys(a).forEach(function(h){c._filterConfigMap.set(h,a[h])}),U.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(a){return this._filterConfigMap.get(a)===1}},{key:"_getToken",value:function(a){if(Et(a)){var c=a.length,h="";if(c%2==0)for(var m=0;m<=c-1;m+=2)h+=a[m+1],h+=a[m];else{for(var y=0;y=this.STORAGE_EXPIRES_TIME,h=!a||a!=="3.1.1";return U.l("".concat(this._n,"._needToUpdate isTimeout:").concat(c," isDifferentVersion:").concat(h)),c||h}},{key:"_fetch",value:function(){if(!this._m.getModule(pn).isPrivateNetWork()){var l="https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.1/tim-error-message.txt",p="application/x-www-form-urlencoded;charset=UTF-8",a="".concat(this._n,"._fetch ok in"),c=this;if(je)Fe.request({url:l,method:"GET",timeout:3e3,header:{"content-type":p},dataType:"text",success:function(y){c._fillAndSave(y.data),U.l("".concat(a," mini program"))},fail:function(){}});else{var h=new XMLHttpRequest,m=setTimeout(function(){h.abort()},3e3);h.onreadystatechange=function(){h.readyState===4&&(clearTimeout(m),h.status!==200&&h.status!==304||(U.l("".concat(a," browser")),c._fillAndSave(h.responseText)))},h.open("GET",l,!0),h.setRequestHeader("Content-type",p),h.send()}}}},{key:"_fillAndSave",value:function(l){this._fillMap(l),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:l,localSavedTime:new Date().getTime(),localSavedVersion:"3.1.1"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.getModule(na)}},{key:"_fillMap",value:function(l){this._map.clear();for(var p,a,c,h=l.split(`; `),m=h.length,y=new RegExp(/'/g),b=0;b0&&a.forEach(function(c){var h=p.getPayloadData(c);h&&p._handleActionType(h,c)})}},{key:"onMessageModified",value:function(l){var p=this,a=this._signalingModule.filterMessageList(l);a.length>0&&a.forEach(function(c){var h=p.getPayloadData(c);h&&p._onInvitationModified(h,c)})}},{key:"getPayloadData",value:function(l){var p="".concat(this._n,".getPayloadData"),a=l.payload.data;try{return JSON.parse(a)}catch{return U.e("".concat(p," JSON parse error. signalingData:").concat(a)),null}}},{key:"_handleActionType",value:function(l,p){switch(l.actionType){case P.ACTION_TYPE_INVITE:this._onNewInvitationReceived(l,p);break;case P.ACTION_TYPE_REJECT_INVITE:this._onInviteeRejected(l);break;case P.ACTION_TYPE_ACCEPT_INVITE:this._onInviteeAccepted(l);break;case P.ACTION_TYPE_CANCEL_INVITE:this._onInvitationCancelled(l);break;case P.ACTION_TYPE_INVITE_TIMEOUT:this._onInvitationTimeout(l)}}},{key:"_createDefaultEmitData",value:function(l){return{inviteID:l.inviteID,inviter:l.inviter,groupID:l.groupID,data:l.data||""}}},{key:"_onNewInvitationReceived",value:function(l,p){var a="".concat(this._n,"._onNewInvitationReceived"),c=l.inviteID,h=l.inviteeList,m=l.groupID,y=this._signalingModule.getMyUserID(),b=h.includes(y),I=Math.round(l.timeout-(new Date().getTime()-1e3*p.time)/1e3);if(U.l("".concat(a," myselfIncluded:").concat(b," groupID:").concat(m," timeout:").concat(I,"s signalObj:").concat(JSON.stringify(l))),m&&b||!m){var E=this._signalingModule.getInviteInfo(c);if(E&&E===l)return;E||this._signalingModule.setInviteInfo(c,r(r({},l),{},{message:p})),this._signalingModule.emitEvent(P.NEW_INVITATION_RECEIVED,r(r({},this._createDefaultEmitData(l)),{},{inviteeList:h})),this._signalingModule.startTimer(r(r({},l),{},{timeout:I}))}}},{key:"_onInviteeRejected",value:function(l){var p="".concat(this._n,"._onInviteeRejected"),a=l.inviteID,c=l.inviter,h=l.groupID,m=this._signalingModule.hasInviteInfo(a);U.l("".concat(p," inviteID:").concat(a," hasInviteID:").concat(m," inviter:").concat(c," groupID:").concat(h)),(h&&m||!h)&&(this._signalingModule.updateInviteInfo(l),this._signalingModule.emitEvent(P.INVITEE_REJECTED,r(r({},this._createDefaultEmitData(l)),{},{invitee:l.inviteeList[0]})))}},{key:"_onInviteeAccepted",value:function(l){var p="".concat(this._n,"._onInviteeAccepted"),a=l.inviteID,c=l.inviter,h=l.groupID,m=this._signalingModule.hasInviteInfo(a);U.l("".concat(p," inviteID:").concat(a," hasInviteID:").concat(m," inviter:").concat(c," groupID:").concat(h)),(h&&m||!h)&&(this._signalingModule.updateInviteInfo(l),this._signalingModule.emitEvent(P.INVITEE_ACCEPTED,r(r({},this._createDefaultEmitData(l)),{},{invitee:l.inviteeList[0]})))}},{key:"_onInvitationCancelled",value:function(l){var p="".concat(this._n,"._onInvitationCancelled"),a=l.inviteID,c=l.inviter,h=l.groupID,m=this._signalingModule.hasInviteInfo(a);U.l("".concat(p," inviteID:").concat(a," hasInviteID:").concat(m," inviter:").concat(c," groupID:").concat(h)),(h&&m||!h)&&(this._signalingModule.deleteInviteInfo(a),this._signalingModule.emitEvent(P.INVITATION_CANCELLED,this._createDefaultEmitData(l)))}},{key:"_onInvitationTimeout",value:function(l){var p="".concat(this._n,"._onInvitationTimeout"),a=l.inviteID,c=l.inviter,h=l.groupID,m=l.inviteeList,y=this._signalingModule.hasInviteInfo(a);U.l("".concat(p," inviteID:").concat(a," hasInviteID:").concat(y," inviter:").concat(c," groupID:").concat(h," data:").concat(l.data)),(h&&y||!h)&&(this._signalingModule.updateInviteInfo(l),this._signalingModule.emitEvent(P.INVITATION_TIMEOUT,r(r({},this._createDefaultEmitData(l)),{},{inviteeList:m,isSelfTimeout:!1})))}},{key:"_onInvitationModified",value:function(l,p){var a="".concat(this._n,"._onInvitationModified"),c=l.inviteID,h=l.data;U.l("".concat(a," inviteID:").concat(c," data:").concat(h)),this._signalingModule.setInviteInfo(c,r(r({},l),{},{message:p})),this._signalingModule.emitEvent(P.INVITATION_MODIFIED,{inviteID:c,data:h})}}]),k}(),H8=function(k){if(k<0||k>53)return NaN;var l=0|1073741824*Math.random();return k>30?l+1073741824*(0|Math.random()*(1<>>30-k},q8=function(k,l){for(var p=k.toString(16),a=l-p.length,c="0";a>0;a>>>=1,c+=c)1&a&&(p=c+p);return p},V8=function(){function k(l){i(this,k),this._n="LocalSignalingHandler",this._signalingModule=l}return u(k,[{key:"generateInviteID",value:function(){var l,p,a=(p=q8)((l=H8)(32),8)+"-"+p(l(16),4)+"-"+p(16384|l(12),4)+"-"+p(32768|l(14),4)+"-"+p(l(48),12);return U.l("".concat(this._n,".generateInviteID inviteID:").concat(a)),a}},{key:"createInviteInfo",value:function(l){var p=this.generateInviteID(),a=this.createInviteCustomData(r(r({},l),{},{inviteID:p})),c=a.groupID,h=a.inviteeList,m=c||h[0];return{customData:a,message:this.createSignalingMessage(a,m),inviteID:p}}},{key:"_createDefaultCustomData",value:function(l){var p=l.data,a=p===void 0?"":p,c=l.inviteID,h=c===void 0?"":c,m=l.groupID;return{businessID:1,timeout:0,data:a,inviteID:h,groupID:m===void 0?"":m}}},{key:"createInviteCustomData",value:function(l){var p=l.userID,a=l.timeout,c=a===void 0?0:a,h=l.groupID,m=h===void 0?"":h,y=this._signalingModule.getMyUserID(),b=r(r({},this._createDefaultCustomData(l)),{},{actionType:P.ACTION_TYPE_INVITE,inviter:y,inviteeList:m?l.inviteeList:[p],timeout:c});return U.l("".concat(this._n,".createInviteCustomData customData:").concat(JSON.stringify(b))),b}},{key:"createCancelCustomData",value:function(l){var p,a="".concat(this._n,".createCancelCustomData"),c=l.inviteID,h=this._signalingModule.getMyUserID(),m=this._signalingModule.getInviteInfo(c),y=m.inviteeList,b=m.groupID,I=m.inviter;return I===h?p=r(r({},this._createDefaultCustomData(l)),{},{actionType:P.ACTION_TYPE_CANCEL_INVITE,groupID:b,inviter:h,inviteeList:y}):U.e("".concat(a," unmatched inviter:").concat(I," and my userID:").concat(h)),U.l("".concat(a," customData:").concat(JSON.stringify(p))),p}},{key:"createAcceptCustomData",value:function(l){var p,a="".concat(this._n,".createAcceptCustomData"),c=l.inviteID,h=this._signalingModule.getMyUserID(),m=this._signalingModule.getInviteInfo(c),y=m.inviter,b=m.groupID;return m.inviteeList.includes(h)?p=r(r({},this._createDefaultCustomData(l)),{},{actionType:P.ACTION_TYPE_ACCEPT_INVITE,groupID:b,inviter:y,inviteeList:[h]}):U.e("".concat(a," userID:").concat(h," not in inviteeList. inviteID:").concat(c," groupID:").concat(b)),U.l("".concat(a," customData:").concat(JSON.stringify(p))),p}},{key:"createRejectCustomData",value:function(l){var p,a="".concat(this._n,".createRejectCustomData"),c=l.inviteID,h=this._signalingModule.getMyUserID(),m=this._signalingModule.getInviteInfo(c),y=m.inviter,b=m.groupID;return m.inviteeList.includes(h)?p=r(r({},this._createDefaultCustomData(l)),{},{actionType:P.ACTION_TYPE_REJECT_INVITE,groupID:b,inviter:y,inviteeList:[h]}):U.e("".concat(a," userID:").concat(h," not in inviteeList. inviteID:").concat(c," groupID:").concat(b)),U.l("".concat(a," customData:").concat(JSON.stringify(p))),p}},{key:"createTimeoutCustomData",value:function(l){var p="".concat(this._n,".createTimeoutCustomData"),a=l.inviteeList,c=l.inviter,h=l.isInviter,m=h!==void 0&&h,y=this._signalingModule.getMyUserID(),b=r(r({},this._createDefaultCustomData(l)),{},{actionType:P.ACTION_TYPE_INVITE_TIMEOUT,inviter:c,inviteeList:m?a:[y]});return U.l("".concat(p," customData:").concat(JSON.stringify(b))),b}},{key:"createSignalingMessage",value:function(l,p){var a=l.groupID,c=l.inviter,h=this._signalingModule.getModule(ir),m={to:p||a||c,conversationType:a?T.CONV_GROUP:T.CONV_C2C,priority:T.MSG_PRIORITY_HIGH,payload:{data:JSON.stringify(l)}},y=h.createCustomMessage(m);return U.d("".concat(this._n,".createSignalingMessage. message:").concat(JSON.stringify(y))),y}}]),k}(),z8=function(){function k(l){i(this,k),this._n="HistorySignalingHandler",this._signalingModule=l,this.EXPIRED_TIME=3e4,this.COUNT=20,this._signalingMap=new Map,this._signalingRelatedToMeMap=new Map}return u(k,[{key:"getHistorySignaling",value:function(){var l=this,p=this._signalingModule.getModule(ct).getLocalConversationList();Ye(p)||this._getSignalingList(p).then(function(a){l._handleSignalingList(a)})}},{key:"_getSignalingList",value:function(l){var p=this,a=this._getValidConversationList(l),c=this._createPromiseList(a);return Ye(c)?Promise.resolve([]):this._concurrentGetMessageList(c).then(function(h){var m=new Map;return h.forEach(function(y){var b=y.signalingList,I=p._getSignalingRelatedToMeMap(b);m=new Map([].concat(L(m),L(I)))}),p._sortSignaling(m)})}},{key:"_handleSignalingList",value:function(l){Ye(l)||(U.d("".concat(this._n,"._handleSignalingList signalingList:").concat(JSON.stringify(l))),this._signalingModule.onNewMessageList(l))}},{key:"_isSignalingNotExpired",value:function(l,p){return l[p]&&1e3*l[p]>new Date().getTime()-this.EXPIRED_TIME}},{key:"_getValidConversationList",value:function(l){for(var p=[],a=0;a0&&b&&p.push(l[a])}return p}},{key:"_createPromiseList",value:function(l){for(var p=[],a=0;a0?p._concurrentGetMessageList(a):p._signalingMap})}},{key:"_relayGetMessageList",value:function(l){var p=l.messageList,a=l.nextReqMessageID,c=l.isCompleted,h=p.length;if(h===0)return null;var m=p[0],y=m.conversationID,b=m.conversationType,I=this._signalingMap.get(y).needMessageCount,E=b===T.CONV_GROUP,R=I===0||c,F=this._isSignalingNotExpired(p[h-1],"time");return E||R||!F?null:this._signalingModule.getModule(ct).getMessageList({conversationID:y,nextReqMessageID:a,count:I})}},{key:"_handleMessageList",value:function(l){for(var p=l.length,a=l[0].conversationID,c=this._signalingMap.get(a),h=c.needMessageCount,m=c.signalingList,y=h-p>0?h-p:0,b=[],I=0;I0&&arguments[0]!==void 0?arguments[0]:{},c=a.messageControlInfo,h=c===void 0?{}:c,m=a.data,y=m===void 0?"":m,b=a.onlineUserOnly,I=a.inviteID,E=I===void 0?"":I,R=!!y.match(/"excludeFromHistoryMessage"/),F={};return E&&(F=this.getInviteInfo(E).message),{onlineUserOnly:b||F._onlineUserOnly,messageControlInfo:r(r({},h),{},{excludedFromUnreadCount:R||h.excludedFromUnreadCount,excludedFromLastMessage:R||h.excludedFromLastMessage,excludedFromContentModeration:!0})}}},{key:"sendSignaling",value:function(a,c){var h=this;return this.getModule(ir).sendMessageInstance(a,this._genMessageControlInfo(c)).catch(function(m){return h._isHandling=!1,Me({code:De.SEND_MESSAGE_FAILED_WITH_CANCEL})})}},{key:"filterMessageList",value:function(a){var c=this;return a.filter(function(h){return c._filterSignalingMessage(h)})}},{key:"_filterSignalingMessage",value:function(a){var c=!1;if(a.type&&a.type===T.MSG_CUSTOM){var h=a.cloudCustomData,m=h===void 0?"":h,y=a.payload.data,b=y===void 0?"":y,I=m.match(/"type":"tsignaling"/),E=b.match(/inviteID/),R=b.match(/actionType/);c=I||E&&R}return c}},{key:"startTimer",value:function(a){var c=this,h="".concat(this._n,".startTimer"),m=a.timeout,y=a.inviteID,b=a.inviter,I=a.groupID,E=b===this.getMyUserID();if(U.l("".concat(h," timeout:").concat(m," isInviter:").concat(E," groupID:").concat(I)),!(m<=0))var R=E?m+5:m,F=1,H=setInterval(function(){var ee=c._hasLocalInviteInfo(a,E);F0:b.length>0&&b.includes(this.getMyUserID()))}},{key:"_getReceiver",value:function(a,c){var h=c.groupID,m=c.inviteeList,y=c.inviter;return a?h||m[0]:h||y}},{key:"_sendTimeoutNotice",value:function(a,c){var h=this,m=this.getInviteInfo(a),y=this._getReceiver(c,m);U.l("".concat(this._n,"._sendTimeoutNotice inviteID:").concat(a," to:").concat(y," isInviter:").concat(c));var b=this._localSignalingHandler.createTimeoutCustomData(r(r({},m),{},{isInviter:c})),I=this._localSignalingHandler.createSignalingMessage(b,y);return this.sendSignaling(I).then(function(E){if(E&&E.code===0){var R=b.data,F=b.groupID,H=b.inviteeList,ee=b.inviter;h.emitEvent(P.INVITATION_TIMEOUT,{data:R,groupID:F,inviteID:a,inviteeList:H,inviter:ee,isSelfTimeout:!0}),c?h.deleteInviteInfo(a):h.updateInviteInfo(b)}})}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._inviteInfoMap.clear(),this._canIUseSignaling=!1,this._isHandling=!1,this._historySignalingHandler.reset(),this._isC2CUnreadHandleCompleted=!1,this._isConvSyncCompleted=!1,this._isSyncCompleted=!1}}]),p}(Sr),J8=function(){function k(l){var p=this;i(this,k);var a,c=new We("sdkConstruct");this._n="ModuleManager",this._isReady=!1,this._reason=De.USER_NOT_LOGGED_IN,this._startLoginTs=0,this._moduleMap=new Map,this._innerEmitter=null,this._outerEmitter=null,this._checkCount=0,this._checkTimer=-1,this._moduleMap.set(pn,new $6(this,l)),this._moduleMap.set(yp,new x8(this)),this._moduleMap.set(mp,new C8(this)),this._moduleMap.set(vp,new N8(this)),this._moduleMap.set($o,new E8(this)),this._moduleMap.set(Ns,new g8(this)),this._moduleMap.set(Pi,new M8(this)),this._moduleMap.set(Ua,new H6(this)),this._moduleMap.set(ir,new t8(this)),this._moduleMap.set(hp,new n8(this)),this._moduleMap.set(gw,new r8(this)),this._moduleMap.set(pr,new G6(this)),this._moduleMap.set(ao,new r6(this)),this._moduleMap.set(ct,new g6(this)),this._moduleMap.set(Mt,new O6(this)),this._moduleMap.set(sr,new P6(this)),this._moduleMap.set(na,new q6(this)),this._moduleMap.set(mw,new $8(this)),this._moduleMap.set(_0,new z6(this)),this._moduleMap.set(Fa,new W6(this)),this._moduleMap.set(pw,new Y6(this)),this._moduleMap.set(Ag,new o8(this)),this._moduleMap.set(b0,new i8(this)),this._moduleMap.set(gp,new I8(this)),this._moduleMap.set(hw,new T8(this)),this._moduleMap.set(hr,new R8(this)),this._moduleMap.set(_p,new U8(this)),this._moduleMap.set(Ga,new F8(this)),this._moduleMap.set(M0,new G8(this)),this._moduleMap.set(ni,new Y8(this)),this._eventThrottleMap=new Map,yn(l.modules)&&Object.keys(l.modules).forEach(function(I){a=l.modules[I],I==="group-module"?p._moduleMap.set(Mt,new a(p)):I==="relationship-module"?p._moduleMap.set(hr,new a(p)):I==="signaling-module"&&p._moduleMap.set(ni,new a(p))});var h=l.instanceID,m=l.SDKAppID,y=this._moduleMap.get(pn).isIntl(),b="instanceID:".concat(h," SDKAppID:").concat(m," host:").concat(Os()," isIntl:").concat(y," inBrowser:").concat(lt," inMiniApp:").concat(je)+" workerAvailable:".concat(mr," UserAgent:").concat(it);We.bindEventStatModule(this._moduleMap.get(_0)),c.setMessage("".concat(b," ").concat(function(){var I="";if(je)try{var E=Fe.getSystemInfoSync(),R=E.model,F=E.version,H=E.system,ee=E.platform,ge=E.SDKVersion;I="model:".concat(R," version:").concat(F," system:").concat(H," platform:").concat(ee," SDKVersion:").concat(ge)}catch{I=""}return I}())).end(),U.i("SDK ".concat(b)),Un.prototype._getErrorMessage=this.getErrorMessage.bind(this),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}return u(k,[{key:"_startTimer",value:function(){var l=this._moduleMap.get(vp),p=l.isWorkerEnabled();U.l("".concat(this._n,".startTimer isWorkerEnabled:").concat(p," seed:").concat(this._checkTimer)),p?l.startWorkerTimer():this._startMainThreadTimer()}},{key:"_startMainThreadTimer",value:function(){this._checkTimer<0&&(this._checkTimer=setInterval(this.onCheckTimer.bind(this),1e3)),U.l("".concat(this._n,"._startMainThreadTimer seed:").concat(this._checkTimer))}},{key:"stopTimer",value:function(){var l=this._moduleMap.get(vp),p=l.isWorkerEnabled();U.l("".concat(this._n,".stopTimer isWorkerEnabled:").concat(p," seed:").concat(this._checkTimer)),p?l.stopWorkerTimer():this._stopMainThreadTimer()}},{key:"_stopMainThreadTimer",value:function(){U.l("".concat(this._n,"._stopMainThreadTimer")),this._checkTimer>0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:"_stopMainThreadSocket",value:function(){U.l("".concat(this._n,"._stopMainThreadSocket"));var l=this._moduleMap.get(Ns);l.setIsWorkerEnabled(!0),l.reConnect()}},{key:"_startMainThreadSocket",value:function(){U.l("".concat(this._n,"._startMainThreadSocket"));var l=this._moduleMap.get(Ns);l.setIsWorkerEnabled(!1),l.reConnect()}},{key:"onWorkerTimerEnabled",value:function(){U.l("".concat(this._n,".onWorkerTimerEnabled, disable main thread timer and socket")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:"onWorkerTimerDisabled",value:function(){U.l("".concat(this._n,".onWorkerTimerDisabled, enable main thread timer and socket")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:"onCheckTimer",value:function(){this._checkCount+=1;var l,p=G(this._moduleMap);try{for(p.s();!(l=p.n()).done;){var a=A(l.value,2)[1];a.onCheckTimer&&a.onCheckTimer(this._checkCount)}}catch(c){p.e(c)}finally{p.f()}}},{key:"_initReadyList",value:function(){var l=this;this._readyList=[this._moduleMap.get(Ua)],this._readyList.forEach(function(p){p.ready(function(){return l._onModuleReady()})})}},{key:"_onModuleReady",value:function(){var l=!0;if(this._readyList.forEach(function(h){h.isReady()||(l=!1)}),l&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(O.SDK_READY);var p=Date.now()-this._startLoginTs;U.w("SDK is ready. cost ".concat(p," ms")),this._startLoginTs=Date.now();var a=this._moduleMap.get(Fa).getNetworkType(),c=this._ssoLogForReady.getStartTs()+wn;this._ssoLogForReady.setNetworkType(a).setMessage(p).start(c).end()}}},{key:"login",value:function(){this._startLoginTs===0&&(Pn(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(Fa).start(),this._ssoLogForReady=new We("sdkReady"),this._reason=De.LOGGING_IN)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOuterEmitterInstance",value:function(){return this._outerEmitter===null&&(this._outerEmitter=new d1,n6(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=(function(l,p){var a=this;if(this._canIUseSignaling()){if(l===O.MESSAGE_RECEIVED){var c=this.getModule(ni);c.onNewMessageList(p)}if(l===O.MESSAGE_MODIFIED){var h=this.getModule(ni);h.onMessageModified(p)}}if(l===O.CONVERSATION_LIST_UPDATED||l===O.FRIEND_LIST_UPDATED||l===O.GROUP_LIST_UPDATED||l===O.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)if(this._eventThrottleMap.has(l)){var m=Date.now(),y=this._eventThrottleMap.get(l);m-y.last<=1e3?(y.timeoutID&&clearTimeout(y.timeoutID),y.timeoutID=setTimeout(function(){y.last=Date.now(),a._outerEmitter._emit.apply(a._outerEmitter,[l,{name:l,data:a._getEventData(l)}])},1e3)):(y.last=m,this._outerEmitter._emit.apply(this._outerEmitter,[l,{name:l,data:this._getEventData(l)}]))}else this._eventThrottleMap.set(l,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[l,{name:l,data:this._getEventData(l)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[l,{name:l,data:arguments[1]}])}).bind(this)),this._outerEmitter}},{key:"_canIUseSignaling",value:function(){var l=this.getModule(ni);return!!l&&l.canIUseSignaling()}},{key:"_getEventData",value:function(l){return l===O.CONVERSATION_LIST_UPDATED?this._moduleMap.get(ct).getLocalConversationList():l===O.FRIEND_LIST_UPDATED?this._moduleMap.get(hr).getLocalFriendList(!1):l===O.GROUP_LIST_UPDATED?this._moduleMap.get(Mt).getLocalGroupList():l===O.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(ct).getTotalUnreadMessageCount():void 0}},{key:"getInnerEmitterInstance",value:function(){return this._innerEmitter===null&&(this._innerEmitter=new d1,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=(function(l,p){var a;a=yn(arguments[1])&&arguments[1].data?[l,{name:arguments[0],data:arguments[1].data}]:[l,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,a)}).bind(this)),this._innerEmitter}},{key:"hasModule",value:function(l){return this._moduleMap.has(l)}},{key:"getModule",value:function(l){return this._moduleMap.get(l)}},{key:"isReady",value:function(){return this._isReady}},{key:"isIntl",value:function(){return this.getModule(pn).isIntl()}},{key:"getNotReadyReason",value:function(){return this._reason}},{key:"setNotReadyReason",value:function(l){this._reason=l}},{key:"getErrorMessage",value:function(l,p,a){return this._moduleMap.get(mw).get({key:l,replacement1:p,replacement2:a,isIntl:this.isIntl()})}},{key:"outputWarning",value:function(l,p,a){var c=this.getErrorMessage(l,p,a);c&&U.w(c)}},{key:"onError",value:function(l){var p="code:".concat(l.code," message:").concat(l.message);U.w("Oops! ".concat(p)),new We("error").setMessage(p).setNetworkType(this.getModule(Fa).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(O.ERROR,l)}},{key:"restartTimer",value:function(){U.l("".concat(this._n,".restartTimer")),this.stopTimer(),this._startTimer();var l=this.getModule(Mt);l&&l.restartPolling()}},{key:"getTimerID",value:function(){var l=this._moduleMap.get(vp);return l.isWorkerEnabled()?l.getTimerID():this._checkTimer}},{key:"getPollingTimerID",value:function(l){return this._moduleMap.get(Mt).getPollingTimerID(l)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),Pn();var l,p=G(this._moduleMap);try{for(p.s();!(l=p.n()).done;){var a=A(l.value,2)[1];a.reset&&a.reset()}}catch(y){p.e(y)}finally{p.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(O.SDK_NOT_READY);var c,h=G(this._eventThrottleMap);try{for(h.s();!(c=h.n()).done;){var m=A(c.value,2)[1];m.timeoutID&&clearTimeout(m.timeoutID)}}catch(y){h.e(y)}finally{h.f()}this._eventThrottleMap.clear()}}]),k}(),X8=function(){function k(l){i(this,k),this._funcMap=new Map,this._m=l}return u(k,[{key:"defense",value:function(l,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(typeof l!="string"||l.length===0||typeof p!="function")return null;if(this._funcMap.has(l)&&this._funcMap.get(l).has(p))return this._funcMap.get(l).get(p);this._funcMap.has(l)||this._funcMap.set(l,new Map);var c=null;return this._funcMap.get(l).has(p)?c=this._funcMap.get(l).get(p):(c=this._pack(l,p,a),this._funcMap.get(l).set(p,c)),c}},{key:"defenseOnce",value:function(l,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return typeof p!="function"?null:this._pack(l,p,a)}},{key:"find",value:function(l,p){return typeof l!="string"||l.length===0||typeof p!="function"?null:this._funcMap.has(l)&&this._funcMap.get(l).has(p)?this._funcMap.get(l).get(p):(this._m.outputWarning("ListenerFnNotFound",l),null)}},{key:"delete",value:function(l,p){return typeof p=="function"&&!!this._funcMap.has(l)&&!!this._funcMap.get(l).has(p)&&(this._funcMap.get(l).delete(p),this._funcMap.get(l).size===0&&this._funcMap.delete(l),!0)}},{key:"_pack",value:function(l,p,a){var c=this;return function(){try{p.apply(a,Array.from(arguments))}catch(I){var h=Object.values(O).indexOf(l),m="CallbackError";if(h!==-1){var y=Object.keys(O)[h];c._m.outputWarning(m,y,I)}var b=new We(m);b.setMessage("eventName:".concat(l)).setMoreMessage(I.message).end()}}}}]),k}(),Z8=function(){function k(l){i(this,k);var p={SDKAppID:l.SDKAppID,unlimitedAVChatRoom:l.unlimitedAVChatRoom||!1,scene:l.scene||"",oversea:l.oversea||!1,instanceID:Na(),devMode:l.devMode||!1,proxyServer:l.proxyServer||void 0,fileUploadProxy:l.fileUploadProxy||void 0,fileDownloadProxy:l.fileDownloadProxy||l.fileUploadProxy||void 0,modules:l.modules||void 0};this._m=new J8(p),this._vendorMap=new Map,this._safetyCallbackFactory=new X8(this._m)}return u(k,[{key:"onError",value:function(l){this._m.onError(l)}},{key:"login",value:function(l){return this._m.login(),this._getModule(Ua).login(l)}},{key:"logout",value:function(){var l=this;return this._getModule(Ua).logout().then(function(p){return l._m.reset(),p})}},{key:"isReady",value:function(){return this._m.isReady()}},{key:"isIntl",value:function(){return this._m.isIntl()}},{key:"getNotReadyReason",value:function(){return this._m.getNotReadyReason()}},{key:"getErrorMessage",value:function(l,p,a){return this._m.getErrorMessage(l,p,a)}},{key:"_getModule",value:function(l){return this._m.getModule(l)}},{key:"destroy",value:function(){var l=this;return this.logout().finally(function(){l._m.stopTimer(),l._getModule(vp).terminate(),l._getModule(Ns).dealloc();var p=l._m.getOuterEmitterInstance(),a=l._getModule(pn);p.emit(O.SDK_DESTROY,{SDKAppID:a.getSDKAppID()})})}},{key:"on",value:function(l,p,a){U.d("on","eventName:".concat(l)),this._m.getOuterEmitterInstance().on(l,this._safetyCallbackFactory.defense(l,p,a),a)}},{key:"once",value:function(l,p,a){U.d("once","eventName:".concat(l)),this._m.getOuterEmitterInstance().once(l,this._safetyCallbackFactory.defenseOnce(l,p,a),a||this)}},{key:"off",value:function(l,p,a,c){U.d("off","eventName:".concat(l));var h=this._safetyCallbackFactory.find(l,p);h!==null&&(this._m.getOuterEmitterInstance().off(l,h,a,c),this._safetyCallbackFactory.delete(l,p))}},{key:"registerPlugin",value:function(l){Ge(l["tim-offline-push-plugin"])?this._getModule(Ag).registerPlugin(l):this._getModule(_p).registerPlugin(l)}},{key:"setLogLevel",value:function(l){if(l<=0){var p=this.getErrorMessage("TIM_ASCII_ART");p&&console.log(p);var a=this.getErrorMessage("API_REFER");a&&(Bu()?console.log("%c ".concat("IM SDK API ->"," %c"),"background:#ff9d00; padding:1px; border-radius:3px; color: #fff","background:transparent",a):console.log("IM SDK API ->",a));var c=this.getErrorMessage("DOCS_GUIDE");c&&console.log(c)}U.setLevel(l)}},{key:"createTextMessage",value:function(l){return this._getModule(ir).createTextMessage(l)}},{key:"createTextAtMessage",value:function(l){return this._getModule(ir).createTextMessage(l)}},{key:"createImageMessage",value:function(l){return this._getModule(ir).createImageMessage(l)}},{key:"createAudioMessage",value:function(l){return this._getModule(ir).createAudioMessage(l)}},{key:"createVideoMessage",value:function(l){return this._getModule(ir).createVideoMessage(l)}},{key:"createCustomMessage",value:function(l){return this._getModule(ir).createCustomMessage(l)}},{key:"createFaceMessage",value:function(l){return this._getModule(ir).createFaceMessage(l)}},{key:"createFileMessage",value:function(l){return this._getModule(ir).createFileMessage(l)}},{key:"createLocationMessage",value:function(l){return this._getModule(ir).createLocationMessage(l)}},{key:"createMergerMessage",value:function(l){return this._getModule(ir).createMergerMessage(l)}},{key:"downloadMergerMessage",value:function(l){return l.type!==T.MSG_MERGER?Me({code:De.MSG_MERGER_TYPE_INVALID}):Ye(l.payload.downloadKey)?Me({code:De.MSG_MERGER_KEY_INVALID}):this._getModule(ir).downloadMergerMessage(l).catch(function(p){return Me({code:De.MSG_MERGER_DOWNLOAD_FAIL})})}},{key:"createForwardMessage",value:function(l){return this._getModule(ir).createForwardMessage(l)}},{key:"sendMessage",value:function(l,p){return l instanceof Hr?this._getModule(ir).sendMessageInstance(l,p):Me({code:De.MSG_INSTANCE_REQUIRED})}},{key:"searchCloudMessages",value:function(l){return this._getModule(ir).searchCloudMessages(l)}},{key:"callExperimentalAPI",value:function(l,p){return l==="sendComboMessage"?this._getModule(gw).sendMessage(p):l==="handleGroupInvitation"?this._getModule(Mt).handleGroupInvitation(p):l==="isCommercialAbilityEnabled"?this._getModule(yp).isFeatureEnabled(p):l==="isIntl"?this.isIntl():l==="sendTRTCCustomData"?this._getModule(M0).sendTRTCCustomData(p):l==="getTimerID"?this._m.getTimerID():l==="getPollingTimerID"?this._m.getPollingTimerID(p):Me({code:De.INVALID_OPERATION})}},{key:"revokeMessage",value:function(l){return this._getModule(ir).revokeMessage(l)}},{key:"resendMessage",value:function(l,p){return l instanceof Hr?this._getModule(ir).resendMessage(l,p):Me({code:De.MSG_INSTANCE_REQUIRED})}},{key:"deleteMessage",value:function(l){return this._getModule(ir).deleteMessage(l)}},{key:"translateText",value:function(l){return this._getModule(ir).translateText(l)}},{key:"setMessageExtensions",value:function(l,p){return this._getModule(hp).setMessageExtensions(l,p)}},{key:"getMessageExtensions",value:function(l){return this._getModule(hp).getMessageExtensions(l)}},{key:"deleteMessageExtensions",value:function(l,p){return this._getModule(hp).deleteMessageExtensions(l,p)}},{key:"modifyMessage",value:function(l){return this._getModule(ir).modifyRemoteMessage(l)}},{key:"getMessageList",value:function(l){return this._getModule(ct).getMessageList(l)}},{key:"getMessageListHopping",value:function(l){return this._getModule(ct).getMessageListHopping(l)}},{key:"sendMessageReadReceipt",value:function(l){return this._getModule(ct).sendReadReceipt(l)}},{key:"getMessageReadReceiptList",value:function(l){return this._getModule(ct).getReadReceiptList(l)}},{key:"getGroupMessageReadMemberList",value:function(l){var p=this._getModule(Mt);return p?p.getReadReceiptDetail(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"findMessage",value:function(l){return this._getModule(ct).findMessage(l)}},{key:"setMessageRead",value:function(l){return this._getModule(ct).setMessageRead(l)}},{key:"getConversationList",value:function(l){return this._getModule(ct).getConversationList(l)}},{key:"getConversationProfile",value:function(l){return this._getModule(ct).getConversationProfile(l)}},{key:"deleteConversation",value:function(l){return this._getModule(ct).deleteConversation(l)}},{key:"setConversationDraft",value:function(l){return this._getModule(ct).setConversationDraft(l)}},{key:"clearHistoryMessage",value:function(l){return this._getModule(ct).clearHistoryMessage(l)}},{key:"pinConversation",value:function(l){return this._getModule(ct).pinConversation(l)}},{key:"setAllMessageRead",value:function(l){return this._getModule(ct).setAllMessageRead(l)}},{key:"setMessageRemindType",value:function(l){return this._getModule(ct).setMessageRemindType(l)}},{key:"getTotalUnreadMessageCount",value:function(){return this._getModule(ct).getTotalUnreadMessageCount()}},{key:"setConversationCustomData",value:function(l){return this._getModule(ct).setConversationCustomData(l)}},{key:"markConversation",value:function(l){return this._getModule(ct).markConversation(l)}},{key:"getConversationGroupList",value:function(){return this._getModule(ct).getConversationGroupList()}},{key:"createConversationGroup",value:function(l){return this._getModule(ct).createConversationGroup(l)}},{key:"deleteConversationGroup",value:function(l){return this._getModule(ct).deleteConversationGroup(l)}},{key:"renameConversationGroup",value:function(l){return this._getModule(ct).renameConversationGroup(l)}},{key:"addConversationsToGroup",value:function(l){return this._getModule(ct).addConversationsToGroup(l)}},{key:"deleteConversationsFromGroup",value:function(l){return this._getModule(ct).deleteConversationsFromGroup(l)}},{key:"getMyProfile",value:function(){return this._getModule(pr).getMyProfile()}},{key:"getUserProfile",value:function(l){return this._getModule(pr).getUserProfile(l)}},{key:"updateMyProfile",value:function(l){return this._getModule(pr).updateMyProfile(l)}},{key:"getBlacklist",value:function(){return this._getModule(pr).getLocalBlacklist()}},{key:"addToBlacklist",value:function(l){return this._getModule(pr).addBlacklist(l)}},{key:"removeFromBlacklist",value:function(l){return this._getModule(pr).deleteBlacklist(l)}},{key:"setSelfStatus",value:function(l){return this._getModule(pr).setSelfStatus(l)}},{key:"getUserStatus",value:function(l){return this._getModule(pr).getUserStatus(l)}},{key:"subscribeUserStatus",value:function(l){return this._getModule(pr).subscribeUserStatus(l)}},{key:"unsubscribeUserStatus",value:function(l){return this._getModule(pr).unsubscribeUserStatus(l)}},{key:"getFriendList",value:function(){var l=this._getModule(hr);return l?l.getLocalFriendList():Me({code:De.CANNOT_FIND_MODULE})}},{key:"addFriend",value:function(l){var p=this._getModule(hr);return p?p.addFriend(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"deleteFriend",value:function(l){var p=this._getModule(hr);return p?p.deleteFriend(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"checkFriend",value:function(l){var p=this._getModule(hr);return p?p.checkFriend(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getFriendProfile",value:function(l){var p=this._getModule(hr);return p?p.getFriendProfile(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"updateFriend",value:function(l){var p=this._getModule(hr);return p?p.updateFriend(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getFriendApplicationList",value:function(){var l=this._getModule(hr);return l?l.getLocalFriendApplicationList():Me({code:De.CANNOT_FIND_MODULE})}},{key:"acceptFriendApplication",value:function(l){var p=this._getModule(hr);return p?p.acceptFriendApplication(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"refuseFriendApplication",value:function(l){var p=this._getModule(hr);return p?p.refuseFriendApplication(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"deleteFriendApplication",value:function(l){var p=this._getModule(hr);return p?p.deleteFriendApplication(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setFriendApplicationRead",value:function(){var l=this._getModule(hr);return l?l.setFriendApplicationRead():Me({code:De.CANNOT_FIND_MODULE})}},{key:"getFriendGroupList",value:function(){var l=this._getModule(hr);return l?l.getLocalFriendGroupList():Me({code:De.CANNOT_FIND_MODULE})}},{key:"createFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.createFriendGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"deleteFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.deleteFriendGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"addToFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.addToFriendGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"removeFromFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.removeFromFriendGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"renameFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.renameFriendGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupList",value:function(){var l=this._getModule(Mt);return l?l.getGroupList():Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupProfile",value:function(l){var p=this._getModule(Mt);return p?p.getGroupProfile(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"createGroup",value:function(l){var p=this._getModule(Mt);return p?p.createGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"dismissGroup",value:function(l){var p=this._getModule(Mt);return p?p.dismissGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"updateGroupProfile",value:function(l){var p=this._getModule(Mt);return p?p.updateGroupProfile(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"joinGroup",value:function(l){var p=this._getModule(Mt);return p?p.joinGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"quitGroup",value:function(l){var p=this._getModule(Mt);return p?p.quitGroup(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"searchGroupByID",value:function(l){var p=this._getModule(Mt);return p?p.searchGroupByID(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupOnlineMemberCount",value:function(l){var p=this._getModule(Mt);return p?p.getGroupOnlineMemberCount(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"changeGroupOwner",value:function(l){var p=this._getModule(Mt);return p?p.changeGroupOwner(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupApplicationList",value:function(){var l=this._getModule(Mt);return l?l.getGroupApplicationList():Me({code:De.CANNOT_FIND_MODULE})}},{key:"handleGroupApplication",value:function(l){var p=this._getModule(Mt);return p?p.handleGroupApplication(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"initGroupAttributes",value:function(l){var p=this._getModule(Mt);return p?p.initGroupAttributes(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setGroupAttributes",value:function(l){var p=this._getModule(Mt);return p?p.setGroupAttributes(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"deleteGroupAttributes",value:function(l){var p=this._getModule(Mt);return p?p.deleteGroupAttributes(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupAttributes",value:function(l){var p=this._getModule(Mt);return p?p.getGroupAttributes(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setGroupCounters",value:function(l){var p=this._getModule(Mt);return p?p.setGroupCounters(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"increaseGroupCounter",value:function(l){var p=this._getModule(Mt);return p?p.increaseGroupCounter(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"decreaseGroupCounter",value:function(l){var p=this._getModule(Mt);return p?p.decreaseGroupCounter(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupCounters",value:function(l){var p=this._getModule(Mt);return p?p.getGroupCounters(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupMemberList",value:function(l){var p=this._getModule(Mt);return p?p.getGroupMemberList(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getGroupMemberProfile",value:function(l){var p=this._getModule(Mt);return p?p.getGroupMemberProfile(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"addGroupMember",value:function(l){var p=this._getModule(Mt);return p?p.addGroupMember(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"deleteGroupMember",value:function(l){var p=this._getModule(Mt);return p?p.deleteGroupMember(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setGroupMemberMuteTime",value:function(l){var p=this._getModule(Mt);return p?p.setGroupMemberMuteTime(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setGroupMemberRole",value:function(l){var p=this._getModule(Mt);return p?p.setGroupMemberRole(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setGroupMemberNameCard",value:function(l){var p=this._getModule(Mt);return p?p.setGroupMemberNameCard(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"setGroupMemberCustomField",value:function(l){var p=this._getModule(Mt);return p?p.setGroupMemberCustomField(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"markGroupMemberList",value:function(l){var p=this._getModule(Mt);return p?p.markGroupMemberList(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getJoinedCommunityList",value:function(){return this._getModule(sr).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(l){return this._getModule(sr).createTopicInCommunity(l)}},{key:"deleteTopicFromCommunity",value:function(l){return this._getModule(sr).deleteTopicFromCommunity(l)}},{key:"updateTopicProfile",value:function(l){return this._getModule(sr).updateTopicProfile(l)}},{key:"getTopicList",value:function(l){return this._getModule(sr).getTopicList(l)}},{key:"addSignalingListener",value:function(l,p,a){var c=this._getModule(ni);c&&c.addSignalingListener(l,this._safetyCallbackFactory.defense(l,p,a),a)}},{key:"removeSignalingListener",value:function(l,p,a){var c=this._safetyCallbackFactory.find(l,p);if(c!==null){var h=this._getModule(ni);h&&(h.removeSignalingListener(l,c,a),this._safetyCallbackFactory.delete(l,p))}}},{key:"invite",value:function(l){var p=this._getModule(ni);return p?p.invite(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"inviteSync",value:function(l,p,a){var c=this._getModule(ni);return c?c.inviteSync(l,p,a):""}},{key:"inviteInGroup",value:function(l){var p=this._getModule(ni);return p?p.invite(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"inviteInGroupSync",value:function(l,p,a){var c=this._getModule(ni);return c?c.inviteSync(l,p,a):""}},{key:"cancel",value:function(l){var p=this._getModule(ni);return p?p.cancel(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"accept",value:function(l){var p=this._getModule(ni);return p?p.accept(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"reject",value:function(l){var p=this._getModule(ni);return p?p.reject(l):Me({code:De.CANNOT_FIND_MODULE})}},{key:"getSignalingInfo",value:function(l){var p=this._getModule(ni);return p?p.getSignalingInfo(l):null}},{key:"modifyInvitation",value:function(l){var p=this._getModule(ni);return p?p.modifyInvitation(l):Me({code:De.CANNOT_FIND_MODULE})}}]),k}(),Q8={login:1,logout: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};function ex(k,l){if(k.isReady()||Q8[l]===1)return!0;var p=k.getNotReadyReason(),a={code:p,message:"".concat(k.getErrorMessage(p)," | ").concat(l," | ").concat(k.getErrorMessage(De.SDK_IS_NOT_READY))};return k.onError(a),a}var Op={},ju={};return ju.create=function(k){var l="TencentCloudChat.create",p=0,a=k.SDKAppID;if(un(a))p=a;else if(p=parseInt(a),isNaN(a))return U.e("".concat(l," failed. Failed to parse the SDKAppID, please check the arguments")),null;if(p&&Op[p])return Op[p];U.l("".concat(l));var c=new Z8(r(r({},k),{},{SDKAppID:p}));c.on(O.SDK_DESTROY,function(m){Op[m.data.SDKAppID]=null,delete Op[m.data.SDKAppID]});var h=function(m){var y=Object.create(null);return Object.keys(J3).forEach(function(b){if(m[b]){var I=new Z;y[b]=function(){var E=Array.from(arguments);return I.use(function(R,F){var H=ex(m,b);return H===!0?F():Me(H)}).use(function(R,F){if(dp(R,fw[b],b)===!0)return F()}).use(function(R,F){return m[b].apply(m,R)}),I.run(E)}}}),y}(c);return Op[p]=h,fw.hookGetAPITips(c.getErrorMessage.bind(c)),U.l("".concat(l," ok")),h},ju.TYPES=T,ju.EVENT=O,ju.TSignaling=P,ju.VERSION="3.1.1",U.l("TencentCloudChat.VERSION:".concat(ju.VERSION)),ju})})(kO);var _$=kO.exports;const vt=qf(_$),cn={typeC2C:"isC2C",typeGroup:"isGroup",cancel:"cancel",group:"GROUP",handleMessage:{revoke:"revoke",copy:"copy",delete:"delete",forward:"forward",reply:"reply",reference:"reference"},at:"@",all:"所有人",typeText:1,typeCustom:2,typeImage:3,typeAudio:4,typeVideo:5,typeFile:6,typeFace:8,typeForward:"forward",typeMute:"mute",typeOrder:"order",typeService:"consultion",typeReply:"quick_reply",typeEvaluate:"evaluation",typeTextLink:"text_link",typeAndroid:"android",typeIphone:"iphone",typeMini:"miniprogram",typeUserTyping:"user_typing_status",typeInputStatusIng:"EIMAMSG_InputStatus_Ing",typeInputStatusEnd:"EIMAMSG_InputStatus_End",scrollType:{toBottom:"bottom",toTarget:"target"},inViewType:{page:"page",scroll:"scroll"},TYPE_CALL_MESSAGE:1,TC_GROUP_NOTICE:"TC_GROUP_NOTICE",CALL_ACTION_TYPE:{INVITE:1,CANCEL_INVITE:2,ACCEPT_INVITE:3,REJECT_INVITE:4,INVITE_TIMEOUT:5}};function kC(e){var n,r,o,i,s,u;let t="";switch(e.type){case vt.TYPES.CONV_C2C:t=ev((n=e==null?void 0:e.userProfile)==null?void 0:n.avatar)?(r=e==null?void 0:e.userProfile)==null?void 0:r.avatar:"https://oss.dayaedu.com/news-info/07/1690787574969.png";break;case vt.TYPES.CONV_GROUP:t=ev((o=e==null?void 0:e.groupProfile)==null?void 0:o.avatar)?(i=e==null?void 0:e.groupProfile)==null?void 0:i.avatar:"https://oss.dayaedu.com/news-info/07/1690775328089.png";break;case vt.TYPES.CONV_SYSTEM:t=ev((s=e==null?void 0:e.groupProfile)==null?void 0:s.avatar)?(u=e==null?void 0:e.groupProfile)==null?void 0:u.avatar:"https://web.sdk.qcloud.com/component/TUIKit/assets/group_avatar.png";break}return t}function jh(e){var r,o;const{t}=window.TUIKitTUICore.config.i18n.useI18n();let n="";switch(e.type){case vt.TYPES.CONV_C2C:n=(e==null?void 0:e.userProfile.nick)||((r=e==null?void 0:e.userProfile)==null?void 0:r.userID)||"";break;case vt.TYPES.CONV_GROUP:n=e.groupProfile.name||((o=e==null?void 0:e.groupProfile)==null?void 0:o.groupID)||"";break;case vt.TYPES.CONV_SYSTEM:n=t("系统通知");break}return n}function DO(e){const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n=[`[${t("TUIConversation.有人@我")}]`,`[${t("TUIConversation.@所有人")}]`,`[${t("TUIConversation.@所有人")}][${t("TUIConversation.有人@我")}]`];let r="";for(let o=0;o0&&(r=n[e.groupAtInfoList[o].atTypeArray[0]-1]);return r}function b$(e){var n;const t={referenceMessageForShow:"",referenceMessageType:0};if(!e||!(e!=null&&e.ID)||!(e!=null&&e.type))return t;switch(e.type){case vt.TYPES.MSG_TEXT:t.referenceMessageForShow=(n=e==null?void 0:e.payload)==null?void 0:n.text,t.referenceMessageType=1;break;case vt.TYPES.MSG_CUSTOM:t.referenceMessageForShow="[自定义消息]",t.referenceMessageType=2;break;case vt.TYPES.MSG_IMAGE:t.referenceMessageForShow="[图片]",t.referenceMessageType=3;break;case vt.TYPES.MSG_AUDIO:t.referenceMessageForShow="[语音]",t.referenceMessageType=4;break;case vt.TYPES.MSG_VIDEO:t.referenceMessageForShow="[视频]",t.referenceMessageType=5;break;case vt.TYPES.MSG_FILE:t.referenceMessageForShow="[文件]",t.referenceMessageType=6;break;case vt.TYPES.MSG_FACE:t.referenceMessageForShow="[表情]",t.referenceMessageType=8;break}return t}function M$(e){var u;const{t}=window.TUIKitTUICore.config.i18n.useI18n(),{lastMessage:n}=e,r=e;let o="",i="";const s=r.unreadCount>0&&r.messageRemindType===vt.TYPES.MSG_REMIND_ACPT_NOT_NOTE?`[${r.unreadCount>99?"99+":r.unreadCount}${t("TUIConversation.条")}] `:"";if(r.type===vt.TYPES.CONV_GROUP&&((n==null?void 0:n.fromAccount)===(r==null?void 0:r.groupProfile.selfInfo.userID)?o=t("TUIConversation.我"):o=(n==null?void 0:n.nameCard)||(n==null?void 0:n.nick)||(n==null?void 0:n.fromAccount)),(n==null?void 0:n.type)===vt.TYPES.MSG_TEXT)i=n==null?void 0:n.payload.text;else if((n==null?void 0:n.type)===vt.TYPES.MSG_CUSTOM){const d=dr((u=n==null?void 0:n.payload)==null?void 0:u.data);if((d==null?void 0:d.businessID)===1)return i=DC(n),i;if((d==null?void 0:d.businessID)==="TC_GROUP_NOTICE")return"[群公告]";i=n==null?void 0:n.messageForShow}else i=n==null?void 0:n.messageForShow;return n!=null&&n.isRevoked&&(i=t("TUIChat.撤回了一条消息")),r.type===vt.TYPES.CONV_GROUP&&(n==null?void 0:n.type)===vt.TYPES.MSG_GRP_TIP?i:`${s}${o?`${o}:`:""}${i}`}function I$(e){var o,i,s,u,d,f,g,v,_,M;const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n={message:e,text:""};let r=(e==null?void 0:e.nick)||((i=(o=e==null?void 0:e.payload)==null?void 0:o.userIDList)==null?void 0:i.join(","));if(((u=(s=e==null?void 0:e.payload)==null?void 0:s.memberList)==null?void 0:u.length)>0&&(r="",(f=(d=e==null?void 0:e.payload)==null?void 0:d.memberList)==null||f.map(C=>{r+=`${(C==null?void 0:C.nick)||(C==null?void 0:C.userID)},`}),r=r==null?void 0:r.slice(0,-1)),(e==null?void 0:e.type)===((g=vt==null?void 0:vt.TYPES)==null?void 0:g.MSG_GRP_TIP))switch(e.payload.operationType){case vt.TYPES.GRP_TIP_MBR_JOIN:n.text=`${r} ${t("message.tip.加入群组")}`;break;case vt.TYPES.GRP_TIP_MBR_QUIT:n.text=`${t("message.tip.群成员")}:${r} ${t("message.tip.退出群组")}`;break;case vt.TYPES.GRP_TIP_MBR_KICKED_OUT:n.text=`${t("message.tip.群成员")}:${r} ${t("message.tip.踢出群组")}`;break;case vt.TYPES.GRP_TIP_MBR_SET_ADMIN:n.text=`${t("message.tip.群成员")}:${r} ${t("message.tip.成为管理员")}`;break;case vt.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:n.text=`${t("message.tip.群成员")}:${r} ${t("message.tip.被撤销管理员")}`;break;case vt.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:n.text=C$(e);break;case vt.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:for(const C of e.payload.memberList)C.muteTime>0?n.text=`${t("message.tip.群成员")}:${C.nick||C.userID}${t("message.tip.被禁言")}`:n.text=`${t("message.tip.群成员")}:${C.nick||C.userID}${t("message.tip.被取消禁言")}`;break;default:n.text=`[${t("message.tip.群提示消息")}]`;break}else if(((_=dr((v=e==null?void 0:e.payload)==null?void 0:v.data))==null?void 0:_.businessID)==="group_create"){const C=dr((M=e==null?void 0:e.payload)==null?void 0:M.data);n.text=`"${C==null?void 0:C.opUser}" `+t(C==null?void 0:C.content)}else n.text=DC(e);return n}function C$(e){const{t}=window.TUIKitTUICore.config.i18n.useI18n(),{payload:n}=e,{newGroupProfile:r}=n,{operatorID:o}=n;let i="";return"muteAllMembers"in r?r.muteAllMembers?i=`${t("message.tip.管理员")} ${o} ${t("message.tip.开启学生禁言")}`:i=`${t("message.tip.管理员")} ${o} ${t("message.tip.取消学生禁言")}`:"ownerID"in r?i=`${r.ownerID} ${t("message.tip.成为新的群主")}`:"groupName"in r?i=`${o} ${t("message.tip.修改群名为")} ${r.groupName}`:"notification"in r&&(i=`${o} ${t("message.tip.发布新公告")}`),i}function EO(e){return{text:SO(e.payload)}}function AO(e){const t={message:e,name:"",url:""};return t.name=e.payload.data,e.payload.data.indexOf("@2x")<0&&(t.name=`${t.name}@2x`),t.url=`https://web.sdk.qcloud.com/im/assets/face-elem/${t.name}.png`,t}function T$(e){const t={lon:"",lat:"",href:"",url:"",description:"",message:e};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}function LO(e){return{progress:(e==null?void 0:e.status)==="unSend"&&e.progress,url:e.payload.imageInfoArray[1].url,width:e.payload.imageInfoArray[0].width,height:e.payload.imageInfoArray[0].height,message:e}}function OO(e){var t,n,r,o;return{progress:(e==null?void 0:e.status)==="unSend"&&(e==null?void 0:e.progress),url:(t=e==null?void 0:e.payload)==null?void 0:t.videoUrl,snapshotUrl:(n=e==null?void 0:e.payload)==null?void 0:n.snapshotUrl,snapshotWidth:(r=e==null?void 0:e.payload)==null?void 0:r.snapshotWidth,snapshotHeight:(o=e==null?void 0:e.payload)==null?void 0:o.snapshotHeight,message:e}}function w$(e){return{progress:(e==null?void 0:e.status)==="unSend"&&e.progress,url:e.payload.url,message:e,second:e.payload.second}}function RO(e){let t="";return e.payload.fileSize>=1024*1024?t=`${(e.payload.fileSize/(1024*1024)).toFixed(2)} Mb`:e.payload.fileSize>=1024?t=`${(e.payload.fileSize/1024).toFixed(2)} Kb`:t=`${e.payload.fileSize.toFixed(2)}B`,{progress:(e==null?void 0:e.status)==="unSend"&&e.progress,url:e.payload.fileUrl,message:e,name:e.payload.fileName,size:t}}function S$(e){return{message:e,...e.payload}}function DC(e){var s,u;const{t}=window.TUIKitTUICore.config.i18n.useI18n();let n={},r={};try{n=dr((s=e==null?void 0:e.payload)==null?void 0:s.data)}catch{n={}}if(n.businessID!==1)return"";try{r=dr(n.data)}catch{r={}}let o="";(u=n==null?void 0:n.inviteeList)==null||u.forEach((d,f)=>{var g;f<((g=n==null?void 0:n.inviteeList)==null?void 0:g.length)-1?o+=`"${d}"、`:o+=`"${d}" `});const i=`"${n==null?void 0:n.inviter}" `;switch(n.actionType){case 1:return r.call_end>=0&&!n.groupID?`${t("message.custom.通话时长")}:${g$(r.call_end)}`:n.groupID&&n.timeout>0?`${i}${t("message.custom.发起通话")}`:n.groupID?`${t("message.custom.结束群聊")}`:r.data&&r.data.cmd==="switchToAudio"?`${t("message.custom.切换语音通话")}`:r.data&&r.data.cmd==="switchToVideo"?`${t("message.custom.切换视频通话")}`:`${t("message.custom.发起通话")}`;case 2:return`${n.groupID?i:""}${t("message.custom.取消通话")}`;case 3:return r.data&&r.data.cmd==="switchToAudio"?`${t("message.custom.切换语音通话")}`:r.data&&r.data.cmd==="switchToVideo"?`${t("message.custom.切换视频通话")}`:`${n.groupID?o:""}${t("message.custom.已接听")}`;case 4:return`${n.groupID?o:""}${t("message.custom.拒绝通话")}`;case 5:return r.data&&r.data.cmd==="switchToAudio"?`${t("message.custom.切换语音通话")}`:r.data&&r.data.cmd==="switchToVideo"?`${t("message.custom.切换视频通话")}`:`${n.groupID?o:""}${t("message.custom.无应答")}`;default:return""}}function NO(e){var r;const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n=dr((r=e==null?void 0:e.payload)==null?void 0:r.data);return(n==null?void 0:n.businessID)===cn.typeEvaluate&&((n==null?void 0:n.score)>0||(n.score=1,e.payload.data=JSON.stringify(n))),{message:e,custom:DC(e)||`[${t("message.custom.自定义消息")}]`}}function k$(e){const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n=e.payload.groupProfile.name||e.payload.groupProfile.groupID;switch(e.payload.operationType){case 1:return`${e.payload.operatorID} ${t("message.tip.申请加入群组")}:${n}`;case 2:return`${t("message.tip.成功加入群组")}:${n}`;case 3:return`${t("message.tip.申请加入群组")}:${n} ${t("message.tip.被拒绝")}`;case 4:return`${t("message.tip.你被管理员")}${e.payload.operatorID} ${t("message.tip.踢出群组")}:${n}`;case 5:return`${t("message.tip.群")}:${n} ${t("message.tip.被")} ${e.payload.operatorID} ${t("message.tip.解散")}`;case 6:return`${e.payload.operatorID} ${t("message.tip.创建群")}:${n}`;case 7:return`${e.payload.operatorID} ${t("message.tip.邀请你加群")}:${n}`;case 8:return`${t("message.tip.你退出群组")}:${n}`;case 9:return`${t("message.tip.你被")}${e.payload.operatorID} ${t("message.tip.设置为群")}:${n} ${t("message.tip.的管理员")}`;case 10:return`${t("message.tip.你被")}${e.payload.operatorID} ${t("message.tip.撤销群")}:${n} ${t("message.tip.的管理员身份")}`;case 12:return`${e.payload.operatorID} ${t("message.tip.邀请你加群")}:${n}`;case 13:return`${e.payload.operatorID} ${t("message.tip.同意加群")}:${n}`;case 14:return`${e.payload.operatorID} ${t("message.tip.拒接加群")}:${n}`;case 255:return`${t("message.tip.自定义群系统通知")}: ${e.payload.userDefinedField}`}}function ik(e,t,n){const r=(e==null?void 0:e.querySelectorAll(`.${t}`))||[],o=Array.prototype.slice.call(r).map(i=>new Promise((s,u)=>{i.onload=()=>{s(i)},i.onloadeddata=()=>{s(i)},i.onprogress=()=>{s(i)},i.complete&&s(i)}));return Promise.all(o).then(()=>{n&&n()}).catch(i=>{console.error("网络异常",i)})}function ev(e){return/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)}function D$(e){if(typeof e=="string")try{return!!JSON.parse(e)}catch{return!1}return!1}function dr(e){return!e||!D$(e)?e:JSON.parse(e)}function uf(e){var t;if(!e)return!1;try{const{businessID:n}=dr((t=e==null?void 0:e.payload)==null?void 0:t.data);if(n===cn.typeUserTyping)return!0}catch{return!1}return!1}function EC(e,t=new WeakMap){if(typeof e!="object"||e===null)throw new TypeError("传入参数不是对象");if(t.has(e))return t.get(e);const n=Object.create(Object.getPrototypeOf(e));return Object.keys(e).forEach(o=>{const i=e[o];typeof i!="object"||i===null?n[o]=i:Array.isArray(i)?n[o]=[...i]:i instanceof Set?n[o]=new Set([...i]):i instanceof Map?n[o]=new Map([...i]):(t.set(e,e),n[o]=EC(i,t))}),n}const PO=e=>{var t,n,r,o,i,s,u,d,f;return(e==null?void 0:e.type)===((t=vt==null?void 0:vt.TYPES)==null?void 0:t.MSG_GRP_TIP)||(e==null?void 0:e.type)===((n=vt==null?void 0:vt.TYPES)==null?void 0:n.MSG_CUSTOM)&&(e==null?void 0:e.conversationType)===((r=vt==null?void 0:vt.TYPES)==null?void 0:r.CONV_GROUP)&&((i=dr((o=e==null?void 0:e.payload)==null?void 0:o.data))==null?void 0:i.businessID)===(cn==null?void 0:cn.TYPE_CALL_MESSAGE)||(e==null?void 0:e.type)===((s=vt==null?void 0:vt.TYPES)==null?void 0:s.MSG_CUSTOM)&&(e==null?void 0:e.conversationType)===((u=vt==null?void 0:vt.TYPES)==null?void 0:u.CONV_GROUP)&&((f=dr((d=e==null?void 0:e.payload)==null?void 0:d.data))==null?void 0:f.businessID)==="group_create"},AC=(e,t,n,r)=>{const o=e/t,i=n/r;return e<=n&&t<=r?{width:e,height:t}:e<=n&&t>r||e>n&&t>r&&o<=i?{width:e*(r/t),height:r}:{width:n,height:t*(n/e)}},uo=class uo{constructor(t){Kt(this,"allowNotifications",!0);Kt(this,"showPreviews",!0);Kt(this,"notificationTitle","腾讯云 IM ");Kt(this,"notificationIcon","https://web.sdk.qcloud.com/im/demo/latest/faviconnew.png");t&&((t==null?void 0:t.allowNotifications)!==void 0&&(this.allowNotifications=t.allowNotifications),(t==null?void 0:t.showPreviews)!==void 0&&(this.showPreviews=t.showPreviews),(t==null?void 0:t.notificationTitle)!==void 0&&(this.notificationTitle=t.notificationTitle),(t==null?void 0:t.notificationIcon)!==void 0&&(this.notificationIcon=t.notificationIcon))}static getInstance(t){return uo.instance||(uo.instance=new uo(t)),uo.instance}static plugin(t,n){t.config.notification=this.getInstance(n),this.TUICore=t}static install(t){t.use(this.getInstance())}setNotificationConfiguration(t){t&&((t==null?void 0:t.allowNotifications)!==void 0&&(this.allowNotifications=t.allowNotifications),(t==null?void 0:t.showPreviews)!==void 0&&(this.showPreviews=t.showPreviews),(t==null?void 0:t.notificationTitle)!==void 0&&(this.notificationTitle=t.notificationTitle),(t==null?void 0:t.notificationIcon)!==void 0&&(this.notificationIcon=t.notificationIcon))}async notify(t){this.allowNotifications&&this.checkNotificationAbility()&&await this.requestNotificationPermission()&&await this.handleNotification(t)}checkNotificationAbility(){return!(!("Notification"in window)||window.Notification.permission==="denied")}requestNotificationPermission(){return new Promise((t,n)=>{window!=null&&window.Notification||n(!1),window.Notification.permission==="granted"&&t(!0),window.Notification.requestPermission().then(r=>{r==="granted"&&t(!0)}).catch(()=>{n(!1)})})}async handleNotification(t){if(!this._isMessageNeedNotification(t))return;const n=this._handleNotificationType(t);let r,o={badge:this.notificationIcon,icon:this.notificationIcon,body:"",requireInteraction:!1};switch(n){case"call":if(r=this._handleCallNotificationContent(t),!(r!=null&&r.content))return;o.body=r.content,o.requireInteraction=!r.callEnd;break;case"chat":o.body=await this._handleChatNotificationContent(t),o.requireInteraction=!1;break}const i=new Notification(this.notificationTitle,o);i.onclick=()=>{var u,d;if(window.focus(),!t||!(t!=null&&t.conversationID))return;const s=(d=(u=uo==null?void 0:uo.TUICore)==null?void 0:u.TUIServer)==null?void 0:d.TUIConversation;((t==null?void 0:t.conversationType)===vt.TYPES.CONV_C2C||(t==null?void 0:t.conversationType)===vt.TYPES.CONV_GROUP)&&(s==null||s.getConversationProfile(t==null?void 0:t.conversationID).then(f=>{var g,v;(g=f==null?void 0:f.data)!=null&&g.conversation&&s.handleCurrentConversation((v=f==null?void 0:f.data)==null?void 0:v.conversation)})),i.close()}}_isMessageNeedNotification(t){var r,o,i,s;if(!t||!(t!=null&&t.ID)||!(t!=null&&t.type)||t!=null&&t.isRevoked||t!=null&&t.isDeleted||uf&&uf(t)||(t==null?void 0:t.type)===vt.TYPES.MSG_GRP_TIP||(t==null?void 0:t.type)===vt.TYPES.MSG_GRP_SYS_NOTICE)return!1;const n=(s=(i=(o=(r=uo==null?void 0:uo.TUICore)==null?void 0:r.TUIServer)==null?void 0:o.TUIConversation)==null?void 0:i.currentStore)==null?void 0:s.currentConversationID;return!(this.checkPageFocus()&&(t==null?void 0:t.conversationID)===n)}_handleNotificationType(t){var n;if(t.type===vt.TYPES.MSG_CUSTOM){const r=dr((n=t==null?void 0:t.payload)==null?void 0:n.data);if((r==null?void 0:r.businessID)===1||(r==null?void 0:r.businessID)==="av_call")return"call"}return"chat"}async _handleChatNotificationContent(t){var r,o;let n="";if(!t||!(t!=null&&t.ID)||!(t!=null&&t.type))return n;switch(this.showPreviews){case!0:n=await this._handleChatNotificationContentTitle(t),n+=this._handleChatNotificationContentText(t);break;case!1:n="您有"+await((o=(r=uo==null?void 0:uo.TUICore)==null?void 0:r.tim)==null?void 0:o.getTotalUnreadMessageCount())+"条新消息";break}return n}async _handleChatNotificationContentTitle(t){var r,o,i;let n="";switch(t==null?void 0:t.conversationType){case vt.TYPES.CONV_C2C:n=((t==null?void 0:t.nick)||(t==null?void 0:t.from))+": ";break;case vt.TYPES.CONV_GROUP:n=(t==null?void 0:t.conversationID)+": ",await((i=(o=(r=uo==null?void 0:uo.TUICore)==null?void 0:r.tim)==null?void 0:o.getConversationProfile(t==null?void 0:t.conversationID))==null?void 0:i.then(s=>{var u,d,f;n=(((f=(d=(u=s==null?void 0:s.data)==null?void 0:u.conversation)==null?void 0:d.groupProfile)==null?void 0:f.name)||(t==null?void 0:t.conversationID))+": "}).catch(()=>{n=(t==null?void 0:t.conversationID)+": "}));break;case vt.TYPES.CONV_SYSTEM:n="系统消息: ";break}return n}_handleChatNotificationContentText(t){var r;let n="";switch(t.type){case vt.TYPES.MSG_TEXT:n+=(r=t==null?void 0:t.payload)==null?void 0:r.text;break;case vt.TYPES.MSG_CUSTOM:n+="[自定义消息]";break;case vt.TYPES.MSG_IMAGE:n+="[图片]";break;case vt.TYPES.MSG_AUDIO:n+="[语音]";break;case vt.TYPES.MSG_VIDEO:n+="[视频]";break;case vt.TYPES.MSG_FILE:n+="[文件]";break;case vt.TYPES.MSG_FACE:n+="[表情]";break;case vt.TYPES.MSG_MERGER:n+="[聊天记录]";break;case vt.TYPES.MSG_LOCATION:n+="[位置]";break}return n}_handleCallNotificationContent(t){var o;let n="",r=!1;try{if(t.type===vt.TYPES.MSG_CUSTOM){const i=dr((o=t==null?void 0:t.payload)==null?void 0:o.data),s=dr(i.data);(i==null?void 0:i.businessID)===1&&(i.actionType===1&&(i.groupID&&i.timeout>0||!i.call_end&&i.call_end!==0&&!i.groupID&&!(s!=null&&s.data&&((s==null?void 0:s.data.cmd)==="switchToAudio"||(s==null?void 0:s.data.cmd)==="switchToVideo")))?(n=this.showPreviews?`${i.inviter} 发起通话`:"您有一个通话请求",r=!1):i.actionType===2&&(n=this.showPreviews?`${i.inviter} 取消通话`:"通话取消",r=!0))}}catch(i){console.warn(i)}return{content:n,callEnd:r}}checkPageFocus(){return document.hasFocus()}};Kt(uo,"TUICore"),Kt(uo,"instance");let AM=uo;class sd{destroyed(){}updateStore(t,n){}}class xO extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIChat",{},this.updateStore.bind(this))}destroyed(){this.unbindTIMEvent()}updateStore(n,r){if(Object.assign(this.currentStore,n),!n.conversation.conversationID){this.currentStore.messageList=[];return}n.conversation.conversationID&&n.conversation.conversationID!==r.conversation.conversationID&&this.render(n.conversation)}render(n){var o,i,s;if(this.currentStore.isFirstRender=!0,this.currentStore.messageList=[],this.currentStore.readSet.clear(),this.getMessageList({conversationID:n.conversationID,count:15}),n.type===this.TUICore.TIM.TYPES.CONV_GROUP){this.currentStore.userInfo.isGroup=!0;const u={groupID:n.groupProfile.groupID,userIDList:[n.groupProfile.selfInfo.userID]};this.getGroupProfile({groupID:n.groupProfile.groupID}),this.getGroupMemberProfile(u).then(d=>{const{memberList:f}=d.data,[g]=f;this.currentStore.selfInfo=g}),(s=(i=(o=this==null?void 0:this.TUICore)==null?void 0:o.TUIServer)==null?void 0:i.TUIGroup)==null||s.getGroupMemberList({groupID:n.groupProfile.groupID,count:100,offset:0}).then(d=>{var f;this.currentStore.allMemberList=(f=d.data)==null?void 0:f.memberList})}else this.currentStore.userInfo.isGroup=!1,this.currentStore.userInfo.list=[n==null?void 0:n.userProfile]}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_RECEIVED,this.handleMessageReceived,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_MODIFIED,this.handleMessageModified,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_REVOKED,this.handleMessageRevoked,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_READ_BY_PEER,this.handleMessageReadByPeer,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.handleMessageReadReceiptReceived,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.MESSAGE_RECEIVED,this.handleMessageReceived),this.TUICore.tim.off(this.TUICore.TIM.EVENT.MESSAGE_MODIFIED,this.handleMessageModified),this.TUICore.tim.off(this.TUICore.TIM.EVENT.MESSAGE_REVOKED,this.handleMessageRevoked),this.TUICore.tim.off(this.TUICore.TIM.EVENT.MESSAGE_READ_BY_PEER,this.handleMessageReadByPeer),this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated),this.TUICore.tim.off(this.TUICore.TIM.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.handleMessageReadReceiptReceived)}handleMessageReceived(n){var r;(r=n==null?void 0:n.data)==null||r.forEach(o=>{var i,s;(o==null?void 0:o.conversationID)===((s=(i=this==null?void 0:this.store)==null?void 0:i.conversation)==null?void 0:s.conversationID)&&(this.currentStore.messageList=[...this.currentStore.messageList,o]),AM.getInstance().notify(o)})}handleMessageModified(n){const r=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=r}handleMessageRevoked(n){const r=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=r}handleMessageReadByPeer(n){const r=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=r}handleGroupListUpdated(n){n==null||n.data.map(r=>{var o,i,s;return(r==null?void 0:r.groupID)===((s=(i=(o=this==null?void 0:this.store)==null?void 0:o.conversation)==null?void 0:i.groupProfile)==null?void 0:s.groupID)&&(this.store.conversation.groupProfile=r,this.currentStore.conversation={},this.currentStore.conversation=this.store.conversation),r})}handleMessageReadReceiptReceived(n){const r=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=r}handleMessageOptions(n,r,o,i){var u,d,f,g,v,_;const s={to:"",conversationType:(i==null?void 0:i.type)||this.store.conversation.type,payload:n,needReadReceipt:this.currentStore.needReadReceipt};switch(this.currentStore.needTyping&&(s.cloudCustomData={messageFeature:{needTyping:1,version:1}},s.cloudCustomData=JSON.stringify(s.cloudCustomData)),r==="file"&&o&&(s.onProgress=o),s.conversationType){case this.TUICore.TIM.TYPES.CONV_C2C:s.to=((u=i==null?void 0:i.userProfile)==null?void 0:u.userID)||((f=(d=this.store.conversation)==null?void 0:d.userProfile)==null?void 0:f.userID)||"";break;case this.TUICore.TIM.TYPES.CONV_GROUP:s.to=((g=i==null?void 0:i.groupProfile)==null?void 0:g.groupID)||((_=(v=this.store.conversation)==null?void 0:v.groupProfile)==null?void 0:_.groupID)||"";break}return s}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUIChat",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}handlePromiseCallbackRetry(n,r=[],o=function(){return!1}){return new Promise((i,s)=>{let u=0;function d(){u++,n().then(i).catch(f=>{if(u>r.length||o&&o(f)){s(f);return}setTimeout(d,r[u-1])})}d()})}handleUploadProgress(n,r){this.currentStore.messageList.map(o=>(o.ID===r.ID&&(o.progress=n),o))}async deleteConversation(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.deleteConversation(n);r(i)}catch(i){o(i)}})}sendFaceMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions(n,"face"),s=this.TUICore.tim.createFaceMessage(i);this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendImageMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions({file:n},"file",d=>{this.handleUploadProgress(d,s)}),s=this.TUICore.tim.createImageMessage(i);s.progress=.01,this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendVideoMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions({file:n},"file",d=>{this.handleUploadProgress(d,s)}),s=this.TUICore.tim.createVideoMessage(i);s.progress=.01,this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendFileMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions({file:n},"file",d=>{this.handleUploadProgress(d,s)}),s=this.TUICore.tim.createFileMessage(i);s.progress=.01,this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendCustomMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{n.data=JSON.stringify(n.data);const i=this.handleMessageOptions(n,"custom"),s=this.TUICore.tim.createCustomMessage(i);this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendLocationMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions(n,"location"),s=this.TUICore.tim.createLocationMessage(i);this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}forwardMessage(n,r){return this.handlePromiseCallback(async(o,i)=>{try{const s=this.handleMessageOptions(n,"forward",{},r),u=this.TUICore.tim.createForwardMessage(s),d=await this.TUICore.tim.sendMessage(u);this.store.conversation.conversationID===d.data.message.conversationID&&this.currentStore.messageList.push(d.data.message),o(d)}catch(s){i(s);const u=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=u}})}async sendMessageReadReceipt(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.sendMessageReadReceipt(n);r(i)}catch(i){o(i)}})}async getMessageReadReceiptList(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getMessageReadReceiptList(n);r(i)}catch(i){o(i)}})}async getMessageList(n,r){return this.handlePromiseCallback(async(o,i)=>{try{const s=await this.TUICore.tim.getMessageList(n);s.data.messageList.length&&await this.getMessageReadReceiptList(s.data.messageList),r?this.currentStore.messageList=[...s.data.messageList,...this.currentStore.messageList]:this.currentStore.messageList=s.data.messageList,this.currentStore.nextReqMessageID=s.data.nextReqMessageID,this.currentStore.isCompleted=s.data.isCompleted,o(s)}catch(s){i(s)}})}async getHistoryMessageList(){const n={conversationID:this.currentStore.conversation.conversationID,nextReqMessageID:this.currentStore.nextReqMessageID,count:15};this.currentStore.isCompleted||this.getMessageList(n,!0)}sendTextMessage(n,r){return this.handlePromiseCallback(async(o,i)=>{try{const s=this.handleMessageOptions({text:n},"text");let u={};if(s.cloudCustomData)try{u=dr(s.cloudCustomData)}catch{u={}}const d=JSON.stringify(r),f=Object.assign(s,{cloudCustomData:d,...u}),g=this.TUICore.tim.createTextMessage(f);this.currentStore.messageList.push(g);const v=await this.TUICore.tim.sendMessage(g);this.currentStore.messageList=this.currentStore.messageList.map(_=>_.ID===v.data.message.ID?v.data.message:_),o(v)}catch(s){i(s);const u=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=u}})}sendTypingMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{n.data=JSON.stringify(n.data);const i=this.handleMessageOptions(n,"custom"),s=this.TUICore.tim.createCustomMessage(i),u=await this.TUICore.tim.sendMessage(s,{onlineUserOnly:!0});r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendTextAtMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions(n,"text"),s=this.TUICore.tim.createTextAtMessage(i);this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}sendMergerMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=this.handleMessageOptions(n,"merger"),s=this.TUICore.tim.createMergerMessage(i);this.currentStore.messageList.push(s);const u=await this.TUICore.tim.sendMessage(s);this.currentStore.messageList=this.currentStore.messageList.map(d=>d.ID===u.data.message.ID?u.data.message:d),r(u)}catch(i){o(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}})}revokeMessage(n){return this.handlePromiseCallback(async(r,o)=>{var i;try{const s=await this.TUICore.tim.revokeMessage(n),u=dr(n==null?void 0:n.cloudCustomData);(i=u==null?void 0:u.messageReply)!=null&&i.messageRootID&&await this.revokeReplyMessage(n),r(s)}catch(s){o(s);const u=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=u}})}resendMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.resendMessage(n);this.currentStore.messageList=this.currentStore.messageList.filter(s=>s.ID!==n.ID),this.currentStore.messageList.push(i.data.message),r(i)}catch(i){o(i)}})}deleteMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.deleteMessage(n);r(i);const s=this.currentStore.messageList;this.currentStore.messageList=[],this.currentStore.messageList=s}catch(i){o(i)}})}modifyMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.modifyMessage(n);r(i)}catch(i){const s=i==null?void 0:i.code,u=i==null?void 0:i.data;s===2480?console.warn("MODIFY_MESSAGE_ERROR","修改消息发生冲突,data.message 是最新的消息","data.message:",u==null?void 0:u.message):s===2481?console.warn("MODIFY_MESSAGE_ERROR","不支持修改直播群消息"):s===20026&&console.warn("MODIFY_MESSAGE_ERROR","消息不存在"),o(i)}})}replyMessage(n,r){const o=()=>this.handlePromiseCallback(async(s,u)=>{var d,f,g,v,_,M;try{const C={messageAbstract:(d=n==null?void 0:n.payload)==null?void 0:d.text,messageSender:n==null?void 0:n.from,messageID:n==null?void 0:n.ID,messageType:n==null?void 0:n.type,messageTime:n==null?void 0:n.time,messageSequence:n==null?void 0:n.sequence,version:1};if(!r){const S=dr(n==null?void 0:n.cloudCustomData),N=(f=S==null?void 0:S.messageReply)==null?void 0:f.messageRootID;r=await((v=(g=this==null?void 0:this.currentStore)==null?void 0:g.messageList)==null?void 0:v.find(A=>(A==null?void 0:A.ID)===N))||this.findMessage(N)}const D=r!=null&&r.cloudCustomData?dr(r==null?void 0:r.cloudCustomData):{messageReplies:{}};(_=D==null?void 0:D.messageReplies)!=null&&_.replies?D.messageReplies.replies=[...(M=D==null?void 0:D.messageReplies)==null?void 0:M.replies,C]:D.messageReplies={replies:[C],version:1},r.cloudCustomData=JSON.stringify(D);const w=this.modifyMessage(r);s(w)}catch(C){u(C)}}),i=function(s){return!(s&&(s==null?void 0:s.code)===2480)};return this.handlePromiseCallbackRetry(o,[500,1e3,3e3],i)}revokeReplyMessage(n,r){const o=()=>this.handlePromiseCallback(async(s,u)=>{var d,f,g,v,_,M;try{if(!r){const w=dr(n==null?void 0:n.cloudCustomData),S=(d=w==null?void 0:w.messageReply)==null?void 0:d.messageRootID;r=await((g=(f=this==null?void 0:this.currentStore)==null?void 0:f.messageList)==null?void 0:g.find(N=>(N==null?void 0:N.ID)===S))||this.findMessage(S)}const C=r!=null&&r.cloudCustomData?dr(r==null?void 0:r.cloudCustomData):{messageReplies:{}};if((v=C==null?void 0:C.messageReplies)!=null&&v.replies){const w=C.messageReplies.replies.findIndex(S=>(S==null?void 0:S.messageID)===(n==null?void 0:n.ID));(M=(_=C==null?void 0:C.messageReplies)==null?void 0:_.replies)==null||M.splice(w,1)}r.cloudCustomData=JSON.stringify(C);const D=this.modifyMessage(r);s(D)}catch(C){u(C)}}),i=function(s){return!(s&&(s==null?void 0:s.code)===2480)};return this.handlePromiseCallbackRetry(o,[500,1e3,3e3],i)}emojiReact(n,r){const o=()=>this.handlePromiseCallback(async(s,u)=>{var d,f,g,v,_,M,C,D,w,S,N,A,L,j,V,x,$,z;try{(!n||!(n!=null&&n.ID)||!r)&&u();const G=(_=(v=(g=(f=(d=this.TUICore)==null?void 0:d.TUIServer)==null?void 0:f.TUIProfile)==null?void 0:g.store)==null?void 0:v.profile)==null?void 0:_.userID;n=await((C=(M=this==null?void 0:this.currentStore)==null?void 0:M.messageList)==null?void 0:C.find(P=>(P==null?void 0:P.ID)===(n==null?void 0:n.ID)))||this.findMessage(n==null?void 0:n.ID);const O=n!=null&&n.cloudCustomData?dr(n==null?void 0:n.cloudCustomData):{messageReact:{}};if((D=O==null?void 0:O.messageReact)!=null&&D.reacts)if((w=O==null?void 0:O.messageReact)!=null&&w.reacts[r]){const P=(N=(S=O==null?void 0:O.messageReact)==null?void 0:S.reacts[r])==null?void 0:N.indexOf(G);P===-1?(L=(A=O==null?void 0:O.messageReact)==null?void 0:A.reacts[r])==null||L.push(G):((V=(j=O==null?void 0:O.messageReact)==null?void 0:j.reacts[r])==null||V.splice(P,1),(($=(x=O==null?void 0:O.messageReact)==null?void 0:x.reacts[r])==null?void 0:$.length)===0&&((z=O==null?void 0:O.messageReact)==null||delete z.reacts[r]))}else O.messageReact.reacts[r]=[G];else O.messageReact={reacts:{},version:1},O.messageReact.reacts[r]=[G];n.cloudCustomData=JSON.stringify(O);const T=this.modifyMessage(n);s(T)}catch(G){u(G)}}),i=function(s){return!(s&&(s==null?void 0:s.code)===2480)};return this.handlePromiseCallbackRetry(o,[500,1e3,3e3],i)}findMessage(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.findMessage(n);r(i)}catch(i){o(i)}})}getGroupProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupProfile(n);this.currentStore.conversation.groupProfile=i.data.group,r(i)}catch(i){o(i)}})}getGroupMemberProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupMemberProfile(n);r(i)}catch(i){o(i)}})}handleGroupApplication(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.handleGroupApplication(n);r(i)}catch(i){o(i)}})}async getUserProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getUserProfile({userIDList:n});r(i)}catch(i){o(i)}})}async getFriendList(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getFriendList();n(o)}catch(o){r(o)}})}async checkFriend(n,r){return this.handlePromiseCallback(async(o,i)=>{var s,u;try{const d=await this.TUICore.tim.checkFriend({userIDList:[n],type:r}),f=(u=(s=d==null?void 0:d.data)==null?void 0:s.successUserIDList[0])==null?void 0:u.relation;o(f)}catch(d){i(d)}})}async getGroupReadMemberList(n,r="",o=15){return this.handlePromiseCallback(async(i,s)=>{try{const u=await this.TUICore.tim.getGroupMessageReadMemberList({message:n,filter:0,cursor:r,count:o});i(u)}catch(u){s(u)}})}async getGroupUnreadMemberList(n,r="",o=15){return this.handlePromiseCallback(async(i,s)=>{try{const u=await this.TUICore.tim.getGroupMessageReadMemberList({message:n,filter:1,cursor:r,count:o});i(u)}catch(u){s(u)}})}async handleMessageSentByMeToView(n){var r,o;(n==null?void 0:n.conversationID)===((o=(r=this==null?void 0:this.store)==null?void 0:r.conversation)==null?void 0:o.conversationID)&&this.currentStore.messageList.push(n)}bind(n){return this.currentStore=n}}const E$=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=zt({data:{}});return nn(()=>{n.data=e.data}),{...Jt(n)}}});const jt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},A$={key:0,class:"text-box"},L$=["src"];function O$(e,t,n,r,o,i){return X(!0),ae(dt,null,qt(e.data.text,(s,u)=>(X(),ae(dt,{key:u},[s.name==="text"?(X(),ae("span",A$,Ee(s.text),1)):s.name==="img"?(X(),ae("img",{key:1,class:"text-img",src:s.src},null,8,L$)):Ce("",!0)],64))),128)}const UO=jt(E$,[["render",O$],["__scopeId","data-v-7f095d6a"]]),R$=ot({props:{data:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},emits:["uploading","previewImage"],setup(e,t){const n=zt({data:{progress:0},show:!1}),r=Ne(),o=Ve(()=>{var g,v,_;const{width:d=0,height:f=0}=(_=(v=(g=n.data)==null?void 0:g.message)==null?void 0:v.payload)==null?void 0:_.imageInfoArray[0];return d>=f});nn(()=>{n.data=e.data,n.data&&br(()=>{var d,f,g;if(n.data.progress)t.emit("uploading");else{const{width:v=0,height:_=0}=n.data;if(v===0||_===0)return;const M=((d=document.getElementById("app"))==null?void 0:d.clientWidth)||0,C=e.isH5?Math.min(M-180,300):300,D=AC(v,_,C,C);(f=r==null?void 0:r.value)!=null&&f.style&&(r.value.style.width=`${D.width}Px`),(g=r==null?void 0:r.value)!=null&&g.style&&(r.value.style.height=`${D.height}Px`)}})});const i=()=>{n.data.progress||t.emit("previewImage",n.data.message)},s=d=>{const f=document.createElement("a"),g=d.payload.imageInfoArray[0].instanceID;f.setAttribute("download",g);const v=new Image;v.src=d.payload.imageInfoArray[0].url,v.setAttribute("crossOrigin","Anonymous"),v.onload=()=>{f.href=u(v),f.click()}},u=d=>{const f=document.createElement("canvas");f.width=d.width,f.height=d.height;const g=f.getContext("2d");g==null||g.drawImage(d,0,0,d.width,d.height);const v=d.src.substring(d.src.lastIndexOf(".")+1).toLowerCase();return f.toDataURL(`image/${v}`,1)};return{...Jt(n),toggleShow:i,skeleton:r,isWidth:o,downloadImage:s}}}),N$=""+new URL("close-image-15985c26.png",import.meta.url).href,P$=""+new URL("downaload-image-285429cc.png",import.meta.url).href;const FO=e=>(Mr("data-v-9b3121bd"),e=e(),Ir(),e),x$=["src","width","height"],U$={key:0,class:"progress"},F$=["value"],G$={key:0},$$=["src"],B$={key:0,class:"dialog-box-h5-footer"},H$=FO(()=>B("img",{src:N$},null,-1)),q$=[H$],V$=FO(()=>B("img",{src:P$},null,-1)),z$=[V$];function j$(e,t,n,r,o,i){return X(),ae("div",{class:"message-image",onClick:t[6]||(t[6]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"])),ref:"skeleton"},[B("img",{class:"message-img",src:e.data.url,width:e.data.width,height:e.data.height,style:Oo(e.isH5?{maxWidth:e.data.width?e.data.width+"Px":"calc(100vw - 180Px)",maxHeight:e.data.height?e.data.height+"Px":"calc(100vw - 180Px)"}:{})},null,12,x$),e.data.progress?(X(),ae("div",U$,[B("progress",{value:e.data.progress,max:"1"},null,8,F$)])):Ce("",!0),e.show?(X(),ae("div",{key:1,class:"dialog",onClick:t[5]||(t[5]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[e.isH5?Ce("",!0):(X(),ae("header",G$,[B("i",{class:"icon icon-close",onClick:t[0]||(t[0]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["stop"]))})])),B("div",{class:st(["dialog-box",[e.isH5?"dialog-box-h5":""]]),onClick:t[4]||(t[4]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[B("img",{class:st([e.isWidth?"isWidth":"isHeight"]),src:e.data.message.payload.imageInfoArray[0].url,onClick:t[1]||(t[1]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},null,10,$$),e.isH5?(X(),ae("div",B$,[B("p",{onClick:t[2]||(t[2]=(...s)=>e.toggleShow&&e.toggleShow(...s))},q$),B("p",{onClick:t[3]||(t[3]=bn(s=>e.downloadImage(e.data.message),["stop"]))},z$)])):Ce("",!0)],2)])):Ce("",!0)],512)}const W$=jt(R$,[["render",j$],["__scopeId","data-v-9b3121bd"]]),K$=ot({props:{data:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},setup(e,t){const n=zt({data:{},show:!1,poster:"",posterWidth:0,posterHeight:0}),r=Ne(),o=Ne(),i=Ve(()=>{var _,M;const{snapshotWidth:g=0,snapshotHeight:v=0}=(M=(_=n.data)==null?void 0:_.message)==null?void 0:M.payload;return g>=v}),s="https://web.sdk.qcloud.com/im/assets/images/transparent.png",u=()=>{n.data.progress||(n.show=!n.show)},d=g=>new Promise(function(v,_){let M="",C=document.createElement("video");C.setAttribute("crossOrigin","anonymous"),C.setAttribute("src",g),C.setAttribute("preload","auto"),C.addEventListener("loadeddata",function(){let D=document.createElement("canvas"),w=C.videoWidth,S=C.videoHeight;D.width=w,D.height=S,D.getContext("2d").drawImage(C,0,0,w,S),M=D.toDataURL("image/jpeg"),n.posterWidth=w,n.posterHeight=S,v(M)},{once:!0})}),f=async g=>{var v,_,M,C,D,w,S,N;return g?g.progress?await d(g.url):g.snapshotUrl!==s&&g.snapshotUrl||((_=(v=g==null?void 0:g.message)==null?void 0:v.payload)==null?void 0:_.snapshotUrl)!==s&&((C=(M=g==null?void 0:g.message)==null?void 0:M.payload)==null?void 0:C.snapshotUrl)||((w=(D=g==null?void 0:g.message)==null?void 0:D.payload)==null?void 0:w.thumbUrl)!==s&&((N=(S=g==null?void 0:g.message)==null?void 0:S.payload)==null?void 0:N.thumbUrl)||await d(g.url):""};return nn(async()=>{n.data=e.data,n.data&&(n.poster=await f(n.data),br(async()=>{var M,C,D,w,S;const g=((M=document.getElementById("messageEle"))==null?void 0:M.clientWidth)||0,v=e.isH5?Math.min(g-172,300):300;let _;if(n.data.progress)t.emit("uploading");else{let{snapshotWidth:N=0,snapshotHeight:A=0,snapshotUrl:L}=n.data;if(N===0||A===0)return;L===s&&(N=n.posterWidth,A=n.posterHeight),_=AC(N,A,v,v),(C=r==null?void 0:r.value)!=null&&C.style&&(r.value.style.width=`${_.width}Px`),(D=r==null?void 0:r.value)!=null&&D.style&&(r.value.style.height=`${_.height}Px`),e.isH5||((w=o==null?void 0:o.value)!=null&&w.style&&(o.value.style.width=`${_.width}Px`),(S=o==null?void 0:o.value)!=null&&S.style&&(o.value.style.height=`${_.height}Px`))}}))}),$t(()=>{var g;return(g=n.data)==null?void 0:g.progress},(g,v)=>{!g&&v&&t.emit("uploading")}),{...Jt(n),toggleShow:u,isWidth:i,getVideoBase64:d,handlePosterUrl:f,skeleton:r,video:o}}});const Y$={class:"message-video"},J$=["src"],X$=["src","poster"],Z$=["src","poster"],Q$={key:3,class:"progress"},e9=["value"],t9=["src"];function n9(e,t,n,r,o,i){return X(),ae("div",Y$,[B("div",{class:st(["message-video-box",[!e.data.progress&&e.data.message.status==="success"&&e.isH5&&"message-video-cover"]]),onClick:t[0]||(t[0]=(...s)=>e.toggleShow&&e.toggleShow(...s)),ref:"skeleton"},[e.data.progress&&e.poster||e.isH5&&e.poster?(X(),ae("img",{key:0,class:st(["message-img",[e.isWidth?"isWidth":"isHeight"]]),src:e.poster},null,10,J$)):e.isH5?(X(),ae("video",{key:1,class:"message-img video-h5-uploading",src:e.data.url+"#t=0.1",poster:e.data.url,preload:"auto",muted:"",ref:"video"},null,8,X$)):!e.data.progress&&!e.isH5?(X(),ae("video",{key:2,class:"message-img video-web",src:e.data.url,controls:"",preload:"metadata",poster:e.poster,ref:"video"},null,8,Z$)):Ce("",!0),e.data.progress?(X(),ae("div",Q$,[B("progress",{value:e.data.progress,max:"1"},null,8,e9)])):Ce("",!0)],2),e.show&&e.isH5?(X(),ae("div",{key:0,class:"dialog-video",onClick:t[3]||(t[3]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[B("header",null,[B("i",{class:"icon icon-close",onClick:t[1]||(t[1]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["stop"]))})]),B("div",{class:st(["dialog-video-box",[e.isH5?"dialog-video-h5":""]]),onClick:t[2]||(t[2]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[B("video",{class:st([e.isWidth?"isWidth":"isHeight"]),src:e.data.url,controls:"",autoplay:""},null,10,t9)],2)])):Ce("",!0)])}const r9=jt(K$,[["render",n9],["__scopeId","data-v-f3ee63bb"]]),o9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=zt({data:{},show:!1,isPlay:!1}),r=Ne(null);$t(()=>e.data,()=>{n.data=e.data},{deep:!0,immediate:!0});const o=()=>{const s=document.getElementsByTagName("audio");for(const f of s)f.paused||(f.parentNode.querySelector(".icon-voice").classList.remove("icon-voice-active"),f.pause(),f.load());const u=r.value,d=u.parentNode;u.paused?(u.play(),n.show=!0,d.querySelector(".icon-voice").classList.add("icon-voice-active")):(u.pause(),u.load(),n.show=!1,d.querySelector(".icon-voice").classList.remove("icon-voice-active"))},i=s=>{const u=s.target.parentNode;u&&u.querySelector(".icon-voice").classList.remove("icon-voice-active")};return{...Jt(n),audio:r,play:o,onStopAnimation:i}}});const i9=["src"];function s9(e,t,n,r,o,i){var s;return X(),ae("div",{class:st(["message-audio",[e.data.message.flow==="out"&&"reserve"]]),onClick:t[2]||(t[2]=bn((...u)=>e.play&&e.play(...u),["stop"])),style:Oo(`width: ${((s=e.data)==null?void 0:s.second)*10+40}Px`)},[B("i",{class:st(["icon icon-voice",[e.data.message.flow==="out"&&"icon-reserve",e.data.message.isPlay?"icon-voice-active":""]])},null,2),B("label",null,Ee(e.data.second?e.data.second:1)+"s",1),B("audio",{ref:"audio",src:e.data.url,onPause:t[0]||(t[0]=(...u)=>e.onStopAnimation&&e.onStopAnimation(...u)),onEnded:t[1]||(t[1]=(...u)=>e.onStopAnimation&&e.onStopAnimation(...u))},null,40,i9)],6)}const a9=jt(o9,[["render",s9],["__scopeId","data-v-c66a067a"]]),l9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=zt({data:{}});nn(()=>{n.data=e.data});const r=()=>{const o=n.data,i={mode:"cors",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded"})};if(window.fetch)fetch(o.url,i).then(s=>s.blob()).then(s=>{const u=document.createElement("a"),d=window.URL.createObjectURL(s);u.href=d,u.download=o.name,u.click()});else{const s=document.createElement("a");s.href=o.url,s.target="_blank",s.download=o.name,s.click()}};return{...Jt(n),download:r}}});const u9=e=>(Mr("data-v-1125cab4"),e=e(),Ir(),e),c9={class:"message-file"},d9=["title"],f9=u9(()=>B("i",{class:"icon icon-files"},null,-1)),p9={class:"message-file-content"},h9=["value"];function g9(e,t,n,r,o,i){return X(),ae("div",c9,[B("div",{class:"box",onClick:t[0]||(t[0]=(...s)=>e.download&&e.download(...s)),title:e.$t("TUIChat.单击下载")},[f9,B("div",p9,[B("label",null,Ee(e.data.name),1),B("span",null,Ee(e.data.size),1)])],8,d9),e.data.progress?(X(),ae("progress",{key:0,value:e.data.progress,max:"1"},null,8,h9)):Ce("",!0)])}const m9=jt(l9,[["render",g9],["__scopeId","data-v-1125cab4"]]),v9=ot({props:{data:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},setup(e,t){const n=zt({data:{}}),r=Ne();return nn(()=>{n.data=e.data,n.data&&br(()=>{var u,d,f;const o=((u=document.getElementById("messageEle"))==null?void 0:u.clientWidth)||0,i=e.isH5?Math.min(o-172,300):300,s=AC(240,240,i,i);(d=r==null?void 0:r.value)!=null&&d.style&&(r.value.style.width=`${s.width}Px`),(f=r==null?void 0:r.value)!=null&&f.style&&(r.value.style.height=`${s.height}Px`)})}),{...Jt(n),skeleton:r}}});const y9={class:"message-image",ref:"skeleton"},_9=["src"];function b9(e,t,n,r,o,i){return X(),ae("div",y9,[B("img",{class:"message-img",src:e.data.url,style:Oo(e.isH5?{maxWidth:e.data.width?e.data.width+"Px":"calc(100vw - 180Px)",maxHeight:e.data.height?e.data.height+"Px":"calc(100vw - 180Px)"}:{})},null,12,_9)],512)}const M9=jt(v9,[["render",b9],["__scopeId","data-v-07d82c7d"]]),I9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=zt({data:{}});return nn(()=>{n.data=e.data}),{...Jt(n)}}});const C9=["href"],T9={class:"el-icon-location-outline"},w9=["src"];function S9(e,t,n,r,o,i){return X(),ae("a",{class:"message-location",href:e.data.href,target:"_blank",title:"点击查看详情"},[B("span",T9,Ee(e.data.description),1),B("img",{src:e.data.url},null,8,w9)],8,C9)}const k9=jt(I9,[["render",S9],["__scopeId","data-v-932323be"]]),D9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=zt({data:{}});return nn(()=>{n.data=e.data}),{...Jt(n)}}});const E9={class:"message-merger"};function A9(e,t,n,r,o,i){return X(),ae("div",E9," 当前版本不支持查看此消息 ")}const L9=jt(D9,[["render",A9],["__scopeId","data-v-2cd600de"]]);/*! * vuex v4.0.2 * (c) 2021 Evan You * @license MIT */var LC="store";function ki(e){return e===void 0&&(e=null),tn(e!==null?e:LC)}function O9(e,t){return e.filter(t)[0]}function LM(e,t){if(t===void 0&&(t=[]),e===null||typeof e!="object")return e;var n=O9(t,function(o){return o.original===e});if(n)return n.copy;var r=Array.isArray(e)?[]:{};return t.push({original:e,copy:r}),Object.keys(e).forEach(function(o){r[o]=LM(e[o],t)}),r}function Vf(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}function GO(e){return e!==null&&typeof e=="object"}function R9(e){return e&&typeof e.then=="function"}function N9(e,t){return function(){return e(t)}}function $O(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function BO(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;$y(e,n,[],e._modules.root,!0),OC(e,n,t)}function OC(e,t,n){var r=e._state;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};Vf(o,function(s,u){i[u]=N9(s,e),Object.defineProperty(e.getters,u,{get:function(){return i[u]()},enumerable:!0})}),e._state=zt({data:t}),e.strict&&G9(e),r&&n&&e._withCommit(function(){r.data=null})}function $y(e,t,n,r,o){var i=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!i&&!o){var u=RC(t,n.slice(0,-1)),d=n[n.length-1];e._withCommit(function(){u[d]=r.state})}var f=r.context=P9(e,s,n);r.forEachMutation(function(g,v){var _=s+v;x9(e,_,g,f)}),r.forEachAction(function(g,v){var _=g.root?v:s+v,M=g.handler||g;U9(e,_,M,f)}),r.forEachGetter(function(g,v){var _=s+v;F9(e,_,g,f)}),r.forEachChild(function(g,v){$y(e,t,n.concat(v),g,o)})}function P9(e,t,n){var r=t==="",o={dispatch:r?e.dispatch:function(i,s,u){var d=Dv(i,s,u),f=d.payload,g=d.options,v=d.type;return(!g||!g.root)&&(v=t+v),e.dispatch(v,f)},commit:r?e.commit:function(i,s,u){var d=Dv(i,s,u),f=d.payload,g=d.options,v=d.type;(!g||!g.root)&&(v=t+v),e.commit(v,f,g)}};return Object.defineProperties(o,{getters:{get:r?function(){return e.getters}:function(){return HO(e,t)}},state:{get:function(){return RC(e.state,n)}}}),o}function HO(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach(function(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}}),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function x9(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.push(function(s){n.call(e,r.state,s)})}function U9(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push(function(s){var u=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},s);return R9(u)||(u=Promise.resolve(u)),e._devtoolHook?u.catch(function(d){throw e._devtoolHook.emit("vuex:error",d),d}):u})}function F9(e,t,n,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(i){return n(r.state,r.getters,i.state,i.getters)})}function G9(e){$t(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function RC(e,t){return t.reduce(function(n,r){return n[r]},e)}function Dv(e,t,n){return GO(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}var $9="vuex bindings",sk="vuex:mutations",k1="vuex:actions",Pd="vuex",B9=0;function H9(e,t){cG({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[$9]},function(n){n.addTimelineLayer({id:sk,label:"Vuex Mutations",color:ak}),n.addTimelineLayer({id:k1,label:"Vuex Actions",color:ak}),n.addInspector({id:Pd,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===Pd)if(r.filter){var o=[];jO(o,t._modules.root,r.filter,""),r.rootNodes=o}else r.rootNodes=[zO(t._modules.root,"")]}),n.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===Pd){var o=r.nodeId;HO(t,o),r.state=z9(W9(t._modules,o),o==="root"?t.getters:t._makeLocalGettersCache,o)}}),n.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===Pd){var o=r.nodeId,i=r.path;o!=="root"&&(i=o.split("/").filter(Boolean).concat(i)),t._withCommit(function(){r.set(t._state.data,i,r.state.value)})}}),t.subscribe(function(r,o){var i={};r.payload&&(i.payload=r.payload),i.state=o,n.notifyComponentUpdate(),n.sendInspectorTree(Pd),n.sendInspectorState(Pd),n.addTimelineEvent({layerId:sk,event:{time:Date.now(),title:r.type,data:i}})}),t.subscribeAction({before:function(r,o){var i={};r.payload&&(i.payload=r.payload),r._id=B9++,r._time=Date.now(),i.state=o,n.addTimelineEvent({layerId:k1,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:i}})},after:function(r,o){var i={},s=Date.now()-r._time;i.duration={_custom:{type:"duration",display:s+"ms",tooltip:"Action duration",value:s}},r.payload&&(i.payload=r.payload),i.state=o,n.addTimelineEvent({layerId:k1,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:i}})}})})}var ak=8702998,q9=6710886,V9=16777215,qO={label:"namespaced",textColor:V9,backgroundColor:q9};function VO(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function zO(e,t){return{id:t||"root",label:VO(t),tags:e.namespaced?[qO]:[],children:Object.keys(e._children).map(function(n){return zO(e._children[n],t+n+"/")})}}function jO(e,t,n,r){r.includes(n)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[qO]:[]}),Object.keys(t._children).forEach(function(o){jO(e,t._children[o],n,r+o+"/")})}function z9(e,t,n){t=n==="root"?t:t[n];var r=Object.keys(t),o={state:Object.keys(e.state).map(function(s){return{key:s,editable:!0,value:e.state[s]}})};if(r.length){var i=j9(t);o.getters=Object.keys(i).map(function(s){return{key:s.endsWith("/")?VO(s):s,editable:!1,value:OM(function(){return i[s]})}})}return o}function j9(e){var t={};return Object.keys(e).forEach(function(n){var r=n.split("/");if(r.length>1){var o=t,i=r.pop();r.forEach(function(s){o[s]||(o[s]={_custom:{value:{},display:s,tooltip:"Module",abstract:!0}}),o=o[s]._custom.value}),o[i]=OM(function(){return e[n]})}else t[n]=OM(function(){return e[n]})}),t}function W9(e,t){var n=t.split("/").filter(function(r){return r});return n.reduce(function(r,o,i){var s=r[o];if(!s)throw new Error('Missing module "'+o+'" for path "'+t+'".');return i===n.length-1?s:s._children},t==="root"?e:e.root._children)}function OM(e){try{return e()}catch(t){return t}}var Ys=function(t,n){this.runtime=n,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},WO={namespaced:{configurable:!0}};WO.namespaced.get=function(){return!!this._rawModule.namespaced};Ys.prototype.addChild=function(t,n){this._children[t]=n};Ys.prototype.removeChild=function(t){delete this._children[t]};Ys.prototype.getChild=function(t){return this._children[t]};Ys.prototype.hasChild=function(t){return t in this._children};Ys.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};Ys.prototype.forEachChild=function(t){Vf(this._children,t)};Ys.prototype.forEachGetter=function(t){this._rawModule.getters&&Vf(this._rawModule.getters,t)};Ys.prototype.forEachAction=function(t){this._rawModule.actions&&Vf(this._rawModule.actions,t)};Ys.prototype.forEachMutation=function(t){this._rawModule.mutations&&Vf(this._rawModule.mutations,t)};Object.defineProperties(Ys.prototype,WO);var ad=function(t){this.register([],t,!1)};ad.prototype.get=function(t){return t.reduce(function(n,r){return n.getChild(r)},this.root)};ad.prototype.getNamespace=function(t){var n=this.root;return t.reduce(function(r,o){return n=n.getChild(o),r+(n.namespaced?o+"/":"")},"")};ad.prototype.update=function(t){KO([],this.root,t)};ad.prototype.register=function(t,n,r){var o=this;r===void 0&&(r=!0);var i=new Ys(n,r);if(t.length===0)this.root=i;else{var s=this.get(t.slice(0,-1));s.addChild(t[t.length-1],i)}n.modules&&Vf(n.modules,function(u,d){o.register(t.concat(d),u,r)})};ad.prototype.unregister=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1],o=n.getChild(r);o&&o.runtime&&n.removeChild(r)};ad.prototype.isRegistered=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1];return n?n.hasChild(r):!1};function KO(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;KO(e.concat(r),t.getChild(r),n.modules[r])}}function YO(e){return new Li(e)}var Li=function(t){var n=this;t===void 0&&(t={});var r=t.plugins;r===void 0&&(r=[]);var o=t.strict;o===void 0&&(o=!1);var i=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new ad(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._devtools=i;var s=this,u=this,d=u.dispatch,f=u.commit;this.dispatch=function(_,M){return d.call(s,_,M)},this.commit=function(_,M,C){return f.call(s,_,M,C)},this.strict=o;var g=this._modules.root.state;$y(this,g,[],this._modules.root),OC(this,g),r.forEach(function(v){return v(n)})},NC={state:{configurable:!0}};Li.prototype.install=function(t,n){t.provide(n||LC,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&H9(t,this)};NC.state.get=function(){return this._state.data};NC.state.set=function(e){};Li.prototype.commit=function(t,n,r){var o=this,i=Dv(t,n,r),s=i.type,u=i.payload,d={type:s,payload:u},f=this._mutations[s];f&&(this._withCommit(function(){f.forEach(function(v){v(u)})}),this._subscribers.slice().forEach(function(g){return g(d,o.state)}))};Li.prototype.dispatch=function(t,n){var r=this,o=Dv(t,n),i=o.type,s=o.payload,u={type:i,payload:s},d=this._actions[i];if(d){try{this._actionSubscribers.slice().filter(function(g){return g.before}).forEach(function(g){return g.before(u,r.state)})}catch{}var f=d.length>1?Promise.all(d.map(function(g){return g(s)})):d[0](s);return new Promise(function(g,v){f.then(function(_){try{r._actionSubscribers.filter(function(M){return M.after}).forEach(function(M){return M.after(u,r.state)})}catch{}g(_)},function(_){try{r._actionSubscribers.filter(function(M){return M.error}).forEach(function(M){return M.error(u,r.state,_)})}catch{}v(_)})})}};Li.prototype.subscribe=function(t,n){return $O(t,this._subscribers,n)};Li.prototype.subscribeAction=function(t,n){var r=typeof t=="function"?{before:t}:t;return $O(r,this._actionSubscribers,n)};Li.prototype.watch=function(t,n,r){var o=this;return $t(function(){return t(o.state,o.getters)},n,Object.assign({},r))};Li.prototype.replaceState=function(t){var n=this;this._withCommit(function(){n._state.data=t})};Li.prototype.registerModule=function(t,n,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,n),$y(this,this.state,t,this._modules.get(t),r.preserveState),OC(this,this.state)};Li.prototype.unregisterModule=function(t){var n=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=RC(n.state,t.slice(0,-1));delete r[t[t.length-1]]}),BO(this)};Li.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};Li.prototype.hotUpdate=function(t){this._modules.update(t),BO(this,!0)};Li.prototype._withCommit=function(t){var n=this._committing;this._committing=!0,t(),this._committing=n};Object.defineProperties(Li.prototype,NC);var JO=Hy(function(e,t){var n={};return By(t).forEach(function(r){var o=r.key,i=r.val;n[o]=function(){var u=this.$store.state,d=this.$store.getters;if(e){var f=qy(this.$store,"mapState",e);if(!f)return;u=f.context.state,d=f.context.getters}return typeof i=="function"?i.call(this,u,d):u[i]},n[o].vuex=!0}),n}),XO=Hy(function(e,t){var n={};return By(t).forEach(function(r){var o=r.key,i=r.val;n[o]=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var f=this.$store.commit;if(e){var g=qy(this.$store,"mapMutations",e);if(!g)return;f=g.context.commit}return typeof i=="function"?i.apply(this,[f].concat(u)):f.apply(this.$store,[i].concat(u))}}),n}),ZO=Hy(function(e,t){var n={};return By(t).forEach(function(r){var o=r.key,i=r.val;i=e+i,n[o]=function(){if(!(e&&!qy(this.$store,"mapGetters",e)))return this.$store.getters[i]},n[o].vuex=!0}),n}),QO=Hy(function(e,t){var n={};return By(t).forEach(function(r){var o=r.key,i=r.val;n[o]=function(){for(var u=[],d=arguments.length;d--;)u[d]=arguments[d];var f=this.$store.dispatch;if(e){var g=qy(this.$store,"mapActions",e);if(!g)return;f=g.context.dispatch}return typeof i=="function"?i.apply(this,[f].concat(u)):f.apply(this.$store,[i].concat(u))}}),n}),K9=function(e){return{mapState:JO.bind(null,e),mapGetters:ZO.bind(null,e),mapMutations:XO.bind(null,e),mapActions:QO.bind(null,e)}};function By(e){return Y9(e)?Array.isArray(e)?e.map(function(t){return{key:t,val:t}}):Object.keys(e).map(function(t){return{key:t,val:e[t]}}):[]}function Y9(e){return Array.isArray(e)||GO(e)}function Hy(e){return function(t,n){return typeof t!="string"?(n=t,t=""):t.charAt(t.length-1)!=="/"&&(t+="/"),e(t,n)}}function qy(e,t,n){var r=e._modulesNamespaceMap[n];return r}function J9(e){e===void 0&&(e={});var t=e.collapsed;t===void 0&&(t=!0);var n=e.filter;n===void 0&&(n=function(g,v,_){return!0});var r=e.transformer;r===void 0&&(r=function(g){return g});var o=e.mutationTransformer;o===void 0&&(o=function(g){return g});var i=e.actionFilter;i===void 0&&(i=function(g,v){return!0});var s=e.actionTransformer;s===void 0&&(s=function(g){return g});var u=e.logMutations;u===void 0&&(u=!0);var d=e.logActions;d===void 0&&(d=!0);var f=e.logger;return f===void 0&&(f=console),function(g){var v=LM(g.state);typeof f>"u"||(u&&g.subscribe(function(_,M){var C=LM(M);if(n(_,v,C)){var D=ck(),w=o(_),S="mutation "+_.type+D;lk(f,S,t),f.log("%c prev state","color: #9E9E9E; font-weight: bold",r(v)),f.log("%c mutation","color: #03A9F4; font-weight: bold",w),f.log("%c next state","color: #4CAF50; font-weight: bold",r(C)),uk(f)}v=C}),d&&g.subscribeAction(function(_,M){if(i(_,M)){var C=ck(),D=s(_),w="action "+_.type+C;lk(f,w,t),f.log("%c action","color: #03A9F4; font-weight: bold",D),uk(f)}}))}}function lk(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch{e.log(t)}}function uk(e){try{e.groupEnd()}catch{e.log("—— log end ——")}}function ck(){var e=new Date;return" @ "+_m(e.getHours(),2)+":"+_m(e.getMinutes(),2)+":"+_m(e.getSeconds(),2)+"."+_m(e.getMilliseconds(),3)}function X9(e,t){return new Array(t+1).join(e)}function _m(e,t){return X9("0",t-e.toString().length)+e}var D1={version:"4.0.2",Store:Li,storeKey:LC,createStore:YO,useStore:ki,mapState:JO,mapMutations:XO,mapGetters:ZO,mapActions:QO,createNamespacedHelpers:K9,createLogger:J9},eR={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(d,f,g){this.fn=d,this.context=f,this.once=g||!1}function i(d,f,g,v,_){if(typeof g!="function")throw new TypeError("The listener must be a function");var M=new o(g,v||d,_),C=n?n+f:f;return d._events[C]?d._events[C].fn?d._events[C]=[d._events[C],M]:d._events[C].push(M):(d._events[C]=M,d._eventsCount++),d}function s(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],g,v;if(this._eventsCount===0)return f;for(v in g=this._events)t.call(g,v)&&f.push(n?v.slice(1):v);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(g)):f},u.prototype.listeners=function(f){var g=n?n+f:f,v=this._events[g];if(!v)return[];if(v.fn)return[v.fn];for(var _=0,M=v.length,C=new Array(M);_({})}},setup(e,t){var d;const n=((d=window==null?void 0:window.TUIKitTUICore)==null?void 0:d.isOfficial)&&ki&&ki()||{},r=zt({data:{},extension:{},isCustom:"",constant:cn});nn(()=>{r.data=e.data;const{message:{payload:f}}=e.data;r.isCustom=f.data||" ",r.isCustom=dr(f.data),f.data===cn.typeService&&(r.extension=dr(f.extension))});const o=f=>{window.open(f)},i=()=>{var v,_,M,C,D;const f=(D=JSON.parse((C=JSON.parse((M=(_=(v=r==null?void 0:r.data)==null?void 0:v.message)==null?void 0:_.payload)==null?void 0:M.data))==null?void 0:C.data))==null?void 0:D.call_type;let g="";switch(f){case 1:g="icon-call-voice";break;case 2:g="icon-call-video";break}return g},s=async()=>{var g,v,_,M,C,D,w,S,N,A,L,j;const f=(C=JSON.parse((M=JSON.parse((_=(v=(g=e==null?void 0:e.data)==null?void 0:g.message)==null?void 0:v.payload)==null?void 0:_.data))==null?void 0:M.data))==null?void 0:C.call_type;switch((w=(D=r==null?void 0:r.data)==null?void 0:D.message)==null?void 0:w.conversationType){case window.TUIKitTUICore.TIM.TYPES.CONV_C2C:const{flow:V,to:x,from:$}=(S=r==null?void 0:r.data)==null?void 0:S.message;if(x===$)break;try{await((L=(A=(N=window==null?void 0:window.TUIKitTUICore)==null?void 0:N.TUIServer)==null?void 0:A.TUICallKit)==null?void 0:L.call({userID:V==="out"?x:$,type:f})),(j=window==null?void 0:window.TUIKitTUICore)!=null&&j.isOfficial&&(n!=null&&n.commit)&&(n==null||n.commit("handleTask",6))}catch(z){console.warn(z)}break;case window.TUIKitTUICore.TIM.TYPES.CONV_GROUP:break}},u=async()=>{var f;console.log(r.isCustom,"data.isCustom"),au.emit("handleNotice",(f=r.isCustom)==null?void 0:f.msgId)};return{...Jt(r),isUrl:ev,openLink:o,handleCallMessageIcon:i,handleNotice:u,handleCallAgain:s}}});const tR=e=>(Mr("data-v-d2ebb559"),e=e(),Ir(),e),tB={class:"custom"},nB={key:0},rB=["href"],oB={key:0},iB=["href"],sB={key:1},aB={key:1,class:"evaluate"},lB=tR(()=>B("i",{class:"icon icon-star-light"},null,-1)),uB=[lB],cB=["src"],dB={key:3,class:"textLink"},fB=["href"],pB=tR(()=>B("div",{class:"notice-title"},[B("i",{class:"iconNotice"}),B("span",null,"群公告")],-1)),hB={class:"content"},gB={class:"content-title"},mB={class:"content-text"},vB=["innerHTML"];function yB(e,t,n,r,o,i){var s,u;return X(),ae("div",tB,[e.isCustom===e.constant.typeService?(X(),ae("div",nB,[B("h1",null,[B("label",null,Ee(e.extension.title),1),e.extension.hyperlinks_text?(X(),ae("a",{key:0,href:e.extension.hyperlinks_text.value,target:"view_window"},Ee(e.extension.hyperlinks_text.key),9,rB)):Ce("",!0)]),e.extension.item&&e.extension.item.length>0?(X(),ae("ul",oB,[(X(!0),ae(dt,null,qt(e.extension.item,(d,f)=>(X(),ae("li",{key:f},[e.isUrl(d.value)?(X(),ae("a",{key:0,href:d.value,target:"view_window"},Ee(d.key),9,iB)):(X(),ae("p",sB,Ee(d.key),1))]))),128))])):Ce("",!0),B("article",null,Ee(e.extension.description),1)])):e.isCustom.businessID===e.constant.typeEvaluate?(X(),ae("div",aB,[B("h1",null,Ee(e.$t("message.custom.对本次服务评价")),1),B("ul",null,[(X(!0),ae(dt,null,qt(~~e.isCustom.score,(d,f)=>(X(),ae("li",{class:"evaluate-list-item",key:f},uB))),128))]),B("article",null,Ee(e.isCustom.comment),1)])):e.isCustom.businessID===e.constant.typeOrder?(X(),ae("div",{key:2,class:"order",onClick:t[0]||(t[0]=d=>e.openLink(e.isCustom.link))},[B("img",{src:e.isCustom.imageUrl,alt:""},null,8,cB),B("main",null,[B("h1",null,Ee(e.isCustom.title),1),B("p",null,Ee(e.isCustom.description),1),B("span",null,Ee(e.isCustom.price),1)])])):e.isCustom.businessID===e.constant.typeTextLink?(X(),ae("div",dB,[B("p",null,Ee(e.isCustom.text),1),B("a",{href:e.isCustom.link,target:"view_window"},Ee(e.$t("message.custom.查看详情>>")),9,fB)])):e.isCustom.businessID===e.constant.TYPE_CALL_MESSAGE?(X(),ae("div",{key:4,class:st(["call",`call-${(u=(s=e.data)==null?void 0:s.message)==null?void 0:u.conversationType}`]),onClick:t[1]||(t[1]=(...d)=>e.handleCallAgain&&e.handleCallAgain(...d))},[B("i",{class:st(["icon",e.handleCallMessageIcon()])},null,2),B("span",null,Ee(e.data.custom),1)],2)):e.isCustom.businessID===e.constant.TC_GROUP_NOTICE?(X(),ae("div",{key:5,class:"notice-message",onClick:t[2]||(t[2]=(...d)=>e.handleNotice&&e.handleNotice(...d))},[pB,B("div",hB,[B("div",gB,Ee(e.isCustom.msgTitle),1),B("div",mB,Ee(e.isCustom.msgContent),1)])])):(X(),ae("span",{key:6,innerHTML:e.data.custom},null,8,vB))])}const _B=jt(eB,[["render",yB],["__scopeId","data-v-d2ebb559"]]),bB=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=zt({message:{}});return nn(()=>{n.message=e.data}),{...Jt(n)}}});const MB={class:"message-tip"};function IB(e,t,n,r,o,i){var s;return X(),ae("div",MB,[B("span",null,Ee((s=e.message)==null?void 0:s.text),1)])}const CB=jt(bB,[["render",IB],["__scopeId","data-v-4c01e0ac"]]);var dk;const PC=typeof window<"u",TB=e=>typeof e=="string",E1=()=>{};PC&&((dk=window==null?void 0:window.navigator)!=null&&dk.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function wB(e,t){function n(...r){e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})}return n}function SB(e,t=!0,n=!0){let r=0,o,i=!0;const s=()=>{o&&(clearTimeout(o),o=void 0)};return d=>{const f=Oe(e),g=Date.now()-r;if(s(),f<=0)return r=Date.now(),d();g>f&&(n||!i)?(r=Date.now(),d()):t&&(o=setTimeout(()=>{r=Date.now(),i=!0,s(),d()},f)),!n&&!o&&(o=setTimeout(()=>i=!0,f)),i=!1}}function xC(e){return ZI()?(iL(e),!0):!1}function Vy(e,t=200,n=!0,r=!0){return wB(SB(t,n,r),e)}function kB(e,t=!0){Ki()?On(e):t?e():br(e)}function DB(e,t,n={}){const{immediate:r=!0}=n,o=Ne(!1);let i=null;function s(){i&&(clearTimeout(i),i=null)}function u(){o.value=!1,s()}function d(...f){s(),o.value=!0,i=setTimeout(()=>{o.value=!1,i=null,e(...f)},Oe(t))}return r&&(o.value=!0,PC&&d()),xC(u),{isPending:o,start:d,stop:u}}function nl(e){var t;const n=Oe(e);return(t=n==null?void 0:n.$el)!=null?t:n}const UC=PC?window:void 0;function rl(...e){let t,n,r,o;if(TB(e[0])?([n,r,o]=e,t=UC):[t,n,r,o]=e,!t)return E1;let i=E1;const s=$t(()=>nl(t),d=>{i(),d&&(d.addEventListener(n,r,o),i=()=>{d.removeEventListener(n,r,o),i=E1})},{immediate:!0,flush:"post"}),u=()=>{s(),i()};return xC(u),u}function Js(e,t,n={}){const{window:r=UC,ignore:o,capture:i=!0,detectIframe:s=!1}=n;if(!r)return;const u=Ne(!0);let d;const f=_=>{r.clearTimeout(d);const M=nl(e),C=_.composedPath();!M||M===_.target||C.includes(M)||!u.value||o&&o.length>0&&o.some(D=>{const w=nl(D);return w&&(_.target===w||C.includes(w))})||t(_)},g=[rl(r,"click",f,{passive:!0,capture:i}),rl(r,"pointerdown",_=>{const M=nl(e);u.value=!!M&&!_.composedPath().includes(M)},{passive:!0}),rl(r,"pointerup",_=>{if(_.button===0){const M=_.composedPath();_.composedPath=()=>M,d=r.setTimeout(()=>f(_),50)}},{passive:!0}),s&&rl(r,"blur",_=>{var M;const C=nl(e);((M=document.activeElement)==null?void 0:M.tagName)==="IFRAME"&&!(C!=null&&C.contains(document.activeElement))&&t(_)})].filter(Boolean);return()=>g.forEach(_=>_())}const EB=500;function AB(e,t,n){var r,o;const i=Ve(()=>nl(e));let s=null;function u(){s!=null&&(clearTimeout(s),s=null)}function d(g){var v,_,M,C;(v=n==null?void 0:n.modifiers)!=null&&v.self&&g.target!==i.value||(u(),(_=n==null?void 0:n.modifiers)!=null&&_.prevent&&g.preventDefault(),(M=n==null?void 0:n.modifiers)!=null&&M.stop&&g.stopPropagation(),s=setTimeout(()=>t(g),(C=n==null?void 0:n.delay)!=null?C:EB))}const f={capture:(r=n==null?void 0:n.modifiers)==null?void 0:r.capture,once:(o=n==null?void 0:n.modifiers)==null?void 0:o.once};rl(i,"pointerdown",d,f),rl(i,"pointerup",u,f),rl(i,"pointerleave",u,f)}const fk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pk="__vueuse_ssr_handlers__";fk[pk]=fk[pk]||{};var hk=Object.getOwnPropertySymbols,LB=Object.prototype.hasOwnProperty,OB=Object.prototype.propertyIsEnumerable,RB=(e,t)=>{var n={};for(var r in e)LB.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hk)for(var r of hk(e))t.indexOf(r)<0&&OB.call(e,r)&&(n[r]=e[r]);return n};function NB(e,t,n={}){const r=n,{window:o=UC}=r,i=RB(r,["window"]);let s;const u=o&&"ResizeObserver"in o,d=()=>{s&&(s.disconnect(),s=void 0)},f=$t(()=>nl(e),v=>{d(),u&&o&&v&&(s=new ResizeObserver(t),s.observe(v,i))},{immediate:!0,flush:"post"}),g=()=>{d(),f()};return xC(g),{isSupported:u,stop:g}}function Ev(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:o=!0,immediate:i=!0}=t,s=Ne(0),u=Ne(0),d=Ne(0),f=Ne(0),g=Ne(0),v=Ne(0),_=Ne(0),M=Ne(0);function C(){const D=nl(e);if(!D){n&&(s.value=0,u.value=0,d.value=0,f.value=0,g.value=0,v.value=0,_.value=0,M.value=0);return}const w=D.getBoundingClientRect();s.value=w.height,u.value=w.bottom,d.value=w.left,f.value=w.right,g.value=w.top,v.value=w.width,_.value=w.x,M.value=w.y}return NB(e,C),$t(()=>nl(e),D=>!D&&C()),o&&rl("scroll",C,{passive:!0}),r&&rl("resize",C,{passive:!0}),kB(()=>{i&&C()}),{height:s,bottom:u,left:d,right:f,top:g,width:v,x:_,y:M,update:C}}var gk;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(gk||(gk={}));const PB=ot({name:"TUIMessage",props:{message:{type:String,default:""},duration:{type:Number,default:3e3},repeatNum:{type:Number,default:1},id:{type:String,default:""},onClose:{type:Function,required:!1},offset:{type:Number,default:20},zIndex:{type:Number,default:0},isH5:{type:Boolean,default:!1},type:{type:String,default:""}},setup(e){const t=Ne(!1);let n;function r(){e.duration>0&&({stop:n}=DB(()=>{t.value&&i()},e.duration))}function o(){n==null||n()}function i(){t.value=!1}$t(()=>e.repeatNum,()=>{o(),r()});const s=Ve(()=>({top:`${e.offset}Px`,zIndex:e.zIndex}));return On(()=>{r(),t.value=!0}),{visible:t,customStyle:s,handleStyle:d=>d&&(d==="error"||d==="success"||d==="warning")?d:"normal"}}});const xB={key:0},UB={key:1};function FB(e,t,n,r,o,i){return X(),It(bo,{name:"fade",onBeforeLeave:e.onClose,onAfterLeave:t[0]||(t[0]=s=>e.$emit("destroy"))},{default:xt(()=>[$n(B("div",{class:st(["message",[e.handleStyle(e.type),e.isH5&&"message-h5"]]),style:Oo(e.customStyle)},[e.isH5?Ce("",!0):(X(),ae("p",xB,Ee(e.message),1)),e.isH5?(X(),ae("span",UB,Ee(e.message),1)):Ce("",!0)],6),[[eo,e.visible]])]),_:1},8,["onBeforeLeave"])}const GB=jt(PB,[["render",FB],["__scopeId","data-v-696e3ea3"]]),Ya=[];let mk=1;const $B=document.body,Wh=function(e){const t=Ya.find(d=>{var f;return`${((f=d.vm.props)==null?void 0:f.message)??""}`==`${e.message??""}`});if(t)return t.vm.component.props.repeatNum+=1,{close:()=>s.component.proxy.visible=!1};let n=e.offset||20;Ya.forEach(({vm:d})=>{var f;n+=(((f=d.el)==null?void 0:f.offsetHeight)||0)+20}),n+=20;const r=`message_${mk+=1}`,o=e.onClose,i={zIndex:20+mk,offset:n,id:r,...e,onClose:()=>{BB(r,o)}},s=St(GB,i),u=document.createElement("div");return s.props.onDestroy=()=>{OS(null,u)},OS(s,u),Ya.push({vm:s}),$B.appendChild(u.firstElementChild),{close:()=>s.component.proxy.visible=!1}};function BB(e,t){const n=Ya.findIndex(({vm:s})=>e===s.component.props.id);if(n===-1)return;const{vm:r}=Ya[n];if(!r)return;t==null||t(r);const o=r.el.offsetHeight;Ya.splice(n,1);const i=Ya.length;if(!(i<1))for(let s=n;s8KB)"};function gg(e){const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n=1e3*60,r=n*60,o=r*24,i=o*7,u=new Date().getTime()-e;let d="";if(u<0)return;const f=u/n,g=u/r,v=u/o,_=u/i;if(_>=1&&_<=4)d=` ${parseInt(`${_}`,10)} ${t("time.周")}${t("time.前")}`;else if(v>=1&&v<=6)d=` ${parseInt(`${v}`,10)} ${t("time.天")}${t("time.前")}`;else if(g>=1&&g<=23)d=` ${parseInt(`${g}`,10)} ${t("time.小时")}${t("time.前")}`;else if(f>=1&&f<=59)d=` ${parseInt(`${f}`,10)} ${t("time.分钟")}${t("time.前")}`;else if(u>=0&&u<=n)d=`${t("time.刚刚")}`;else{const M=new Date;M.setTime(e);const C=M.getFullYear(),D=M.getMonth()+1<10?`0${M.getMonth()+1}`:M.getMonth()+1,w=M.getDate()<10?`0${M.getDate()}`:M.getDate();d=`${C}-${D}-${w}`}return d}function xr(e,t){console.log(e,"error",e.type,e.message),e.message.indexOf("this group does not exist")!==-1&&(e.message="当前群组已解散"),e.message.indexOf("only group member can get group info")===-1&&(e!=null&&e.type&&(e!=null&&e.message)?Wh({message:`${e.type} : ${e.message}`||e,isH5:!!(t!=null&&t.isH5),type:"error"}):Wh({message:HB[e.code]||e.message,isH5:!!(t!=null&&t.isH5),type:"error"}))}function qB(e,t){Wh({message:e,isH5:!!(t!=null&&t.isH5),type:"success"})}function VB(e,t){if(e.length!==t.length)return!1;for(let n=0;n({})},referenceForShow:{type:Object,default:()=>({})},face:{type:Array,default:()=>[]},url:{type:String,default:""},allMessageID:{type:String,default:""},type:{type:String,deafault:""}},setup(e,t){const n=zt({message:{},referenceMessage:{},referenceForShow:{},allMessageID:"",face:[],url:"",type:""});return nn(()=>{n.message=e.message,n.referenceMessage=e.referenceMessage,n.referenceForShow=e.referenceForShow,n.face=e.face,n.url=e.url,n.allMessageID=e.allMessageID,n.type=e.type,console.log(n,"-----------------")}),$t(()=>e.referenceForShow,()=>{n.referenceForShow=e.referenceForShow},{deep:!0}),{...Jt(n),constant:cn}}});const jB={class:"message-reference-user"},WB={class:"nick"},KB={class:"colon"},YB={key:0,class:"face-box"},JB={key:0,class:"text-box"},XB=["src"],ZB={key:1},QB=["src"],eH={key:3,class:"message-video-cover"},tH=["src"],nH=["src"],rH={key:5};function oH(e,t,n,r,o,i){var s,u,d,f,g,v,_,M;return(s=e.referenceMessage)!=null&&s.messageID&&e.allMessageID.indexOf(e.referenceMessage.messageID)!==-1?(X(),ae("div",{key:0,class:st(`${e.type} ${e.message.flow==="in"&&e.type+"-reverse"}`)},[B("p",jB,[B("span",WB,Ee(e.referenceForShow.nick||e.referenceForShow.from),1),B("span",KB,Ee(e.type==="reference"?":":""),1)]),e.referenceMessage.messageType===e.constant.typeText?(X(),ae("div",YB,[(X(!0),ae(dt,null,qt(e.face,(C,D)=>(X(),ae("div",{key:D},[C.name==="text"?(X(),ae("span",JB,Ee(C.text),1)):C.name==="img"?(X(),ae("img",{key:1,class:"text-img",src:C.src},null,8,XB)):Ce("",!0)]))),128))])):Ce("",!0),e.referenceMessage.messageType===e.constant.typeCustom?(X(),ae("span",ZB,Ee(e.referenceMessage.messageAbstract),1)):Ce("",!0),e.referenceMessage.messageType===e.constant.typeImage?(X(),ae("img",{key:2,class:"message-img",src:e.referenceForShow.payload.imageInfoArray[1].url},null,8,QB)):Ce("",!0),e.referenceMessage.messageType===e.constant.typeVideo?(X(),ae("div",eH,[B("img",{class:"message-videoimg",src:((d=(u=e.referenceForShow)==null?void 0:u.payload)==null?void 0:d.snapshotUrl)||((g=(f=e.referenceForShow)==null?void 0:f.payload)==null?void 0:g.thumbUrl)},null,8,tH)])):Ce("",!0),e.referenceMessage.messageType===e.constant.typeFace?(X(),ae("img",{key:4,class:"message-img",src:e.url},null,8,nH)):Ce("",!0),e.referenceMessage.messageType===e.constant.typeFile||e.referenceMessage.messageType===e.constant.typeAudio?(X(),ae("span",rH,Ee((v=e.referenceMessage)==null?void 0:v.messageAbstract),1)):Ce("",!0)],2)):(X(),ae("div",{key:1,class:st(`${e.type} ${e.message.flow==="in"&&e.type+"-reverse"}`)},[B("p",null,Ee((_=e.referenceMessage)==null?void 0:_.messageSender),1),B("span",null,Ee((M=e.referenceMessage)==null?void 0:M.messageAbstract),1)],2))}const iH=jt(zB,[["render",oH],["__scopeId","data-v-305f0990"]]),sH=ot({props:{message:{type:Object,default:()=>({})},emojiList:{type:Array,default:()=>[]},type:{type:String,default:""}},emits:["handleCollapse"],setup(e,t){const{TUIServer:n}=yc,r=zt({message:{},emojiUrl:lh,emojiMap:lf,emojiName:wO,isCollapse:!0,types:vt.TYPES,env:n.TUICore.TUIEnv,type:e.type,emojiReacts:{},allMemberList:[]}),o=Ne({}),i=Ve(()=>r.emojiName.slice(0,6)),s=Ve(()=>r.emojiName.slice(6)),u=v=>{n.emojiReact(r.message,v)},d=v=>{var _,M;try{if(!(v!=null&&v.cloudCustomData))return;const C=(M=(_=dr(v==null?void 0:v.cloudCustomData))==null?void 0:_.messageReact)==null?void 0:M.reacts;return C?(r.emojiReacts=C,C):void 0}catch(C){console.warn(C)}},f=v=>{let _="";return v==null||v.forEach((M,C)=>{var w;const D=(w=r.allMemberList)==null?void 0:w.find(S=>S.userID===M);_=_+(D?D==null?void 0:D.nick:M)+", "}),_.length&&(_=_.substring(0,_.lastIndexOf(","))),_},g=v=>{var M,C,D,w,S,N,A;const _=n==null?void 0:n.currentStore;switch(v==null?void 0:v.conversationType){case vt.TYPES.CONV_C2C:r.allMemberList=[{userID:(C=(M=_==null?void 0:_.conversation)==null?void 0:M.userProfile)==null?void 0:C.userID,nick:(w=(D=_==null?void 0:_.conversation)==null?void 0:D.userProfile)==null?void 0:w.nick},{userID:(S=_==null?void 0:_.selfInfo)==null?void 0:S.userID,nick:(N=_==null?void 0:_.selfInfo)==null?void 0:N.nick}];break;case vt.TYPES.CONV_GROUP:r.allMemberList=(A=_==null?void 0:_.allMemberList)==null?void 0:A.memberList;break}};return $t(()=>e.message,(v,_)=>{r.message=e.message,(v==null?void 0:v.conversationID)!==(_==null?void 0:_.conversationID)&&g(v)},{deep:!0,immediate:!0}),$t(()=>r.isCollapse,(v,_)=>{var M;v!==_&&(M=r==null?void 0:r.env)!=null&&M.isH5&&t.emit("handleCollapse",v)}),{...Jt(r),emojiCollapseList:i,emojiExpandList:s,select:u,handleEmojiReact:d,handleEmojiReactItem:f,container:o}}});const aH={class:"face-list collapse"},lH={class:"face-list-collapse"},uH=["onClick"],cH=["src"],dH={class:"face-list face-list-expand"},fH=["onClick"],pH=["src"],hH={key:1,class:"emoji-content"},gH={class:"emoji-react",ref:"container"},mH=["onClick"],vH=["src"],yH={class:"emoji-react-item-content"};function _H(e,t,n,r,o,i){var s;return X(),ae(dt,null,[e.type==="dropdown"?(X(),ae("div",{key:0,class:st(["dialog-emoji",(s=e.env)!=null&&s.isH5?"dialog-emoji-h5":""])},[B("div",aH,[B("ul",lH,[(X(!0),ae(dt,null,qt(e.emojiCollapseList,(u,d)=>(X(),ae("li",{class:"face-list-item",key:d,onClick:bn(f=>e.select(u),["stop"])},[B("img",{src:e.emojiUrl+e.emojiMap[u]},null,8,cH)],8,uH))),128))]),B("div",{class:"face-list-button",onClick:t[0]||(t[0]=bn(u=>e.isCollapse=!e.isCollapse,["stop"]))},[B("i",{class:st(["icon",[e.isCollapse?"icon-expand":"icon-collapse"]])},null,2)])]),$n(B("ul",dH,[(X(!0),ae(dt,null,qt(e.emojiExpandList,(u,d)=>(X(),ae("li",{class:"face-list-item",key:d,onClick:bn(f=>e.select(u),["stop"])},[B("img",{src:e.emojiUrl+e.emojiMap[u]},null,8,pH)],8,fH))),128))],512),[[eo,!e.isCollapse]])],2)):Ce("",!0),e.type==="content"?(X(),ae("div",hH,[B("ul",gH,[(X(!0),ae(dt,null,qt(e.handleEmojiReact(e.message),(u,d)=>$n((X(),ae("li",{class:"emoji-react-item",key:d,onClick:bn(f=>e.select(d),["stop"])},[B("img",{src:e.emojiUrl+e.emojiMap[d]},null,8,vH),B("div",yH,[B("span",null,Ee(e.handleEmojiReactItem(u)),1)])],8,mH)),[[eo,u&&(u==null?void 0:u.length)]])),128))],512)])):Ce("",!0)],64)}const FC=jt(sH,[["render",_H],["__scopeId","data-v-ec5b0600"]]),bH=ot({props:{data:{type:Object,default:()=>({})},messagesList:{type:Array,default:()=>[]},isH5:{type:Boolean,default:!1},needGroupReceipt:{type:Boolean,default:!1},needReplies:{type:Boolean,default:!0},flow:{type:String,default:""},needEmojiReact:{type:Boolean,default:!1}},emits:["jumpID","resendMessage","showReadReceiptDialog","showRepliesDialog","dropDownOpen"],components:{MessageReference:iH,MessageEmojiReact:FC},setup(e,t){const{t:n}=window.TUIKitTUICore.config.i18n.useI18n(),{TUIServer:r}=yc,o=zt({env:zh(),message:{},messagesList:[],show:!1,type:{},referenceMessage:{},referenceForShow:{},allMessageID:"",needGroupReceipt:!1,needReplies:!0,replies:[],face:[],url:"",needEmojiReact:!1});nn(()=>{var A,L,j;if(o.type=cn,o.messagesList=e.messagesList,o.needEmojiReact=e.needEmojiReact,o.message=EC(((A=o.messagesList)==null?void 0:A.find(V=>{var x;return(V==null?void 0:V.ID)===((x=e.message)==null?void 0:x.ID)}))||e.data),o.needGroupReceipt=e.needGroupReceipt,o.needReplies=e.needReplies,o.message.cloudCustomData){const V=[],x=dr(o.message.cloudCustomData);o.replies=((L=x==null?void 0:x.messageReplies)==null?void 0:L.replies)||[],o.referenceMessage=x.messageReply?x.messageReply:"";for(let $=0;${s.value=!s.value,s.value&&(t.emit("dropDownOpen",u),br(()=>{var oe,J,ie,pe,ue,de,Y,re,fe,Ae,ye,le,Q,ve,Le;const L=(oe=u==null?void 0:u.value)==null?void 0:oe.children[0],j=document.getElementsByClassName("dialog-item")[0],V=(J=u==null?void 0:u.value)==null?void 0:J.offsetParent,x=Ev(V),$=document.getElementById("messageEle"),z=Ev($),G=(ie=z==null?void 0:z.left)==null?void 0:ie.value,O=((pe=z==null?void 0:z.left)==null?void 0:pe.value)+$.clientWidth-L.clientWidth+76,T=(ue=z==null?void 0:z.top)==null?void 0:ue.value,P=((de=z==null?void 0:z.top)==null?void 0:de.value)+$.clientHeight-L.clientHeight,{clientX:Z,clientY:K}=A;if((Y=o==null?void 0:o.env)!=null&&Y.isH5){((re=x==null?void 0:x.top)==null?void 0:re.value)<=(j==null?void 0:j.clientHeight)?L.style.bottom=`-${j==null?void 0:j.clientHeight}Px`:((fe=o==null?void 0:o.message)==null?void 0:fe.flow)==="in"?L.style.top=`-${(j==null?void 0:j.clientHeight)-20}Px`:L.style.top=`-${j==null?void 0:j.clientHeight}Px`;const me=((Ae=x==null?void 0:x.left)==null?void 0:Ae.value)+((ye=x==null?void 0:x.width)==null?void 0:ye.value)/2;me>j.clientWidth/2&&me<($==null?void 0:$.clientWidth)-j.clientWidth/2?L.style.left="calc(50% - 135Px)":me<=j.clientWidth/2?L.style.left="-20Px":L.style.left=`-${j.clientWidth/2+10}Px`;return}switch(!0){case(Z>G&&Z=O:L.style.right=`${Math.max(((Q=x==null?void 0:x.left)==null?void 0:Q.value)+(V==null?void 0:V.clientWidth)-A.clientX-256,-10)}Px`;break}switch(!0){case(K>T&&K=P:L.style.bottom=`${((Le=x==null?void 0:x.top)==null?void 0:Le.value)+(V==null?void 0:V.clientHeight)-A.clientY}Px`,L.style.cssText+="align-items:end;";break}}))},f=A=>{var L,j;if((L=o.referenceMessage)!=null&&L.messageID&&o.allMessageID.includes((j=o.referenceMessage)==null?void 0:j.messageID))t.emit("jumpID",o.referenceMessage.messageID);else{const V=n("TUIChat.无法定位到原消息");xr(V,e)}};Js(u,()=>{s.value=!1}),AB(i,A=>{var L;(L=o==null?void 0:o.env)!=null&&L.isH5&&d(A)});const v=A=>{t.emit("resendMessage",A)},_=A=>!!(A.flow==="out"&&A.status==="success"&&A.needReadReceipt),M=A=>{var L,j,V;return(L=A==null?void 0:A.readReceiptInfo)!=null&&L.isPeerRead||((j=A==null?void 0:A.readReceiptInfo)==null?void 0:j.isPeerRead)===void 0&&(A!=null&&A.isPeerRead)||((V=A==null?void 0:A.readReceiptInfo)==null?void 0:V.unreadCount)===0?"":"unRead"},C=A=>{var L,j;switch(A.conversationType){case r.TUICore.TIM.TYPES.CONV_C2C:return(L=A==null?void 0:A.readReceiptInfo)!=null&&L.isPeerRead||((j=A==null?void 0:A.readReceiptInfo)==null?void 0:j.isPeerRead)===void 0&&(A!=null&&A.isPeerRead)?n("TUIChat.已读"):n("TUIChat.未读");case r.TUICore.TIM.TYPES.CONV_GROUP:return A.readReceiptInfo.unreadCount===0?n("TUIChat.全部已读"):A.readReceiptInfo.readCount===0||A.readReceiptInfo.unreadCount===void 0&&A.readReceiptInfo.readCount===void 0?n("TUIChat.未读"):`${A.readReceiptInfo.readCount+n("TUIChat.人已读")}`;default:return""}},D=A=>{t.emit("showReadReceiptDialog",A,"receipt")},w=(A,L)=>{var j,V;if(L){t.emit("showRepliesDialog",A,"replies");return}if((j=o.referenceMessage)!=null&&j.messageRootID){const x=(V=o.messagesList)==null?void 0:V.find($=>{var z;return $.ID===((z=o.referenceMessage)==null?void 0:z.messageRootID)});if(x){t.emit("showRepliesDialog",x,"replies");return}else{const $=n("TUIChat.无法定位到原消息");xr($,e)}}},S=A=>{const L=["content"];return A&&(L.push(`content-${o.message.flow}`),o.message.type===vt.TYPES.MSG_IMAGE&&!N(A)&&L.push("content-image"),o.message.type===vt.TYPES.MSG_VIDEO&&!N(A)&&L.push("content-video")),L},N=A=>{var L,j;try{if(!(A!=null&&A.cloudCustomData))return;const V=(j=(L=dr(A==null?void 0:A.cloudCustomData))==null?void 0:L.messageReact)==null?void 0:j.reacts;return!(!V||Object.keys(V).length===0)}catch(V){return console.warn(V),!1}};return{...Jt(o),toggleDialog:d,htmlRefHook:i,jumpToAim:f,dropdown:s,dropdownRef:u,resendMessage:v,showReadReceiptTag:_,readReceiptStyle:M,readReceiptCont:C,showReadReceiptDialog:D,showRepliesDialog:w,handleImageOrVideoBubbleStyle:S,isEmojiReactionInMessage:N,TIM:vt}}});const MH=e=>(Mr("data-v-3e69bd89"),e=e(),Ir(),e),IH=["src"],CH={class:"message-area"},TH={key:0,class:"name"},wH={key:1,ref:"dropdownRef",class:"dropdown-inner"},SH=MH(()=>B("i",{class:"icon icon-msg-replies"},null,-1));function kH(e,t,n,r,o,i){var d,f,g,v,_,M,C,D;const s=Yt("MessageReference"),u=Yt("MessageEmojiReact");return X(),ae(dt,null,[B("div",{class:st(["message-bubble",[e.message.flow==="in"?"":"reverse"]]),ref:"htmlRefHook"},[B("img",{class:"avatar",src:((d=e.message)==null?void 0:d.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,IH),B("main",CH,[e.message.flow==="in"&&e.message.conversationType==="GROUP"?(X(),ae("label",TH,Ee(e.message.nameCard||e.message.nick||e.message.from),1)):Ce("",!0),B("div",{class:st(e.handleImageOrVideoBubbleStyle(e.message)),onContextmenu:t[2]||(t[2]=bn((...w)=>e.toggleDialog&&e.toggleDialog(...w),["prevent","right"]))},[(f=e.message)!=null&&f.cloudCustomData&&e.referenceMessage&&((g=e.referenceMessage)!=null&&g.messageRootID)?(X(),ae("div",{key:0,class:st(["message-replie-area",[((v=e.message)==null?void 0:v.flow)==="in"?"":"message-replies-area-reverse"]]),onClick:t[0]||(t[0]=w=>e.showRepliesDialog(e.message,!1))},[St(s,{message:e.message,referenceMessage:e.referenceMessage,referenceForShow:e.referenceForShow,url:e.url,face:e.face,allMessageID:e.allMessageID,type:"reply"},null,8,["message","referenceMessage","referenceForShow","url","face","allMessageID"])],2)):Ce("",!0),Ft(e.$slots,"default",{},void 0,!0),e.dropdown?(X(),ae("div",wH,[B("div",{class:st(["dialog",[e.message.flow==="in"?"":"dialog-right"]]),onClick:t[1]||(t[1]=w=>e.dropdown=!1)},[Ft(e.$slots,"dialog",{},void 0,!0)],2)],512)):Ce("",!0),e.needEmojiReact&&e.isEmojiReactionInMessage(e.message)?(X(),It(u,{key:2,message:e.message,type:"content"},null,8,["message"])):Ce("",!0)],34)]),e.message.status==="fail"?(X(),ae("label",{key:0,class:"message-label fail",onClick:t[3]||(t[3]=w=>e.resendMessage(e.message))}," ! ")):Ce("",!0)],2),(_=e.message)!=null&&_.cloudCustomData&&e.referenceMessage&&!((M=e.referenceMessage)!=null&&M.messageRootID)?(X(),ae("div",{key:0,class:st(["message-reference-area",[e.message.flow==="in"?"":"message-reference-area-reverse"]]),onClick:t[4]||(t[4]=w=>e.jumpToAim(e.referenceMessage))},[St(s,{message:e.message,referenceMessage:e.referenceMessage,referenceForShow:e.referenceForShow,url:e.url,face:e.face,allMessageID:e.allMessageID,type:"reference"},null,8,["message","referenceMessage","referenceForShow","url","face","allMessageID"])],2)):Ce("",!0),(C=e.replies)!=null&&C.length?(X(),ae("label",{key:1,class:st(["message-replies",[e.message.flow==="in"?"":"message-replies-reverse"]]),onClick:t[5]||(t[5]=w=>e.showRepliesDialog(e.message,!0))},[SH,B("span",null,Ee(((D=e.replies)==null?void 0:D.length)+e.$t("TUIChat.条回复")),1)],2)):Ce("",!0)],64)}const DH=jt(bH,[["render",kH],["__scopeId","data-v-3e69bd89"]]),EH=ot({props:{data:{type:Object,default:()=>({})},isEdit:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({message:{},isEdit:!1});nn(()=>{n.message=e.data,n.isEdit=e.isEdit});const r=()=>{t.emit("edit",n.message)};return{...Jt(n),edit:r}}});const AH={class:"revoke"},LH={key:0},OH={key:1};function RH(e,t,n,r,o,i){return X(),ae("div",AH,[e.message.flow==="in"?(X(),ae("label",LH,Ee(e.message.nick||e.message.from),1)):(X(),ae("label",OH,Ee(e.$t("TUIChat.您")),1)),B("span",null,Ee(e.$t("TUIChat.撤回了一条消息")),1),e.message.flow==="out"&&e.isEdit?(X(),ae("span",{key:2,class:"edit",onClick:t[0]||(t[0]=(...s)=>e.edit&&e.edit(...s))},Ee(e.$t("TUIChat.重新编辑")),1)):Ce("",!0)])}const NH=jt(EH,[["render",RH],["__scopeId","data-v-0c5cbaa4"]]),PH=ot({props:{data:{type:Array,default:()=>[]},types:{type:Object,default:()=>({})}},setup(e,t){const n=zt({messageList:[],types:{}});nn(()=>{n.messageList=e.data,n.types=e.types});const r=(o,i)=>{const s={handleAction:o,message:i};t.emit("application",s)};return{...Jt(n),translateGroupSystemNotice:k$,handleApplication:r}}});const xH=e=>(Mr("data-v-fd617f16"),e=e(),Ir(),e),UH={class:"message-system"},FH={class:"list"},GH=xH(()=>B("i",{class:"icon icon-system"},null,-1)),$H={key:0,class:"btn-box"},BH=["onClick"],HH=["onClick"];function qH(e,t,n,r,o,i){return X(),ae("div",UH,[B("ul",FH,[(X(!0),ae(dt,null,qt(e.messageList,(s,u)=>{var d;return X(),ae("li",{key:u},[s.type===e.types.MSG_GRP_TIP||s.type===e.types.MSG_GRP_SYS_NOTICE?(X(),ae(dt,{key:0},[GH,B("span",null,Ee(e.translateGroupSystemNotice(s)),1),((d=s==null?void 0:s.payload)==null?void 0:d.operationType)===1?(X(),ae("div",$H,[B("button",{class:"btn btn-default",onClick:f=>e.handleApplication("Agree",s)}," 接受 ",8,BH),B("button",{class:"btn btn-cancel",onClick:f=>e.handleApplication("Reject",s)}," 拒绝 ",8,HH)])):Ce("",!0)],64)):Ce("",!0)])}),128))])])}const VH=jt(PH,[["render",qH],["__scopeId","data-v-fd617f16"]]);var nR={exports:{}};/*! * clipboard.js v2.0.11 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */(function(e,t){(function(r,o){e.exports=o()})(pi,function(){return function(){var n={686:function(i,s,u){u.d(s,{default:function(){return de}});var d=u(279),f=u.n(d),g=u(370),v=u.n(g),_=u(817),M=u.n(_);function C(Y){try{return document.execCommand(Y)}catch{return!1}}var D=function(re){var fe=M()(re);return C("cut"),fe},w=D;function S(Y){var re=document.documentElement.getAttribute("dir")==="rtl",fe=document.createElement("textarea");fe.style.fontSize="12pt",fe.style.border="0",fe.style.padding="0",fe.style.margin="0",fe.style.position="absolute",fe.style[re?"right":"left"]="-9999px";var Ae=window.pageYOffset||document.documentElement.scrollTop;return fe.style.top="".concat(Ae,"px"),fe.setAttribute("readonly",""),fe.value=Y,fe}var N=function(re,fe){var Ae=S(re);fe.container.appendChild(Ae);var ye=M()(Ae);return C("copy"),Ae.remove(),ye},A=function(re){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},Ae="";return typeof re=="string"?Ae=N(re,fe):re instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(re==null?void 0:re.type)?Ae=N(re.value,fe):(Ae=M()(re),C("copy")),Ae},L=A;function j(Y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(fe){return typeof fe}:j=function(fe){return fe&&typeof Symbol=="function"&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe},j(Y)}var V=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fe=re.action,Ae=fe===void 0?"copy":fe,ye=re.container,le=re.target,Q=re.text;if(Ae!=="copy"&&Ae!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(le!==void 0)if(le&&j(le)==="object"&&le.nodeType===1){if(Ae==="copy"&&le.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(Ae==="cut"&&(le.hasAttribute("readonly")||le.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Q)return L(Q,{container:ye});if(le)return Ae==="cut"?w(le):L(le,{container:ye})},x=V;function $(Y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$=function(fe){return typeof fe}:$=function(fe){return fe&&typeof Symbol=="function"&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe},$(Y)}function z(Y,re){if(!(Y instanceof re))throw new TypeError("Cannot call a class as a function")}function G(Y,re){for(var fe=0;fe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ie(Y){return ie=Object.setPrototypeOf?Object.getPrototypeOf:function(fe){return fe.__proto__||Object.getPrototypeOf(fe)},ie(Y)}function pe(Y,re){var fe="data-clipboard-".concat(Y);if(re.hasAttribute(fe))return re.getAttribute(fe)}var ue=function(Y){T(fe,Y);var re=Z(fe);function fe(Ae,ye){var le;return z(this,fe),le=re.call(this),le.resolveOptions(ye),le.listenClick(Ae),le}return O(fe,[{key:"resolveOptions",value:function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof ye.action=="function"?ye.action:this.defaultAction,this.target=typeof ye.target=="function"?ye.target:this.defaultTarget,this.text=typeof ye.text=="function"?ye.text:this.defaultText,this.container=$(ye.container)==="object"?ye.container:document.body}},{key:"listenClick",value:function(ye){var le=this;this.listener=v()(ye,"click",function(Q){return le.onClick(Q)})}},{key:"onClick",value:function(ye){var le=ye.delegateTarget||ye.currentTarget,Q=this.action(le)||"copy",ve=x({action:Q,container:this.container,target:this.target(le),text:this.text(le)});this.emit(ve?"success":"error",{action:Q,text:ve,trigger:le,clearSelection:function(){le&&le.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(ye){return pe("action",ye)}},{key:"defaultTarget",value:function(ye){var le=pe("target",ye);if(le)return document.querySelector(le)}},{key:"defaultText",value:function(ye){return pe("text",ye)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(ye){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return L(ye,le)}},{key:"cut",value:function(ye){return w(ye)}},{key:"isSupported",value:function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],le=typeof ye=="string"?[ye]:ye,Q=!!document.queryCommandSupported;return le.forEach(function(ve){Q=Q&&!!document.queryCommandSupported(ve)}),Q}}]),fe}(f()),de=ue},828:function(i){var s=9;if(typeof Element<"u"&&!Element.prototype.matches){var u=Element.prototype;u.matches=u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector}function d(f,g){for(;f&&f.nodeType!==s;){if(typeof f.matches=="function"&&f.matches(g))return f;f=f.parentNode}}i.exports=d},438:function(i,s,u){var d=u(828);function f(_,M,C,D,w){var S=v.apply(this,arguments);return _.addEventListener(C,S,w),{destroy:function(){_.removeEventListener(C,S,w)}}}function g(_,M,C,D,w){return typeof _.addEventListener=="function"?f.apply(null,arguments):typeof C=="function"?f.bind(null,document).apply(null,arguments):(typeof _=="string"&&(_=document.querySelectorAll(_)),Array.prototype.map.call(_,function(S){return f(S,M,C,D,w)}))}function v(_,M,C,D){return function(w){w.delegateTarget=d(w.target,M),w.delegateTarget&&D.call(_,w)}}i.exports=g},879:function(i,s){s.node=function(u){return u!==void 0&&u instanceof HTMLElement&&u.nodeType===1},s.nodeList=function(u){var d=Object.prototype.toString.call(u);return u!==void 0&&(d==="[object NodeList]"||d==="[object HTMLCollection]")&&"length"in u&&(u.length===0||s.node(u[0]))},s.string=function(u){return typeof u=="string"||u instanceof String},s.fn=function(u){var d=Object.prototype.toString.call(u);return d==="[object Function]"}},370:function(i,s,u){var d=u(879),f=u(438);function g(C,D,w){if(!C&&!D&&!w)throw new Error("Missing required arguments");if(!d.string(D))throw new TypeError("Second argument must be a String");if(!d.fn(w))throw new TypeError("Third argument must be a Function");if(d.node(C))return v(C,D,w);if(d.nodeList(C))return _(C,D,w);if(d.string(C))return M(C,D,w);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function v(C,D,w){return C.addEventListener(D,w),{destroy:function(){C.removeEventListener(D,w)}}}function _(C,D,w){return Array.prototype.forEach.call(C,function(S){S.addEventListener(D,w)}),{destroy:function(){Array.prototype.forEach.call(C,function(S){S.removeEventListener(D,w)})}}}function M(C,D,w){return f(document.body,C,D,w)}i.exports=g},817:function(i){function s(u){var d;if(u.nodeName==="SELECT")u.focus(),d=u.value;else if(u.nodeName==="INPUT"||u.nodeName==="TEXTAREA"){var f=u.hasAttribute("readonly");f||u.setAttribute("readonly",""),u.select(),u.setSelectionRange(0,u.value.length),f||u.removeAttribute("readonly"),d=u.value}else{u.hasAttribute("contenteditable")&&u.focus();var g=window.getSelection(),v=document.createRange();v.selectNodeContents(u),g.removeAllRanges(),g.addRange(v),d=g.toString()}return d}i.exports=s},279:function(i){function s(){}s.prototype={on:function(u,d,f){var g=this.e||(this.e={});return(g[u]||(g[u]=[])).push({fn:d,ctx:f}),this},once:function(u,d,f){var g=this;function v(){g.off(u,v),d.apply(f,arguments)}return v._=d,this.on(u,v,f)},emit:function(u){var d=[].slice.call(arguments,1),f=((this.e||(this.e={}))[u]||[]).slice(),g=0,v=f.length;for(g;g{const t=(e==null?void 0:e.appendToBody)===void 0?!0:e.appendToBody;return{toClipboard(n,r){return new Promise((o,i)=>{const s=document.createElement("button"),u=new jH(s,{text:()=>n,action:()=>"copy",container:r!==void 0?r:document.body});u.on("success",d=>{u.destroy(),o(d)}),u.on("error",d=>{u.destroy(),i(d)}),t&&document.body.appendChild(s),s.click(),t&&document.body.removeChild(s)})}}},WH=ot({props:{message:{type:Object,default:()=>({})},needEmojiReact:{type:Boolean,default:!1}},components:{MessageEmojiReact:FC},setup(e,t){var d,f,g;const n=(f=(d=window==null?void 0:window.TUIKitTUICore)==null?void 0:d.TUIServer)==null?void 0:f.TUIChat,r=((g=window==null?void 0:window.TUIKitTUICore)==null?void 0:g.isOfficial)&&ki&&ki()||{},o=zt({message:{},show:!1,types:vt.TYPES,env:n.TUICore.TUIEnv,showToolList:!0,needEmojiReact:!1});nn(()=>{o.needEmojiReact=e.needEmojiReact}),$t(()=>e.message,()=>{o.message=e.message},{deep:!0,immediate:!0});const i=v=>{let _="";switch(v.type){case o.types.MSG_FILE:_=v.payload.fileUrl;break;case o.types.MSG_VIDEO:_=v.payload.remoteVideoUrl;break;case o.types.MSG_IMAGE:_=v.payload.imageInfoArray[0].url;break}window.open(_,"_blank")},s=async(v,_)=>{var M,C,D;switch(_){case cn.handleMessage.revoke:try{await n.revokeMessage(v),(M=window==null?void 0:window.TUIKitTUICore)!=null&&M.isOfficial&&(r!=null&&r.commit)&&(r==null||r.commit("handleTask",1))}catch(w){xr(w,o.env)}break;case cn.handleMessage.copy:try{if((v==null?void 0:v.type)===o.types.MSG_TEXT&&((C=v==null?void 0:v.payload)!=null&&C.text)){const{toClipboard:w}=rR();await w((D=v==null?void 0:v.payload)==null?void 0:D.text)}}catch(w){xr(w,o.env)}break;case cn.handleMessage.delete:await n.deleteMessage([v]);break;case cn.handleMessage.forward:t.emit("handleMessage",v,cn.handleMessage.forward);break;case cn.handleMessage.reference:t.emit("handleMessage",v,cn.handleMessage.reference);break;case cn.handleMessage.reply:t.emit("handleMessage",v,cn.handleMessage.reply);break}},u=v=>{var _;(_=o==null?void 0:o.env)!=null&&_.isH5&&(o.showToolList=v)};return{...Jt(o),openMessage:i,handleMessage:s,constant:cn,handleCollapse:u}}});const ld=e=>(Mr("data-v-48212351"),e=e(),Ir(),e),KH=ld(()=>B("i",{class:"icon icon-msg-copy"},null,-1)),YH=ld(()=>B("i",{class:"icon icon-msg-copy"},null,-1)),JH=ld(()=>B("i",{class:"icon icon-msg-forward"},null,-1)),XH=ld(()=>B("i",{class:"icon icon-msg-quote"},null,-1)),ZH=ld(()=>B("i",{class:"icon icon-msg-reply"},null,-1)),QH=ld(()=>B("i",{class:"icon icon-msg-revoke"},null,-1)),eq=ld(()=>B("i",{class:"icon icon-msg-del"},null,-1));function tq(e,t,n,r,o,i){var u,d,f;const s=Yt("MessageEmojiReact");return X(),ae("div",{class:st(["dialog-item",(u=e.env)!=null&&u.isH5?"dialog-item-h5":"dialog-item-web"])},[(d=e.env)!=null&&d.isH5&&e.needEmojiReact?(X(),It(s,{key:0,message:e.message,type:"dropdown",onHandleCollapse:e.handleCollapse},null,8,["message","onHandleCollapse"])):Ce("",!0),$n(B("ul",{class:st(["dialog-item-list",(f=e.env)!=null&&f.isH5?"dialog-item-list-h5":"dialog-item-list-web"])},[(e.message.type===e.types.MSG_FILE||e.message.type===e.types.MSG_VIDEO||e.message.type===e.types.MSG_IMAGE)&&!e.env.isH5?(X(),ae("li",{key:0,onClick:t[0]||(t[0]=g=>e.openMessage(e.message))},[KH,B("span",null,Ee(e.$t("TUIChat.打开")),1)])):Ce("",!0),e.message.type===e.types.MSG_TEXT?(X(),ae("li",{key:1,onClick:t[1]||(t[1]=g=>e.handleMessage(e.message,e.constant.handleMessage.copy))},[YH,B("span",null,Ee(e.$t("TUIChat.复制")),1)])):Ce("",!0),e.message.status==="success"?(X(),ae("li",{key:2,onClick:t[2]||(t[2]=g=>e.handleMessage(e.message,e.constant.handleMessage.forward))},[JH,B("span",null,Ee(e.$t("TUIChat.转发")),1)])):Ce("",!0),e.message.status==="success"?(X(),ae("li",{key:3,onClick:t[3]||(t[3]=g=>e.handleMessage(e.message,e.constant.handleMessage.reference))},[XH,B("span",null,Ee(e.$t("TUIChat.引用")),1)])):Ce("",!0),e.message.status==="success"?(X(),ae("li",{key:4,onClick:t[4]||(t[4]=g=>e.handleMessage(e.message,e.constant.handleMessage.reply))},[ZH,B("span",null,Ee(e.$t("TUIChat.回复")),1)])):Ce("",!0),e.message.flow==="out"&&e.message.status==="success"&&e.message.type!==e.types.MSG_CUSTOM?(X(),ae("li",{key:5,onClick:t[5]||(t[5]=g=>e.handleMessage(e.message,e.constant.handleMessage.revoke))},[QH,B("span",null,Ee(e.$t("TUIChat.撤回")),1)])):Ce("",!0),e.message.status==="success"?(X(),ae("li",{key:6,onClick:t[6]||(t[6]=g=>e.handleMessage(e.message,e.constant.handleMessage.delete))},[eq,B("span",null,Ee(e.$t("TUIChat.删除")),1)])):Ce("",!0)],2),[[eo,e.showToolList]])],2)}const nq=jt(WH,[["render",tq],["__scopeId","data-v-48212351"]]),rq=ot({props:{show:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({show:!1});nn(()=>{n.show=e.show});const r=()=>{n.show=!n.show,t.emit("update:show",n.show)};return{...Jt(n),toggleView:r}}});function oq(e,t,n,r,o,i){return e.show?(X(),ae("div",{key:0,class:"mask",onClick:t[0]||(t[0]=bn((...s)=>e.toggleView&&e.toggleView(...s),["self"]))},[Ft(e.$slots,"default",{},void 0,!0)])):Ce("",!0)}const iq=jt(rq,[["render",oq],["__scopeId","data-v-95460edc"]]),sq=ot({props:{list:{type:Array,default:()=>[]},selectedList:{type:Array,default:()=>[]},isSearch:{type:Boolean,default:()=>!0},isRadio:{type:Boolean,default:()=>!1},isCustomItem:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},type:{type:String,default:()=>""},isH5:{type:Boolean,default:()=>!1},resultShow:{type:Boolean,default:()=>!0}},setup(e,t){const n=zt({type:"",list:[],selectedList:[],isSearch:!0,isCustomItem:!1,title:""});nn(()=>{if(e.isCustomItem)for(let f=0;f-1&&e.list.splice(f,1),n.list=e.list;else n.list=e.list;n.selectedList=e.selectedList,n.isSearch=e.isSearch,n.isCustomItem=e.isCustomItem,n.title=e.title,n.type=e.type});const r=Ve(()=>n.list.filter(f=>!f.isDisabled)),o=f=>{t.emit("search",f.target.value)},i=f=>{if(f.isDisabled)return;let g=n.selectedList;const v=g.indexOf(f);if(v>-1)return n.selectedList.splice(v,1);e.isRadio&&(g=[]),g.push(f),n.selectedList=g},s=()=>{n.selectedList.length===r.value.length?n.selectedList=[]:n.selectedList=[...r.value]},u=()=>{t.emit("submit",n.selectedList)},d=()=>{t.emit("cancel")};return{...Jt(n),optional:r,handleInput:o,selected:i,selectedAll:s,submit:u,cancel:d}}}),ud=""+new URL("nomore-9da703ae.png",import.meta.url).href;const oR=e=>(Mr("data-v-8cb1c9dc"),e=e(),Ir(),e),aq={key:0,class:"transfer-h5-header"},lq={class:"title"},uq={class:"main"},cq={class:"left"},dq={key:0},fq=["placeholder"],pq={class:"list"},hq={class:"all"},gq=["onClick"],mq=["src"],vq={class:"name"},yq={key:0},_q={key:0,class:"theEmtpy",style:{height:"90%"}},bq=oR(()=>B("img",{class:"emptyImg",src:ud},null,-1)),Mq=oR(()=>B("p",null,"暂无数据",-1)),Iq=[bq,Mq],Cq={class:"right"},Tq={key:0},wq={class:"list"},Sq={key:0},kq=["src"],Dq={key:0},Eq=["onClick"];function Aq(e,t,n,r,o,i){return X(),ae("div",{class:st(["transfer",[e.isH5?"transfer-h5":""]])},[e.isH5?(X(),ae("header",aq,[B("i",{class:"icon icon-back",onClick:t[0]||(t[0]=(...s)=>e.cancel&&e.cancel(...s))}),B("span",lq,Ee(e.title),1)])):Ce("",!0),B("main",uq,[B("div",cq,[e.isSearch?(X(),ae("header",dq,[B("input",{type:"text",onKeyup:t[1]||(t[1]=fr((...s)=>e.handleInput&&e.handleInput(...s),["enter"])),placeholder:e.$t("component.请输入userID"),enterkeyhint:"search"},null,40,fq)])):Ce("",!0),B("main",null,[B("ul",pq,[e.optional.length>1&&!e.isRadio?(X(),ae("li",{key:0,class:"list-item",onClick:t[2]||(t[2]=(...s)=>e.selectedAll&&e.selectedAll(...s))},[B("i",{class:st(["icon",[e.selectedList.length===e.optional.length?"icon-selected":"icon-unselected"]])},null,2),B("span",hq,Ee(e.$t("component.全选")),1)])):Ce("",!0),(X(!0),ae(dt,null,qt(e.list,(s,u)=>(X(),ae("li",{class:"list-item",key:u,onClick:d=>e.selected(s)},[B("i",{class:st(["icon",[(s==null?void 0:s.isDisabled)&&"disabled",e.selectedList.indexOf(s)>-1?"icon-selected":"icon-unselected"]])},null,2),e.isCustomItem?Ft(e.$slots,"left",{key:1,data:s},void 0,!0):(X(),ae(dt,{key:0},[B("img",{class:"avatar",src:(s==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,mq),B("span",vq,Ee((s==null?void 0:s.nick)||(s==null?void 0:s.userID)),1),s!=null&&s.isDisabled?(X(),ae("span",yq,"("+Ee(e.$t("component.已在群聊中"))+")",1)):Ce("",!0)],64))],8,gq))),128))]),e.optional.length<=0?(X(),ae("div",_q,Iq)):Ce("",!0)])]),B("div",Cq,[e.isH5?Ce("",!0):(X(),ae("header",Tq,Ee(e.title),1)),$n(B("ul",wq,[e.selectedList.length>0&&!e.isH5?(X(),ae("p",Sq,Ee(e.$t("component.已选中"))+Ee(e.selectedList.length)+Ee(e.$t("component.人")),1)):Ce("",!0),(X(!0),ae(dt,null,qt(e.selectedList,(s,u)=>(X(),ae("li",{class:"list-item space-between",key:u},[B("aside",null,[e.isCustomItem?Ft(e.$slots,"right",{key:1,data:s},void 0,!0):(X(),ae(dt,{key:0},[B("img",{class:"avatar",src:(s==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,kq),e.isH5?Ce("",!0):(X(),ae("span",Dq,Ee(s.nick||s.userID),1))],64))]),e.isH5?Ce("",!0):(X(),ae("i",{key:0,class:"icon icon-cancel",onClick:d=>e.selected(s)},null,8,Eq))]))),128))],512),[[eo,e.resultShow]]),B("footer",null,[B("button",{class:"btn btn-cancel",onClick:t[3]||(t[3]=(...s)=>e.cancel&&e.cancel(...s))},Ee(e.$t("component.取消")),1),e.selectedList.length>0?(X(),ae("button",{key:0,class:"btn",onClick:t[4]||(t[4]=(...s)=>e.submit&&e.submit(...s))},Ee(e.$t("component.完成")),1)):(X(),ae("button",{key:1,class:"btn btn-no",onClick:t[5]||(t[5]=(...s)=>e.submit&&e.submit(...s))},Ee(e.$t("component.完成")),1))])])])],2)}const GC=jt(sq,[["render",Aq],["__scopeId","data-v-8cb1c9dc"]]),Lq=ot({props:{open:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({open:!1});nn(()=>{n.open=e.open});const r=()=>{n.open=!n.open,t.emit("change",n.open)};return{...Jt(n),toggle:r}}});const Oq=e=>(Mr("data-v-5246dd4c"),e=e(),Ir(),e),Rq=Oq(()=>B("span",{class:"slider-block"},null,-1)),Nq=[Rq];function Pq(e,t,n,r,o,i){return X(),ae("div",{class:st(["slider-box",[e.open&&"slider-open"]]),onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},Nq,2)}const iR=jt(Lq,[["render",Pq],["__scopeId","data-v-5246dd4c"]]),xq=ot({props:{data:{type:Object,default:()=>({})},isAuth:{type:Boolean,default:!1},isH5:{type:Boolean,default:!1}},setup(e,t){const n=zt({groupProfile:{},input:"",isEdit:!1});nn(()=>{n.groupProfile=e.data});const r=Ne();Js(r,()=>{n.isEdit=!1});const o=async()=>{n.input&&n.input!==n.groupProfile.name&&(t.emit("update",{key:"name",value:n.input}),n.groupProfile.name=n.input,n.input=""),i()},i=async()=>{e.isAuth&&(n.isEdit=!n.isEdit),n.isEdit&&(n.input=n.groupProfile.name)};return{...Jt(n),updateProfile:o,toggleEdit:i,dialog:r}}});const Uq={class:"name"},Fq={key:0,class:"edit-h5-header"},Gq={class:"left"},$q={class:"input-box"},Bq={key:1},Hq={key:1,class:"edit-h5-footer"},Vq=["disabled"],zq={key:1};function jq(e,t,n,r,o,i){return X(),ae("div",Uq,[B("label",null,Ee(e.$t("TUIChat.manage.群名称")),1),e.isEdit?(X(),ae("div",{key:0,class:st([e.isH5?"edit-h5":""]),ref:"dialog"},[B("main",null,[e.isH5?(X(),ae("header",Fq,[B("aside",Gq,[B("h1",null,Ee(e.$t("TUIChat.manage.修改群聊名称")),1),B("span",null,Ee(e.$t("TUIChat.manage.修改群聊名称后,将在群内通知其他成员")),1)]),B("span",{class:"close",onClick:t[0]||(t[0]=(...s)=>e.toggleEdit&&e.toggleEdit(...s))},Ee(e.$t("关闭")),1)])):Ce("",!0),B("div",$q,[e.isEdit?$n((X(),ae("input",{key:0,class:"input","onUpdate:modelValue":t[1]||(t[1]=s=>e.input=s),type:"text",onKeyup:t[2]||(t[2]=fr((...s)=>e.updateProfile&&e.updateProfile(...s),["enter"]))},null,544)),[[al,e.input]]):Ce("",!0),e.isH5?(X(),ae("span",Bq,Ee(e.$t("TUIChat.manage.仅限中文、字母、数字和下划线,2-20个字")),1)):Ce("",!0)]),e.isH5?(X(),ae("footer",Hq,[B("button",{class:"btn",disabled:!e.input,onClick:t[3]||(t[3]=(...s)=>e.updateProfile&&e.updateProfile(...s))},Ee(e.$t("确认")),9,Vq)])):Ce("",!0)])],2)):Ce("",!0),!e.isEdit||e.isH5?(X(),ae("p",zq,[B("span",null,Ee(e.groupProfile.name),1)])):Ce("",!0)])}const Wq=jt(xq,[["render",jq],["__scopeId","data-v-3873bf46"]]);var Kq=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;t[n]=o;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==o||s.enumerable!==!0)return!1}return!0},vk=typeof Symbol<"u"&&Symbol,Yq=Kq,Jq=function(){return typeof vk!="function"||typeof Symbol!="function"||typeof vk("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Yq()},yk={foo:{}},Xq=Object,Zq=function(){return{__proto__:yk}.foo===yk.foo&&!({__proto__:null}instanceof Xq)},Qq="Function.prototype.bind called on incompatible ",A1=Array.prototype.slice,eV=Object.prototype.toString,tV="[object Function]",nV=function(t){var n=this;if(typeof n!="function"||eV.call(n)!==tV)throw new TypeError(Qq+n);for(var r=A1.call(arguments,1),o,i=function(){if(this instanceof o){var g=n.apply(this,r.concat(A1.call(arguments)));return Object(g)===g?g:this}else return n.apply(t,r.concat(A1.call(arguments)))},s=Math.max(0,n.length-r.length),u=[],d=0;d"u"||!So?Sn:So(Uint8Array),Fc={"%AggregateError%":typeof AggregateError>"u"?Sn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Sn:ArrayBuffer,"%ArrayIteratorPrototype%":xd&&So?So([][Symbol.iterator]()):Sn,"%AsyncFromSyncIteratorPrototype%":Sn,"%AsyncFunction%":Vd,"%AsyncGenerator%":Vd,"%AsyncGeneratorFunction%":Vd,"%AsyncIteratorPrototype%":Vd,"%Atomics%":typeof Atomics>"u"?Sn:Atomics,"%BigInt%":typeof BigInt>"u"?Sn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Sn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Sn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Sn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Sn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Sn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Sn:FinalizationRegistry,"%Function%":sR,"%GeneratorFunction%":Vd,"%Int8Array%":typeof Int8Array>"u"?Sn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Sn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Sn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xd&&So?So(So([][Symbol.iterator]())):Sn,"%JSON%":typeof JSON=="object"?JSON:Sn,"%Map%":typeof Map>"u"?Sn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xd||!So?Sn:So(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Sn:Promise,"%Proxy%":typeof Proxy>"u"?Sn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Sn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Sn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xd||!So?Sn:So(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Sn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xd&&So?So(""[Symbol.iterator]()):Sn,"%Symbol%":xd?Symbol:Sn,"%SyntaxError%":wf,"%ThrowTypeError%":sV,"%TypedArray%":lV,"%TypeError%":cf,"%Uint8Array%":typeof Uint8Array>"u"?Sn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Sn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Sn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Sn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Sn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Sn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Sn:WeakSet};if(So)try{null.error}catch(e){var uV=So(So(e));Fc["%Error.prototype%"]=uV}var cV=function e(t){var n;if(t==="%AsyncFunction%")n=L1("async function () {}");else if(t==="%GeneratorFunction%")n=L1("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=L1("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&So&&(n=So(o.prototype))}return Fc[t]=n,n},_k={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mg=$C,Av=iV,dV=mg.call(Function.call,Array.prototype.concat),fV=mg.call(Function.apply,Array.prototype.splice),bk=mg.call(Function.call,String.prototype.replace),Lv=mg.call(Function.call,String.prototype.slice),pV=mg.call(Function.call,RegExp.prototype.exec),hV=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,gV=/\\(\\)?/g,mV=function(t){var n=Lv(t,0,1),r=Lv(t,-1);if(n==="%"&&r!=="%")throw new wf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new wf("invalid intrinsic syntax, expected opening `%`");var o=[];return bk(t,hV,function(i,s,u,d){o[o.length]=u?bk(d,gV,"$1"):s||i}),o},vV=function(t,n){var r=t,o;if(Av(_k,r)&&(o=_k[r],r="%"+o[0]+"%"),Av(Fc,r)){var i=Fc[r];if(i===Vd&&(i=cV(r)),typeof i>"u"&&!n)throw new cf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:i}}throw new wf("intrinsic "+t+" does not exist!")},BC=function(t,n){if(typeof t!="string"||t.length===0)throw new cf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new cf('"allowMissing" argument must be a boolean');if(pV(/^%?[^%]*%?$/,t)===null)throw new wf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=mV(t),o=r.length>0?r[0]:"",i=vV("%"+o+"%",n),s=i.name,u=i.value,d=!1,f=i.alias;f&&(o=f[0],fV(r,dV([0,1],f)));for(var g=1,v=!0;g=r.length){var D=Uc(u,_);v=!!D,v&&"get"in D&&!("originalValue"in D.get)?u=D.get:u=u[_]}else v=Av(u,_),u=u[_];v&&!d&&(Fc[s]=u)}}return u},aR={exports:{}};(function(e){var t=$C,n=BC,r=n("%Function.prototype.apply%"),o=n("%Function.prototype.call%"),i=n("%Reflect.apply%",!0)||t.call(o,r),s=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),d=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}e.exports=function(v){var _=i(t,o,arguments);if(s&&u){var M=s(_,"length");M.configurable&&u(_,"length",{value:1+d(0,v.length-(arguments.length-1))})}return _};var f=function(){return i(t,r,arguments)};u?u(e.exports,"apply",{value:f}):e.exports.apply=f})(aR);var yV=aR.exports,lR=BC,uR=yV,_V=uR(lR("String.prototype.indexOf")),bV=function(t,n){var r=lR(t,!!n);return typeof r=="function"&&_V(t,".prototype.")>-1?uR(r):r};const MV={},IV=Object.freeze(Object.defineProperty({__proto__:null,default:MV},Symbol.toStringTag,{value:"Module"})),CV=y$(IV);var HC=typeof Map=="function"&&Map.prototype,R1=Object.getOwnPropertyDescriptor&&HC?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ov=HC&&R1&&typeof R1.get=="function"?R1.get:null,Mk=HC&&Map.prototype.forEach,qC=typeof Set=="function"&&Set.prototype,N1=Object.getOwnPropertyDescriptor&&qC?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Rv=qC&&N1&&typeof N1.get=="function"?N1.get:null,Ik=qC&&Set.prototype.forEach,TV=typeof WeakMap=="function"&&WeakMap.prototype,uh=TV?WeakMap.prototype.has:null,wV=typeof WeakSet=="function"&&WeakSet.prototype,ch=wV?WeakSet.prototype.has:null,SV=typeof WeakRef=="function"&&WeakRef.prototype,Ck=SV?WeakRef.prototype.deref:null,kV=Boolean.prototype.valueOf,DV=Object.prototype.toString,EV=Function.prototype.toString,AV=String.prototype.match,VC=String.prototype.slice,zl=String.prototype.replace,LV=String.prototype.toUpperCase,Tk=String.prototype.toLowerCase,cR=RegExp.prototype.test,wk=Array.prototype.concat,da=Array.prototype.join,OV=Array.prototype.slice,Sk=Math.floor,RM=typeof BigInt=="function"?BigInt.prototype.valueOf:null,P1=Object.getOwnPropertySymbols,NM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Sf=typeof Symbol=="function"&&typeof Symbol.iterator=="object",hi=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Sf||"symbol")?Symbol.toStringTag:null,dR=Object.prototype.propertyIsEnumerable,kk=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Dk(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||cR.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Sk(-e):Sk(e);if(r!==e){var o=String(r),i=VC.call(t,o.length+1);return zl.call(o,n,"$&_")+"."+zl.call(zl.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return zl.call(t,n,"$&_")}var PM=CV,Ek=PM.custom,Ak=pR(Ek)?Ek:null,RV=function e(t,n,r,o){var i=n||{};if($l(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if($l(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=$l(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($l(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if($l(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return gR(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var d=String(t);return u?Dk(t,d):d}if(typeof t=="bigint"){var f=String(t)+"n";return u?Dk(t,f):f}var g=typeof i.depth>"u"?5:i.depth;if(typeof r>"u"&&(r=0),r>=g&&g>0&&typeof t=="object")return xM(t)?"[Array]":"[Object]";var v=XV(i,r);if(typeof o>"u")o=[];else if(hR(o,t)>=0)return"[Circular]";function _(P,Z,K){if(Z&&(o=OV.call(o),o.push(Z)),K){var oe={depth:i.depth};return $l(i,"quoteStyle")&&(oe.quoteStyle=i.quoteStyle),e(P,oe,r+1,o)}return e(P,i,r+1,o)}if(typeof t=="function"&&!Lk(t)){var M=HV(t),C=bm(t,_);return"[Function"+(M?": "+M:" (anonymous)")+"]"+(C.length>0?" { "+da.call(C,", ")+" }":"")}if(pR(t)){var D=Sf?zl.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):NM.call(t);return typeof t=="object"&&!Sf?xp(D):D}if(KV(t)){for(var w="<"+Tk.call(String(t.nodeName)),S=t.attributes||[],N=0;N",w}if(xM(t)){if(t.length===0)return"[]";var A=bm(t,_);return v&&!JV(A)?"["+UM(A,v)+"]":"[ "+da.call(A,", ")+" ]"}if(xV(t)){var L=bm(t,_);return!("cause"in Error.prototype)&&"cause"in t&&!dR.call(t,"cause")?"{ ["+String(t)+"] "+da.call(wk.call("[cause]: "+_(t.cause),L),", ")+" }":L.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+da.call(L,", ")+" }"}if(typeof t=="object"&&s){if(Ak&&typeof t[Ak]=="function"&&PM)return PM(t,{depth:g-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(qV(t)){var j=[];return Mk&&Mk.call(t,function(P,Z){j.push(_(Z,t,!0)+" => "+_(P,t))}),Ok("Map",Ov.call(t),j,v)}if(jV(t)){var V=[];return Ik&&Ik.call(t,function(P){V.push(_(P,t))}),Ok("Set",Rv.call(t),V,v)}if(VV(t))return x1("WeakMap");if(WV(t))return x1("WeakSet");if(zV(t))return x1("WeakRef");if(FV(t))return xp(_(Number(t)));if($V(t))return xp(_(RM.call(t)));if(GV(t))return xp(kV.call(t));if(UV(t))return xp(_(String(t)));if(!PV(t)&&!Lk(t)){var x=bm(t,_),$=kk?kk(t)===Object.prototype:t instanceof Object||t.constructor===Object,z=t instanceof Object?"":"null prototype",G=!$&&hi&&Object(t)===t&&hi in t?VC.call(Su(t),8,-1):z?"Object":"",O=$||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",T=O+(G||z?"["+da.call(wk.call([],G||[],z||[]),": ")+"] ":"");return x.length===0?T+"{}":v?T+"{"+UM(x,v)+"}":T+"{ "+da.call(x,", ")+" }"}return String(t)};function fR(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function NV(e){return zl.call(String(e),/"/g,""")}function xM(e){return Su(e)==="[object Array]"&&(!hi||!(typeof e=="object"&&hi in e))}function PV(e){return Su(e)==="[object Date]"&&(!hi||!(typeof e=="object"&&hi in e))}function Lk(e){return Su(e)==="[object RegExp]"&&(!hi||!(typeof e=="object"&&hi in e))}function xV(e){return Su(e)==="[object Error]"&&(!hi||!(typeof e=="object"&&hi in e))}function UV(e){return Su(e)==="[object String]"&&(!hi||!(typeof e=="object"&&hi in e))}function FV(e){return Su(e)==="[object Number]"&&(!hi||!(typeof e=="object"&&hi in e))}function GV(e){return Su(e)==="[object Boolean]"&&(!hi||!(typeof e=="object"&&hi in e))}function pR(e){if(Sf)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!NM)return!1;try{return NM.call(e),!0}catch{}return!1}function $V(e){if(!e||typeof e!="object"||!RM)return!1;try{return RM.call(e),!0}catch{}return!1}var BV=Object.prototype.hasOwnProperty||function(e){return e in this};function $l(e,t){return BV.call(e,t)}function Su(e){return DV.call(e)}function HV(e){if(e.name)return e.name;var t=AV.call(EV.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function hR(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return gR(VC.call(e,0,t.maxStringLength),t)+r}var o=zl.call(zl.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,YV);return fR(o,"single",t)}function YV(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+LV.call(t.toString(16))}function xp(e){return"Object("+e+")"}function x1(e){return e+" { ? }"}function Ok(e,t,n,r){var o=r?UM(n,r):da.call(n,", ");return e+" ("+t+") {"+o+"}"}function JV(e){for(var t=0;t=0)return!1;return!0}function XV(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=da.call(Array(e.indent+1)," ");else return null;return{base:n,prev:da.call(Array(t+1),n)}}function UM(e,t){if(e.length===0)return"";var n=` `+t.prev+t.base;return n+da.call(e,","+n)+` `+t.prev}function bm(e,t){var n=xM(e),r=[];if(n){r.length=e.length;for(var o=0;o1;){var n=t.pop(),r=n.obj[n.prop];if(sc(r)){for(var o=[],i=0;i=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===fz.RFC1738&&(f===40||f===41)){u+=s.charAt(d);continue}if(f<128){u=u+ia[f];continue}if(f<2048){u=u+(ia[192|f>>6]+ia[128|f&63]);continue}if(f<55296||f>=57344){u=u+(ia[224|f>>12]+ia[128|f>>6&63]+ia[128|f&63]);continue}d+=1,f=65536+((f&1023)<<10|s.charCodeAt(d)&1023),u+=ia[240|f>>18]+ia[128|f>>12&63]+ia[128|f>>6&63]+ia[128|f&63]}return u},yz=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],o=0;o"u"&&(A=0)}if(typeof d=="function"?S=d(n,S):S instanceof Date?S=v(S):r==="comma"&&Ja(S)&&(S=tv.maybeMap(S,function(oe){return oe instanceof Date?v(oe):oe})),S===null){if(i)return u&&!C?u(n,ii.encoder,D,"key",_):n;S=""}if(Sz(S)||tv.isBuffer(S)){if(u){var V=C?n:u(n,ii.encoder,D,"key",_);return[M(V)+"="+M(u(S,ii.encoder,D,"value",_))]}return[M(n)+"="+M(String(S))]}var x=[];if(typeof S>"u")return x;var $;if(r==="comma"&&Ja(S))C&&u&&(S=tv.maybeMap(S,u)),$=[{value:S.length>0?S.join(",")||null:void 0}];else if(Ja(d))$=d;else{var z=Object.keys(S);$=f?z.sort(f):z}for(var G=o&&Ja(S)&&S.length===1?n+"[]":n,O=0;O<$.length;++O){var T=$[O],P=typeof T=="object"&&typeof T.value<"u"?T.value:S[T];if(!(s&&P===null)){var Z=Ja(S)?typeof r=="function"?r(G,T):G:G+(g?"."+T:"["+T+"]");w.set(t,A);var K=yR();K.set(G1,w),_R(x,e(P,Z,r,o,i,s,r==="comma"&&C&&Ja(S)?null:u,d,f,g,v,_,M,C,D,K))}}return x},Dz=function(t){if(!t)return ii;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||ii.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=dh.default;if(typeof t.format<"u"){if(!Cz.call(dh.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=dh.formatters[r],i=ii.filter;return(typeof t.filter=="function"||Ja(t.filter))&&(i=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:ii.addQueryPrefix,allowDots:typeof t.allowDots>"u"?ii.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ii.charsetSentinel,delimiter:typeof t.delimiter>"u"?ii.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:ii.encode,encoder:typeof t.encoder=="function"?t.encoder:ii.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:ii.encodeValuesOnly,filter:i,format:r,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:ii.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:ii.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ii.strictNullHandling}},Ez=function(e,t){var n=e,r=Dz(t),o,i;typeof r.filter=="function"?(i=r.filter,n=i("",n)):Ja(r.filter)&&(i=r.filter,o=i);var s=[];if(typeof n!="object"||n===null)return"";var u;t&&t.arrayFormat in Rk?u=t.arrayFormat:t&&"indices"in t?u=t.indices?"indices":"repeat":u="indices";var d=Rk[u];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=d==="comma"&&t&&t.commaRoundTrip;o||(o=Object.keys(n)),r.sort&&o.sort(r.sort);for(var g=yR(),v=0;v0?C+M:""},kf=vR,FM=Object.prototype.hasOwnProperty,Az=Array.isArray,wo={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:kf.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Lz=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},bR=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Oz="utf8=%26%2310003%3B",Rz="utf8=%E2%9C%93",Nz=function(t,n){var r={__proto__:null},o=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=n.parameterLimit===1/0?void 0:n.parameterLimit,s=o.split(n.delimiter,i),u=-1,d,f=n.charset;if(n.charsetSentinel)for(d=0;d-1&&(C=Az(C)?[C]:C),FM.call(r,M)?r[M]=kf.combine(r[M],C):r[M]=C}return r},Pz=function(e,t,n,r){for(var o=r?t:bR(t,n),i=e.length-1;i>=0;--i){var s,u=e[i];if(u==="[]"&&n.parseArrays)s=[].concat(o);else{s=n.plainObjects?Object.create(null):{};var d=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,f=parseInt(d,10);!n.parseArrays&&d===""?s={0:o}:!isNaN(f)&&u!==d&&String(f)===d&&f>=0&&n.parseArrays&&f<=n.arrayLimit?(s=[],s[f]=o):d!=="__proto__"&&(s[d]=o)}o=s}return o},xz=function(t,n,r,o){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,d=r.depth>0&&s.exec(i),f=d?i.slice(0,d.index):i,g=[];if(f){if(!r.plainObjects&&FM.call(Object.prototype,f)&&!r.allowPrototypes)return;g.push(f)}for(var v=0;r.depth>0&&(d=u.exec(i))!==null&&v"u"?wo.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?wo.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:wo.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:wo.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:wo.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:wo.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:wo.comma,decoder:typeof t.decoder=="function"?t.decoder:wo.decoder,delimiter:typeof t.delimiter=="string"||kf.isRegExp(t.delimiter)?t.delimiter:wo.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:wo.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:wo.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:wo.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:wo.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:wo.strictNullHandling}},Fz=function(e,t){var n=Uz(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?Nz(e,n):e,o=n.plainObjects?Object.create(null):{},i=Object.keys(r),s=0;s-1};function jf(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function KC(e){return typeof e!="string"&&(e=String(e)),e}function YC(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return Ci.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Io(e){this.map={},e instanceof Io?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}Io.prototype.append=function(e,t){e=jf(e),t=KC(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};Io.prototype.delete=function(e){delete this.map[jf(e)]};Io.prototype.get=function(e){return e=jf(e),this.has(e)?this.map[e]:null};Io.prototype.has=function(e){return this.map.hasOwnProperty(jf(e))};Io.prototype.set=function(e,t){this.map[jf(e)]=KC(t)};Io.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)};Io.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),YC(e)};Io.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),YC(e)};Io.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),YC(e)};Ci.iterable&&(Io.prototype[Symbol.iterator]=Io.prototype.entries);function $1(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function IR(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function zz(e){var t=new FileReader,n=IR(t);return t.readAsArrayBuffer(e),n}function jz(e){var t=new FileReader,n=IR(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=r?r[1]:"utf-8";return t.readAsText(e,o),n}function Wz(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}function Zc(e,t){if(!(this instanceof Zc))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof Zc){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Io(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new Io(t.headers)),this.method=Yz(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in Vo){var i=new AbortController;return i.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Zc.prototype.clone=function(){return new Zc(this,{body:this._bodyInit})};function Jz(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),o=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(i))}}),t}function Xz(e){var t=new Io,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(` `)===0?r.substr(1,r.length):r}).forEach(function(r){var o=r.split(":"),i=o.shift().trim();if(i){var s=o.join(":").trim();try{t.append(i,s)}catch(u){console.warn("Response "+u.message)}}}),t}CR.call(Zc.prototype);function wa(e,t){if(!(this instanceof wa))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Io(t.headers),this.url=t.url||"",this._initBody(e)}CR.call(wa.prototype);wa.prototype.clone=function(){return new wa(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Io(this.headers),url:this.url})};wa.error=function(){var e=new wa(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var Zz=[301,302,303,307,308];wa.redirect=function(e,t){if(Zz.indexOf(t)===-1)throw new RangeError("Invalid status code");return new wa(null,{status:t,headers:{location:e}})};var ac=Vo.DOMException;try{new ac}catch{ac=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},ac.prototype=Object.create(Error.prototype),ac.prototype.constructor=ac}function TR(e,t){return new Promise(function(n,r){var o=new Zc(e,t);if(o.signal&&o.signal.aborted)return r(new ac("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var f={status:i.status,statusText:i.statusText,headers:Xz(i.getAllResponseHeaders()||"")};f.url="responseURL"in i?i.responseURL:f.headers.get("X-Request-URL");var g="response"in i?i.response:i.responseText;setTimeout(function(){n(new wa(g,f))},0)},i.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},i.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},i.onabort=function(){setTimeout(function(){r(new ac("Aborted","AbortError"))},0)};function u(f){try{return f===""&&Vo.location.href?Vo.location.href:f}catch{return f}}if(i.open(o.method,u(o.url),!0),o.credentials==="include"?i.withCredentials=!0:o.credentials==="omit"&&(i.withCredentials=!1),"responseType"in i&&(Ci.blob?i.responseType="blob":Ci.arrayBuffer&&(i.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Io||Vo.Headers&&t.headers instanceof Vo.Headers)){var d=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){d.push(jf(f)),i.setRequestHeader(f,KC(t.headers[f]))}),o.headers.forEach(function(f,g){d.indexOf(g)===-1&&i.setRequestHeader(g,f)})}else o.headers.forEach(function(f,g){i.setRequestHeader(g,f)});o.signal&&(o.signal.addEventListener("abort",s),i.onreadystatechange=function(){i.readyState===4&&o.signal.removeEventListener("abort",s)}),i.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}TR.polyfill=!0;Vo.fetch||(Vo.fetch=TR,Vo.Headers=Io,Vo.Request=Zc,Vo.Response=wa);self.fetch.bind(self);function xk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function qi(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nv(e,t,n){return SR()?nv=Reflect.construct:nv=function(o,i,s){var u=[null];u.push.apply(u,i);var d=Function.bind.apply(o,u),f=new d;return s&&Yh(f,s.prototype),f},nv.apply(null,arguments)}function ej(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Nv(e){var t=typeof Map=="function"?new Map:void 0;return Nv=function(r){if(r===null||!ej(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,o)}function o(){return nv(r,arguments,Kh(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Yh(o,r)},Nv(e)}function tj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nj(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tj(e)}function kR(e){var t=SR();return function(){var r=Kh(e),o;if(t){var i=Kh(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return nj(this,o)}}function pa(e){return rj(e)||oj(e)||ij(e)||sj()}function rj(e){if(Array.isArray(e))return GM(e)}function oj(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ij(e,t){if(e){if(typeof e=="string")return GM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GM(e,t)}}function GM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},o=!1,i=!1,s=!1;if(typeof r=="number"?(process&&process.env,o=!0,i=!1):lu(r)==="object"&&r&&(i=r.global||!1,o=r.core||!1,s=r.defaultInstance||!1),i){e.globalMiddlewares.splice(e.globalMiddlewares.length-e.defaultGlobalMiddlewaresLength,0,n);return}if(o){e.coreMiddlewares.splice(e.coreMiddlewares.length-e.defaultCoreMiddlewaresLength,0,n);return}if(s){this.defaultMiddlewares.push(n);return}this.middlewares.push(n)}},{key:"execute",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=aj([].concat(pa(this.middlewares),pa(this.defaultMiddlewares),pa(e.globalMiddlewares),pa(e.coreMiddlewares)));return r(n)}}]),e}();Ws.globalMiddlewares=[];Ws.defaultGlobalMiddlewaresLength=0;Ws.coreMiddlewares=[];Ws.defaultCoreMiddlewaresLength=0;var lj=function(){function e(t){vg(this,e),this.cache=new Map,this.timer={},this.extendOptions(t)}return JC(e,[{key:"extendOptions",value:function(n){this.maxCache=n.maxCache||0}},{key:"get",value:function(n){return this.cache.get(JSON.stringify(n))}},{key:"set",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var s=pa(this.cache.keys())[0];this.cache.delete(s),this.timer[s]&&clearTimeout(this.timer[s])}var u=JSON.stringify(n);this.cache.set(u,r),i>0&&(this.timer[u]=setTimeout(function(){o.cache.delete(u),delete o.timer[u]},i))}},{key:"delete",value:function(n){var r=JSON.stringify(n);return delete this.timer[r],this.cache.delete(r)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),e}(),DR=function(e){wR(n,e);var t=kR(n);function n(r,o){var i,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return vg(this,n),i=t.call(this,r),i.name="RequestError",i.request=o,i.type=s,i}return n}(Nv(Error)),Kp=function(e){wR(n,e);var t=kR(n);function n(r,o,i,s){var u,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return vg(this,n),u=t.call(this,o||r.statusText),u.name="ResponseError",u.data=i,u.response=r,u.request=s,u.type=d,u}return n}(Nv(Error));function uj(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e,"GBK")})}function Fk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;try{return JSON.parse(e)}catch{if(t)throw new Kp(n,"JSON.parse fail",e,r,"ParseError")}return e}function cj(e,t,n){return new Promise(function(r,o){setTimeout(function(){o(new DR(t||"timeout of ".concat(e,"ms exceeded"),n,"Timeout"))},e)})}function Gk(e){return new Promise(function(t,n){e.cancelToken&&e.cancelToken.promise.then(function(r){n(r)})})}var dj=Object.prototype.toString;function ER(){var e;return typeof process<"u"&&dj.call(process)==="[object process]"&&(e="NODE"),typeof XMLHttpRequest<"u"&&(e="BROWSER"),e}function $M(e){return lu(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]"}function AR(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function fj(e){return lu(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $k(e){return e!==null&&lu(e)==="object"}function Bk(e,t){if(e)if(lu(e)!=="object"&&(e=[e]),$M(e))for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=n.prefix,o=n.suffix;return r&&(t="".concat(r).concat(t)),o&&(t="".concat(t).concat(o)),{url:t,options:n}};function hj(e,t){var n=t.method,r=n===void 0?"get":n;return r.toLowerCase()==="get"}function gj(e,t){if(!e)return t();var n=e.req;n=n===void 0?{}:n;var r=n.options,o=r===void 0?{}:r,i=n.url,s=i===void 0?"":i,u=e.cache,d=e.responseInterceptors,f=o.timeout,g=f===void 0?0:f,v=o.timeoutMessage,_=o.__umiRequestCoreType__,M=_===void 0?"normal":_,C=o.useCache,D=C===void 0?!1:C,w=o.method,S=w===void 0?"get":w,N=o.params,A=o.ttl,L=o.validateCache,j=L===void 0?hj:L;if(M!=="normal")return process&&process.env,t();var V=fetch;if(!V)throw new Error("Global fetch not exist!");var x=ER()==="BROWSER",$=j(s,o)&&D&&x;if($){var z=u.get({url:s,params:N,method:S});if(z)return z=z.clone(),z.useCache=!0,e.res=z,t()}var G;return g>0?G=Promise.race([Gk(o),V(s,o),cj(g,v,e.req)]):G=Promise.race([Gk(o),V(s,o)]),d.forEach(function(O){G=G.then(function(T){var P=typeof T.clone=="function"?T.clone():T;return O(P,o)})}),G.then(function(O){if($&&O.status===200){var T=O.clone();T.useCache=!0,u.set({url:s,params:N,method:S},T,A)}return e.res=O,t()})}function mj(e,t){var n;return t().then(function(){if(e){var r=e.res,o=r===void 0?{}:r,i=e.req,s=i===void 0?{}:i,u=s||{},d=u.options;d=d===void 0?{}:d;var f=d.responseType,g=f===void 0?"json":f,v=d.charset,_=v===void 0?"utf8":v;d.getResponse;var M=d.throwErrIfParseFail,C=M===void 0?!1:M,D=d.parseResponse,w=D===void 0?!0:D;if(w&&!(!o||!o.clone)){if(n=ER()==="BROWSER"?o.clone():o,n.useCache=o.useCache||!1,_==="gbk")try{return o.blob().then(uj).then(function(S){return Fk(S,!1,n,s)})}catch(S){throw new Kp(n,S.message,null,s,"ParseError")}else if(g==="json")return o.text().then(function(S){return Fk(S,C,n,s)});try{return o[g]()}catch{throw new Kp(n,"responseType not support",null,s,"ParseError")}}}}).then(function(r){if(e){e.res;var o=e.req,i=o===void 0?{}:o,s=i||{},u=s.options;u=u===void 0?{}:u;var d=u.getResponse,f=d===void 0?!1:d;if(n){if(n.status>=200&&n.status<300){if(f){e.res={data:r,response:n};return}e.res=r;return}throw new Kp(n,"http error",r,i,"HttpError")}}}).catch(function(r){if(r instanceof DR||r instanceof Kp)throw r;var o=e.req,i=e.res;throw r.request=r.request||o,r.response=r.response||i,r.type=r.type||r.name,r.data=r.data||void 0,r})}function vj(e,t){if(!e)return t();var n=e.req;n=n===void 0?{}:n;var r=n.options,o=r===void 0?{}:r,i=o.method,s=i===void 0?"get":i;if(["post","put","patch","delete"].indexOf(s.toLowerCase())===-1)return t();var u=o.requestType,d=u===void 0?"json":u,f=o.data;if(f){var g=Object.prototype.toString.call(f);g==="[object Object]"||g==="[object Array]"?d==="json"?(o.headers=qi({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},o.headers),o.body=JSON.stringify(f)):d==="form"&&(o.headers=qi({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},o.headers),o.body=BM(f)):(o.headers=qi({Accept:"application/json"},o.headers),o.body=f)}return e.req.options=o,t()}function yj(e,t){var n,r;if(e)if(t)n=t(e);else if(AR(e))n=e.toString();else if($M(e))r=[],Bk(e,function(i){i===null||typeof i>"u"?r.push(i):r.push($k(i)?JSON.stringify(i):i)}),n=BM(r);else{r={},Bk(e,function(i,s){var u=i;i===null||typeof i>"u"?r[s]=i:fj(i)?u=i.toISOString():$M(i)?u=i:$k(i)&&(u=JSON.stringify(i)),r[s]=u});var o=BM(r);n=o}return n}function _j(e,t){if(!e)return t();var n=e.req;n=n===void 0?{}:n;var r=n.options,o=r===void 0?{}:r,i=o.paramsSerializer,s=o.params,u=e.req;u=u===void 0?{}:u;var d=u.url,f=d===void 0?"":d;o.method=o.method?o.method.toUpperCase():"GET",o.credentials=o.credentials||"same-origin";var g=yj(s,i);if(e.req.originUrl=f,g){var v=f.indexOf("?")!==-1?"&":"?";e.req.url="".concat(f).concat(v).concat(g)}return e.req.options=o,t()}var OR=[vj,_j,mj],RR=[gj];Ws.globalMiddlewares=OR;Ws.defaultGlobalMiddlewaresLength=OR.length;Ws.coreMiddlewares=RR;Ws.defaultCoreMiddlewaresLength=RR.length;var fh=function(){function e(t){vg(this,e),this.onion=new Ws([]),this.fetchIndex=0,this.mapCache=new lj(t),this.initOptions=t,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return JC(e,[{key:"use",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1};return this.onion.use(n,r),this}},{key:"extendOptions",value:function(n){this.initOptions=LR(this.initOptions,n),this.mapCache.extendOptions(n)}},{key:"dealRequestInterceptors",value:function(n){var r=function(s,u){return s.then(function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n.req.url=d.url||n.req.url,n.req.options=d.options||n.req.options,u(n.req.url,n.req.options)})},o=[].concat(pa(e.requestInterceptors),pa(this.instanceRequestInterceptors));return o.reduce(r,Promise.resolve()).then(function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n.req.url=i.url||n.req.url,n.req.options=i.options||n.req.options,Promise.resolve()})}},{key:"request",value:function(n,r){var o=this,i=this.onion,s={req:{url:n,options:qi(qi({},r),{},{url:n})},res:null,cache:this.mapCache,responseInterceptors:[].concat(pa(e.responseInterceptors),pa(this.instanceResponseInterceptors))};if(typeof n!="string")throw new Error("url MUST be a string");return new Promise(function(u,d){o.dealRequestInterceptors(s).then(function(){return i.execute(s)}).then(function(){u(s.res)}).catch(function(f){var g=s.req.options.errorHandler;if(g)try{var v=g(f);u(v)}catch(_){d(_)}else d(f)})})}}],[{key:"requestUse",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof n!="function")throw new TypeError("Interceptor must be function!");r.global?e.requestInterceptors.push(n):this.instanceRequestInterceptors.push(n)}},{key:"responseUse",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof n!="function")throw new TypeError("Interceptor must be function!");r.global?e.responseInterceptors.push(n):this.instanceResponseInterceptors.push(n)}}]),e}();fh.requestInterceptors=[pj];fh.responseInterceptors=[];function zy(e){this.message=e}zy.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"};zy.prototype.__CANCEL__=!0;function Pv(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var n=this;e(function(o){n.reason||(n.reason=new zy(o),t(n.reason))})}Pv.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Pv.source=function(){var t,n=new Pv(function(o){t=o});return{token:n,cancel:t}};function bj(e){return!!(e&&e.__CANCEL__)}var XC=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=new fh(t),r=function(s){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=LR(n.initOptions,u);return n.request(s,d)};r.use=n.use.bind(n),r.fetchIndex=n.fetchIndex,r.interceptors={request:{use:fh.requestUse.bind(n)},response:{use:fh.responseUse.bind(n)}};var o=["get","post","delete","put","patch","head","options","rpc"];return o.forEach(function(i){r[i]=function(s,u){return r(s,qi(qi({},u),{},{method:i}))}}),r.Cancel=zy,r.CancelToken=Pv,r.isCancel=bj,r.extendOptions=n.extendOptions.bind(n),r.middlewares={instance:n.onion.middlewares,defaultInstance:n.onion.defaultMiddlewares,global:Ws.globalMiddlewares,core:Ws.coreMiddlewares},r},Mj=function(t){return XC(t)};XC({parseResponse:!1});XC({});var xv={exports:{}};xv.exports;(function(e,t){var n=9007199254740991,r="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",s="[object Map]",u="[object Object]",d="[object Promise]",f="[object Set]",g="[object WeakMap]",v="[object DataView]",_=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,C=typeof pi=="object"&&pi&&pi.Object===Object&&pi,D=typeof self=="object"&&self&&self.Object===Object&&self,w=C||D||Function("return this")(),S=t&&!t.nodeType&&t,N=S&&!0&&e&&!e.nodeType&&e,A=N&&N.exports===S;function L(Fe,it){return Fe==null?void 0:Fe[it]}function j(Fe){var it=!1;if(Fe!=null&&typeof Fe.toString!="function")try{it=!!(Fe+"")}catch{}return it}function V(Fe,it){return function(Tt){return Fe(it(Tt))}}var x=Function.prototype,$=Object.prototype,z=w["__core-js_shared__"],G=function(){var Fe=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||"");return Fe?"Symbol(src)_1."+Fe:""}(),O=x.toString,T=$.hasOwnProperty,P=$.toString,Z=RegExp("^"+O.call(T).replace(_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K=A?w.Buffer:void 0,oe=$.propertyIsEnumerable,J=K?K.isBuffer:void 0,ie=V(Object.keys,Object),pe=W(w,"DataView"),ue=W(w,"Map"),de=W(w,"Promise"),Y=W(w,"Set"),re=W(w,"WeakMap"),fe=!oe.call({valueOf:1},"valueOf"),Ae=ce(pe),ye=ce(ue),le=ce(de),Q=ce(Y),ve=ce(re);function Le(Fe){return P.call(Fe)}function me(Fe){if(!Be(Fe)||se(Fe))return!1;var it=ne(Fe)||j(Fe)?Z:M;return it.test(ce(Fe))}function W(Fe,it){var Tt=L(Fe,it);return me(Tt)?Tt:void 0}var te=Le;(pe&&te(new pe(new ArrayBuffer(1)))!=v||ue&&te(new ue)!=s||de&&te(de.resolve())!=d||Y&&te(new Y)!=f||re&&te(new re)!=g)&&(te=function(Fe){var it=P.call(Fe),Tt=it==u?Fe.constructor:void 0,mn=Tt?ce(Tt):void 0;if(mn)switch(mn){case Ae:return v;case ye:return s;case le:return d;case Q:return f;case ve:return g}return it});function se(Fe){return!!G&&G in Fe}function Te(Fe){var it=Fe&&Fe.constructor,Tt=typeof it=="function"&&it.prototype||$;return Fe===Tt}function ce(Fe){if(Fe!=null){try{return O.call(Fe)}catch{}try{return Fe+""}catch{}}return""}function Se(Fe){return He(Fe)&&T.call(Fe,"callee")&&(!oe.call(Fe,"callee")||P.call(Fe)==r)}var Pe=Array.isArray;function xe(Fe){return Fe!=null&&_e(Fe.length)&&!ne(Fe)}function He(Fe){return je(Fe)&&xe(Fe)}var Ie=J||lt;function q(Fe){if(xe(Fe)&&(Pe(Fe)||typeof Fe=="string"||typeof Fe.splice=="function"||Ie(Fe)||Se(Fe)))return!Fe.length;var it=te(Fe);if(it==s||it==f)return!Fe.size;if(fe||Te(Fe))return!ie(Fe).length;for(var Tt in Fe)if(T.call(Fe,Tt))return!1;return!0}function ne(Fe){var it=Be(Fe)?P.call(Fe):"";return it==o||it==i}function _e(Fe){return typeof Fe=="number"&&Fe>-1&&Fe%1==0&&Fe<=n}function Be(Fe){var it=typeof Fe;return!!Fe&&(it=="object"||it=="function")}function je(Fe){return!!Fe&&typeof Fe=="object"}function lt(){return!1}e.exports=q})(xv,xv.exports);var Ij=xv.exports,Cj="[object Object]";function Tj(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function wj(e,t){return function(n){return e(t(n))}}var Sj=Function.prototype,NR=Object.prototype,PR=Sj.toString,kj=NR.hasOwnProperty,Dj=PR.call(Object),Ej=NR.toString,Aj=wj(Object.getPrototypeOf,Object);function Lj(e){return!!e&&typeof e=="object"}function Oj(e){if(!Lj(e)||Ej.call(e)!=Cj||Tj(e))return!1;var t=Aj(e);if(t===null)return!0;var n=kj.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&PR.call(n)==Dj}var Rj=Oj,Uv={exports:{}};Uv.exports;(function(e,t){var n=200,r="Expected a function",o="__lodash_hash_undefined__",i=1,s=2,u=1/0,d=9007199254740991,f="[object Arguments]",g="[object Array]",v="[object Boolean]",_="[object Date]",M="[object Error]",C="[object Function]",D="[object GeneratorFunction]",w="[object Map]",S="[object Number]",N="[object Object]",A="[object Promise]",L="[object RegExp]",j="[object Set]",V="[object String]",x="[object Symbol]",$="[object WeakMap]",z="[object ArrayBuffer]",G="[object DataView]",O="[object Float32Array]",T="[object Float64Array]",P="[object Int8Array]",Z="[object Int16Array]",K="[object Int32Array]",oe="[object Uint8Array]",J="[object Uint8ClampedArray]",ie="[object Uint16Array]",pe="[object Uint32Array]",ue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,de=/^\w*$/,Y=/^\./,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fe=/[\\^$.*+?()[\]{}|]/g,Ae=/\\(\\)?/g,ye=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,Q={};Q[O]=Q[T]=Q[P]=Q[Z]=Q[K]=Q[oe]=Q[J]=Q[ie]=Q[pe]=!0,Q[f]=Q[g]=Q[z]=Q[v]=Q[G]=Q[_]=Q[M]=Q[C]=Q[w]=Q[S]=Q[N]=Q[L]=Q[j]=Q[V]=Q[$]=!1;var ve=typeof pi=="object"&&pi&&pi.Object===Object&&pi,Le=typeof self=="object"&&self&&self.Object===Object&&self,me=ve||Le||Function("return this")(),W=t&&!t.nodeType&&t,te=W&&!0&&e&&!e.nodeType&&e,se=te&&te.exports===W,Te=se&&ve.process,ce=function(){try{return Te&&Te.binding("util")}catch{}}(),Se=ce&&ce.isTypedArray;function Pe(he,ke){for(var Ke=-1,ft=he?he.length:0;++Ke-1}function Oa(he,ke){var Ke=this.__data__,ft=ds(Ke,he);return ft<0?Ke.push([he,ke]):Ke[ft][1]=ke,this}Gt.prototype.clear=yl,Gt.prototype.delete=Zs,Gt.prototype.get=_l,Gt.prototype.has=bl,Gt.prototype.set=Oa;function Zo(he){var ke=-1,Ke=he?he.length:0;for(this.clear();++keVn))return!1;var Yr=Rt.get(he);if(Yr&&Rt.get(ke))return Yr==ke;var Br=-1,Co=!0,wr=rn&i?new Qs:void 0;for(Rt.set(he,ke),Rt.set(ke,he);++Br-1&&he%1==0&&he-1&&he%1==0&&he<=d}function xa(he){var ke=typeof he;return!!he&&(ke=="object"||ke=="function")}function ei(he){return!!he&&typeof he=="object"}function so(he){return typeof he=="symbol"||ei(he)&&vn.call(he)==x}var Tr=Se?q(Se):ap;function ta(he){return he==null?"":Go(he)}function Je(he,ke,Ke){var ft=he==null?void 0:Ls(he,ke);return ft===void 0?Ke:ft}function mi(he,ke){return he!=null&&Dg(he,ke,Ri)}function Rs(he){return cp(he)?Ge(he):Cl(he)}function Hu(he,ke,Ke){var ft=ps(he)||Tr(he);if(ke=ea(ke),Ke==null)if(ft||xa(he)){var rn=he.constructor;ft?Ke=ps(he)?new rn:[]:Ke=Ye(rn)?Fo(ln(he)):{}}else Ke={};return(ft?Pe:_d)(he,function(Rt,xn,Vn){return ke(Ke,Rt,xn,Vn)}),Ke}function fp(he){return he}function pp(he){return Fu(he)?He($u(he)):Pu(he)}e.exports=Hu})(Uv,Uv.exports);var Nj=Uv.exports;const Pj=Ij,qk=Rj,xj=Nj;var Uj=function e(t,{cleanKeys:n=[],cleanValues:r=[],emptyArrays:o=!0,emptyObjects:i=!0,emptyStrings:s=!0,NaNValues:u=!1,nullValues:d=!0,undefinedValues:f=!0}={}){return xj(t,(g,v,_)=>{if(!n.includes(_)&&((Array.isArray(v)||qk(v))&&(v=e(v,{NaNValues:u,cleanKeys:n,cleanValues:r,emptyArrays:o,emptyObjects:i,emptyStrings:s,nullValues:d,undefinedValues:f})),!r.includes(v)&&!(i&&qk(v)&&Pj(v))&&!(o&&Array.isArray(v)&&!v.length)&&!(s&&v==="")&&!(u&&Number.isNaN(v))&&!(d&&v===null)&&!(f&&v===void 0))){if(Array.isArray(g))return g.push(v);g[_]=v}})};const Vk=qf(Uj),Jo=Mj({hideLoading:!0,timeout:2e4,timeoutMessage:"请求超时"});Jo.interceptors.request.use((e,t)=>{const n=sessionStorage.getItem("Authorization")||"",r={};return n&&(r.Authorization=n),{url:e,options:{...t,params:Vk(t.params),data:Vk(t.data),headers:{...t.headers,...r}}}},{global:!1});Jo.interceptors.response.use(async e=>{if(e.status>299||e.status<200){const n="服务器错误,状态码"+e.status;throw new Error(n)}const t=await e.clone().json();if(t.code===401||t.code===4001||t.code==403||t.code==5e3){sessionStorage.removeItem("Authorization");return}if(t.code!==200&&t.errCode!==0){const n=t.msg||t.message||"处理失败,请重试";throw t.code===403||t.code,new Error(n)}return e},{global:!1});const Fj=sessionStorage.getItem("platform")||"classroom",Oi=Fj=="classroom"?"/edu-app":"/api-backend",Gj=e=>Jo.post(Oi+"/imGroup/page",{data:e}),xR=e=>Jo.post(Oi+"/imUserFriend/page",{data:e}),$j=e=>Jo.post(Oi+"/imGroup/changeGroupOwner",{data:e}),Bj=e=>Jo.post(Oi+"/imGroupNotice/page",{data:e}),Hj=e=>Jo.post(Oi+"/imGroupNotice/save",{data:e}),qj=e=>Jo.post(Oi+"/imGroupNotice/remove",{requestType:"form",data:e}),zk=e=>Jo.post(Oi+"/imGroupNotice/update",{data:e}),UR=e=>Jo.get(Oi+"/imGroup/detail/"+e.id),jk=e=>Jo.post(Oi+"/imGroupMember/page",{data:e}),Vj=e=>Jo.post(Oi+"/imGroupMember/userDetail",{data:e}),zj=e=>Jo.post(Oi+"/imGroup/quit/"+e.id,{data:e}),jj=e=>Jo.post(Oi+"/imGroup/muteAll",{data:e}),Wj=e=>Jo.post(Oi+"/imGroupMember/groupMute",{data:e}),Kj=e=>Jo.post(Oi+"/imGroupMember/saveImAll",{data:e}),Yj=e=>Jo.post(Oi+"/imGroup/dismiss/"+e.id,{data:e}),Jj=ot({components:{Slider:iR},props:{data:{type:Object,default:()=>({})},isAuth:{type:Boolean,default:!1}},setup(e,t){const n=zt({groupProfile:{},total:0,id:"",title:"",input:"",topFlag:!0,loading:!1,groupList:[],isEdit:!1,page:1,rows:20}),r=Ne(),o=async()=>{n.loading=!0;try{let v=await Bj({groupId:n.groupProfile.groupID,page:n.page,rows:n.rows});const _=v.data.rows||[];n.total=v.data.total||0,_.length>0&&(n.groupList=[...n.groupList,..._])}catch{}n.loading=!1},i=()=>{n.page=n.page+1,o()};nn(()=>{n.groupProfile=e.data,o()});const s=v=>({TEACHER:"音乐老师",ADMIN:"管理员",HEADMASTER:"校长"})[v],u=async(v,_,M)=>{var C;try{_==="edit"?(t.emit("changeStatus","edit"),n.isEdit=!0,n.title=v.title,n.input=v.content,n.topFlag=v.topFlag,n.id=v.id):_==="top"?(await zk({groupId:n.groupProfile.groupID,topFlag:!0,id:v.id}),n.page=1,n.groupList=[],o()):_==="delete"?(await qj({id:v.id}),n.page=1,n.groupList=[],o()):_==="add"&&(n.isEdit=!0,n.title="",n.input="",n.topFlag=!0,n.id="",t.emit("changeStatus","add"))}catch{}(C=r.value[M])==null||C.setShow(!1)},d=async()=>{if(!(!n.title||!n.input))try{n.id?await zk({groupId:n.groupProfile.groupID,topFlag:n.topFlag,title:n.title,content:n.input,id:n.id}):await Hj({groupId:n.groupProfile.groupID,title:n.title,content:n.input,topFlag:n.topFlag}),n.isEdit=!1,t.emit("changeStatus","submit"),n.page=1,n.groupList=[],o()}catch{}},f=v=>{console.log(v,"onTopFlag"),n.topFlag=v},g=()=>{n.isEdit=!1};return t.expose({onCloseEdit:g}),{...Jt(n),popoverRef:r,formatJobType:s,onMore:i,onTopFlag:f,onOperation:u,onSubmit:d}}});const Wf=e=>(Mr("data-v-d3ed41e1"),e=e(),Ir(),e),Xj={class:"notification"},Zj={class:"section"},Qj={class:"userInfo"},eW=["src"],tW={class:"username"},nW={class:"users"},rW={class:"name"},oW={class:"tag"},iW={class:"userTime"},sW={class:"time"},aW={key:0,class:"tag"},lW=Wf(()=>B("i",{class:"iconMorePoint iconMore"},null,-1)),uW={class:"p-list"},cW=["onClick"],dW=["onClick"],fW=["onClick"],pW={class:"section-content"},hW={class:"content"},gW={key:0,class:"theEmpty"},mW=Wf(()=>B("img",{class:"emptyImg",src:ud},null,-1)),vW=Wf(()=>B("p",null,"暂无群公告",-1)),yW={key:2,class:"edit-notification"},_W={class:"input-section"},bW=Wf(()=>B("div",{class:"input-title"},[B("i",{class:"iconNotifit1"}),B("span",null,"公告标题")],-1)),MW={class:"input-content"},IW={class:"input-section"},CW=Wf(()=>B("div",{class:"input-title"},[B("i",{class:"iconNotifit2"}),B("span",null,"公告内容")],-1)),TW={class:"input-content notice-content"},wW={class:"input-section"},SW={class:"input-title input-slider"},kW=Wf(()=>B("span",null,"设置为置顶",-1));function DW(e,t,n,r,o,i){const s=Yt("n-popover"),u=Yt("n-button"),d=Yt("n-tooltip"),f=Yt("n-input"),g=Yt("Slider");return X(),ae("main",Xj,[B("div",Zj,[(X(!0),ae(dt,null,qt(e.groupList,(v,_)=>(X(),ae("div",{class:"section-item",key:_},[B("div",Qj,[B("img",{class:"img",src:v.avatar},null,8,eW),B("div",tW,[B("div",nW,[B("span",rW,Ee(v.username),1),B("span",oW,Ee(e.formatJobType(v.clientType)),1)]),B("div",iW,[B("span",sW,Ee(v.createTime),1),v.topFlag?(X(),ae("span",aW,"置顶")):Ce("",!0)])]),e.isAuth?(X(),It(s,{key:0,trigger:"click",ref_for:!0,ref:"popoverRef",to:!1,placement:"bottom-end",width:"160px","show-arrow":!1,class:"popoverContainer"},{trigger:xt(()=>[lW]),default:xt(()=>[B("div",uW,[B("div",{class:"p-item",onClick:M=>e.onOperation(v,"edit",_)}," 编辑公告 ",8,cW),B("div",{class:"p-item",onClick:M=>e.onOperation(v,"top",_)}," 设为置顶 ",8,dW),B("div",{class:"p-item p-red",onClick:M=>e.onOperation(v,"delete",_)}," 删除公告 ",8,fW)])]),_:2},1536)):Ce("",!0)]),B("div",pW,[B("h2",null,Ee(v.title),1),B("div",hW,Ee(v.content),1)])]))),128)),e.groupList.lengthe.onMore&&e.onMore(...v))}," 查看更多 ")):Ce("",!0)]),!e.loading&&e.groupList.length<=0?(X(),ae("div",gW,[mW,vW,St(u,{round:"",type:"info",class:"notificationBtn",onClick:t[1]||(t[1]=v=>e.onOperation({},"add"))},{default:xt(()=>[jr("发布公告")]),_:1})])):Ce("",!0),e.groupList.length>0&&!e.isEdit?(X(),It(d,{key:1,trigger:"hover","show-arrow":!1,class:"toolsNotifi"},{trigger:xt(()=>[B("div",{class:"iconNotifiAdd",onClick:t[2]||(t[2]=v=>e.onOperation({},"add"))})]),default:xt(()=>[jr(" 发布公告 ")]),_:1})):Ce("",!0),e.isEdit?(X(),ae("div",yW,[B("div",_W,[bW,B("div",MW,[St(f,{value:e.title,"onUpdate:value":t[3]||(t[3]=v=>e.title=v),style:{"--n-caret-color":"#198cfe","--n-border-hover":"1px solid #198cfe","--n-border-focus":"1px solid #198cfe","--n-loading-color":"#198cfe","--n-box-shadow-focus":"0 0 0 2px rgba(25 140 254, 0.2)"},type:"textarea",placeholder:"请输入公告标题","show-count":"",maxlength:50},null,8,["value"])])]),B("div",IW,[CW,B("div",TW,[St(f,{value:e.input,"onUpdate:value":t[4]||(t[4]=v=>e.input=v),style:{"--n-caret-color":"#198cfe","--n-border-hover":"1px solid #198cfe","--n-border-focus":"1px solid #198cfe","--n-loading-color":"#198cfe","--n-box-shadow-focus":"0 0 0 2px rgba(25 140 254, 0.2)"},type:"textarea",placeholder:"请输入公告内容",rows:10,"show-count":"",maxlength:200},null,8,["value"])])]),B("div",wW,[B("div",SW,[kW,St(g,{open:e.topFlag,onChange:e.onTopFlag},null,8,["open","onChange"])])]),B("div",{class:st(["submitBtn",!e.title||!e.input?"disabled":""]),onClick:t[5]||(t[5]=(...v)=>e.onSubmit&&e.onSubmit(...v))}," 发布 ",2)])):Ce("",!0)])}const EW=jt(Jj,[["render",DW],["__scopeId","data-v-d3ed41e1"]]),AW=ot({components:{},props:{list:{type:Array,default:()=>[]},total:{type:Number,default:()=>0},isShowDel:{type:Boolean,default:()=>!1},self:{type:Object,default:()=>({})}},setup(e,t){vt.TYPES;const n=zt({total:0,list:[],isShowDel:!1,self:{}});nn(()=>{n.total=e.total,n.isShowDel=e.isShowDel,n.list=e.list,n.self=e.self});const r=d=>{const{t:f}=window.TUIKitTUICore.config.i18n.useI18n();let g="";return d.imUserId===n.self.userID&&(g+=` (${f("TUIChat.manage.我")})`),g},o=d=>({TEACHER:"音乐老师",ADMIN:"管理员",HEADMASTER:"校长"})[d],i=()=>{t.emit("more")},s=d=>{t.emit("del",[d])},u=d=>{t.emit("handleMemberProfileShow",d)};return{...Jt(n),getMore:i,submit:s,handleRoleName:r,formatJobType:o,handleMemberProfileShow:u}}});const LW={class:"member"},OW={class:"list"},RW={class:"avatarSection"},NW=["src"],PW={key:0,class:"jobType"},xW={key:1,class:st(["jobType","Owner"])},UW={class:"name"},FW={key:0,class:"roleType"},GW={style:{color:"#777777"}},$W=["onClick"];function BW(e,t,n,r,o,i){return X(),ae("main",LW,[B("ul",OW,[(X(!0),ae(dt,null,qt(e.list,(s,u)=>(X(),ae("li",{class:"list-item",key:u},[B("aside",null,[B("div",RW,[B("img",{class:"avatar",src:(s==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,NW),(s==null?void 0:s.groupRoleType)==="Admin"?(X(),ae("span",PW,Ee((s==null?void 0:s.groupRoleType)==="Admin"?"管理员":""),1)):Ce("",!0),(s==null?void 0:s.groupRoleType)==="Owner"?(X(),ae("span",xW,Ee((s==null?void 0:s.groupRoleType)==="Owner"?"群主":""),1)):Ce("",!0)]),B("span",UW,[jr(Ee((s==null?void 0:s.nickname)||(s==null?void 0:s.userID))+" ",1),s!=null&&s.teacherJobType?(X(),ae("span",FW,Ee(e.formatJobType(s.teacherJobType)),1)):Ce("",!0)]),B("span",GW,Ee(e.handleRoleName(s)),1)]),s.role!=="Owner"&&e.isShowDel?(X(),ae("i",{key:0,class:"icon icon-del",onClick:d=>e.submit(s)},null,8,$W)):Ce("",!0)]))),128)),e.list.lengthe.getMore&&e.getMore(...s))},Ee(e.$t("TUIChat.manage.查看更多")),1)):Ce("",!0)])])}const HW=jt(AW,[["render",BW],["__scopeId","data-v-6793cf8f"]]),qW=ot({props:{userInfo:{type:Object,default:()=>({})}},setup(e,t){const n=ll==null?void 0:ll.TUIServer,r=zt({isFriendShip:!1,userInfo:{},self:{}});nn(()=>{r.self=e.self}),$t(()=>e.userInfo,async(u,d)=>{var g;if(u===d)return;const f=await n.getUserProfile([(g=e==null?void 0:e.userInfo)==null?void 0:g.userID]);r.userInfo=f==null?void 0:f.data[0],i()},{deep:!0,immediate:!0});const o=async(u,d)=>{const f=`${d}${u}`;n.TUICore.TUIServer.TUIConversation.getConversationProfile(f).then(g=>{n.TUICore.TUIServer.TUIConversation.handleCurrentConversation(g.data.conversation)})},i=async()=>{if(!r.userInfo.userID)return;const u=await n.checkFriend(r.userInfo.userID,vt.TYPES.SNS_CHECK_TYPE_BOTH);r.isFriendShip=u===vt.TYPES.SNS_TYPE_BOTH_WAY},s=()=>{var u;return r.isFriendShip||!((u=n==null?void 0:n.TUICore)!=null&&u.isOfficial)};return{...Jt(r),enter:o,showEnter:s}}});const VW=e=>(Mr("data-v-25fa5b68"),e=e(),Ir(),e),zW={class:"memeber-profile"},jW={class:"memeber-profile-main"},WW=["src"],KW={class:"list"},YW=VW(()=>B("label",null,"ID:",-1)),JW={class:"memeber-profile-footer"};function XW(e,t,n,r,o,i){var s,u,d,f,g;return X(),ae("div",zW,[B("div",jW,[B("img",{class:"avatar",src:((s=e.userInfo)==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,WW),B("ul",KW,[B("h1",null,Ee(((u=e.userInfo)==null?void 0:u.nick)||((d=e.userInfo)==null?void 0:d.userID)),1),B("li",null,[YW,B("span",null,Ee((f=e.userInfo)==null?void 0:f.userID),1)]),B("li",null,[B("label",null,Ee(e.$t("TUIContact.个性签名"))+":",1),B("span",null,Ee((g=e.userInfo)==null?void 0:g.selfSignature),1)])])]),B("div",JW,[e.showEnter()?(X(),ae("div",{key:0,class:"button",onClick:t[0]||(t[0]=v=>{var _;return e.enter((_=e.userInfo)==null?void 0:_.userID,"C2C")})},Ee(e.$t("TUIContact.发送消息")),1)):Ce("",!0)])])}const ZW=jt(qW,[["render",XW],["__scopeId","data-v-25fa5b68"]]),QW=ot({components:{},props:{list:{type:Array,default:()=>[]},currentModel:{type:String,default:""},muteLoading:{type:Boolean,default:!1},total:{type:Number,default:0},conversation:{type:Object,default:()=>({})},isShowDel:{type:Boolean,default:()=>!1},self:{type:Object,default:()=>({})}},setup(e,t){vt.TYPES;const n=zt({conversation:{},currentModel:"",total:0,muteLoading:!1,list:[],page:1,isShowDel:!1,self:{},keyword:"",showMore:!1,selectList:[],isSelectAll:!1});nn(()=>{n.currentModel!==e.currentModel&&(n.selectList=[]),n.conversation=e.conversation,n.muteLoading=e.muteLoading,n.total=e.total,n.isShowDel=e.isShowDel,n.list=e.list,n.self=e.self,n.currentModel=e.currentModel,n.selectList=[],n.isSelectAll=!1});const r=M=>{const{t:C}=window.TUIKitTUICore.config.i18n.useI18n();let D="";switch(console.log(M,n.self,"self"),M==null?void 0:M.groupRoleType){case"Admin":D=C("TUIChat.manage.管理员");break;case"Owner":D=C("TUIChat.manage.群主");break}return D&&(D=`(${D})`),M.imUserId===n.self.userID&&(D+=` (${C("TUIChat.manage.我")})`),D},o=async M=>{var C,D;try{if(n.selectList.length<=0)return;const w=n.selectList.map(S=>S.userId);await Wj({groupId:(D=(C=n.conversation)==null?void 0:C.groupProfile)==null?void 0:D.groupID,muteTime:-1,groupMute:n.currentModel==="not_mute",userIds:w}),f()}catch{}},i=M=>{const C=n.selectList.findIndex(D=>D.userId===M.userId);C===-1?n.selectList.push(M):n.selectList.splice(C,1),n.isSelectAll=n.list.length===n.selectList.length},s=M=>n.selectList.findIndex(D=>D.userId===M.userId)!==-1,u=M=>{n.list.length===n.selectList.length?(n.selectList=[],n.isSelectAll=!1):(n.selectList=[...n.list],n.isSelectAll=!0)},d=M=>{t.emit("handleMemberProfileShow",M)},f=()=>{t.emit("back")},g=M=>{t.emit("search",n.keyword)},v=Vy(M=>{g()},500),_=M=>{M.stopPropagation(),M.code==="Enter"&&v(n.keyword)};return{...Jt(n),submit:o,isSelect:s,debouncedRequest:v,onKeyup:_,onSearch:g,onSelectItem:i,onSelectAll:u,handleRoleName:r,handleMemberProfileShow:d}}});const Kf=e=>(Mr("data-v-8f0a4ad6"),e=e(),Ir(),e),eK={class:"member"},tK={class:"sectionSearch"},nK=Kf(()=>B("span",{class:"icon-search-input"},null,-1)),rK={class:"list"},oK=["onClick"],iK=["src"],sK={class:"name"},aK={key:0,class:"theEmpty",style:{height:"75%"}},lK=Kf(()=>B("img",{class:"emptyImg",src:ud},null,-1)),uK=Kf(()=>B("p",null,"暂无数据",-1)),cK=[lK,uK],dK={class:"footer"},fK={class:"userInfo"},pK=["src"],hK={key:0,class:"maskMute"},gK={class:"selectHeader"},mK={class:"title"},vK={class:"selectContainer"},yK=["onClick"],_K=["src"],bK={class:"name"},MK=Kf(()=>B("i",{class:"icon icon-remove"},null,-1)),IK={key:0,class:"theEmpty",style:{"margin-top":"20px","margin-bottom":"0"}},CK=Kf(()=>B("img",{class:"emptyImg",src:ud},null,-1)),TK=Kf(()=>B("p",null,"暂无数据",-1)),wK=[CK,TK];function SK(e,t,n,r,o,i){const s=Yt("n-button"),u=Yt("n-input"),d=Yt("n-spin"),f=Yt("n-scrollbar");return X(),It(f,{class:"member-section"},{default:xt(()=>[B("main",eK,[St(d,{show:e.muteLoading,stroke:"#198CFE"},{default:xt(()=>[B("div",tK,[St(u,{class:"TheSearch noBorder",style:{"--n-font-size":"12px","--n-height":"35px","--n-caret-color":"#198cfe","--n-border-hover":"1px solid #198cfe","--n-border-focus":"1px solid #198cfe","--n-loading-color":"#198cfe","--n-box-shadow-focus":"0 0 0 2px rgba(25 140 254, 0.2)"},round:"",clearable:"",placeholder:"请输入群成员名称",value:e.keyword,"onUpdate:value":t[1]||(t[1]=g=>e.keyword=g),onKeyup:e.onKeyup},{prefix:xt(()=>[nK]),suffix:xt(()=>[St(s,{onClick:t[0]||(t[0]=g=>e.debouncedRequest("")),round:"",color:"#198cfe"},{default:xt(()=>[jr("搜索")]),_:1})]),_:1},8,["value","onKeyup"])]),B("ul",rK,[(X(!0),ae(dt,null,qt(e.list,(g,v)=>(X(),ae("li",{class:"list-item",key:v,onClick:_=>e.onSelectItem(g)},[B("aside",null,[B("i",{class:st(["icon",e.isSelect(g)?"icon-selected":"icon-unselected"])},null,2),B("img",{class:"avatar",src:(g==null?void 0:g.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,iK),B("span",sK,Ee((g==null?void 0:g.nickname)||(g==null?void 0:g.userID)),1)])],8,oK))),128)),e.list.length0&&!e.muteLoading?(X(),ae("li",{key:0,class:"list-item",onClick:t[2]||(t[2]=(...g)=>e.getMore&&e.getMore(...g))},Ee(e.$t("TUIChat.manage.查看更多")),1)):Ce("",!0)]),!e.muteLoading&&e.list.length<=0?(X(),ae("div",aK,cK)):Ce("",!0)]),_:1},8,["show"])]),B("div",dK,[B("div",{class:"selectUser",onClick:t[3]||(t[3]=(...g)=>e.onSelectAll&&e.onSelectAll(...g))},[B("i",{class:st(["icon",e.isSelectAll?"icon-selected":"icon-unselected"])},null,2),B("span",null,"全选(已选择"+Ee(e.selectList.length||0)+"):",1)]),B("div",fK,[B("div",{class:"userList",onClick:t[4]||(t[4]=g=>e.showMore=!0)},[(X(!0),ae(dt,null,qt(e.selectList,(g,v)=>(X(),ae("img",{class:"avatar",key:v,src:(g==null?void 0:g.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,pK))),128))]),B("span",{class:st(["muteBtn",e.selectList.length<=0?"disabled":""]),onClick:t[5]||(t[5]=(...g)=>e.submit&&e.submit(...g))},Ee(e.currentModel==="not_mute"?"禁言":"解除禁言"),3)])]),e.showMore?(X(),ae("div",hK)):Ce("",!0),B("div",{class:st(["selectListSection",e.showMore?"show":""])},[B("div",gK,[B("i",{class:"icon-close",onClick:t[6]||(t[6]=g=>e.showMore=!1)}),B("span",mK,"已选择 ("+Ee(e.selectList.length||0)+")",1),B("span",{class:st(["sureBtn",e.selectList.length<=0?"disabled":""]),onClick:t[7]||(t[7]=g=>e.showMore=!1)},"确定",2)]),B("div",vK,[(X(!0),ae(dt,null,qt(e.selectList,(g,v)=>(X(),ae("div",{class:"list-item",key:v,onClick:_=>e.onSelectItem(g)},[B("aside",null,[B("img",{class:"avatar",src:(g==null?void 0:g.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,_K),B("span",bK,Ee((g==null?void 0:g.nickname)||(g==null?void 0:g.userID)),1)]),MK],8,yK))),128)),e.selectList.length<=0?(X(),ae("div",IK,wK)):Ce("",!0)])],2)]),_:1})}const kK=jt(QW,[["render",SK],["__scopeId","data-v-8f0a4ad6"]]),DK=ot({props:{show:{type:Boolean,default:()=>!1},isHeaderShow:{type:Boolean,default:()=>!0},isFooterShow:{type:Boolean,default:()=>!0},background:{type:Boolean,default:()=>!0},title:{type:String,default:()=>""},isH5:{type:Boolean,default:()=>!1},center:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({show:!1,isHeaderShow:!0,isFooterShow:!0,background:!0,title:""});nn(()=>{n.show=e.show,n.title=e.title,n.isHeaderShow=e.isHeaderShow,n.isFooterShow=e.isFooterShow,n.background=e.background});const r=()=>{n.show=!n.show,t.emit("update:show",n.show)},o=()=>{t.emit("submit"),r()};return{...Jt(n),toggleView:r,submit:o}}});const EK={key:0},AK={class:"dialog-main-content"},LK={key:1};function OK(e,t,n,r,o,i){return e.show?(X(),ae("div",{key:0,class:st(["dialog",[e.isH5?"dialog-h5":"",e.center?"center":""]]),onClick:t[3]||(t[3]=bn((...s)=>e.toggleView&&e.toggleView(...s),["self"]))},[B("main",{class:"dialog-main",style:Oo(!e.background&&{background:"none"})},[e.isHeaderShow?(X(),ae("header",EK,[B("h1",null,Ee(e.title),1),B("i",{class:"icon icon-close",onClick:t[0]||(t[0]=(...s)=>e.toggleView&&e.toggleView(...s))})])):Ce("",!0),B("div",AK,[Ft(e.$slots,"default",{},void 0,!0)]),e.isFooterShow?(X(),ae("footer",LK,[B("button",{class:"btn btn-cancel",onClick:t[1]||(t[1]=(...s)=>e.toggleView&&e.toggleView(...s))},Ee(e.$t("component.取消")),1),B("button",{class:"btn btn-default",onClick:t[2]||(t[2]=(...s)=>e.submit&&e.submit(...s))},Ee(e.$t("component.确定")),1)])):Ce("",!0)],4)],2)):Ce("",!0)}const jy=jt(DK,[["render",OK],["__scopeId","data-v-836ac6a7"]]),Us=ot({components:{MaskTUI:iq,Transfer:GC,Slider:iR,ManageName:Wq,ManageNotification:EW,ManageMember:HW,MemeberProfile:ZW,ManageMute:kK,DialogTUI:jy},props:{userInfo:{type:Object,default:()=>({isGroup:!1,list:[]})},conversation:{type:Object,default:()=>({})},show:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){var ye;const n=Us.TUIServer.TUICore.TIM.TYPES,{GroupServer:r}=Us,{t:o}=Us.TUIServer.TUICore.config.i18n.useI18n(),i=zt({conversation:{},userInfo:{isGroup:!1,list:[],muteList:[]},isShowMuteTimeInput:!1,editLableName:"",mask:!1,currentTab:"",transferType:"",isSearch:!1,isRadio:!1,transferList:[],selectedList:[],isMuteTime:!1,show:!1,typeName:{[n.GRP_WORK]:"好友工作群",[n.GRP_PUBLIC]:"陌生人社交群",[n.GRP_MEETING]:"临时会议群",[n.GRP_AVCHATROOM]:"直播群",[n.JOIN_OPTIONS_FREE_ACCESS]:"自由加入",[n.JOIN_OPTIONS_NEED_PERMISSION]:"需要验证",[n.JOIN_OPTIONS_DISABLE_APPLY]:"禁止加群"},delDialogShow:!1,quitDialogShow:!1,dimmisDialogShow:!1,userList:[],transferTitle:"",member:{admin:[],member:[],muteMember:[]},currentMember:{},classGroupDetail:{},page:1,currentUserDetail:{},mutePage:1,muteSearch:"",muteLoading:!1,muteTotal:0,groupDetail:{},currentModel:"not_mute"}),s=Ne(),u=Ne();nn(()=>{i.conversation=e.conversation,i.userInfo=e.userInfo,i.show=e.show});const d=((ye=window==null?void 0:window.TUIKitTUICore)==null?void 0:ye.isOfficial)&&(D1==null?void 0:D1.useStore())||{},f=Ve(()=>{let le="";switch(i.currentTab){case"notification":le="群公告";break;case"notificationAdd":le="添加群公告";break;case"notificationUpdate":le="修改群公告";break;case"member":le="群成员";break;case"profile":le="群成员";break;default:le="群管理";break}return le});$t(()=>i.userInfo.list,(le,Q)=>{i.member={admin:[],member:[],muteMember:[]},le.map(Le=>{switch(Le==null?void 0:Le.groupRoleType){case"Admin":i.member.admin.push(Le);break;case"Member":i.member.member.push(Le);break}return Le});const ve=new Date().getTime();i.member.muteMember=le.filter(Le=>(Le==null?void 0:Le.muteUntil)*1e3-ve>0)},{deep:!0});const g=Ve(()=>{var W,te;const{conversation:le}=i,Q=(W=le==null?void 0:le.groupProfile)==null?void 0:W.selfInfo.role,ve=(te=le==null?void 0:le.groupProfile)==null?void 0:te.type,Le=Q===n.GRP_MBR_ROLE_OWNER,me=ve===n.GRP_WORK;return Le&&!me}),v=Ve(()=>{var Le;const{conversation:le}=i;return((Le=le==null?void 0:le.groupProfile)==null?void 0:Le.type)===n.GRP_WORK}),_=Ve(()=>{let le=3;return v.value||(le+=1),i.conversation.groupProfile.selfInfo.role!=="Owner"&&(le+=1),le}),M=Ve(()=>{var me;const{conversation:le}=i,Q=(me=le==null?void 0:le.groupProfile)==null?void 0:me.selfInfo.role,ve=Q===n.GRP_MBR_ROLE_OWNER,Le=Q===n.GRP_MBR_ROLE_ADMIN;return ve||Le}),C=Ve(()=>{var te,se;const{conversation:le}=i,Q=(te=le==null?void 0:le.groupProfile)==null?void 0:te.type,Le=((se=le==null?void 0:le.groupProfile)==null?void 0:se.selfInfo.role)===n.GRP_MBR_ROLE_OWNER,me=Q===n.GRP_WORK,W=Q===n.GRP_AVCHATROOM;return!!(!me&&!W&&Le)}),D=Ve(()=>{var Le;const{conversation:le}=i;return!(((Le=le==null?void 0:le.groupProfile)==null?void 0:Le.type)===n.GRP_WORK||!M.value)}),w=async le=>{var Q;try{const{conversation:ve}=i,Le={groupId:(Q=ve==null?void 0:ve.groupProfile)==null?void 0:Q.groupID,rows:100,page:le&&le==="more"?i.page+1:i.page};await jk(Le).then(me=>{const W=me.data.rows||[];W.forEach(te=>{te.nick=te.nickname}),le&&le==="more"?i.userInfo.list=[...i.userInfo.list,...W]:i.userInfo.list=W})}catch{}},S=async le=>{var Q;i.muteLoading=!0;try{const{conversation:ve}=i,Le={groupId:(Q=ve==null?void 0:ve.groupProfile)==null?void 0:Q.groupID,rows:100,groupMute:i.currentModel!=="not_mute",groupRoleTypes:["Member"],page:le&&le==="more"?i.mutePage+1:i.mutePage,keyword:i.muteSearch};await jk(Le).then(me=>{const W=me.data.rows||[];W.forEach(te=>{te.nick=te.nickname}),le&&le==="more"?i.userInfo.muteList=[...i.userInfo.list,...W]:i.userInfo.muteList=W,i.muteTotal=me.data.total||0})}catch{}i.muteLoading=!1},N=async le=>{const{conversation:Q}=i,ve=[];le.forEach(Le=>{ve.push({groupId:Q.groupProfile.groupID,imUserId:Le})});try{await Kj(ve),Ae(),w()}catch{}},A=le=>{const{conversation:Q}=i,ve={groupID:Q.groupProfile.groupID,userIDList:[le.userID]};r.deleteGroupMember(ve)},L=async le=>{console.log(i.conversation.groupProfile,le),await $j({oldOwner:i.conversation.groupProfile.ownerID,groupId:i.conversation.groupProfile.groupID,newOwner:le}),pe(),i.conversation.groupProfile={},Wh({message:"转交成功",isH5:!1,type:"success"})},j=async le=>{i.quitDialogShow=!0},V=async le=>{i.dimmisDialogShow=!0},x=async le=>{const{conversation:Q}=i;let ve="";switch(le.role){case n.GRP_MBR_ROLE_ADMIN:ve=n.GRP_MBR_ROLE_MEMBER;break;case n.GRP_MBR_ROLE_MEMBER:ve=n.GRP_MBR_ROLE_ADMIN;break}const Le={groupID:Q.groupProfile.groupID,userID:le.userID,role:ve};await r.setGroupMemberRole(Le),w()},$=async(le,Q)=>{var me;const{conversation:ve}=i,Le={groupID:ve.groupProfile.groupID,userID:le,muteTime:Q==="add"?60*60*24*30:0};await r.setGroupMemberMuteTime(Le),Q==="add"&&(me=window==null?void 0:window.TUIKitTUICore)!=null&&me.isOfficial&&d!=null&&d.commit&&(d==null||d.commit("handleTask",4)),w()},z=async le=>{const{conversation:Q}=i,ve={groupID:Q.groupProfile.groupID,userIDList:le,reason:""};await r.deleteGroupMember(ve),w()},G=le=>{i.editLableName=le},O=le=>{console.log(le,"type"),console.log(u.value),le==="add"?i.currentTab="notificationAdd":le==="edit"?i.currentTab="notificationUpdate":le==="submit"&&(i.currentTab="notification")},T=async le=>{const{key:Q,value:ve}=le,Le={groupID:i.conversation.groupProfile.groupID,[Q]:ve},me=await r.updateGroupProfile(Le),{conversation:W}=Us.TUIServer.store;W.groupProfile=me.data.group,Us.TUIServer.store.conversation={},Us.TUIServer.store.conversation=W,i.editLableName=""},P=le=>{var Q;if(i.currentTab==="notificationAdd"||i.currentTab==="notificationUpdate"){(Q=u.value)==null||Q.onCloseEdit(),i.currentTab="notification";return}le==="onlyMute"&&S(),i.currentTab=le,i.editLableName="",i.currentTab==="member"&&(i.transferType="remove"),i.currentTab||(i.transferType="")},Z=async le=>{var me,W;let Q={},ve={};const Le={groupID:i.conversation.groupProfile.groupID,userIDList:[le]};switch(i.transferType){case"add":try{ve=await r.getGroupMemberProfile(Le),i.transferList=i.transferList.filter(te=>{var se;return te.userID!==((se=Q.data[0])==null?void 0:se.userID)}),i.transferList=[...i.transferList,...Q.data],((me=ve==null?void 0:ve.data)==null?void 0:me.memberList.length)>0&&(i.transferList=i.transferList.map(te=>{var se;return te.userID===((se=ve==null?void 0:ve.data)==null?void 0:se.memberList[0].userID)&&(te.isDisabled=!0),te}))}catch{const se=o("TUIChat.manage.该用户不存在");xr(se,e)}break;case"remove":try{if(Q=await r.getGroupMemberProfile(Le),Q.data.memberList.length===0){const te=o("TUIChat.manage.该用户不在群组内");return xr(te,e)}i.transferList=i.transferList.filter(te=>{var se,Te;return te.userID!==((Te=(se=Q==null?void 0:Q.data)==null?void 0:se.memberList[0])==null?void 0:Te.userID)}),i.transferList=[...i.transferList,...(W=Q==null?void 0:Q.data)==null?void 0:W.memberList]}catch{const se=o("TUIChat.manage.该用户不存在");xr(se,e)}break}},K=le=>{console.log(le,i.transferType," data.transferType"),!(le.length<=0)&&(i.transferType==="remove"?(i.userList=le,i.delDialogShow=!i.delDialogShow):de(le,i.transferType),i.mask=!1)},oe=async()=>{const le=await xR({page:1,rows:999});console.log(le,"lits");const Q=le.data.rows||[];return Q.forEach(ve=>{ve.nick=ve.friendNickname}),Q.filter(ve=>!i.userInfo.list.some(Le=>Le.imUserId===ve.imUserId))},J=()=>{ie()},ie=async le=>{switch(i.selectedList=[],le){case"add":i.isRadio=!1,i.transferList=await oe(),i.transferTitle="添加成员";break;case"remove":i.isRadio=!1,i.transferList=i.userInfo.list.filter(Q=>{var ve,Le;return Q.userID!==((Le=(ve=i.conversation)==null?void 0:ve.groupProfile)==null?void 0:Le.selfInfo.userID)}),i.transferTitle="删除成员";break;case"addAdmin":i.isRadio=!0,i.transferList=i.member.member,i.transferTitle="新增管理员";break;case"removeAdmin":i.isRadio=!0,i.transferList=i.member.admin,i.transferTitle="移除管理员";break;case"changeOwner":i.isRadio=!0,i.transferList=[...i.member.admin,...i.member.member].filter(Q=>Q.roleType!=="STUDENT"),i.transferTitle="转让群组",console.log(i.transferList,"data.transferList");break;case"addMute":i.isRadio=!0,i.transferList=i.member.member,i.conversation.groupProfile.selfInfo.role==="Owner"&&(i.transferList=[...i.member.admin,...i.member.member]),i.transferTitle="新增禁言用户";break;case"removeMute":i.isRadio=!0,i.transferList=i.member.muteMember,i.transferTitle="移除禁言用户";break}i.transferType=le,i.mask=!i.mask};Js(s,()=>{i.show=!1});const pe=()=>{if(!r){const le=o("TUIChat.manage.请先注册 TUIGroup 模块");return xr(le,e)}i.show=!i.show,i.show||(i.currentTab=""),i.show&&w()},ue=async le=>{try{await jj({groupId:i.conversation.groupProfile.groupID,muteAll:le}),Ae()}catch{}},de=(le,Q)=>{const ve=[];switch(le.map(Le=>(ve.push(Le.imUserId),Le)),Q){case"add":N(ve);break;case"remove":z(ve);break;case"addAdmin":x(le[0]);break;case"removeAdmin":x(le[0]);break;case"changeOwner":L(ve[0]);break;case"addMute":$(ve[0],"add");break;case"removeMute":$(ve[0],"remove");break;case"quit":zj({id:i.conversation.groupProfile.groupID}).then(()=>{au.emit("removeGroup",i.conversation.groupProfile.groupID),Us.TUIServer.deleteConversation(i.conversation.conversationID),Us.TUIServer.store.conversation={},pe()});break;case"dismiss":Yj({id:i.conversation.groupProfile.groupID}).then(()=>{au.emit("removeGroup",i.conversation.groupProfile.groupID),Us.TUIServer.deleteConversation(i.conversation.conversationID),Us.TUIServer.store.conversation={},pe()}).catch(Le=>{Wh({message:Le.message,isH5:!1,type:"error"})});break}},Y=async()=>{var le,Q;try{const{toClipboard:ve}=rR();await ve((Q=(le=i==null?void 0:i.conversation)==null?void 0:le.groupProfile)==null?void 0:Q.groupID)}catch(ve){xr(ve,i.env)}},re=le=>{i.currentMember=le,P("profile")},fe=async()=>{var le,Q,ve,Le;try{const me=await Vj({groupId:(Q=(le=i==null?void 0:i.conversation)==null?void 0:le.groupProfile)==null?void 0:Q.groupID,imUserId:(Le=(ve=i==null?void 0:i.conversation)==null?void 0:ve.groupProfile)==null?void 0:Le.selfInfo.userID});i.currentUserDetail=me.data}catch{}},Ae=async()=>{var le,Q;try{const Le=(await UR({id:(Q=(le=i==null?void 0:i.conversation)==null?void 0:le.groupProfile)==null?void 0:Q.groupID})).data;Le.configJson=Le.configJson?JSON.parse(Le.configJson):{},i.groupDetail=Le}catch{}};return $t(()=>i.show,()=>{if(i.show)try{Ae(),fe()}catch{}}),On(()=>{au.on("handleNotice",le=>{console.log("22222"),i.currentTab="notification",i.show=!i.show,i.show&&w()});try{Ae(),fe()}catch{}}),{...Jt(i),isDismissGroupAuth:g,isShowAddMember:v,isSetMuteTime:D,isAdmin:C,isAuth:M,addMember:N,deleteMember:A,changeOwner:L,quit:j,dismiss:V,handleAdmin:x,setMemberMuteTime:$,kickedOut:z,edit:G,onNotificationChangeStatus:O,updateProfile:T,setTab:P,TabName:f,getMember:w,getUserList:S,handleSearchMember:Z,submit:K,cancel:J,toggleMask:ie,toggleShow:pe,setAllMuteTime:ue,handleManage:de,showUserNum:_,dialog:s,manageNotificationRef:u,handleGroupIDCopy:Y,handleMemberProfileShow:re}}});const hl=e=>(Mr("data-v-0ff89db3"),e=e(),Ir(),e),RK={class:"manage-header-left"},NK={key:1},PK={key:0},xK={key:1},UK={key:0,class:st(["main"]),style:{"background-color":"#f4f5f9",height:"100%"}},FK={class:"userInfo space-top",style:{"background-color":"#fff"}},GK=hl(()=>B("i",{class:"icon icon-right"},null,-1)),$K=["src"],BK={key:0},HK=hl(()=>B("i",{class:"icon icon-right end"},null,-1)),qK={key:0,class:"admin-content space-top",style:{"background-color":"#fff","padding-top":"12px","border-top":"1Px solid #f4f5f9"}},VK=hl(()=>B("aside",null,[B("label",null,"学生禁言")],-1)),zK=hl(()=>B("aside",null,[B("label",null,"禁言名单")],-1)),jK=hl(()=>B("i",{class:"icon icon-right end"},null,-1)),WK=[zK,jK],KK=hl(()=>B("aside",null,[B("label",null,"移交群主")],-1)),YK=hl(()=>B("i",{class:"icon icon-right end"},null,-1)),JK=[KK,YK],XK={class:"footer space-top",style:{overflow:"hidden","background-color":"#f4f5f9"}},ZK={key:4,class:"admin"},QK={key:0,class:"admin-list"},eY=["src"],tY={key:1,class:"admin-content space-top"},nY={key:2,class:"admin-list last"},rY=["src"],oY={key:0,class:"delDialog-title"},iY={key:1,class:"delDialog-title"},sY=hl(()=>B("p",{class:"delDialog-title"},"是否退出群聊?",-1)),aY=hl(()=>B("p",{class:"delDialog-title"},"是否解散群聊?",-1));function lY(e,t,n,r,o,i){var S,N,A;const s=Yt("n-tab-pane"),u=Yt("n-tabs"),d=Yt("ManageName"),f=Yt("Slider"),g=Yt("ManageMember"),v=Yt("MemeberProfile"),_=Yt("ManageNotification"),M=Yt("ManageMute"),C=Yt("Transfer"),D=Yt("MaskTUI"),w=Yt("DialogTUI");return X(),ae("div",null,[B("i",{class:"icon icon-chat-setting",onClick:t[0]||(t[0]=(...L)=>e.toggleShow&&e.toggleShow(...L))}),e.show?(X(),ae("div",{key:0,class:st(["manage",[e.isH5?"manage-h5":""]]),ref:"dialog"},[B("header",{class:st(["manage-header",e.currentTab==="onlyMute"?"currentModel":""])},[e.isH5&&!e.currentTab?(X(),ae("i",{key:0,class:"icon icon-back",onClick:t[1]||(t[1]=(...L)=>e.toggleShow&&e.toggleShow(...L))})):Ce("",!0),B("aside",RK,[e.currentTab?(X(),ae("i",{key:0,class:"icon icon-back",onClick:t[2]||(t[2]=()=>{e.currentModel="not_mute",e.setTab("")})})):Ce("",!0),e.currentTab!=="onlyMute"?(X(),ae("main",NK,[B("h1",null,[jr(Ee(e.TabName)+" ",1),e.currentTab==="member"?(X(),ae("span",PK,Ee(e.groupDetail.memberNum||0)+Ee(e.$t("TUIChat.manage.人")),1)):Ce("",!0)])])):(X(),It(u,{key:2,"justify-content":"center",style:{"margin-left":"-14Px",flex:"1","--n-tab-padding":"6px 0","--n-tab-gap":"34px","--n-tab-text-color":"#000","--n-tab-text-color-hover":"#0f0f0f","--n-tab-text-color-active":"#000","--n-tab-font-weight-active":"600","--n-bar-color":"#198cfe"},"bar-width":20,value:e.currentModel,"onUpdate:value":t[3]||(t[3]=L=>{e.currentModel=L,e.mutePage=1,e.muteSearch="",e.getUserList()})},{default:xt(()=>[St(s,{name:"not_mute",tab:"未禁言"}),St(s,{name:"mute",tab:"已禁言"})]),_:1},8,["value"]))]),e.currentTab!=="onlyMute"?(X(),ae("span",xK,[e.isH5?Ce("",!0):(X(),ae("i",{key:0,class:"icon icon-close",onClick:t[4]||(t[4]=(...L)=>e.toggleShow&&e.toggleShow(...L))}))])):Ce("",!0)],2),e.currentTab?e.currentTab==="member"?(X(),It(g,{key:1,self:e.conversation.groupProfile.selfInfo,list:e.userInfo.list,total:~~e.conversation.groupProfile.memberCount,onMore:t[13]||(t[13]=L=>e.getMember("more")),onDel:e.submit,onHandleMemberProfileShow:e.handleMemberProfileShow},null,8,["self","list","total","onDel","onHandleMemberProfileShow"])):e.currentTab==="profile"?(X(),It(v,{key:2,userInfo:e.currentMember},null,8,["userInfo"])):e.currentTab==="notification"||e.currentTab==="notificationAdd"||e.currentTab==="notificationUpdate"?(X(),It(_,{key:3,ref:"manageNotificationRef",isAuth:e.isAuth,data:e.conversation.groupProfile,onUpdate:e.updateProfile,onChangeStatus:e.onNotificationChangeStatus},null,8,["isAuth","data","onUpdate","onChangeStatus"])):e.currentTab==="admin"?(X(),ae("main",ZK,[e.isAdmin?(X(),ae("div",QK,[B("label",null,Ee(e.$t("TUIChat.manage.群管理员")),1),B("ol",null,[(X(!0),ae(dt,null,qt(e.member.admin,(L,j)=>(X(),ae("dl",{key:j},[B("dt",null,[B("img",{class:"avatar",src:(L==null?void 0:L.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,eY)]),B("dd",null,Ee((L==null?void 0:L.nick)||(L==null?void 0:L.userID)),1)]))),128)),B("dl",null,[B("dt",{class:"avatar",onClick:t[14]||(t[14]=L=>e.toggleMask("addAdmin"))},"+")]),B("dl",null,[e.member.admin.length>0?(X(),ae("dt",{key:0,class:"avatar",onClick:t[15]||(t[15]=L=>e.toggleMask("removeAdmin"))},"-")):Ce("",!0)])])])):Ce("",!0),e.isSetMuteTime?(X(),ae("div",tY,[B("aside",null,[B("label",null,Ee(e.$t("TUIChat.manage.学生禁言")),1),B("p",null,Ee(e.$t("TUIChat.manage.学生禁言开启后,只允许群主和管理员发言。")),1)]),St(f,{open:e.conversation.groupProfile.muteAllMembers,onChange:e.setAllMuteTime},null,8,["open","onChange"])])):Ce("",!0),e.isSetMuteTime?(X(),ae("div",nY,[B("label",null,Ee(e.$t("TUIChat.manage.单独禁言人员")),1),B("ol",null,[(X(!0),ae(dt,null,qt(e.member.muteMember,(L,j)=>(X(),ae("dl",{key:j},[B("dt",null,[B("img",{class:"avatar",src:(L==null?void 0:L.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,rY)]),B("dd",null,Ee((L==null?void 0:L.nick)||(L==null?void 0:L.userID)),1)]))),128)),B("dl",null,[B("dt",{class:"avatar",onClick:t[16]||(t[16]=L=>e.toggleMask("addMute"))},"+")]),B("dl",null,[e.member.muteMember.length>0?(X(),ae("dt",{key:0,class:"avatar",onClick:t[17]||(t[17]=L=>e.toggleMask("removeMute"))},"-")):Ce("",!0)])])])):Ce("",!0)])):e.currentTab==="onlyMute"?(X(),It(M,{key:5,currentModel:e.currentModel,total:e.muteTotal,self:e.conversation.groupProfile.selfInfo,list:e.userInfo.muteList,conversation:e.conversation,muteLoading:e.muteLoading,onMore:t[18]||(t[18]=L=>e.getUserList("more")),onDel:e.submit,onBack:t[19]||(t[19]=()=>{e.setTab(""),e.currentModel="not_mute"}),onSearch:t[20]||(t[20]=L=>{e.mutePage=1,e.muteSearch=L,e.userInfo.muteList=[],e.getUserList()}),onHandleMemberProfileShow:e.handleMemberProfileShow},null,8,["currentModel","total","self","list","conversation","muteLoading","onDel","onHandleMemberProfileShow"])):Ce("",!0):(X(),ae("main",UK,[St(d,{class:"space-top",isAuth:e.isAuth,isH5:e.isH5,data:e.conversation.groupProfile,onUpdate:e.updateProfile,style:{"background-color":"#fff"}},null,8,["isAuth","isH5","data","onUpdate"]),B("div",FK,[B("header",{class:"userInfo-header",onClick:t[5]||(t[5]=L=>e.setTab("member"))},[B("label",null,Ee(e.$t("TUIChat.manage.群成员")),1),B("p",null,[B("span",null,Ee(e.groupDetail.memberNum||0)+Ee(e.$t("TUIChat.manage.人")),1),GK])]),B("ol",null,[(X(!0),ae(dt,null,qt((N=(S=e.userInfo)==null?void 0:S.list)==null?void 0:N.slice(0,e.showUserNum),(L,j)=>(X(),ae("dl",{key:j},[B("dt",null,[B("img",{class:"avatar",src:(L==null?void 0:L.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,$K)]),B("dd",null,Ee((L==null?void 0:L.nickname)||(L==null?void 0:L.userID)),1)]))),128)),e.currentUserDetail.groupRoleType==="Owner"?(X(),ae("dl",BK,[B("dt",{class:"avatar",onClick:t[6]||(t[6]=L=>e.toggleMask("add"))},"+")])):Ce("",!0)])]),B("ul",{class:"content space-top",onClick:t[8]||(t[8]=L=>e.editLableName=""),style:{"background-color":"#fff"}},[B("li",{onClick:t[7]||(t[7]=bn(L=>e.setTab("notification"),["stop"]))},[B("aside",null,[B("label",null,Ee(e.$t("TUIChat.manage.群公告")),1),B("article",null,Ee(e.conversation.groupProfile.notification),1)]),HK])]),e.currentUserDetail.groupRoleType==="Owner"||e.currentUserDetail.groupRoleType==="Admin"?(X(),ae("div",qK,[VK,St(f,{open:e.groupDetail.configJson.mute,onChange:e.setAllMuteTime},null,8,["open","onChange"])])):Ce("",!0),e.currentUserDetail.groupRoleType==="Owner"||e.currentUserDetail.groupRoleType==="Admin"?(X(),ae("div",{key:1,class:"admin-content space-top",style:{"background-color":"#fff","padding-top":"12px","border-top":"1Px solid #f4f5f9"},onClick:t[9]||(t[9]=bn(()=>{e.userInfo.muteList=[],e.setTab("onlyMute")},["stop"]))},WK)):Ce("",!0),e.currentUserDetail.groupRoleType==="Owner"&&((A=e.userInfo)==null?void 0:A.list.length)>1?(X(),ae("div",{key:2,class:"admin-content space-top",style:{"background-color":"#fff","padding-top":"12px","border-top":"1Px solid #f4f5f9"},onClick:t[10]||(t[10]=bn(L=>e.toggleMask("changeOwner"),["stop"]))},JK)):Ce("",!0),B("ul",XK,[e.currentUserDetail.groupRoleType==="Owner"?(X(),ae("li",{key:0,onClick:t[11]||(t[11]=bn(L=>e.dismiss(e.conversation.groupProfile),["stop"]))},"解散群聊")):(X(),ae("li",{key:1,onClick:t[12]||(t[12]=bn(L=>e.quit(e.conversation.groupProfile),["stop"]))},"退出群组"))])])),St(D,{show:e.mask,"onUpdate:show":t[21]||(t[21]=L=>e.mask=L)},{default:xt(()=>[St(C,{title:e.$t(`TUIChat.manage.${e.transferTitle}`),list:e.transferList,isSearch:e.isSearch,isRadio:e.isRadio,selectedList:e.selectedList,onSubmit:e.submit,onCancel:e.cancel,onSearch:e.handleSearchMember,isH5:e.isH5},null,8,["title","list","isSearch","isRadio","selectedList","onSubmit","onCancel","onSearch","isH5"])]),_:1},8,["show"]),St(w,{title:e.$t("TUIChat.manage.删除成员"),show:e.delDialogShow,isH5:e.isH5,center:!0,isHeaderShow:!e.isH5,onSubmit:t[22]||(t[22]=L=>e.handleManage(e.userList,"remove")),"onUpdate:show":t[23]||(t[23]=L=>e.delDialogShow=L)},{default:xt(()=>[e.userList.length===1?(X(),ae("p",oY,Ee(e.$t("TUIChat.manage.确定从群聊中删除该成员?")),1)):Ce("",!0),e.userList.length>1?(X(),ae("p",iY,Ee(e.$t("TUIChat.manage.确定从群聊中删除所选成员?")),1)):Ce("",!0)]),_:1},8,["title","show","isH5","isHeaderShow"]),St(w,{title:"退出群聊",show:e.quitDialogShow,isH5:e.isH5,center:!0,isHeaderShow:!e.isH5,onSubmit:t[24]||(t[24]=L=>e.handleManage([],"quit")),"onUpdate:show":t[25]||(t[25]=L=>e.quitDialogShow=L)},{default:xt(()=>[sY]),_:1},8,["show","isH5","isHeaderShow"]),St(w,{title:"解散群聊",show:e.dimmisDialogShow,isH5:e.isH5,center:!0,isHeaderShow:!e.isH5,onSubmit:t[26]||(t[26]=L=>e.handleManage([],"dismiss")),"onUpdate:show":t[27]||(t[27]=L=>e.dimmisDialogShow=L)},{default:xt(()=>[aY]),_:1},8,["show","isH5","isHeaderShow"])],2)):Ce("",!0)])}const ll=jt(Us,[["render",lY],["__scopeId","data-v-0ff89db3"]]),uY={class:"message-item"},cY=ot({__name:"index",props:{message:{type:Object,default:()=>({})},beforeMessage:{type:Object,default:()=>({})},types:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},messageList:{type:Array,default:()=>[]},displayGroupMessageReadReceipt:{type:Boolean,default:!0},displayEmojiReactions:{type:Boolean,default:!0}},emits:["handleEditor","showDialog","uploading","jumpID","resendMessage"],setup(e,{emit:t}){const n=e,r=ll==null?void 0:ll.TUIServer;Ne(!1),Ne([]);const{message:o,types:i,env:s,messageList:u,displayGroupMessageReadReceipt:d,displayEmojiReactions:f}=Jt(n);On(async()=>{var N,A,L,j,V,x,$,z,G,O,T,P,Z,K,oe,J;if((A=(N=n.message)==null?void 0:N.payload)!=null&&A.operatorID&&((j=(L=n.message)==null?void 0:L.payload)==null?void 0:j.operatorID.indexOf("KT"))!=-1){const ie=await r.getUserProfile([(x=(V=n.message)==null?void 0:V.payload)==null?void 0:x.operatorID]);if(console.log(ie,"operatorInfo"),o.value.payload.operatorID=($=ie.data[0])==null?void 0:$.nick,(O=(G=(z=n.message)==null?void 0:z.payload)==null?void 0:G.newGroupProfile)!=null&&O.ownerID){const pe=await r.getUserProfile([(Z=(P=(T=n.message)==null?void 0:T.payload)==null?void 0:P.newGroupProfile)==null?void 0:Z.ownerID]);o.value.payload.newGroupProfile.ownerID=(K=pe.data[0])==null?void 0:K.nick}}else((J=(oe=n.message)==null?void 0:oe.payload)==null?void 0:J.operatorID)==="mec_admin"&&(o.value.payload.operatorID="")});const g=N=>{t("handleEditor",N,"reedit")},v=(N,A)=>{if(!(!N||!A))switch(A){case cn.handleMessage.forward:t("showDialog",N,cn.handleMessage.forward);break;case cn.handleMessage.reference:t("handleEditor",N,cn.handleMessage.reference);break;case cn.handleMessage.reply:t("handleEditor",N,cn.handleMessage.reply);break}},_=N=>{N&&t("showDialog",N,"previewImage")},M=N=>{N&&t("showDialog",N,"receipt")},C=N=>{N&&t("showDialog",N,"replies")},D=N=>{N&&t("jumpID",N)},w=()=>{t("uploading")},S=N=>{N&&t("resendMessage",N)};return(N,A)=>(X(),ae("div",uY,[Oe(PO)(Oe(o))?(X(),It(CB,{key:0,data:Oe(I$)(Oe(o))},null,8,["data"])):Oe(o).isRevoked?(X(),It(NH,{key:2,isEdit:Oe(o).type===Oe(i).MSG_TEXT,data:Oe(o),onEdit:A[0]||(A[0]=L=>g(Oe(o)))},null,8,["isEdit","data"])):(X(),It(DH,{key:1,data:Oe(o),isH5:Oe(s).isH5,messagesList:Oe(u),needGroupReceipt:Oe(d),needReplies:!0,needEmojiReact:Oe(f),onJumpID:D,onResendMessage:S,onShowReadReceiptDialog:M,onShowRepliesDialog:C},{dialog:xt(()=>[St(nq,{message:Oe(o),needEmojiReact:Oe(f),onHandleMessage:v},null,8,["message","needEmojiReact"])]),default:xt(()=>[Oe(o).type===Oe(i).MSG_TEXT?(X(),It(UO,{key:0,data:Oe(EO)(Oe(o))},null,8,["data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_IMAGE?(X(),It(W$,{key:1,isH5:Oe(s).isH5,data:Oe(LO)(Oe(o)),onUploading:w,onPreviewImage:_},null,8,["isH5","data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_VIDEO?(X(),It(r9,{key:2,isH5:Oe(s).isH5,data:Oe(OO)(Oe(o)),onUploading:w},null,8,["isH5","data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_AUDIO?(X(),It(a9,{key:3,data:Oe(w$)(Oe(o))},null,8,["data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_FILE?(X(),It(m9,{key:4,data:Oe(RO)(Oe(o))},null,8,["data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_FACE?(X(),It(M9,{key:5,data:Oe(AO)(Oe(o)),isH5:Oe(s).isH5},null,8,["data","isH5"])):Ce("",!0),Oe(o).type===Oe(i).MSG_LOCATION?(X(),It(k9,{key:6,data:Oe(T$)(Oe(o))},null,8,["data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_CUSTOM?(X(),It(_B,{key:7,data:Oe(NO)(Oe(o))},null,8,["data"])):Ce("",!0),Oe(o).type===Oe(i).MSG_MERGER?(X(),It(L9,{key:8,data:Oe(S$)(Oe(o))},null,8,["data"])):Ce("",!0)]),_:1},8,["data","isH5","messagesList","needGroupReceipt","needEmojiReact"]))]))}});const dY=jt(cY,[["__scopeId","data-v-022159b3"]]),fY=ot({__name:"message-timestamp",props:{currTime:{type:Number,default:0},prevTime:{type:Number,default:0}},setup(e){var f,g,v;const t=e,{t:n}=(v=(g=(f=window==null?void 0:window.TUIKitTUICore)==null?void 0:f.config)==null?void 0:g.i18n)==null?void 0:v.useI18n(),{currTime:r,prevTime:o}=Jt(t),i=Ne(!1),s=Ne(""),u=(_,M)=>(i.value=!1,_<=0?"":!M||M<=0||_-M>=600?(i.value=!0,d(_*1e3)):"");$t(()=>[r.value,o.value],(_,M)=>{(_==null?void 0:_.toString())!==(M==null?void 0:M.toString())&&(s.value=u(r.value,o.value))},{immediate:!0});function d(_){const M=new Date().setHours(0,0,0,0),C=new Date(new Date().getFullYear(),0,1,0,0,0,0).getTime(),D=new Date(_),w=24*60*60*1e3,S=7*w,N=M-D.getTime();function A(L){return L<10?"0"+L:L.toString()}if(N<=0)return`${A(D.getHours())}:${A(D.getMinutes())}`;if(N<=w)return`${n("time.昨天")} ${A(D.getHours())}:${A(D.getMinutes())}`;if(N<=S-w){const j=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][D.getDay()];return`${n("time."+j)} ${A(D.getHours())}:${A(D.getMinutes())}`}else return D.getTime()>=C?`${D.getMonth()+1}/${D.getDate()} ${A(D.getHours())}:${A(D.getMinutes())}`:`${D.getFullYear()}/${D.getMonth()+1}/${D.getDate()} ${A(D.getHours())}:${A(D.getMinutes())}`}return(_,M)=>$n((X(),ae("div",{class:"message-timestamp"},Ee(s.value),513)),[[eo,i.value]])}});const pY=jt(fY,[["__scopeId","data-v-9b177b8a"]]),FR={product:{label:"产品文档",url:"https://cloud.tencent.com/document/product/269/1499#.E7.BE.A4.E7.BB.84.E5.8A.9F.E8.83.BD"},customMessage:{label:"自定义消息",url:"https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#createCustomMessage"},complaint:{label:"点此投诉",url:"https://cloud.tencent.com/apply/p/xc3oaubi98g"},implement:{label:"集成TUICallKit",url:"https://cloud.tencent.com/document/product/269/79861"},purchase:{label:"开通腾讯实时音视频服务",url:"https://cloud.tencent.com/document/product/1640/79968"}};function qo(e){this.content=e}qo.prototype={constructor:qo,find:function(e){for(var t=0;t>1}};qo.from=function(e){if(e instanceof qo)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new qo(t)};function GR(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=GR(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function $R(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=e.child(--o),u=t.child(--i),d=s.nodeSize;if(s==u){n-=d,r-=d;continue}if(!s.sameMarkup(u))return{a:n,b:r};if(s.isText&&s.text!=u.text){let f=0,g=Math.min(s.text.length,u.text.length);for(;ft&&r(d,o+u,i||null,s)!==!1&&d.content.size){let g=u+1;d.nodesBetween(Math.max(0,t-g),Math.min(d.content.size,n-g),r,o+g)}u=f}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",s=!0;return this.nodesBetween(t,n,(u,d)=>{u.isText?(i+=u.text.slice(Math.max(t,d)-d,n-d),s=!r):u.isLeaf?(o?i+=typeof o=="function"?o(u):o:u.type.spec.leafText&&(i+=u.type.spec.leafText(u)),s=!r):!s&&u.isBlock&&(i+=r,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);it)for(let i=0,s=0;st&&((sn)&&(u.isText?u=u.cut(Math.max(0,t-s),Math.min(u.text.length,n-s)):u=u.cut(Math.max(0,t-s-1),Math.min(u.content.size,n-s-1))),r.push(u),o+=u.nodeSize),s=d}return new pt(r,o)}cutByIndex(t,n){return t==n?pt.empty:t==0&&n==this.content.length?this:new pt(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new pt(o,i)}addToStart(t){return new pt([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new pt(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||n>0?Cm(r+1,s):Cm(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return pt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new pt(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return pt.empty;let n,r=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;nr.type.rank-o.type.rank),n}};lr.none=[];class Gv extends Error{}class Lt{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=HR(this.content,t+this.openStart,n);return r&&new Lt(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Lt(BR(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Lt.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Lt(pt.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new Lt(t,r,o)}}Lt.empty=new Lt(pt.empty,0,0);function BR(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:u}=e.findIndex(n);if(o==t||i.isText){if(u!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(BR(i.content,t-o-1,n-o-1)))}function HR(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=HR(s.content,t-i-1,n);return u&&e.replaceChild(o,s.copy(u))}function hY(e,t,n){if(n.openStart>e.depth)throw new Gv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Gv("Inconsistent open depths");return qR(e,t,n,0)}function qR(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ph(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Gc(e.nodeAfter,r),i++));for(let u=i;uo&&qM(e,t,o+1),s=r.depth>o&&qM(n,r,o+1),u=[];return ph(null,e,o,u),i&&s&&t.index(o)==n.index(o)?(VR(i,s),Gc($c(i,zR(e,t,n,r,o+1)),u)):(i&&Gc($c(i,$v(e,t,o+1)),u),ph(t,n,o,u),s&&Gc($c(s,$v(n,r,o+1)),u)),ph(r,null,o,u),new pt(u)}function $v(e,t,n){let r=[];if(ph(null,e,n,r),e.depth>n){let o=qM(e,t,n+1);Gc($c(o,$v(e,t,n+1)),r)}return ph(t,null,n,r),new pt(r)}function gY(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(pt.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Jh{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Bv(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=t;;){let{index:u,offset:d}=s.content.findIndex(i),f=i-d;if(r.push(s,u,o+d),!f||(s=s.child(u),s.isText))break;i=f-1,o+=d+1}return new Jh(n,r,i)}static resolveCached(t,n){for(let o=0;ot&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),jR(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=pt.empty,o=0,i=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,o,i),u=s&&s.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let d=o;dn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=pt.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,o,r)}};Bc.prototype.text=void 0;class Hv extends Bc{constructor(t,n,r,o){if(super(t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Hv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Hv(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function jR(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Qc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new yY(t,n);if(r.next==null)return Qc.empty;let o=WR(r);r.next&&r.err("Unexpected trailing text");let i=wY(TY(o));return SY(i,r),i}matchType(t){for(let n=0;nf.createAndFill()));for(let f=0;f=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(r.next[s].next);return i}).join(` `)}}Qc.empty=new Qc(!0);class yY{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function WR(e){let t=[];do t.push(_Y(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function _Y(e){let t=[];do t.push(bY(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function bY(e){let t=CY(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=MY(e,t);else break;return t}function Wk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function MY(e,t){let n=Wk(e),r=n;return e.eat(",")&&(e.next!="}"?r=Wk(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function IY(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function CY(e){if(e.eat("(")){let t=WR(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=IY(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function TY(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(s,u,d){let f={term:d,to:u};return t[s].push(f),f}function o(s,u){s.forEach(d=>d.to=u)}function i(s,u){if(s.type=="choice")return s.exprs.reduce((d,f)=>d.concat(i(f,u)),[]);if(s.type=="seq")for(let d=0;;d++){let f=i(s.exprs[d],u);if(d==s.exprs.length-1)return f;o(f,u=n())}else if(s.type=="star"){let d=n();return r(u,d),o(i(s.expr,d),d),[r(d)]}else if(s.type=="plus"){let d=n();return o(i(s.expr,u),d),o(i(s.expr,d),d),[r(d)]}else{if(s.type=="opt")return[r(u)].concat(i(s.expr,u));if(s.type=="range"){let d=u;for(let f=0;f{e[s].forEach(({term:u,to:d})=>{if(!u)return;let f;for(let g=0;g{f||o.push([u,f=[]]),f.indexOf(g)==-1&&f.push(g)})})});let i=t[r.join(",")]=new Qc(r.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;nr[i]=new ZR(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class kY{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Wy{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=XR(o.attrs),this.excluded=null;let i=YR(this.attrs);this.instance=i?new lr(this,i):null}create(t=null){return!t&&this.instance?this.instance:new lr(this,JR(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new Wy(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n-1}}class DY{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=qo.from(t.nodes),n.marks=qo.from(t.marks||{}),this.nodes=Yk.compile(this.spec.nodes,this),this.marks=Wy.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",u=i.spec.marks;i.contentMatch=r[s]||(r[s]=Qc.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=u=="_"?null:u?Jk(this,u.split(" ")):u==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Jk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Yk){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new Hv(r,r.defaultAttrs,t,lr.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Bc.fromJSON(this,t)}markFromJSON(t){return lr.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function Jk(e,t){let n=[];for(let r=0;r-1)&&n.push(s=d)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Df{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=t.nodes[r.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Zk(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Zk(this,n,!0);return r.addAll(t,n.from,n.to),Lt.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;ot.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(s.getAttrs){let d=s.getAttrs(n);if(d===!1)continue;s.attrs=d||void 0}return s}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=Qk(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Qk(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Df(t,Df.schemaRules(t)))}}const QR={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},EY={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},eN={ol:!0,ul:!0},qv=1,Vv=2,hh=4;function Xk(e,t,n){return t!=null?(t?qv:0)|(t==="full"?Vv:0):e&&e.whitespace=="pre"?qv|Vv:n&~hh}class Tm{constructor(t,n,r,o,i,s,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=u,this.content=[],this.activeMarks=lr.none,this.stashMarks=[],this.match=s||(u&hh?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(pt.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&qv)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=pt.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(pt.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;nthis.addAll(t)),s&&this.sync(u),this.needsBlock=d}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=lr.none,r=lr.none;for(let o=0;o{s.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(t,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(t):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let u=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(d=>this.insertNode(d));else{let d=t;typeof n.contentElement=="string"?d=t.querySelector(n.contentElement):typeof n.contentElement=="function"?d=n.contentElement(t):n.contentElement&&(d=n.contentElement),this.findAround(t,d,!0),this.addAll(d)}o&&this.sync(u)&&this.open--,s&&this.removePendingMark(s,u)}addAll(t,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;othis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(u,d)=>{for(;u>=0;u--){let f=n[u];if(f==""){if(u==n.length-1||u==0)continue;for(;d>=i;d--)if(s(u-1,d))return!0;return!1}else{let g=d>0||d==0&&o?this.nodes[d].type:r&&d>=i?r.node(d-i).type:null;if(!g||g.name!=f&&g.groups.indexOf(f)==-1)return!1;d--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=NY(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function AY(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&eN.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function LY(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function OY(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function Qk(e){let t={};for(let n in e)t[n]=e[n];return t}function RY(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=u=>{i.push(u);for(let d=0;d{if(i.length||s.marks.length){let u=0,d=0;for(;u=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&ba.renderSpec(V1(r),o(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,u=r?t.createElementNS(r,o):t.createElement(o),d=n[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let g in d)if(d[g]!=null){let v=g.indexOf(" ");v>0?u.setAttributeNS(g.slice(0,v),g.slice(v+1),d[g]):u.setAttribute(g,d[g])}}for(let g=f;gf)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:_,contentDOM:M}=ba.renderSpec(t,v,r);if(u.appendChild(_),M){if(s)throw new RangeError("Multiple content holes");s=M}}}return{dom:u,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ba(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=e2(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return e2(t.marks)}}function e2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function V1(e){return e.document||window.document}const tN=65535,nN=Math.pow(2,16);function PY(e,t){return e+t*nN}function t2(e){return e&tN}function xY(e){return(e-(e&tN))/nN}const rN=1,oN=2,rv=4,iN=8;class zM{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&iN)>0}get deletedBefore(){return(this.delInfo&(rN|rv))>0}get deletedAfter(){return(this.delInfo&(oN|rv))>0}get deletedAcross(){return(this.delInfo&rv)>0}}class Cs{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Cs.empty)return Cs.empty}recover(t){let n=0,r=t2(t);if(!this.inverted)for(let o=0;ot)break;let f=this.ranges[u+i],g=this.ranges[u+s],v=d+f;if(t<=v){let _=f?t==d?-1:t==v?1:n:n,M=d+o+(_<0?0:g);if(r)return M;let C=t==(n<0?d:v)?null:PY(u/3,t-d),D=t==d?oN:t==v?rN:rv;return(n<0?t!=d:t!=v)&&(D|=iN),new zM(M,D,C)}o+=g-f}return r?t+o:new zM(t+o,0,null)}touches(t,n){let r=0,o=t2(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;ut)break;let f=this.ranges[u+i],g=d+f;if(t<=g&&u==o*3)return!0;r+=this.ranges[u+s]-f}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new gh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;ri&&d!s.isAtom||!u.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return _o.fromReplace(t,this.from,this.to,i)}invert(){return new Ma(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new jl(n.pos,r.pos,this.mark)}merge(t){return t instanceof jl&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new jl(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new jl(n.from,n.to,t.markFromJSON(n.mark))}}Yi.jsonID("addMark",jl);class Ma extends Yi{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Lt(ZC(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return _o.fromReplace(t,this.from,this.to,r)}invert(){return new jl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ma(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ma&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ma(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ma(n.from,n.to,t.markFromJSON(n.mark))}}Yi.jsonID("removeMark",Ma);class Wl extends Yi{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return _o.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _o.fromReplace(t,this.pos,this.pos+1,new Lt(pt.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new xo(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new xo(n.from,n.to,n.gapFrom,n.gapTo,Lt.fromJSON(t,n.slice),n.insert,!!n.structure)}}Yi.jsonID("replaceAround",xo);function jM(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function UY(e,t,n,r){let o=[],i=[],s,u;e.doc.nodesBetween(t,n,(d,f,g)=>{if(!d.isInline)return;let v=d.marks;if(!r.isInSet(v)&&g.type.allowsMarkType(r.type)){let _=Math.max(f,t),M=Math.min(f+d.nodeSize,n),C=r.addToSet(v);for(let D=0;De.step(d)),i.forEach(d=>e.step(d))}function FY(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(s,u)=>{if(!s.isInline)return;i++;let d=null;if(r instanceof Wy){let f=s.marks,g;for(;g=r.isInSet(f);)(d||(d=[])).push(g),f=g.removeFromSet(f)}else r?r.isInSet(s.marks)&&(d=[r]):d=s.marks;if(d&&d.length){let f=Math.min(u+s.nodeSize,n);for(let g=0;ge.step(new Ma(s.from,s.to,s.style)))}function GY(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let u=0;u=0;u--)e.step(i[u])}function $Y(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Yf(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let o=e.$from.node(r),i=e.$from.index(r),s=e.$to.indexAfter(r);if(rn;C--)D||r.index(C)>0?(D=!0,g=pt.from(r.node(C).copy(g)),v++):d--;let _=pt.empty,M=0;for(let C=i,D=!1;C>n;C--)D||o.after(C+1)=0;s--){if(r.size){let u=n[s].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=pt.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new xo(o,i,o,i,new Lt(r,0,0),n.length,!0))}function zY(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,u)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&jY(e.doc,e.mapping.slice(i).map(u),r)){e.clearIncompatible(e.mapping.slice(i).map(u,1),r);let d=e.mapping.slice(i),f=d.map(u,1),g=d.map(u+s.nodeSize,1);return e.step(new xo(f,g,f+1,g-1,new Lt(pt.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function jY(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function WY(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new xo(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Lt(pt.from(s),0,0),1,!0))}function df(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let f=o.depth-1,g=n-2;f>i;f--,g--){let v=o.node(f),_=o.index(f);if(v.type.spec.isolating)return!1;let M=v.content.cutByIndex(_,v.childCount),C=r&&r[g+1];C&&(M=M.replaceChild(0,C.type.create(C.attrs)));let D=r&&r[g]||v;if(!v.canReplace(_+1,v.childCount)||!D.type.validContent(M))return!1}let u=o.indexAfter(i),d=r&&r[0];return o.node(i).canReplaceWith(u,u,d?d.type:o.node(i+1).type)}function KY(e,t,n=1,r){let o=e.doc.resolve(t),i=pt.empty,s=pt.empty;for(let u=o.depth,d=o.depth-n,f=n-1;u>d;u--,f--){i=pt.from(o.node(u).copy(i));let g=r&&r[f];s=pt.from(g?g.type.create(g.attrs,s):o.node(u).copy(s))}e.step(new zo(t,t,new Lt(i.append(s),n,n),!0))}function cd(e,t){let n=e.resolve(t),r=n.index();return aN(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function aN(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function lN(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let i,s,u=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),u++,s=r.node(o).maybeChild(u)):(i=r.node(o).maybeChild(u-1),s=r.node(o+1)),i&&!i.isTextblock&&aN(i,s)&&r.node(o).canReplace(u,u+1))return t;if(o==0)break;t=n<0?r.before(o):r.after(o)}}function YY(e,t,n){let r=new zo(t-n,t+n,Lt.empty,!0);e.step(r)}function JY(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i=0;s--){let u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,d=r.index(s)+(u>0?1:0),f=r.node(s),g=!1;if(i==1)g=f.canReplace(d,d,o);else{let v=f.contentMatchAt(d).findWrapping(o.firstChild.type);g=v&&f.canReplaceWith(d,d,v[0])}if(g)return u==0?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function QC(e,t,n=t,r=Lt.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return uN(o,i,r)?new zo(t,n,r):new ZY(o,i,r).fit()}function uN(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class ZY{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=pt.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=pt.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let f=this.findFittable();f?this.placeNodes(f):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,s=r.depth,u=o.depth;for(;s&&u&&i.childCount==1;)i=i.firstChild.content,s--,u--;let d=new Lt(i,s,u);return t>-1?new xo(r.pos,t,this.$to.pos,this.$to.end(),d,n):d.size||r.pos!=this.$to.pos?new zo(r.pos,o.pos,d):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=j1(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let u=this.depth;u>=0;u--){let{type:d,match:f}=this.frontier[u],g,v=null;if(n==1&&(s?f.matchType(s.type)||(v=f.fillBefore(pt.from(s),!1)):i&&d.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:u,parent:i,inject:v};if(n==2&&s&&(g=f.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:u,parent:i,wrap:g};if(i&&f.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=j1(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new Lt(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=j1(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new Lt(Yp(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Lt(Yp(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let D=0;D1||d==0||D.content.size)&&(v=w,g.push(cN(D.mark(_.allowedMarks(D.marks)),f==1?d:0,f==u.childCount?M:-1)))}let C=f==u.childCount;C||(M=-1),this.placed=Jp(this.placed,n,pt.from(g)),this.frontier[n].match=v,C&&M<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let D=0,w=u;D1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;u--){let{match:d,type:f}=this.frontier[u],g=W1(t,u,f,d,!0);if(!g||g.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Jp(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Jp(this.placed,this.depth,pt.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(pt.empty,!0);n.childCount&&(this.placed=Jp(this.placed,this.frontier.length,n))}}function Yp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Yp(e.firstChild.content,t-1,n)))}function Jp(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Jp(e.lastChild.content,t-1,n)))}function j1(e,t){for(let n=0;n1&&(r=r.replaceChild(0,cN(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(pt.empty,!0)))),e.copy(r)}function W1(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let u=r.fillBefore(i.content,!0,s);return u&&!QY(n,i.content,s)?u:null}function QY(e,t,n){for(let r=n;r0;_--,M--){let C=o.node(_).type.spec;if(C.defining||C.definingAsContext||C.isolating)break;s.indexOf(_)>-1?u=_:o.before(_)==M&&s.splice(1,0,-_)}let d=s.indexOf(u),f=[],g=r.openStart;for(let _=r.content,M=0;;M++){let C=_.firstChild;if(f.push(C),M==r.openStart)break;_=C.content}for(let _=g-1;_>=0;_--){let M=f[_].type,C=eJ(M);if(C&&o.node(d).type!=M)g=_;else if(C||!M.isTextblock)break}for(let _=r.openStart;_>=0;_--){let M=(_+g+1)%(r.openStart+1),C=f[M];if(C)for(let D=0;D=0&&(e.replace(t,n,r),!(e.steps.length>v));_--){let M=s[_];M<0||(t=o.before(M),n=i.after(M))}}function dN(e,t,n,r,o){if(tr){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(pt.empty,!0))}return e}function nJ(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=JY(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new Lt(pt.from(r),0,0))}function rJ(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=fN(r,o);for(let s=0;s0&&(d||r.node(u-1).canReplace(r.index(u-1),o.indexAfter(u-1))))return e.delete(r.before(u),o.after(u))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}function fN(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class ff extends Yi{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return _o.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return _o.fromReplace(t,this.pos,this.pos+1,new Lt(pt.from(o),0,n.isLeaf?0:1))}getMap(){return Cs.empty}invert(t){return new ff(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ff(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ff(n.pos,n.attr,n.value)}}Yi.jsonID("attr",ff);let Af=class extends Error{};Af=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Af.prototype=Object.create(Error.prototype);Af.prototype.constructor=Af;Af.prototype.name="TransformError";class oJ{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new gh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Af(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Lt.empty){let o=QC(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new Lt(pt.from(r),0,0))}delete(t,n){return this.replace(t,n,Lt.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return tJ(this,t,n,r),this}replaceRangeWith(t,n,r){return nJ(this,t,n,r),this}deleteRange(t,n){return rJ(this,t,n),this}lift(t,n){return BY(this,t,n),this}join(t,n=1){return YY(this,t,n),this}wrap(t,n){return VY(this,t,n),this}setBlockType(t,n=t,r,o=null){return zY(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return WY(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new ff(t,n,r)),this}addNodeMark(t,n){return this.step(new Wl(t,n)),this}removeNodeMark(t,n){if(!(n instanceof lr)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ef(t,n)),this}split(t,n=1,r){return KY(this,t,n,r),this}addMark(t,n,r){return UY(this,t,n,r),this}removeMark(t,n,r){return FY(this,t,n,r),this}clearIncompatible(t,n,r){return GY(this,t,n,r),this}}const K1=Object.create(null);class kn{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new iJ(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;i--){let s=n<0?zd(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):zd(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new zs(t.node(0))}static atStart(t){return zd(t,t,0,0,1)||new zs(t)}static atEnd(t){return zd(t,t,t.content.size,t.childCount,-1)||new zs(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=K1[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in K1)throw new RangeError("Duplicate use of selection JSON ID "+t);return K1[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Bn.between(this.$anchor,this.$head).getBookmark()}}kn.prototype.visible=!0;class iJ{constructor(t,n){this.$from=t,this.$to=n}}let r2=!1;function o2(e){!r2&&!e.parent.inlineContent&&(r2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Bn extends kn{constructor(t,n=t){o2(t),o2(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return kn.near(r);let o=t.resolve(n.map(this.anchor));return new Bn(o.parent.inlineContent?o:r,r)}replace(t,n=Lt.empty){if(super.replace(t,n),n==Lt.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Bn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ky(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Bn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=kn.findFrom(n,r,!0)||kn.findFrom(n,-r,!0);if(i)n=i.$head;else return kn.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=(kn.findFrom(t,-r,!0)||kn.findFrom(t,r,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let u=t.child(s);if(u.isAtom){if(!i&&sn.isSelectable(u))return sn.create(e,n-(o<0?u.nodeSize:0))}else{let d=zd(e,u,n+o,o<0?u.childCount:0,o,i);if(d)return d}n+=u.nodeSize*o}return null}function i2(e,t,n){let r=e.steps.length-1;if(r{s==null&&(s=g)}),e.setSelection(kn.near(e.doc.resolve(s),n))}const s2=1,wm=2,a2=4;class aJ extends oJ{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=wm,this}ensureMarks(t){return lr.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&wm)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~wm,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||lr.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),this.selection.empty||this.setSelection(kn.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=a2,this}get scrolledIntoView(){return(this.updated&a2)>0}}function l2(e,t){return!t||!e?e:e.bind(t)}class Xp{constructor(t,n,r){this.name=t,this.init=l2(n.init,r),this.apply=l2(n.apply,r)}}const lJ=[new Xp("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Xp("selection",{init(e,t){return e.selection||kn.atStart(t.doc)},apply(e){return e.selection}}),new Xp("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Xp("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Y1{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=lJ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Xp(r.key,r.spec.state,r))})}}class Xd{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;rr.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Y1(t.schema,t.plugins),i=new Xd(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Bc.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=kn.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let d=r[u],f=d.spec.state;if(d.key==s.name&&f&&f.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){i[s.name]=f.fromJSON.call(d,t,n[u],i);return}}i[s.name]=s.init(t,i)}}),i}}function pN(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=pN(o,t,{})),n[r]=o}return n}class Aa{constructor(t){this.spec=t,this.props={},t.props&&pN(t.props,this,this.props),this.key=t.key?t.key.key:hN("plugin")}getState(t){return t[this.key]}}const J1=Object.create(null);function hN(e){return e in J1?e+"$"+ ++J1[e]:(J1[e]=0,e+"$")}class ku{constructor(t="key"){this.key=hN(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const wi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Xh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let u2=null;const Wa=function(e,t,n){let r=u2||(u2=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},ed=function(e,t,n,r){return n&&(c2(e,t,n,r,-1)||c2(e,t,n,r,1))},uJ=/^(img|br|input|textarea|hr)$/i;function c2(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:ha(e))){let i=e.parentNode;if(!i||i.nodeType!=1||tT(e)||uJ.test(e.nodeName)||e.contentEditable=="false")return!1;t=wi(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?ha(e):0}else return!1}}function ha(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function cJ(e,t,n){for(let r=t==0,o=t==ha(e);r||o;){if(e==n)return!0;let i=wi(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==ha(e)}}function tT(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Yy=function(e){return e.focusNode&&ed(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function lc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function dJ(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function fJ(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Sa=typeof navigator<"u"?navigator:null,d2=typeof document<"u"?document:null,Du=Sa&&Sa.userAgent||"",WM=/Edge\/(\d+)/.exec(Du),gN=/MSIE \d/.exec(Du),KM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Du),ji=!!(gN||KM||WM),uu=gN?document.documentMode:KM?+KM[1]:WM?+WM[1]:0,Ks=!ji&&/gecko\/(\d+)/i.test(Du);Ks&&+(/Firefox\/(\d+)/.exec(Du)||[0,0])[1];const YM=!ji&&/Chrome\/(\d+)/.exec(Du),fi=!!YM,pJ=YM?+YM[1]:0,Di=!ji&&!!Sa&&/Apple Computer/.test(Sa.vendor),Lf=Di&&(/Mobile\/\w+/.test(Du)||!!Sa&&Sa.maxTouchPoints>2),bs=Lf||(Sa?/Mac/.test(Sa.platform):!1),hJ=Sa?/Win/.test(Sa.platform):!1,$s=/Android \d/.test(Du),Jy=!!d2&&"webkitFontSmoothing"in d2.documentElement.style,gJ=Jy?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function mJ(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ba(e,t){return typeof e=="number"?e:e[t]}function vJ(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function f2(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Xh(s)){if(s.nodeType!=1)continue;let u=s,d=u==i.body,f=d?mJ(i):vJ(u),g=0,v=0;if(t.topf.bottom-Ba(r,"bottom")&&(v=t.bottom-t.top>f.bottom-f.top?t.top+Ba(o,"top")-f.top:t.bottom-f.bottom+Ba(o,"bottom")),t.leftf.right-Ba(r,"right")&&(g=t.right-f.right+Ba(o,"right")),g||v)if(d)i.defaultView.scrollBy(g,v);else{let _=u.scrollLeft,M=u.scrollTop;v&&(u.scrollTop+=v),g&&(u.scrollLeft+=g);let C=u.scrollLeft-_,D=u.scrollTop-M;t={left:t.left-C,top:t.top-D,right:t.right-C,bottom:t.bottom-D}}if(d||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function yJ(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,s=n+1;s=n-20){r=u,o=d.top;break}}return{refDOM:r,refTop:o,stack:mN(e.dom)}}function mN(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Xh(r));return t}function _J({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;vN(n,r==0?0:r-t)}function vN(e,t){for(let n=0;n=u){s=Math.max(C.bottom,s),u=Math.min(C.top,u);let D=C.left>t.left?C.left-t.left:C.right=(C.left+C.right)/2?1:0));continue}}else C.top>t.top&&!d&&C.left<=t.left&&C.right>=t.left&&(d=g,f={left:Math.max(C.left,Math.min(C.right,t.left)),top:C.top});!n&&(t.left>=C.right&&t.top>=C.top||t.left>=C.left&&t.top>=C.bottom)&&(i=v+1)}}return!n&&d&&(n=d,o=f,r=0),n&&n.nodeType==3?MJ(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:yN(n,o)}function MJ(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function nT(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function IJ(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function TJ(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let u=e.docView.nearestDesc(i,!0);if(!u)return null;if(u.dom.nodeType==1&&(u.node.isBlock&&u.parent&&!s||!u.contentDOM)){let d=u.dom.getBoundingClientRect();if(u.node.isBlock&&u.parent&&!s&&(s=!0,d.left>r.left||d.top>r.top?o=u.posBefore:(d.right-1?o:e.docView.posFromDOM(t,n,-1)}function _N(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(u=TJ(e,r,o,t))}u==null&&(u=CJ(e,s,t));let d=e.docView.nearestDesc(s,!0);return{pos:u,inside:d?d.posAtStart-d.border:-1}}function p2(e){return e.top=0&&o==r.nodeValue.length?(d--,g=1):n<0?d--:f++,Up(Nl(Wa(r,d,f),g),g<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==ha(r))){let d=r.childNodes[o-1];if(d.nodeType==1)return X1(d.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==ha(r))){let d=r.childNodes[o-1],f=d.nodeType==3?Wa(d,ha(d)-(s?0:1)):d.nodeType==1&&(d.nodeName!="BR"||!d.nextSibling)?d:null;if(f)return Up(Nl(f,1),!1)}if(i==null&&o=0)}function Up(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function X1(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function MN(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function kJ(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return MN(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(i,!0);if(!u)break;if(u.node.isBlock){i=u.contentDOM||u.dom;break}i=u.dom.parentNode}let s=bN(e,o.pos,1);for(let u=i.firstChild;u;u=u.nextSibling){let d;if(u.nodeType==1)d=u.getClientRects();else if(u.nodeType==3)d=Wa(u,0,u.nodeValue.length).getClientRects();else continue;for(let f=0;fg.top+1&&(n=="up"?s.top-g.top>(g.bottom-s.top)*2:g.bottom-s.bottom>(s.bottom-g.top)*2))return!1}}return!0})}const DJ=/[\u0590-\u08ac]/;function EJ(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,u=e.domSelection();return!DJ.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?i:s:MN(e,t,()=>{let{focusNode:d,focusOffset:f,anchorNode:g,anchorOffset:v}=e.domSelectionRange(),_=u.caretBidiLevel;u.modify("move",n,"character");let M=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:C,focusOffset:D}=e.domSelectionRange(),w=C&&!M.contains(C.nodeType==1?C:C.parentNode)||d==C&&f==D;try{u.collapse(g,v),d&&(d!=g||f!=v)&&u.extend&&u.extend(d,f)}catch{}return _!=null&&(u.caretBidiLevel=_),w})}let h2=null,g2=null,m2=!1;function AJ(e,t,n){return h2==t&&g2==n?m2:(h2=t,g2=n,m2=n=="up"||n=="down"?kJ(e,t,n):EJ(e,t,n))}const Ss=0,v2=1,pc=2,ka=3;class yg{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Ss,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;nwi(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||s instanceof CN){o=t-i;break}i=u}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof IN&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?wi(i.dom)+1:0}}else{let i,s=!0;for(;i=r=g&&n<=f-d.border&&d.node&&d.contentDOM&&this.contentDOM.contains(d.contentDOM))return d.parseRange(t,n,g);t=s;for(let v=u;v>0;v--){let _=this.children[v-1];if(_.size&&_.dom.parentNode==this.contentDOM&&!_.emptyChildAt(1)){o=wi(_.dom)+1;break}t-=_.size}o==-1&&(o=0)}if(o>-1&&(f>n||u==this.children.length-1)){n=f;for(let g=u+1;gM&&sn){let M=u;u=d,d=M}let _=document.createRange();_.setEnd(d.node,d.offset),_.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(_)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o=r:tr){let u=r+i.border,d=s-i.border;if(t>=u&&n<=d){this.dirty=t==r||n==s?pc:v2,t==u&&n==d&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ka:i.markDirty(t-u,n-u);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?pc:ka}r=s}this.dirty=pc}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?pc:v2;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let u=document.createElement("span");u.appendChild(s),s=u}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==Ss&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class LJ extends yg{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class td extends yg{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=ba.renderSpec(document,n.type.spec.toDOM(n,r))),new td(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&ka||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=ka&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Ss){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=ZM(i,0,t,r));for(let u=0;u{if(!d)return s;if(d.parent)return d.parent.posBeforeChild(d)},r,o),g=f&&f.dom,v=f&&f.contentDOM;if(n.isText){if(!g)g=document.createTextNode(n.text);else if(g.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else g||({dom:g,contentDOM:v}=ba.renderSpec(document,n.type.spec.toDOM(n)));!v&&!n.isText&&g.nodeName!="BR"&&(g.hasAttribute("contenteditable")||(g.contentEditable="false"),n.type.spec.draggable&&(g.draggable=!0));let _=g;return g=SN(g,r,n),f?d=new OJ(t,n,r,o,g,v||null,_,f,i,s+1):n.isText?new Xy(t,n,r,o,g,_,i):new cu(t,n,r,o,g,v||null,_,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>pt.empty)}return t}matchesNode(t,n,r){return this.dirty==Ss&&t.eq(this.node)&&XM(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,u=i&&i.pos<0,d=new NJ(this,s&&s.node,t);UJ(this.node,this.innerDeco,(f,g,v)=>{f.spec.marks?d.syncToMarks(f.spec.marks,r,t):f.type.side>=0&&!v&&d.syncToMarks(g==this.node.childCount?lr.none:this.node.child(g).marks,r,t),d.placeWidget(f,t,o)},(f,g,v,_)=>{d.syncToMarks(f.marks,r,t);let M;d.findNodeMatch(f,g,v,_)||u&&t.state.selection.from>o&&t.state.selection.to-1&&d.updateNodeAt(f,g,v,M,t)||d.updateNextNode(f,g,v,t,_,o)||d.addNode(f,g,v,t,o),o+=f.nodeSize}),d.syncToMarks([],r,t),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==pc)&&(s&&this.protectLocalComposition(t,s),TN(this.contentDOM,this.children,t),Lf&&FJ(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Bn)||rn+this.node.content.size)return null;let i=t.domSelectionRange(),s=GJ(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let u=s.nodeValue,d=$J(this.node.content,u,r-n,o-n);return d<0?null:{node:s,pos:d,text:u}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new LJ(this,i,n,o);t.input.compositionNodes.push(s),this.children=ZM(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==ka||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Ss}updateOuterDeco(t){if(XM(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=wN(this.dom,this.nodeDOM,JM(this.outerDeco,this.node,n),JM(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function y2(e,t,n,r,o){SN(r,t,e);let i=new cu(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Xy extends cu{constructor(t,n,r,o,i,s,u){super(t,n,r,o,i,null,s,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==ka||this.dirty!=Ss&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ss||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Ss,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new Xy(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ka)}get domAtom(){return!1}}class CN extends yg{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Ss&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class OJ extends cu{constructor(t,n,r,o,i,s,u,d,f,g){super(t,n,r,o,i,s,u,f,g),this.spec=d}update(t,n,r,o){if(this.dirty==ka)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function TN(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let d=td.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))i=this.top.children.indexOf(s,this.index);else for(let u=this.index,d=Math.min(this.top.children.length,u+5);u0;){let u;for(;;)if(r){let f=n.children[r-1];if(f instanceof td)n=f,r=f.children.length;else{u=f,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let d=u.node;if(d){if(d!=e.child(o-1))break;--o,i.set(u,o),s.push(u)}}return{index:o,matched:i,matches:s.reverse()}}function xJ(e,t){return e.type.side-t.type.side}function UJ(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let f=0;fi;)u.push(o[s++]);let _=i+g.nodeSize;if(g.isText){let C=_;s!C.inline):u.slice();r(g,M,t.forChild(i,g),v),i=_}}function FJ(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function GJ(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=ha(e)}else if(e.nodeType==1&&t=n){let f=u=0&&f+t.length+u>=n)return u+f;if(n==r&&d.length>=r+t.length-u&&d.slice(r-u,r-u+t.length)==t)return r}}return-1}function ZM(e,t,n,r,o){let i=[];for(let s=0,u=0;s=n||g<=t?i.push(d):(fn&&i.push(d.slice(n-f,d.size,r)))}return i}function rT(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let u=r.resolve(s),d,f;if(Yy(n)){for(d=u;o&&!o.node;)o=o.parent;let g=o.node;if(o&&g.isAtom&&sn.isSelectable(g)&&o.parent&&!(g.isInline&&cJ(n.focusNode,n.focusOffset,o.dom))){let v=o.posBefore;f=new sn(s==v?u:r.resolve(v))}}else{let g=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(g<0)return null;d=r.resolve(g)}if(!f){let g=t=="pointer"||e.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!kN(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function HJ(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,wi(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&ji&&uu<=11&&(r.disabled=!0,r.disabled=!1)}function DN(e,t){if(t instanceof sn){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(C2(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else C2(e)}function C2(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oT(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Bn.between(t,n,r)}function T2(e){return e.editable&&!e.hasFocus()?!1:EN(e)}function EN(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function qJ(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return ed(t.node,t.offset,n.anchorNode,n.anchorOffset)}function QM(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&kn.findFrom(i,t)}function uc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function w2(e,t,n){let r=e.state.selection;if(r instanceof Bn){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let o=QM(e.state,t);return o&&o instanceof sn?uc(e,o):!1}else if(!(bs&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let u=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(u))&&!s.contentDOM?sn.isSelectable(i)?uc(e,new sn(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Jy?uc(e,new Bn(e.state.doc.resolve(t<0?u:u+i.nodeSize))):!1:!1}}else{if(r instanceof sn&&r.node.isInline)return uc(e,new Bn(t>0?r.$to:r.$from));{let o=QM(e.state,t);return o?uc(e,o):!1}}}function zv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vh(e){if(e.contentEditable=="false")return!0;let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function Fp(e,t){return t<0?VJ(e):AN(e)}function VJ(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(Ks&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(vh(u))o=n,i=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(LN(n))break;{let u=n.previousSibling;for(;u&&vh(u);)o=n.parentNode,i=wi(u),u=u.previousSibling;if(u)n=u,r=zv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?eI(e,n,r):o&&eI(e,o,i)}function AN(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=zv(n),i,s;for(;;)if(r{e.state==o&&ul(e)},50)}function S2(e,t){let n=e.state.doc.resolve(t);if(!(fi||hJ)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function k2(e,t,n){let r=e.state.selection;if(r instanceof Bn&&!r.empty||n.indexOf("s")>-1||bs&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=QM(e.state,t);if(s&&s instanceof sn)return uc(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,u=r instanceof zs?kn.near(s,t):kn.findFrom(s,t);return u?uc(e,u):!1}return!1}function D2(e,t){if(!(e.state.selection instanceof Bn))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function E2(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function WJ(e){if(!Di||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;E2(e,r,"true"),setTimeout(()=>E2(e,r,"false"),20)}return!1}function KJ(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function YJ(e,t){let n=t.keyCode,r=KJ(t);if(n==8||bs&&n==72&&r=="c")return D2(e,-1)||Fp(e,-1);if(n==46&&!t.shiftKey||bs&&n==68&&r=="c")return D2(e,1)||Fp(e,1);if(n==13||n==27)return!0;if(n==37||bs&&n==66&&r=="c"){let o=n==37?S2(e,e.state.selection.from)=="ltr"?-1:1:-1;return w2(e,o,r)||Fp(e,o)}else if(n==39||bs&&n==70&&r=="c"){let o=n==39?S2(e,e.state.selection.from)=="ltr"?1:-1:1;return w2(e,o,r)||Fp(e,o)}else{if(n==38||bs&&n==80&&r=="c")return k2(e,-1,r)||Fp(e,-1);if(n==40||bs&&n==78&&r=="c")return WJ(e)||k2(e,1,r)||AN(e);if(r==(bs?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ON(e,t){e.someProp("transformCopied",M=>{t=M(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let M=r.firstChild;n.push(M.type.name,M.attrs!=M.type.defaultAttrs?M.attrs:null),r=M.content}let s=e.someProp("clipboardSerializer")||ba.fromSchema(e.state.schema),u=FN(),d=u.createElement("div");d.appendChild(s.serializeFragment(r,{document:u}));let f=d.firstChild,g,v=0;for(;f&&f.nodeType==1&&(g=UN[f.nodeName.toLowerCase()]);){for(let M=g.length-1;M>=0;M--){let C=u.createElement(g[M]);for(;d.firstChild;)C.appendChild(d.firstChild);d.appendChild(C),v++}f=d.firstChild}f&&f.nodeType==1&&f.setAttribute("data-pm-slice",`${o} ${i}${v?` -${v}`:""} ${JSON.stringify(n)}`);let _=e.someProp("clipboardTextSerializer",M=>M(t,e))||t.content.textBetween(0,t.content.size,` `);return{dom:d,text:_}}function RN(e,t,n,r,o){let i=o.parent.type.spec.code,s,u;if(!n&&!t)return null;let d=t&&(r||i||!n);if(d){if(e.someProp("transformPastedText",_=>{t=_(t,i||r,e)}),i)return t?new Lt(pt.from(e.state.schema.text(t.replace(/\r\n?/g,` `))),0,0):Lt.empty;let v=e.someProp("clipboardTextParser",_=>_(t,o,r,e));if(v)u=v;else{let _=o.marks(),{schema:M}=e.state,C=ba.fromSchema(M);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(D=>{let w=s.appendChild(document.createElement("p"));D&&w.appendChild(C.serializeNode(M.text(D,_)))})}}else e.someProp("transformPastedHTML",v=>{n=v(n,e)}),s=ZJ(n),Jy&&QJ(s);let f=s&&s.querySelector("[data-pm-slice]"),g=f&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(f.getAttribute("data-pm-slice")||"");if(g&&g[3])for(let v=+g[3];v>0;v--){let _=s.firstChild;for(;_&&_.nodeType!=1;)_=_.nextSibling;if(!_)break;s=_}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||Df.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(d||g),context:o,ruleFromNode(_){return _.nodeName=="BR"&&!_.nextSibling&&_.parentNode&&!JJ.test(_.parentNode.nodeName)?{ignore:!0}:null}})),g)u=eX(A2(u,+g[1],+g[2]),g[4]);else if(u=Lt.maxOpen(XJ(u.content,o),!0),u.openStart||u.openEnd){let v=0,_=0;for(let M=u.content.firstChild;v{u=v(u,e)}),u}const JJ=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function XJ(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(u=>{if(!s)return;let d=o.findWrapping(u.type),f;if(!d)return s=null;if(f=s.length&&i.length&&PN(d,i,u,s[s.length-1],0))s[s.length-1]=f;else{s.length&&(s[s.length-1]=xN(s[s.length-1],i.length));let g=NN(u,d);s.push(g),o=o.matchType(g.type),i=d}}),s)return pt.from(s)}return e}function NN(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,pt.from(e));return e}function PN(e,t,n,r,o){if(o1&&(i=0),o=n&&(u=t<0?s.contentMatchAt(0).fillBefore(u,i<=o).append(u):u.append(s.contentMatchAt(s.childCount).fillBefore(pt.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(u))}function A2(e,t,n){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=FN().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&UN[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),n.innerHTML=e,o)for(let i=0;i=0;u-=2){let d=n.nodes[r[u]];if(!d||d.hasRequiredAttrs())break;o=pt.from(d.create(r[u+1],o)),i++,s++}return new Lt(o,i,s)}const Ei={},Ai={},tX={touchstart:!0,touchmove:!0};class nX{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function rX(e){for(let t in Ei){let n=Ei[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{iX(e,r)&&!iT(e,r)&&(e.editable||!(r.type in Ai))&&n(e,r)},tX[t]?{passive:!0}:void 0)}Di&&e.dom.addEventListener("input",()=>null),nI(e)}function Kl(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function oX(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function nI(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>iT(e,r))})}function iT(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function iX(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function sX(e,t){!iT(e,t)&&Ei[t.type]&&(e.editable||!(t.type in Ai))&&Ei[t.type](e,t)}Ai.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!$N(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!($s&&fi&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Lf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,lc(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||YJ(e,n)?n.preventDefault():Kl(e,"key")};Ai.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Ai.keypress=(e,t)=>{let n=t;if($N(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||bs&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Bn)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Zy(e){return{left:e.clientX,top:e.clientY}}function aX(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function sT(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,u=>s>i.depth?u(e,n,i.nodeAfter,i.before(s),o,!0):u(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function pf(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function lX(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&sn.isSelectable(r)?(pf(e,new sn(n),"pointer"),!0):!1}function uX(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof sn&&(r=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let u=s>i.depth?i.nodeAfter:i.node(s);if(sn.isSelectable(u)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(pf(e,sn.create(e.state.doc,o),"pointer"),!0):!1}function cX(e,t,n,r,o){return sT(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?uX(e,n):lX(e,n))}function dX(e,t,n,r){return sT(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function fX(e,t,n,r){return sT(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||pX(e,n,r)}function pX(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(pf(e,Bn.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),u=o.before(i);if(s.inlineContent)pf(e,Bn.create(r,u+1,u+1+s.content.size),"pointer");else if(sn.isSelectable(s))pf(e,sn.create(r,u),"pointer");else continue;return!0}}function aT(e){return jv(e)}const GN=bs?"metaKey":"ctrlKey";Ei.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=aT(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&aX(n,e.input.lastClick)&&!n[GN]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(Zy(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new hX(e,s,n,!!r)):(i=="doubleClick"?dX:fX)(e,s.pos,s.inside,n)?n.preventDefault():Kl(e,"pointer"))};class hX{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[GN],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let g=t.state.doc.resolve(n.pos);i=g.parent,s=g.depth?g.before():0}const u=o?null:r.target,d=u?t.docView.nearestDesc(u,!0):null;this.target=d?d.dom:null;let{selection:f}=t.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||f instanceof sn&&f.from<=s&&f.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ks&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Kl(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ul(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Zy(t))),this.updateAllowDefault(t),this.allowDefault||!n?Kl(this.view,"pointer"):cX(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Di&&this.mightDrag&&!this.mightDrag.node.isAtom||fi&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(pf(this.view,kn.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Kl(this.view,"pointer")}move(t){this.updateAllowDefault(t),Kl(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Ei.touchstart=e=>{e.input.lastTouch=Date.now(),aT(e),Kl(e,"pointer")};Ei.touchmove=e=>{e.input.lastTouch=Date.now(),Kl(e,"pointer")};Ei.contextmenu=e=>aT(e);function $N(e,t){return e.composing?!0:Di&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const gX=$s?5e3:-1;Ai.compositionstart=Ai.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),jv(e,!0),e.markCursor=null;else if(jv(e),Ks&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}BN(e,gX)};Ai.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,BN(e,20))};function BN(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>jv(e),t))}function HN(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=mX());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function mX(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function jv(e,t=!1){if(!($s&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),HN(e),t||e.docView&&e.docView.dirty){let n=rT(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function vX(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Of=ji&&uu<15||Lf&&gJ<604;Ei.copy=Ai.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=Of?null:n.clipboardData,s=r.content(),{dom:u,text:d}=ON(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",u.innerHTML),i.setData("text/plain",d)):vX(e,u),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yX(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function _X(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Zh(e,r.value,null,o,t):Zh(e,r.textContent,r.innerHTML,o,t)},50)}function Zh(e,t,n,r,o){let i=RN(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",d=>d(e,o,i||Lt.empty)))return!0;if(!i)return!1;let s=yX(i),u=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ai.paste=(e,t)=>{let n=t;if(e.composing&&!$s)return;let r=Of?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Zh(e,r.getData("text/plain"),r.getData("text/html"),o,n)?n.preventDefault():_X(e,n)};class bX{constructor(t,n){this.slice=t,this.move=n}}const qN=bs?"altKey":"ctrlKey";Ei.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Zy(n));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof sn?o.to-1:o.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(sn.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&e.dispatch(e.state.tr.setSelection(sn.create(e.state.doc,f.posBefore)))}}let s=e.state.selection.content(),{dom:u,text:d}=ON(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Of?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Of||n.dataTransfer.setData("text/plain",d),e.dragging=new bX(s,!n[qN])};Ei.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Ai.dragover=Ai.dragenter=(e,t)=>t.preventDefault();Ai.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(Zy(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",C=>{s=C(s,e)}):s=RN(e,n.dataTransfer.getData(Of?"Text":"text/plain"),Of?null:n.dataTransfer.getData("text/html"),!1,i);let u=!!(r&&!n[qN]);if(e.someProp("handleDrop",C=>C(e,n,s||Lt.empty,u))){n.preventDefault();return}if(!s)return;n.preventDefault();let d=s?XY(e.state.doc,i.pos,s):i.pos;d==null&&(d=i.pos);let f=e.state.tr;u&&f.deleteSelection();let g=f.mapping.map(d),v=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,_=f.doc;if(v?f.replaceRangeWith(g,g,s.content.firstChild):f.replaceRange(g,g,s),f.doc.eq(_))return;let M=f.doc.resolve(g);if(v&&sn.isSelectable(s.content.firstChild)&&M.nodeAfter&&M.nodeAfter.sameMarkup(s.content.firstChild))f.setSelection(new sn(M));else{let C=f.mapping.map(d);f.mapping.maps[f.mapping.maps.length-1].forEach((D,w,S,N)=>C=N),f.setSelection(oT(e,M,f.doc.resolve(C)))}e.focus(),e.dispatch(f.setMeta("uiEvent","drop"))};Ei.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ul(e)},20))};Ei.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Ei.beforeinput=(e,t)=>{if(fi&&$s&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,lc(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Ai)Ei[e]=Ai[e];function Qh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class lT{constructor(t,n){this.toDOM=t,this.spec=n||Hc,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:s}=t.mapResult(n.from+o,this.side<0?-1:1);return s?null:new is(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof lT&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Qh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class du{constructor(t,n){this.attrs=t,this.spec=n||Hc}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new is(i,s,this)}valid(t,n){return n.from=t&&(!i||i(u.spec))&&r.push(u.copy(u.from+o,u.to+o))}for(let s=0;st){let u=this.children[s]+1;this.children[s+2].findInner(t-u,n-u,r,o+u,i)}}map(t,n,r){return this==si||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Hc)}mapInner(t,n,r,o,i){let s;for(let u=0;u{let f=d+r,g;if(g=zN(n,u,f)){for(o||(o=this.children.slice());iu&&v.to=t){this.children[u]==t&&(r=this.children[u+2]);break}let i=t+1,s=i+n.content.size;for(let u=0;ui&&d.type instanceof du){let f=Math.max(i,d.from)-i,g=Math.min(s,d.to)-i;fo.map(t,n,Hc));return Bl.from(r)}forChild(t,n){if(n.isLeaf)return fo.empty;let r=[];for(let o=0;on instanceof fo)?t:t.reduce((n,r)=>n.concat(r instanceof fo?r:r.members),[]))}}}function MX(e,t,n,r,o,i,s){let u=e.slice();for(let f=0,g=i;f{let w=D-C-(M-_);for(let S=0;SN+g-v)continue;let A=u[S]+g-v;M>=A?u[S+1]=_<=A?-2:-1:C>=o&&w&&(u[S]+=w,u[S+1]+=w)}v+=w}),g=n.maps[f].map(g,-1)}let d=!1;for(let f=0;f=r.content.size){d=!0;continue}let _=n.map(e[f+1]+i,-1),M=_-o,{index:C,offset:D}=r.content.findIndex(v),w=r.maybeChild(C);if(w&&D==v&&D+w.nodeSize==M){let S=u[f+2].mapInner(n,w,g+1,e[f]+i+1,s);S!=si?(u[f]=v,u[f+1]=M,u[f+2]=S):(u[f+1]=-2,d=!0)}else d=!0}if(d){let f=IX(u,e,t,n,o,i,s),g=Wv(f,r,0,s);t=g.local;for(let v=0;vn&&s.to{let f=zN(e,u,d+n);if(f){i=!0;let g=Wv(f,u,n+d+1,r);g!=si&&o.push(d,d+u.nodeSize,g)}});let s=VN(i?jN(e):e,-n).sort(qc);for(let u=0;u0;)t++;e.splice(t,0,n)}function Q1(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=si&&t.push(r)}),e.cursorWrapper&&t.push(fo.create(e.state.doc,[e.cursorWrapper.deco])),Bl.from(t)}const CX={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},TX=ji&&uu<=11;class wX{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class SX{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new wX,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),TX&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,CX)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(T2(this.view)){if(this.suppressingSelectionUpdates)return ul(this.view);if(ji&&uu<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ed(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Xh(i))n.add(i);for(let i=t.anchorNode;i;i=Xh(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&T2(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,u=!1,d=[];if(t.editable)for(let g=0;g1){let g=d.filter(v=>v.nodeName=="BR");if(g.length==2){let v=g[0],_=g[1];v.parentNode&&v.parentNode.parentNode==_.parentNode?_.remove():v.remove()}}let f=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),kX(t)),this.handleDOMChange(i,s,u,d),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ul(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let g=0;go;w--){let S=r.childNodes[w-1],N=S.pmViewDesc;if(S.nodeName=="BR"&&!N){i=w;break}if(!N||N.size)break}let v=e.state.doc,_=e.someProp("domParser")||Df.fromSchema(e.state.schema),M=v.resolve(s),C=null,D=_.parse(r,{topNode:M.parent,topMatch:M.parent.contentMatchAt(M.index()),topOpen:!0,from:o,to:i,preserveWhitespace:M.parent.type.whitespace=="pre"?"full":!0,findPositions:f,ruleFromNode:AX,context:M});if(f&&f[0].pos!=null){let w=f[0].pos,S=f[1]&&f[1].pos;S==null&&(S=w),C={anchor:w+s,head:S+s}}return{doc:D,sel:C,from:s,to:u}}function AX(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Di&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Di&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const LX=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function OX(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let z=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,G=rT(e,z);if(G&&!e.state.selection.eq(G)){if(fi&&$s&&e.input.lastKeyCode===13&&Date.now()-100T(e,lc(13,"Enter"))))return;let O=e.state.tr.setSelection(G);z=="pointer"?O.setMeta("pointer",!0):z=="key"&&O.scrollIntoView(),i&&O.setMeta("composition",i),e.dispatch(O)}return}let s=e.state.doc.resolve(t),u=s.sharedDepth(n);t=s.before(u+1),n=e.state.doc.resolve(n).after(u+1);let d=e.state.selection,f=EX(e,t,n),g=e.state.doc,v=g.slice(f.from,f.to),_,M;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||$s)&&o.some(z=>z.nodeType==1&&!LX.test(z.nodeName))&&(!C||C.endA>=C.endB)&&e.someProp("handleKeyDown",z=>z(e,lc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!C)if(r&&d instanceof Bn&&!d.empty&&d.$head.sameParent(d.$anchor)&&!e.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))C={start:d.from,endA:d.to,endB:d.to};else{if(f.sel){let z=P2(e,e.state.doc,f.sel);if(z&&!z.eq(e.state.selection)){let G=e.state.tr.setSelection(z);i&&G.setMeta("composition",i),e.dispatch(G)}}return}if(fi&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from&&f.sel.head==f.sel.anchor){let z=C.endB-C.start;f.sel={anchor:f.sel.anchor+z,head:f.sel.anchor+z}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&C.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?C.start=e.state.selection.from:C.endA=e.state.selection.to-2&&e.state.selection.to<=f.to&&(C.endB+=e.state.selection.to-C.endA,C.endA=e.state.selection.to)),ji&&uu<=11&&C.endB==C.start+1&&C.endA==C.start&&C.start>f.from&&f.doc.textBetween(C.start-f.from-1,C.start-f.from+1)=="  "&&(C.start--,C.endA--,C.endB--);let D=f.doc.resolveNoCache(C.start-f.from),w=f.doc.resolveNoCache(C.endB-f.from),S=g.resolve(C.start),N=D.sameParent(w)&&D.parent.inlineContent&&S.end()>=C.endA,A;if((Lf&&e.input.lastIOSEnter>Date.now()-225&&(!N||o.some(z=>z.nodeName=="DIV"||z.nodeName=="P"))||!N&&D.posz(e,lc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>C.start&&NX(g,C.start,C.endA,D,w)&&e.someProp("handleKeyDown",z=>z(e,lc(8,"Backspace")))){$s&&fi&&e.domObserver.suppressSelectionUpdates();return}fi&&$s&&C.endB==C.start&&(e.input.lastAndroidDelete=Date.now()),$s&&!N&&D.start()!=w.start()&&w.parentOffset==0&&D.depth==w.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==C.endA&&(C.endB-=2,w=f.doc.resolveNoCache(C.endB-f.from),setTimeout(()=>{e.someProp("handleKeyDown",function(z){return z(e,lc(13,"Enter"))})},20));let L=C.start,j=C.endA,V,x,$;if(N){if(D.pos==w.pos)ji&&uu<=11&&D.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ul(e),20)),V=e.state.tr.delete(L,j),x=g.resolve(C.start).marksAcross(g.resolve(C.endA));else if(C.endA==C.endB&&($=RX(D.parent.content.cut(D.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,C.endA-S.start()))))V=e.state.tr,$.type=="add"?V.addMark(L,j,$.mark):V.removeMark(L,j,$.mark);else if(D.parent.child(D.index()).isText&&D.index()==w.index()-(w.textOffset?0:1)){let z=D.parent.textBetween(D.parentOffset,w.parentOffset);if(e.someProp("handleTextInput",G=>G(e,L,j,z)))return;V=e.state.tr.insertText(z,L,j)}}if(V||(V=e.state.tr.replace(L,j,f.doc.slice(C.start-f.from,C.endB-f.from))),f.sel){let z=P2(e,V.doc,f.sel);z&&!(fi&&$s&&e.composing&&z.empty&&(C.start!=C.endB||e.input.lastAndroidDeletet.content.size?null:oT(e,t.resolve(n.anchor),t.resolve(n.head))}function RX(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,u,d;for(let g=0;gg.mark(u.addToSet(g.marks));else if(o.length==0&&i.length==1)u=i[0],s="remove",d=g=>g.mark(u.removeFromSet(g.marks));else return null;let f=[];for(let g=0;gn||eb(s,!0,!1)0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function PX(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a:s,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let d=Math.max(0,i-Math.min(s,u));r-=s+d-i}if(s=s?i-r:0;i-=d,u=i+(u-s),s=i}else if(u=u?i-r:0;i-=d,s=i+(s-u),u=i}return{start:i,endA:s,endB:u}}class xX{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new nX,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach($2),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=F2(this),U2(this),this.nodeViews=G2(this),this.docView=y2(this.state.doc,x2(this),Q1(this),this.dom,this),this.domObserver=new SX(this,(r,o,i,s)=>OX(this,r,o,i,s)),this.domObserver.start(),rX(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&nI(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach($2),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(HN(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let _=G2(this);FX(_,this.nodeViews)&&(this.nodeViews=_,o=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&nI(this),this.editable=F2(this),U2(this);let u=Q1(this),d=x2(this),f=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",g=o||!this.docView.matchesNode(t.doc,d,u);(g||!t.selection.eq(r.selection))&&(i=!0);let v=f=="preserve"&&i&&this.dom.style.overflowAnchor==null&&yJ(this);if(i){this.domObserver.stop();let _=g&&(ji||fi)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&UX(r.selection,t.selection);if(g){let M=fi?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,d,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=y2(t.doc,d,u,this.dom,this)),M&&!this.trackWrites&&(_=!0)}_||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&qJ(this))?ul(this,_):(DN(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():v&&_J(v)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof sn){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&f2(this,n.getBoundingClientRect(),t)}else f2(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;nn.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return wJ(this,t)}coordsAtPos(t,n=1){return bN(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return AJ(this,n||this.state,t)}pasteHTML(t,n){return Zh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Zh(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(oX(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Q1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return sX(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Di&&this.root.nodeType===11&&dJ(this.dom.ownerDocument)==this.dom?DX(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function x2(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[is.node(0,e.state.doc.content.size,t)]}function U2(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:is.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function F2(e){return!e.someProp("editable",t=>t(e.state)===!1)}function UX(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function G2(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function FX(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function $2(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var _u={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Kv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},GX=typeof navigator<"u"&&/Mac/.test(navigator.platform),$X=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var jo=0;jo<10;jo++)_u[48+jo]=_u[96+jo]=String(jo);for(var jo=1;jo<=24;jo++)_u[jo+111]="F"+jo;for(var jo=65;jo<=90;jo++)_u[jo]=String.fromCharCode(jo+32),Kv[jo]=String.fromCharCode(jo);for(var tb in _u)Kv.hasOwnProperty(tb)||(Kv[tb]=_u[tb]);function BX(e){var t=GX&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||$X&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Kv:_u)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const HX=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function qX(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let u=0;u127)&&(i=_u[r.keyCode])&&i!=o){let u=t[nb(i,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const WX=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function KX(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const YX=(e,t,n)=>{let r=KX(e,n);if(!r)return!1;let o=WN(r);if(!o){let s=r.blockRange(),u=s&&Yf(s);return u==null?!1:(t&&t(e.tr.lift(s,u).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&JN(e,o,t))return!0;if(r.parent.content.size==0&&(Rf(i,"end")||sn.isSelectable(i))){let s=QC(e.doc,r.before(),r.after(),Lt.empty);if(s&&s.slice.size{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=WN(r)}let s=i&&i.nodeBefore;return!s||!sn.isSelectable(s)?!1:(t&&t(e.tr.setSelection(sn.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function WN(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function XX(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let r=XX(e,n);if(!r)return!1;let o=KN(r);if(!o)return!1;let i=o.nodeAfter;if(JN(e,o,t))return!0;if(r.parent.content.size==0&&(Rf(i,"start")||sn.isSelectable(i))){let s=QC(e.doc,r.before(),r.after(),Lt.empty);if(s&&s.slice.size{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof sn,o;if(r){if(n.node.isTextblock||!cd(e.doc,n.from))return!1;o=n.from}else if(o=lN(e.doc,n.from,-1),o==null)return!1;if(t){let i=e.tr.join(o);r&&i.setSelection(sn.create(i.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},tZ=(e,t)=>{let n=e.selection,r;if(n instanceof sn){if(n.node.isTextblock||!cd(e.doc,n.to))return!1;r=n.to}else if(r=lN(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},nZ=(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Yf(o);return i==null?!1:(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},rZ=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` `).scrollIntoView()),!0)};function YN(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=YN(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let u=n.after(),d=e.tr.replaceWith(u,u,s.createAndFill());d.setSelection(kn.near(d.doc.resolve(u),1)),t(d.scrollIntoView())}return!0},iZ=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof zs||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=YN(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(df(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Yf(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)},aZ=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(sn.create(e.doc,o))),!0)};function lZ(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||cd(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function JN(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(lZ(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let v=t.pos+o.nodeSize,_=pt.empty;for(let D=i.length-1;D>=0;D--)_=pt.from(i[D].create(null,_));_=pt.from(r.copy(_));let M=e.tr.step(new xo(t.pos-1,v,t.pos,v,new Lt(_,1,0),i.length,!0)),C=v+2*i.length;cd(M.doc,C)&&M.join(C),n(M.scrollIntoView())}return!0}let d=kn.findFrom(t,1),f=d&&d.$from.blockRange(d.$to),g=f&&Yf(f);if(g!=null&&g>=t.depth)return n&&n(e.tr.lift(f,g).scrollIntoView()),!0;if(u&&Rf(o,"start",!0)&&Rf(r,"end")){let v=r,_=[];for(;_.push(v),!v.isTextblock;)v=v.lastChild;let M=o,C=1;for(;!M.isTextblock;M=M.firstChild)C++;if(v.canReplace(v.childCount,v.childCount,M.content)){if(n){let D=pt.empty;for(let S=_.length-1;S>=0;S--)D=pt.from(_[S].copy(D));let w=e.tr.step(new xo(t.pos-_.length,t.pos+o.nodeSize,t.pos+C,t.pos+o.nodeSize-C,new Lt(D,_.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function XN(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(Bn.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const uZ=XN(-1),cZ=XN(1);function dZ(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),u=s&&sN(s,e,t);return u?(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0):!1}}function B2(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!d.isTextblock||d.hasMarkup(e,t)))if(d.type==e)o=!0;else{let g=n.doc.resolve(f),v=g.index();o=g.parent.canReplaceWith(v,v+1,e)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let g=n.doc.resolve(s.start-2);d=new Bv(g,g,s.depth),s.endIndex=0;g--)i=pt.from(n[g].type.create(n[g].attrs,i));e.step(new xo(t.start-(r?2:0),t.end,t.start,t.end,new Lt(i,0,0),n.length,!0));let s=0;for(let g=0;gs.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?gZ(t,n,e,i):mZ(t,n,i):!0:!1}}function gZ(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);iD;C--)M-=o.child(C).nodeSize,r.delete(M-1,M+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,d=n.endIndex==o.childCount,f=i.node(-1),g=i.index(-1);if(!f.canReplace(g+(u?0:1),g+1,s.content.append(d?pt.empty:pt.from(o))))return!1;let v=i.pos,_=v+s.nodeSize;return r.step(new xo(v-(u?1:0),_+(d?1:0),v+1,_-1,new Lt((u?pt.empty:pt.from(o.copy(pt.empty))).append(d?pt.empty:pt.from(o.copy(pt.empty))),u?0:1,d?0:1),u?0:1)),t(r.scrollIntoView()),!0}function vZ(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,f=>f.childCount>0&&f.firstChild.type==e);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let u=i.parent,d=u.child(s-1);if(d.type!=e)return!1;if(n){let f=d.lastChild&&d.lastChild.type==u.type,g=pt.from(f?e.create():null),v=new Lt(pt.from(e.create(null,pt.from(u.type.create(null,g)))),f?3:1,0),_=i.start,M=i.end;n(t.tr.step(new xo(_-(f?3:1),M,_,M,v,1,!0)).scrollIntoView())}return!0}}function Qy(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class e0{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([u,d])=>[u,(...g)=>{const v=d(...g)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),v}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,u=[],d=!!t,f=t||i.tr,g=()=>(!d&&n&&!f.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(f),u.every(_=>_===!0)),v={...Object.fromEntries(Object.entries(r).map(([_,M])=>[_,(...D)=>{const w=this.buildProps(f,n),S=M(...D)(w);return u.push(S),v}])),run:g};return v}createCan(t){const{rawCommands:n,state:r}=this,o=!1,i=t||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([d,f])=>[d,(...g)=>f(...g)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(t,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o;i.storedMarks&&t.setStoredMarks(i.storedMarks);const u={tr:t,editor:o,view:s,state:Qy({state:i,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([d,f])=>[d,(...g)=>f(...g)(u)]))}};return u}}class yZ{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(o=>o.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(o=>o!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function Ut(e,t,n){return e.config[t]===void 0&&e.parent?Ut(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Ut(e.parent,t,n):null}):e.config[t]}function t0(e){const t=e.filter(o=>o.type==="extension"),n=e.filter(o=>o.type==="node"),r=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ZN(e){const t=[],{nodeExtensions:n,markExtensions:r}=t0(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage},d=Ut(s,"addGlobalAttributes",u);if(!d)return;d().forEach(g=>{g.types.forEach(v=>{Object.entries(g.attributes).forEach(([_,M])=>{t.push({type:v,name:_,attribute:{...i,...M}})})})})}),o.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage},d=Ut(s,"addAttributes",u);if(!d)return;const f=d();Object.entries(f).forEach(([g,v])=>{const _={...i,...v};typeof(_==null?void 0:_.default)=="function"&&(_.default=_.default()),_!=null&&_.isRequired&&(_==null?void 0:_.default)===void 0&&delete _.default,t.push({type:s.name,name:g,attribute:_})})}),t}function Uo(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function _g(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}o==="class"?r[o]=[r[o],i].join(" "):o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function rI(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>_g(n,r),{})}function QN(e){return typeof e=="function"}function Ln(e,t=void 0,...n){return QN(e)?t?e.bind(t)(...n):e(...n):e}function _Z(e={}){return Object.keys(e).length===0&&e.constructor===Object}function bZ(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function H2(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const o=t.reduce((i,s)=>{const u=s.attribute.parseHTML?s.attribute.parseHTML(n):bZ(n.getAttribute(s.name));return u==null?i:{...i,[s.name]:u}},{});return{...r,...o}}}}function q2(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&_Z(n)?!1:n!=null))}function MZ(e,t){var n;const r=ZN(e),{nodeExtensions:o,markExtensions:i}=t0(e),s=(n=o.find(f=>Ut(f,"topNode")))===null||n===void 0?void 0:n.name,u=Object.fromEntries(o.map(f=>{const g=r.filter(S=>S.type===f.name),v={name:f.name,options:f.options,storage:f.storage,editor:t},_=e.reduce((S,N)=>{const A=Ut(N,"extendNodeSchema",v);return{...S,...A?A(f):{}}},{}),M=q2({..._,content:Ln(Ut(f,"content",v)),marks:Ln(Ut(f,"marks",v)),group:Ln(Ut(f,"group",v)),inline:Ln(Ut(f,"inline",v)),atom:Ln(Ut(f,"atom",v)),selectable:Ln(Ut(f,"selectable",v)),draggable:Ln(Ut(f,"draggable",v)),code:Ln(Ut(f,"code",v)),defining:Ln(Ut(f,"defining",v)),isolating:Ln(Ut(f,"isolating",v)),attrs:Object.fromEntries(g.map(S=>{var N;return[S.name,{default:(N=S==null?void 0:S.attribute)===null||N===void 0?void 0:N.default}]}))}),C=Ln(Ut(f,"parseHTML",v));C&&(M.parseDOM=C.map(S=>H2(S,g)));const D=Ut(f,"renderHTML",v);D&&(M.toDOM=S=>D({node:S,HTMLAttributes:rI(S,g)}));const w=Ut(f,"renderText",v);return w&&(M.toText=w),[f.name,M]})),d=Object.fromEntries(i.map(f=>{const g=r.filter(w=>w.type===f.name),v={name:f.name,options:f.options,storage:f.storage,editor:t},_=e.reduce((w,S)=>{const N=Ut(S,"extendMarkSchema",v);return{...w,...N?N(f):{}}},{}),M=q2({..._,inclusive:Ln(Ut(f,"inclusive",v)),excludes:Ln(Ut(f,"excludes",v)),group:Ln(Ut(f,"group",v)),spanning:Ln(Ut(f,"spanning",v)),code:Ln(Ut(f,"code",v)),attrs:Object.fromEntries(g.map(w=>{var S;return[w.name,{default:(S=w==null?void 0:w.attribute)===null||S===void 0?void 0:S.default}]}))}),C=Ln(Ut(f,"parseHTML",v));C&&(M.parseDOM=C.map(w=>H2(w,g)));const D=Ut(f,"renderHTML",v);return D&&(M.toDOM=w=>D({mark:w,HTMLAttributes:rI(w,g)})),[f.name,M]}));return new DY({topNode:s,nodes:u,marks:d})}function rb(e,t){return t.nodes[e]||t.marks[e]||null}function V2(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const IZ=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(o,i,s,u)=>{var d,f;const g=((f=(d=o.type.spec).toText)===null||f===void 0?void 0:f.call(d,{node:o,pos:i,parent:s,index:u}))||o.textContent||"%leaf%";n+=g.slice(0,Math.max(0,r-i))}),n};function dT(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class CZ{constructor(t){this.find=t.find,this.handler=t.handler}}const TZ=(e,t)=>{if(dT(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function ob(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:u}=e,{view:d}=n;if(d.composing)return!1;const f=d.state.doc.resolve(r);if(f.parent.type.spec.code||!((t=f.nodeBefore||f.nodeAfter)===null||t===void 0)&&t.marks.find(_=>_.type.spec.code))return!1;let g=!1;const v=IZ(f)+i;return s.forEach(_=>{if(g)return;const M=TZ(v,_.find);if(!M)return;const C=d.state.tr,D=Qy({state:d.state,transaction:C}),w={from:r-(M[0].length-i.length),to:o},{commands:S,chain:N,can:A}=new e0({editor:n,state:D});_.handler({state:D,range:w,match:M,commands:S,chain:N,can:A})===null||!C.steps.length||(C.setMeta(u,{transform:C,from:r,to:o,text:i}),d.dispatch(C),g=!0)}),g}function wZ(e){const{editor:t,rules:n}=e,r=new Aa({state:{init(){return null},apply(o,i){const s=o.getMeta(r);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput(o,i,s,u){return ob({editor:t,from:i,to:s,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&ob({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?ob({editor:t,from:s.pos,to:s.pos,text:` `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function SZ(e){return typeof e=="number"}const kZ=(e,t)=>{if(dT(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=e,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function DZ(e){const{editor:t,state:n,from:r,to:o,rule:i}=e,{commands:s,chain:u,can:d}=new e0({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,o,(v,_)=>{if(!v.isTextblock||v.type.spec.code)return;const M=Math.max(r,_),C=Math.min(o,_+v.content.size),D=v.textBetween(M-_,C-_,void 0,"");kZ(D,i.find).forEach(S=>{if(S.index===void 0)return;const N=M+S.index+1,A=N+S[0].length,L={from:n.tr.mapping.map(N),to:n.tr.mapping.map(A)},j=i.handler({state:n,range:L,match:S,commands:s,chain:u,can:d});f.push(j)})}),f.every(v=>v!==null)}function EZ(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1;return n.map(u=>new Aa({view(d){const f=g=>{var v;r=!((v=d.dom.parentElement)===null||v===void 0)&&v.contains(g.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:d=>(i=r===d.dom.parentElement,!1),paste:(d,f)=>{var g;const v=(g=f.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return o=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,g)=>{const v=d[0],_=v.getMeta("uiEvent")==="paste"&&!o,M=v.getMeta("uiEvent")==="drop"&&!i;if(!_&&!M)return;const C=f.doc.content.findDiffStart(g.doc.content),D=f.doc.content.findDiffEnd(g.doc.content);if(!SZ(C)||!D||C===D.b)return;const w=g.tr,S=Qy({state:g,transaction:w});if(!(!DZ({editor:t,state:S,from:Math.max(C-1,0),to:D.b-1,rule:u})||!w.steps.length))return w}}))}function AZ(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class Zd{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Zd.resolve(t),this.schema=MZ(this.extensions,n),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const i={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:rb(r.name,this.schema)};r.type==="mark"&&(!((o=Ln(Ut(r,"keepOnSplit",i)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(r.name);const s=Ut(r,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const u=Ut(r,"onCreate",i);u&&this.editor.on("create",u);const d=Ut(r,"onUpdate",i);d&&this.editor.on("update",d);const f=Ut(r,"onSelectionUpdate",i);f&&this.editor.on("selectionUpdate",f);const g=Ut(r,"onTransaction",i);g&&this.editor.on("transaction",g);const v=Ut(r,"onFocus",i);v&&this.editor.on("focus",v);const _=Ut(r,"onBlur",i);_&&this.editor.on("blur",_);const M=Ut(r,"onDestroy",i);M&&this.editor.on("destroy",M)})}static resolve(t){const n=Zd.sort(Zd.flatten(t)),r=AZ(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ut(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(t){return t.sort((r,o)=>{const i=Ut(r,"priority")||100,s=Ut(o,"priority")||100;return i>s?-1:i{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:rb(n.name,this.schema)},o=Ut(n,"addCommands",r);return o?{...t,...o()}:t},{})}get plugins(){const{editor:t}=this,n=Zd.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const u={name:s.name,options:s.options,storage:s.storage,editor:t,type:rb(s.name,this.schema)},d=[],f=Ut(s,"addKeyboardShortcuts",u);let g={};if(s.type==="mark"&&s.config.exitable&&(g.ArrowRight=()=>Xv.handleExit({editor:t,mark:s})),f){const D=Object.fromEntries(Object.entries(f()).map(([w,S])=>[w,()=>S({editor:t})]));g={...g,...D}}const v=zX(g);d.push(v);const _=Ut(s,"addInputRules",u);V2(s,t.options.enableInputRules)&&_&&r.push(..._());const M=Ut(s,"addPasteRules",u);V2(s,t.options.enablePasteRules)&&M&&o.push(...M());const C=Ut(s,"addProseMirrorPlugins",u);if(C){const D=C();d.push(...D)}return d}).flat();return[wZ({editor:t,rules:r}),...EZ({editor:t,rules:o}),...i]}get attributes(){return ZN(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=t0(this.extensions);return Object.fromEntries(n.filter(r=>!!Ut(r,"addNodeView")).map(r=>{const o=this.attributes.filter(d=>d.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t,type:Uo(r.name,this.schema)},s=Ut(r,"addNodeView",i);if(!s)return[];const u=(d,f,g,v)=>{const _=rI(d,o);return s()({editor:t,node:d,getPos:g,decorations:v,HTMLAttributes:_,extension:r})};return[r.name,u]}))}}function LZ(e){return Object.prototype.toString.call(e).slice(8,-1)}function ib(e){return LZ(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function n0(e,t){const n={...e};return ib(e)&&ib(t)&&Object.keys(t).forEach(r=>{ib(t[r])?r in e?n[r]=n0(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Da{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ln(Ut(this,"addOptions",{name:this.name}))),this.storage=Ln(Ut(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Da(t)}configure(t={}){const n=this.extend();return n.options=n0(this.options,t),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Da(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ln(Ut(n,"addOptions",{name:n.name})),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}}function e5(e,t,n){const{from:r,to:o}=t,{blockSeparator:i=` `,textSerializers:s={}}=n||{};let u="",d=!0;return e.nodesBetween(r,o,(f,g,v,_)=>{var M;const C=s==null?void 0:s[f.type.name];C?(f.isBlock&&!d&&(u+=i,d=!0),v&&(u+=C({node:f,pos:g,parent:v,index:_,range:t}))):f.isText?(u+=(M=f==null?void 0:f.text)===null||M===void 0?void 0:M.slice(Math.max(r,g)-g,o-g),d=!1):f.isBlock&&!d&&(u+=i,d=!0)}),u}function t5(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const OZ=Da.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Aa({key:new ku("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(g=>g.$from.pos)),u=Math.max(...i.map(g=>g.$to.pos)),d=t5(n);return e5(r,{from:s,to:u},{textSerializers:d})}}})]}}),RZ=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),NZ=(e=!1)=>({commands:t})=>t.setContent("",e),PZ=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{e.doc.nodesBetween(i.pos,s.pos,(u,d)=>{if(u.type.isText)return;const{doc:f,mapping:g}=t,v=f.resolve(g.map(d)),_=f.resolve(g.map(d+u.nodeSize)),M=v.blockRange(_);if(!M)return;const C=Yf(M);if(u.type.isTextblock){const{defaultType:D}=v.parent.contentMatchAt(v.index());t.setNodeMarkup(M.start,D)}(C||C===0)&&t.lift(M,C)})}),!0},xZ=e=>t=>e(t),UZ=()=>({state:e,dispatch:t})=>iZ(e,t),FZ=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(t){const u=o.before(i),d=o.after(i);e.delete(u,d).scrollIntoView()}return!0}return!1},GZ=e=>({tr:t,state:n,dispatch:r})=>{const o=Uo(e,n.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const d=i.before(s),f=i.after(s);t.delete(d,f).scrollIntoView()}return!0}return!1},$Z=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},BZ=()=>({state:e,dispatch:t})=>WX(e,t),HZ=()=>({commands:e})=>e.keyboardShortcut("Enter"),qZ=()=>({state:e,dispatch:t})=>oZ(e,t);function Yv(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>n.strict?t[o]===e[o]:dT(t[o])?t[o].test(e[o]):t[o]===e[o]):!0}function oI(e,t,n={}){return e.find(r=>r.type===t&&Yv(r.attrs,n))}function VZ(e,t,n={}){return!!oI(e,t,n)}function n5(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const o=oI([...r.node.marks],t,n);if(!o)return;let i=r.index,s=e.start()+r.offset,u=i+1,d=s+r.node.nodeSize;for(oI([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;u({tr:n,state:r,dispatch:o})=>{const i=Eu(e,r.schema),{doc:s,selection:u}=n,{$from:d,from:f,to:g}=u;if(o){const v=n5(d,i,t);if(v&&v.from<=f&&v.to>=g){const _=Bn.create(s,v.from,v.to);n.setSelection(_)}}return!0},jZ=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{fT()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(i&&e===null&&!r5(n.state.selection))return s(),!0;const u=o5(o.doc,e)||n.state.selection,d=n.state.selection.eq(u);return i&&(d||o.setSelection(u),d&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},KZ=(e,t)=>n=>e.every((r,o)=>t(r,{...n,index:o})),YZ=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function z2(e){const t=`${e}`;return new window.DOMParser().parseFromString(t,"text/html").body}function Jv(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)&&e.length>0?pt.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Jv("",t,n)}if(typeof e=="string"){const r=Df.fromSchema(t);return n.slice?r.parseSlice(z2(e),n.parseOptions).content:r.parse(z2(e),n.parseOptions)}return Jv("",t,n)}function JZ(e,t,n){const r=e.steps.length-1;if(r{s===0&&(s=g)}),e.setSelection(kn.near(e.doc.resolve(s),n))}const XZ=e=>e.toString().startsWith("<"),ZZ=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const s=Jv(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:u,to:d}=typeof e=="number"?{from:e,to:e}:e,f=!0,g=!0;if((XZ(s)?s:[s]).forEach(_=>{_.check(),f=f?_.isText&&_.marks.length===0:!1,g=g?_.isBlock:!1}),u===d&&g){const{parent:_}=r.doc.resolve(u);_.isTextblock&&!_.type.spec.code&&!_.childCount&&(u-=1,d+=1)}f?Array.isArray(t)?r.insertText(t.map(_=>_.text||"").join(""),u,d):typeof t=="object"&&t&&t.text?r.insertText(t.text,u,d):r.insertText(t,u,d):r.replaceWith(u,d,s),n.updateSelection&&JZ(r,r.steps.length-1,-1)}return!0},QZ=()=>({state:e,dispatch:t})=>eZ(e,t),eQ=()=>({state:e,dispatch:t})=>tZ(e,t),tQ=()=>({state:e,dispatch:t})=>YX(e,t),nQ=()=>({state:e,dispatch:t})=>ZX(e,t);function i5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function rQ(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let u=0;u({editor:t,view:n,tr:r,dispatch:o})=>{const i=rQ(e).split(/-(?!$)/),s=i.find(f=>!["Alt","Ctrl","Meta","Shift"].includes(f)),u=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),d=t.captureTransaction(()=>{n.someProp("handleKeyDown",f=>f(n,u))});return d==null||d.steps.forEach(f=>{const g=f.map(r.mapping);g&&o&&r.maybeStep(g)}),!0};function eg(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?Uo(t,e.schema):null,u=[];e.doc.nodesBetween(r,o,(v,_)=>{if(v.isText)return;const M=Math.max(r,_),C=Math.min(o,_+v.nodeSize);u.push({node:v,from:M,to:C})});const d=o-r,f=u.filter(v=>s?s.name===v.node.type.name:!0).filter(v=>Yv(v.node.attrs,n,{strict:!1}));return i?!!f.length:f.reduce((v,_)=>v+_.to-_.from,0)>=d}const iQ=(e,t={})=>({state:n,dispatch:r})=>{const o=Uo(e,n.schema);return eg(n,o,t)?nZ(n,r):!1},sQ=()=>({state:e,dispatch:t})=>sZ(e,t),aQ=e=>({state:t,dispatch:n})=>{const r=Uo(e,t.schema);return hZ(r)(t,n)},lQ=()=>({state:e,dispatch:t})=>rZ(e,t);function r0(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function j2(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,o)=>(n.includes(o)||(r[o]=e[o]),r),{})}const uQ=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const u=r0(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(i=Uo(e,r.schema)),u==="mark"&&(s=Eu(e,r.schema)),o&&n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(f,g)=>{i&&i===f.type&&n.setNodeMarkup(g,void 0,j2(f.attrs,t)),s&&f.marks.length&&f.marks.forEach(v=>{s===v.type&&n.addMark(g,g+f.nodeSize,s.create(j2(v.attrs,t)))})})}),!0):!1},cQ=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),dQ=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),fQ=()=>({state:e,dispatch:t})=>JX(e,t),pQ=()=>({state:e,dispatch:t})=>QX(e,t),hQ=()=>({state:e,dispatch:t})=>aZ(e,t),gQ=()=>({state:e,dispatch:t})=>cZ(e,t),mQ=()=>({state:e,dispatch:t})=>uZ(e,t);function s5(e,t,n={}){return Jv(e,t,{slice:!1,parseOptions:n})}const vQ=(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,u=s5(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,u).setMeta("preventUpdate",!t),!0};function yQ(e){for(let t=0;t0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function pT(e){return t=>_Q(t.$from,e)}function bQ(e,t){const n=ba.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function MQ(e,t){const n={from:0,to:e.content.size};return e5(e,n,t)}function a5(e,t){const n=Eu(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,d=>{s.push(...d.marks)});const u=s.find(d=>d.type.name===n.name);return u?{...u.attrs}:{}}function IQ(e,t){const n=Uo(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,u=>{i.push(u)});const s=i.reverse().find(u=>u.type.name===n.name);return s?{...s.attrs}:{}}function CQ(e,t){const n=r0(typeof t=="string"?t:t.name,e.schema);return n==="node"?IQ(e,t):n==="mark"?a5(e,t):{}}function ov(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=e.find(i=>i.type===t&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function iI(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Eu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(v=>i?i.name===v.type.name:!0).find(v=>Yv(v.attrs,n,{strict:!1}));let s=0;const u=[];if(o.forEach(({$from:v,$to:_})=>{const M=v.pos,C=_.pos;e.doc.nodesBetween(M,C,(D,w)=>{if(!D.isText&&!D.marks.length)return;const S=Math.max(M,w),N=Math.min(C,w+D.nodeSize),A=N-S;s+=A,u.push(...D.marks.map(L=>({mark:L,from:S,to:N})))})}),s===0)return!1;const d=u.filter(v=>i?i.name===v.mark.type.name:!0).filter(v=>Yv(v.mark.attrs,n,{strict:!1})).reduce((v,_)=>v+_.to-_.from,0),f=u.filter(v=>i?v.mark.type!==i&&v.mark.type.excludes(i):!0).reduce((v,_)=>v+_.to-_.from,0);return(d>0?d+f:d)>=s}function TQ(e,t,n={}){if(!t)return eg(e,null,n)||iI(e,null,n);const r=r0(t,e.schema);return r==="node"?eg(e,t,n):r==="mark"?iI(e,t,n):!1}function W2(e,t){const{nodeExtensions:n}=t0(t),r=n.find(s=>s.name===e);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Ln(Ut(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function wQ(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function SQ(e,t,n){var r;const{selection:o}=t;let i=null;if(r5(o)&&(i=o.$cursor),i){const u=(r=e.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(u)||!u.some(d=>d.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:u,$to:d})=>{let f=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,d.pos,(g,v,_)=>{if(f)return!1;if(g.isInline){const M=!_||_.type.allowsMarkType(n),C=!!n.isInSet(g.marks)||!g.marks.some(D=>D.type.excludes(n));f=M&&C}return!f}),f})}const kQ=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:u}=i,d=Eu(e,r.schema);if(o)if(s){const f=a5(r,d);n.addStoredMark(d.create({...f,...t}))}else u.forEach(f=>{const g=f.$from.pos,v=f.$to.pos;r.doc.nodesBetween(g,v,(_,M)=>{const C=Math.max(M,g),D=Math.min(M+_.nodeSize,v);_.marks.find(S=>S.type===d)?_.marks.forEach(S=>{d===S.type&&n.addMark(C,D,d.create({...S.attrs,...t}))}):n.addMark(C,D,d.create(t))})});return SQ(r,n,d)},DQ=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),EQ=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Uo(e,n.schema);return i.isTextblock?o().command(({commands:s})=>B2(i,t)(n)?!0:s.clearNodes()).command(({state:s})=>B2(i,t)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},AQ=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,o=gc(e,0,r.content.size),i=sn.create(r,o);t.setSelection(i)}return!0},LQ=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,s=Bn.atStart(r).from,u=Bn.atEnd(r).to,d=gc(o,s,u),f=gc(i,s,u),g=Bn.create(r,d,f);t.setSelection(g)}return!0},OQ=e=>({state:t,dispatch:n})=>{const r=Uo(e,t.schema);return vZ(r)(t,n)};function K2(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(o=>t==null?void 0:t.includes(o.type.name));e.tr.ensureMarks(r)}}const RQ=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:u,$to:d}=i,f=o.extensionManager.attributes,g=ov(f,u.node().type.name,u.node().attrs);if(i instanceof sn&&i.node.isBlock)return!u.parentOffset||!df(s,u.pos)?!1:(r&&(e&&K2(n,o.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const v=d.parentOffset===d.parent.content.size;i instanceof Bn&&t.deleteSelection();const _=u.depth===0?void 0:yQ(u.node(-1).contentMatchAt(u.indexAfter(-1)));let M=v&&_?[{type:_,attrs:g}]:void 0,C=df(t.doc,t.mapping.map(u.pos),1,M);if(!M&&!C&&df(t.doc,t.mapping.map(u.pos),1,_?[{type:_}]:void 0)&&(C=!0,M=_?[{type:_,attrs:g}]:void 0),C&&(t.split(t.mapping.map(u.pos),1,M),_&&!v&&!u.parentOffset&&u.parent.type!==_)){const D=t.mapping.map(u.before()),w=t.doc.resolve(D);u.node(-1).canReplaceWith(w.index(),w.index()+1,_)&&t.setNodeMarkup(t.mapping.map(u.before()),_)}e&&K2(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},NQ=e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=Uo(e,n.schema),{$from:u,$to:d}=n.selection,f=n.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;const g=u.node(-1);if(g.type!==s)return!1;const v=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==s||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let w=pt.empty;const S=u.index(-1)?1:u.index(-2)?2:3;for(let x=u.depth-S;x>=u.depth-3;x-=1)w=pt.from(u.node(x).copy(w));const N=u.indexAfter(-1){if(V>-1)return!1;x.isTextblock&&x.content.size===0&&(V=$+1)}),V>-1&&t.setSelection(Bn.near(t.doc.resolve(V))),t.scrollIntoView()}return!0}const _=d.pos===u.end()?g.contentMatchAt(0).defaultType:null,M=ov(v,g.type.name,g.attrs),C=ov(v,u.node().type.name,u.node().attrs);t.delete(u.pos,d.pos);const D=_?[{type:s,attrs:M},{type:_,attrs:C}]:[{type:s,attrs:M}];if(!df(t.doc,u.pos,2))return!1;if(r){const{selection:w,storedMarks:S}=n,{splittableMarks:N}=o.extensionManager,A=S||w.$to.parentOffset&&w.$from.marks();if(t.split(u.pos,2,D).scrollIntoView(),!A||!r)return!0;const L=A.filter(j=>N.includes(j.type.name));t.ensureMarks(L)}return!0},sb=(e,t)=>{const n=pT(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&cd(e.doc,n.pos)&&e.join(n.pos),!0},ab=(e,t)=>{const n=pT(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&cd(e.doc,r)&&e.join(r),!0},PQ=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:u,chain:d,commands:f,can:g})=>{const{extensions:v,splittableMarks:_}=o.extensionManager,M=Uo(e,s.schema),C=Uo(t,s.schema),{selection:D,storedMarks:w}=s,{$from:S,$to:N}=D,A=S.blockRange(N),L=w||D.$to.parentOffset&&D.$from.marks();if(!A)return!1;const j=pT(V=>W2(V.type.name,v))(D);if(A.depth>=1&&j&&A.depth-j.depth<=1){if(j.node.type===M)return f.liftListItem(C);if(W2(j.node.type.name,v)&&M.validContent(j.node.content)&&u)return d().command(()=>(i.setNodeMarkup(j.pos,M),!0)).command(()=>sb(i,M)).command(()=>ab(i,M)).run()}return!n||!L||!u?d().command(()=>g().wrapInList(M,r)?!0:f.clearNodes()).wrapInList(M,r).command(()=>sb(i,M)).command(()=>ab(i,M)).run():d().command(()=>{const V=g().wrapInList(M,r),x=L.filter($=>_.includes($.type.name));return i.ensureMarks(x),V?!0:f.clearNodes()}).wrapInList(M,r).command(()=>sb(i,M)).command(()=>ab(i,M)).run()},xQ=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Eu(e,r.schema);return iI(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},UQ=(e,t,n={})=>({state:r,commands:o})=>{const i=Uo(e,r.schema),s=Uo(t,r.schema);return eg(r,i,n)?o.setNode(s):o.setNode(i,n)},FQ=(e,t={})=>({state:n,commands:r})=>{const o=Uo(e,n.schema);return eg(n,o,t)?r.lift(o):r.wrapIn(o,t)},GQ=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r=0;d-=1)s.step(u.steps[d].invert(u.docs[d]));if(i.text){const d=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,d))}else s.delete(i.from,i.to)}return!0}}return!1},$Q=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(i=>{e.removeMark(i.$from.pos,i.$to.pos)}),!0},BQ=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:u}=n,d=Eu(e,r.schema),{$from:f,empty:g,ranges:v}=u;if(!o)return!0;if(g&&s){let{from:_,to:M}=u;const C=(i=f.marks().find(w=>w.type===d))===null||i===void 0?void 0:i.attrs,D=n5(f,d,C);D&&(_=D.from,M=D.to),n.removeMark(_,M,d)}else v.forEach(_=>{n.removeMark(_.$from.pos,_.$to.pos,d)});return n.removeStoredMark(d),!0},HQ=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const u=r0(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(i=Uo(e,r.schema)),u==="mark"&&(s=Eu(e,r.schema)),o&&n.selection.ranges.forEach(d=>{const f=d.$from.pos,g=d.$to.pos;r.doc.nodesBetween(f,g,(v,_)=>{i&&i===v.type&&n.setNodeMarkup(_,void 0,{...v.attrs,...t}),s&&v.marks.length&&v.marks.forEach(M=>{if(s===M.type){const C=Math.max(_,f),D=Math.min(_+v.nodeSize,g);n.addMark(C,D,s.create({...M.attrs,...t}))}})})}),!0):!1},qQ=(e,t={})=>({state:n,dispatch:r})=>{const o=Uo(e,n.schema);return dZ(o,t)(n,r)},VQ=(e,t={})=>({state:n,dispatch:r})=>{const o=Uo(e,n.schema);return fZ(o,t)(n,r)};var zQ=Object.freeze({__proto__:null,blur:RZ,clearContent:NZ,clearNodes:PZ,command:xZ,createParagraphNear:UZ,deleteCurrentNode:FZ,deleteNode:GZ,deleteRange:$Z,deleteSelection:BZ,enter:HZ,exitCode:qZ,extendMarkRange:zZ,first:jZ,focus:WZ,forEach:KZ,insertContent:YZ,insertContentAt:ZZ,joinUp:QZ,joinDown:eQ,joinBackward:tQ,joinForward:nQ,keyboardShortcut:oQ,lift:iQ,liftEmptyBlock:sQ,liftListItem:aQ,newlineInCode:lQ,resetAttributes:uQ,scrollIntoView:cQ,selectAll:dQ,selectNodeBackward:fQ,selectNodeForward:pQ,selectParentNode:hQ,selectTextblockEnd:gQ,selectTextblockStart:mQ,setContent:vQ,setMark:kQ,setMeta:DQ,setNode:EQ,setNodeSelection:AQ,setTextSelection:LQ,sinkListItem:OQ,splitBlock:RQ,splitListItem:NQ,toggleList:PQ,toggleMark:xQ,toggleNode:UQ,toggleWrap:FQ,undoInputRule:GQ,unsetAllMarks:$Q,unsetMark:BQ,updateAttributes:HQ,wrapIn:qQ,wrapInList:VQ});const jQ=Da.create({name:"commands",addCommands(){return{...zQ}}}),WQ=Da.create({name:"editable",addProseMirrorPlugins(){return[new Aa({key:new ku("editable"),props:{editable:()=>this.editor.options.editable}})]}}),KQ=Da.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Aa({key:new ku("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),YQ=Da.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:u})=>{const{selection:d,doc:f}=u,{empty:g,$anchor:v}=d,{pos:_,parent:M}=v,C=kn.atStart(f).from===_;return!g||!C||!M.type.isTextblock||M.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return fT()||i5()?i:o},addProseMirrorPlugins(){return[new Aa({key:new ku("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(C=>C.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:o,from:i,to:s}=t.selection,u=kn.atStart(t.doc).from,d=kn.atEnd(t.doc).to;if(o||!(i===u&&s===d)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const v=n.tr,_=Qy({state:n,transaction:v}),{commands:M}=new e0({editor:this.editor,state:_});if(M.clearNodes(),!!v.steps.length)return v}})]}}),JQ=Da.create({name:"tabindex",addProseMirrorPlugins(){return[new Aa({key:new ku("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var XQ=Object.freeze({__proto__:null,ClipboardTextSerializer:OZ,Commands:jQ,Editable:WQ,FocusEvents:KQ,Keymap:YQ,Tabindex:JQ});const ZQ=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;function QQ(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}let eee=class extends yZ{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=QQ(ZQ,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=QN(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(XQ):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Zd(n,this)}createCommandManager(){this.commandManager=new e0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=s5(this.options.content,this.schema,this.options.parseOptions),n=o5(t,this.options.autofocus);this.view=new xX(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Xd.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(s)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return CQ(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,o=typeof t=="string"?n:t;return TQ(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return bQ(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=` `,textSerializers:r={}}=t||{};return MQ(this.state.doc,{blockSeparator:n,textSerializers:{...t5(this.schema),...r}})}get isEmpty(){return wQ(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function tee(e){return new CZ({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Ln(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let u=n.to;if(r[1]){const d=r[0].lastIndexOf(r[1]);let f=s+d;f>u?f=u:u=f+r[1].length;const g=r[0][r[0].length-1];i.insertText(g,s+r[0].length-1),i.replaceWith(f,u,e.type.create(o))}else r[0]&&i.replaceWith(s,u,e.type.create(o))}})}class Xv{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ln(Ut(this,"addOptions",{name:this.name}))),this.storage=Ln(Ut(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Xv(t)}configure(t={}){const n=this.extend();return n.options=n0(this.options,t),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Xv(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ln(Ut(n,"addOptions",{name:n.name})),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(f=>(f==null?void 0:f.type.name)===n.name))return!1;const d=s.find(f=>(f==null?void 0:f.type.name)===n.name);return d&&r.removeStoredMark(d),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}}class bu{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ln(Ut(this,"addOptions",{name:this.name}))),this.storage=Ln(Ut(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new bu(t)}configure(t={}){const n=this.extend();return n.options=n0(this.options,t),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new bu(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ln(Ut(n,"addOptions",{name:n.name})),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}}function nee(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y2(e){return Qx((t,n)=>({get(){return t(),e},set(r){e=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class ree extends eee{constructor(t={}){return super(t),this.vueRenderers=zt(new Map),this.contentComponent=null,this.reactiveState=Y2(this.view.state),this.reactiveExtensionStorage=Y2(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),iC(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,n){super.registerPlugin(t,n),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const oee=ot({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=Ne(),n=Ki();return nn(()=>{const r=e.editor;r&&r.options.element&&t.value&&br(()=>{if(!t.value||!r.options.element.firstChild)return;const o=Oe(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:o}),r.createNodeViews()})}),gi(()=>{const r=e.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const o=document.createElement("div");o.append(...r.options.element.childNodes),r.setOptions({element:o})}),{rootEl:t}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach(t=>{const n=Re(yC,{to:t.teleportElement,key:t.id},Re(t.component,{ref:t.id,...t.props}));e.push(n)}),Re("div",{ref:t=>{this.rootEl=t}},...e)}}),iee=(e={})=>{const t=vL();return On(()=>{t.value=new ree(e)}),gi(()=>{var n;(n=t.value)===null||n===void 0||n.destroy()}),t},see=bu.create({name:"doc",topNode:!0,content:"block+"}),aee=bu.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",_g(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lee=Da.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Aa({key:new ku("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=e.type.createAndFill(),s=(i==null?void 0:i.sameMarkup(e))&&i.content.findDiffStart(e.content)===null;return e.descendants((u,d)=>{const f=r>=d&&r<=d+u.nodeSize,g=!u.isLeaf&&!u.childCount;if((f||!this.options.showOnlyCurrent)&&g){const v=[this.options.emptyNodeClass];s&&v.push(this.options.emptyEditorClass);const _=is.node(d,d+u.nodeSize,{class:v.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:u,pos:d,hasAnchor:f}):this.options.placeholder});o.push(_)}return this.options.includeChildren}),fo.create(e,o)}}})]}}),uee=bu.create({name:"text",group:"inline"});function cee(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:s}=e,u=nee(n),d=new RegExp(`\\s${u}$`),f=i?"^":"",g=r?new RegExp(`${f}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${u}]*`,"gm"),v=((t=s.nodeBefore)===null||t===void 0?void 0:t.isText)&&s.nodeBefore.text;if(!v)return null;const _=s.pos-v.length,M=Array.from(v.matchAll(g)).pop();if(!M||M.input===void 0||M.index===void 0)return null;const C=M.input.slice(Math.max(0,M.index-1),M.index),D=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(C);if(o!==null&&!D)return null;const w=_+M.index;let S=w+M[0].length;return r&&d.test(v.slice(S-1,S+1))&&(M[0]+=" ",S+=1),w=s.pos?{range:{from:w,to:S},query:M[0].slice(n.length),text:M[0]}:null}const dee=new ku("suggestion");function fee({pluginKey:e=dee,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:o=[" "],startOfLine:i=!1,decorationTag:s="span",decorationClass:u="suggestion",command:d=()=>null,items:f=()=>[],render:g=()=>({}),allow:v=()=>!0}){let _;const M=g==null?void 0:g(),C=new Aa({key:e,view(){return{update:async(D,w)=>{var S,N,A,L,j,V,x;const $=(S=this.key)===null||S===void 0?void 0:S.getState(w),z=(N=this.key)===null||N===void 0?void 0:N.getState(D.state),G=$.active&&z.active&&$.range.from!==z.range.from,O=!$.active&&z.active,T=$.active&&!z.active,P=!O&&!T&&$.query!==z.query,Z=O||G,K=P&&!G,oe=T||G;if(!Z&&!K&&!oe)return;const J=oe&&!Z?$:z,ie=D.dom.querySelector(`[data-decoration-id="${J.decorationId}"]`);_={editor:t,range:J.range,query:J.query,text:J.text,items:[],command:pe=>{d({editor:t,range:J.range,props:pe})},decorationNode:ie,clientRect:ie?()=>{var pe;const{decorationId:ue}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(t.state),de=D.dom.querySelector(`[data-decoration-id="${ue}"]`);return(de==null?void 0:de.getBoundingClientRect())||null}:null},Z&&((A=M==null?void 0:M.onBeforeStart)===null||A===void 0||A.call(M,_)),K&&((L=M==null?void 0:M.onBeforeUpdate)===null||L===void 0||L.call(M,_)),(K||Z)&&(_.items=await f({editor:t,query:J.query})),oe&&((j=M==null?void 0:M.onExit)===null||j===void 0||j.call(M,_)),K&&((V=M==null?void 0:M.onUpdate)===null||V===void 0||V.call(M,_)),Z&&((x=M==null?void 0:M.onStart)===null||x===void 0||x.call(M,_))},destroy:()=>{var D;_&&((D=M==null?void 0:M.onExit)===null||D===void 0||D.call(M,_))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(D,w,S,N){const{isEditable:A}=t,{composing:L}=t.view,{selection:j}=D,{empty:V,from:x}=j,$={...w};if($.composing=L,A&&(V||t.view.composing)){(xw.range.to)&&!L&&!w.composing&&($.active=!1);const z=cee({char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:j.$from}),G=`id_${Math.floor(Math.random()*4294967295)}`;z&&v({editor:t,state:N,range:z.range})?($.active=!0,$.decorationId=w.decorationId?w.decorationId:G,$.range=z.range,$.query=z.query,$.text=z.text):$.active=!1}else $.active=!1;return $.active||($.decorationId=null,$.range={from:0,to:0},$.query=null,$.text=null),$}},props:{handleKeyDown(D,w){var S;const{active:N,range:A}=C.getState(D.state);return N&&((S=M==null?void 0:M.onKeyDown)===null||S===void 0?void 0:S.call(M,{view:D,event:w,range:A}))||!1},decorations(D){const{active:w,range:S,decorationId:N}=C.getState(D);return w?fo.create(D.doc,[is.inline(S.from,S.to,{nodeName:s,class:u,"data-decoration-id":N})]):null}}});return C}const pee=new ku("mention"),hee=bu.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:pee,command:({editor:e,range:t,props:n})=>{var r,o;const i=e.view.state.selection.$to.nodeAfter;((r=i==null?void 0:i.text)===null||r===void 0?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(o=window.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",_g({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:o,anchor:i}=r;return o?(t.doc.nodesBetween(i-1,i,(s,u)=>{if(s.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",u,u+s.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[fee({editor:this.editor,...this.options.suggestion})]}}),gee=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,J2=bu.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",_g(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[tee({find:gee,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),mee=J2.extend({name:"custom-image",addAttributes(){return{...J2.config.addAttributes(),class:{default:"image",rendered:!1}}},addCommands(){return{setImage:e=>({tr:t,commands:n})=>{var r,o,i;return((i=(o=(r=t.selection)==null?void 0:r.node)==null?void 0:o.type)==null?void 0:i.name)=="custom-image"?n.updateAttributes("custom-image",e):n.insertContent({type:this.name,attrs:e})}}},renderHTML({node:e,HTMLAttributes:t}){return t.class="custom-image-"+e.attrs.class,["img",_g(this.options.HTMLAttributes,t)]}}),vee=""+new URL("at-21d7cd83.svg",import.meta.url).href,es=Ne(),mc=Ne(!1),Xa=Ne(),ar=Ne(),vc=Ne({left:0,top:0}),sI=Ne(),fu=Ne(0),Vc=Ne(),Zv=Ne(!1),yee=()=>({allowedPrefixes:null,items:e=>{var n;const t=(n=Xa==null?void 0:Xa.value)==null?void 0:n.filter(r=>{var o,i,s,u,d,f;return((s=(o=r==null?void 0:r.nick)==null?void 0:o.toLowerCase())==null?void 0:s.startsWith((i=e==null?void 0:e.query)==null?void 0:i.toLowerCase()))||((f=(u=r==null?void 0:r.userID)==null?void 0:u.toLowerCase())==null?void 0:f.startsWith((d=e==null?void 0:e.query)==null?void 0:d.toLowerCase()))});return ar.value=t!=null&&t.length?t:Xa.value,ar.value},render:()=>({onStart:e=>{if(mc.value=!0,!(e!=null&&e.clientRect))return;const t=e==null?void 0:e.clientRect();t!=null&&t.left&&(t!=null&&t.top)&&!Zv.value&&(vc.value={left:t==null?void 0:t.left,top:t==null?void 0:t.top}),sI.value=e.command},onUpdate(e){if(!(e!=null&&e.clientRect))return;const t=e==null?void 0:e.clientRect();t!=null&&t.left&&(t!=null&&t.top)&&!Zv.value&&(vc.value={left:t==null?void 0:t.left,top:t==null?void 0:t.top})},onKeyDown(e){var t,n;return e.event.key==="Enter"&&((t=e.event)==null||t.stopPropagation(),(n=e.event)==null||n.preventDefault()),e.event.key==="Escape"?(mc.value=!1,ar.value=Xa.value,!0):(e==null?void 0:e.event.key)==="ArrowUp"?(_ee(),!0):(e==null?void 0:e.event.key)==="ArrowDown"?(bee(),!0):(e==null?void 0:e.event.key)==="Enter"?(Mee(),!0):!1},onExit(e){mc.value=!1,ar.value=Xa.value,vc.value={left:0,top:0}}})}),_ee=()=>{var e,t,n,r;(e=ar==null?void 0:ar.value)!=null&&e.length&&(fu.value=(fu.value+((t=ar==null?void 0:ar.value)==null?void 0:t.length)-1)%((n=ar==null?void 0:ar.value)==null?void 0:n.length),(r=Vc==null?void 0:Vc.value[fu.value])==null||r.scrollIntoView(!1))},bee=()=>{var e,t,n;(e=ar==null?void 0:ar.value)!=null&&e.length&&(fu.value=(fu.value+1)%((t=ar==null?void 0:ar.value)==null?void 0:t.length),(n=Vc==null?void 0:Vc.value[fu.value])==null||n.scrollIntoView(!1))},Mee=()=>{l5(fu.value)},l5=e=>{var n;if(!((n=ar==null?void 0:ar.value)!=null&&n.length))return;const t=ar==null?void 0:ar.value[e];t&&sI.value&&sI.value({id:t==null?void 0:t.userID,label:(t==null?void 0:t.nick)||(t==null?void 0:t.userID)})},Iee=ot({props:{memberList:{type:Array,default:()=>[]},isGroup:{type:Boolean,default:!1},selfInfo:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},setup(e){const{memberList:t,isGroup:n,selfInfo:r}=Jt(e),o={userID:vt.TYPES.MSG_AT_ALL,nick:"所有人",isAll:!0,avatar:vee},i=Ne();nn(()=>{mc.value=mc.value&&n.value,Zv.value=e.isH5}),$t(()=>t.value,()=>{var d,f,g;(d=t==null?void 0:t.value[0])!=null&&d.isAll||(f=t==null?void 0:t.value)==null||f.unshift(o);const u=(g=t==null?void 0:t.value)==null?void 0:g.filter(v=>{var _;return(v==null?void 0:v.userID)!==((_=r==null?void 0:r.value)==null?void 0:_.userID)});Xa.value=u,ar.value=u},{deep:!0,immediate:!0}),$t(()=>[vc.value,es==null?void 0:es.value],()=>{var u;Zv.value||!(es!=null&&es.value)||!((u=es==null?void 0:es.value)!=null&&u.style)||(es.value.style.left=vc.value.left+"Px",es.value.style.top=vc.value.top-es.value.clientHeight+"Px")},{deep:!0,immediate:!0});const s=()=>{mc.value=!1,ar.value=Xa.value,vc.value={left:0,top:0}};return Js(i,()=>{s()}),{selectedIndex:fu,selectItem:l5,showAtList:mc,closeAt:s,showMemberList:ar,allMemberList:Xa,MessageInputAt:es,memberListItems:Vc,dialog:i}}});const Cee={class:"memberList",ref:"dialog"},Tee={key:0,class:"memberList-title"},wee={class:"title"},See={class:"memberList-box"},kee=["onClick"],Dee=["src"];function Eee(e,t,n,r,o,i){return e.showAtList?(X(),ae("div",{key:0,class:st(["message-input-at",[e.isH5&&"message-input-at-h5"]]),ref:"MessageInputAt"},[B("div",Cee,[e.isH5?(X(),ae("header",Tee,[B("span",wee,Ee(e.$t("TUIChat.选择提醒的人")),1),B("i",{class:"icon icon-close close",onClick:t[0]||(t[0]=(...s)=>e.closeAt&&e.closeAt(...s))})])):Ce("",!0),B("ul",See,[(X(!0),ae(dt,null,qt(e.showMemberList,(s,u)=>(X(),ae("li",{class:st(["memberList-box-body",[u===e.selectedIndex&&"selected"]]),key:u,onClick:d=>e.selectItem(u),ref_for:!0,ref:"memberListItems"},[B("img",{src:(s==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png"},null,8,Dee),B("span",null,Ee(s!=null&&s.nick?s==null?void 0:s.nick:s==null?void 0:s.userID),1)],10,kee))),128))])],512)],2)):Ce("",!0)}const Aee=jt(Iee,[["render",Eee],["__scopeId","data-v-e8288dc1"]]),Lee=ot({__name:"message-input-editor",props:{placeholder:{type:String,default:"this is placeholder"},replayOrReferenceMessage:{type:Object,default:()=>({})},isMute:{type:Boolean,default:!0},muteText:{type:String,default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableDragUpload:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0},isH5:{type:Boolean,default:!0},isGroup:{type:Boolean,default:!1}},emits:["sendMessage","onTyping"],setup(e,{expose:t,emit:n}){const r=e,{placeholder:o,isH5:i,enableAt:s,enableDragUpload:u,isGroup:d,enableTyping:f}=Jt(r),g=Ne(!0),v=Ne(!0),_=iee({extensions:[see,aee,uee,lee.configure({emptyEditorClass:"is-editor-empty",placeholder:o.value}),hee.configure({HTMLAttributes:{class:"mention"},suggestion:s.value&&yee()}),mee.configure({inline:!0,allowBase64:!0,HTMLAttributes:{class:"custom-image"}})],autofocus:!0,editable:!0,injectCSS:!1,onUpdate({editor:O,transaction:T}){var P,Z;!f.value||d.value||(v.value=!O.isFocused,((Z=(P=T==null?void 0:T.doc)==null?void 0:P.content)==null?void 0:Z.size)>2?g.value=!1:g.value=!0,n("onTyping",g.value,v.value))},onFocus(){var O;if(i.value&&((O=document==null?void 0:document.getElementById("app"))!=null&&O.style)){const T=document.body.scrollHeight-window.innerHeight;document.getElementById("app").style.marginBottom=`${T}Px`,document.getElementById("app").style.height=`calc(100% - ${T}Px)`}!f.value||d.value||(v.value=!0,n("onTyping",g.value,v.value))},onBlur(){var O;i.value&&((O=document==null?void 0:document.getElementById("app"))!=null&&O.style)&&(document.getElementById("app").style.marginBottom="",document.getElementById("app").style.height="100%"),!(!f.value||d.value)&&(v.value=!0,n("onTyping",g.value,v.value))}}),M=Ne(),C=O=>{var T,P;i!=null&&i.value||(O==null||O.preventDefault(),O==null||O.stopPropagation(),O.keyCode===13&&O.ctrlKey?(P=(T=_==null?void 0:_.value)==null?void 0:T.commands)==null||P.insertContent("

"):O.keyCode===13&&n("sendMessage"))},D=new Map,w=async(O,T)=>{var P,Z,K,oe;if(O.preventDefault(),O.stopPropagation(),!i.value&&!(!(u!=null&&u.value)&&T==="drop")&&(T==="drop"&&O.dataTransfer||T==="paste"&&O.clipboardData)){const J=T==="drop"?(P=O==null?void 0:O.dataTransfer)==null?void 0:P.files:(Z=O==null?void 0:O.clipboardData)==null?void 0:Z.files;for(let ie=0;ie{var Y,re,fe,Ae;(re=(Y=_==null?void 0:_.value)==null?void 0:Y.commands)==null||re.focus("end"),(Ae=(fe=_==null?void 0:_.value)==null?void 0:fe.commands)==null||Ae.scrollIntoView()},10)}}},S=new Map,N=(O,T)=>new Promise((P,Z)=>{if(S.has(T))P(S.get(T));else{let K=new Image;K.crossOrigin="anonymous",K.onload=()=>{S.set(T,K),P(K)},K.onerror=Z,K.src=O}}),A=async O=>{const{name:T,type:P}=O,Z=document.createElement("canvas");let K=160,oe=50;Z.style.width=K+"Px",Z.style.height=oe+"Px";let J=window.devicePixelRatio;Z.width=Math.floor(K*J),Z.height=Math.floor(oe*J);const ie=Z.getContext("2d");if(!ie)return"";ie.scale(J,J);const{iconSrc:pe,iconType:ue}=L(P),de=await N(pe,ue);ie==null||ie.drawImage(de,10,10,30,30);const Y=j(T);return ie.fillText(Y,45,22),Z.toDataURL()},L=O=>{const T="https://web.sdk.qcloud.com/component/TUIKit/assets/file-",P=["image","pdf","text","ppt","presentation","sheet","zip","word","video","unknown"];let Z="",K="";return P.forEach(oe=>{O.includes(oe)&&(Z=T+oe+".svg",K=oe)}),{iconSrc:Z||T+"unknown.svg",iconType:K||"unknown"}},j=O=>{if(!O)return O;let T="",P=0;for(let Z=0;Z<(O==null?void 0:O.length);Z++){if(P>16){T+="...";break}T+=O[Z],/[a-z]|[0-9]|[,;.!@#-+/\\$%^*()<>?:"'{}~]/i.test(O[Z])?P+=1:P+=2}return T},V=()=>x(),x=()=>{var K,oe,J,ie,pe;const O=(K=_==null?void 0:_.value)==null?void 0:K.getJSON(),T=[],P=ue=>{if(!(!ue||!ue.type))if(ue.type!=="text"&&ue.type!=="custom-image"&&ue.type!=="mention"){ue.type==="paragraph"&&Z(ue),ue.content&&ue.content.length&&ue.content.forEach(de=>{P(de)});return}else Z(ue)},Z=ue=>{var de,Y,re,fe,Ae,ye,le,Q,ve,Le,me,W,te,se,Te,ce,Se,Pe;if(ue.type==="paragraph")T.length>0&&T[T.length-1]&&((de=T[T.length-1])==null?void 0:de.type)==="text"&&(T[T.length-1].payload.text+=` `);else if(ue.type==="text"||ue.type==="custom-image"&&((Y=ue==null?void 0:ue.attrs)==null?void 0:Y.class)==="emoji"){const xe=ue.type==="text"?ue==null?void 0:ue.text:(re=ue==null?void 0:ue.attrs)==null?void 0:re.alt;T.length>0&&T[T.length-1]&&((fe=T[T.length-1])==null?void 0:fe.type)==="text"?T[T.length-1].payload.text+=xe:T.push({type:"text",payload:{text:xe}})}else if(ue.type==="custom-image"&&((Ae=ue==null?void 0:ue.attrs)==null?void 0:Ae.class)==="normal")T.push({type:"image",payload:{file:D==null?void 0:D.get((ye=ue==null?void 0:ue.attrs)==null?void 0:ye.src)}});else if(ue.type==="custom-image"&&((le=ue==null?void 0:ue.attrs)==null?void 0:le.class)==="file"){const xe=D==null?void 0:D.get((Q=ue==null?void 0:ue.attrs)==null?void 0:Q.src);T.push({type:(ve=xe==null?void 0:xe.type)!=null&&ve.includes("video")?"video":"file",payload:{file:xe}})}else if(ue.type==="mention"){const xe="@"+((Le=ue==null?void 0:ue.attrs)==null?void 0:Le.label)+" ";T.length>0&&T[T.length-1]&&((me=T[T.length-1])==null?void 0:me.type)==="text"?T[T.length-1].payload.text+=xe:T.push({type:"text",payload:{text:xe}}),(te=(W=T[T.length-1])==null?void 0:W.payload)!=null&&te.atUserList?(Se=(Te=(se=T[T.length-1])==null?void 0:se.payload)==null?void 0:Te.atUserList)==null||Se.push((ce=ue==null?void 0:ue.attrs)==null?void 0:ce.id):T[T.length-1].payload.atUserList=[(Pe=ue==null?void 0:ue.attrs)==null?void 0:Pe.id]}};if(P(O),T.length>0&&T[T.length-1]&&((oe=T[T.length-1])==null?void 0:oe.type)==="text"&&((pe=(ie=(J=T[T.length-1])==null?void 0:J.payload)==null?void 0:ie.text)!=null&&pe.endsWith(` `))){const ue=T[T.length-1].payload.text;T[T.length-1].payload.text=ue==null?void 0:ue.substring(0,ue.lastIndexOf(` `))}return T};return t({getEditorContent:V,addEmoji:O=>{var T,P,Z,K,oe;(P=(T=_==null?void 0:_.value)==null?void 0:T.commands)==null||P.insertContent({type:"custom-image",attrs:{src:O==null?void 0:O.url,alt:O==null?void 0:O.name,title:O==null?void 0:O.name,class:"emoji"}}),(Z=_==null?void 0:_.value)==null||Z.commands.focus("end"),(oe=(K=_==null?void 0:_.value)==null?void 0:K.commands)==null||oe.scrollIntoView()},resetEditor:()=>{var O,T,P,Z;(T=(O=_==null?void 0:_.value)==null?void 0:O.commands)==null||T.clearContent(!0),D==null||D.clear(),(Z=(P=_==null?void 0:_.value)==null?void 0:P.commands)==null||Z.focus("end"),v.value=!0,g.value=!0},setEditorContent:O=>{var T,P;(P=(T=_==null?void 0:_.value)==null?void 0:T.commands)==null||P.insertContent(O)}}),(O,T)=>(X(),ae("div",{class:st(["message-input-container",Oe(i)&&"message-input-container-h5"])},[$n(B("div",{class:"message-input-mute"},Ee(O.$t(`TUIChat.${e.muteText}`)),513),[[eo,e.isMute]]),$n(St(Oe(oee),{editor:Oe(_),class:"message-input-area",ref_key:"editorContainer",ref:M,onDrop:T[0]||(T[0]=P=>w(P,"drop")),onPaste:T[1]||(T[1]=P=>w(P,"paste")),onKeydown:fr(C,["enter"])},null,8,["editor","onKeydown"]),[[eo,!e.isMute&&e.enableInput]])],2))}});const Oee=jt(Lee,[["__scopeId","data-v-1114d381"]]),Ree={class:"message-input-button-hover"},Nee=ot({__name:"message-input-button",props:{enableSend:{type:Boolean,default:!0},messages:{type:Array,default:()=>[]},isH5:{type:Boolean,default:!0}},emits:["sendMessage"],setup(e,{emit:t}){const n=e,{enableSend:r}=Jt(n),o=()=>{t("sendMessage")};return(i,s)=>(X(),ae("div",{class:st(["message-input-button",e.isH5&&"message-input-button-h5"])},[Oe(r)?(X(),ae("button",{key:0,class:"message-input-button-cont","data-type":"text",onClick:o,disabled:!1},[B("p",Ree,Ee(i.$t("TUIChat.按Enter发送,Ctrl+Enter换行")),1),jr(" "+Ee(i.$t("发送")),1)])):Ce("",!0)],2))}});const Pee=jt(Nee,[["__scopeId","data-v-52846a98"]]),xee=e=>(Mr("data-v-0ef798e8"),e=e(),Ir(),e),Uee={key:0,class:"reference"},Fee={class:"reference-box"},Gee={class:"reference-box-show"},$ee={class:"reference-box-show-name"},Bee={key:1,class:"reply"},Hee={class:"reply-box"},qee=xee(()=>B("i",null,null,-1)),Vee={class:"reply-box-show"},zee=ot({__name:"message-input-reference-or-reply",props:{replyOrReference:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},emits:["resetReplyOrReference"],setup(e,{emit:t}){const n=e,{replyOrReference:r,isH5:o}=Jt(n),i=()=>{t("resetReplyOrReference")};return(s,u)=>{var d,f,g,v,_,M,C,D,w,S,N,A,L,j,V,x,$,z,G,O,T;return(d=Oe(r))!=null&&d.show?(X(),ae("div",{key:0,class:st([((f=Oe(r))==null?void 0:f.show)==="reference"&&"message-input-reference",((g=Oe(r))==null?void 0:g.show)==="reply"&&"message-input-reply",Oe(o)&&((v=Oe(r))==null?void 0:v.show)==="reference"&&"message-input-reference-h5",Oe(o)&&((_=Oe(r))==null?void 0:_.show)==="reply"&&"message-input-reply-h5"])},[((M=Oe(r))==null?void 0:M.show)==="reference"?(X(),ae("div",Uee,[B("div",Fee,[B("div",Gee,[B("span",$ee,Ee((D=(C=Oe(r))==null?void 0:C.message)!=null&&D.nick?(S=(w=Oe(r))==null?void 0:w.message)==null?void 0:S.nick:(A=(N=Oe(r))==null?void 0:N.message)==null?void 0:A.from)+": ",1),B("span",null,Ee((L=Oe(r))==null?void 0:L.content),1)]),B("label",{class:"icon icon-cancel",onClick:i})])])):((j=Oe(r))==null?void 0:j.show)==="reply"?(X(),ae("div",Bee,[B("div",Hee,[qee,B("div",Vee,[B("span",null,Ee((x=(V=Oe(r))==null?void 0:V.message)!=null&&x.nick?(z=($=Oe(r))==null?void 0:$.message)==null?void 0:z.nick:(O=(G=Oe(r))==null?void 0:G.message)==null?void 0:O.from)+Ee(Oe(o)?":":""),1),B("span",null,Ee((T=Oe(r))==null?void 0:T.content),1)]),B("label",{class:"icon icon-cancel",onClick:i})])])):Ce("",!0)],2)):Ce("",!0)}}});const jee=jt(zee,[["__scopeId","data-v-0ef798e8"]]),Wee=ot({__name:"index",props:{placeholder:{type:String,default:"this is placeholder"},conversation:{type:Object,default:()=>({})},replyOrReference:{type:Object,default:()=>({})},isGroup:{type:Boolean,default:!1},memberList:{type:Array,default:()=>[]},isMute:{type:Boolean,default:!0},muteText:{type:String,default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableDragUpload:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0},env:{type:Object,default:()=>({})}},emits:["sendMessage","resetReplyOrReference","onTyping"],setup(e,{expose:t,emit:n}){var j;const r=e,{placeholder:o,isGroup:i,memberList:s,conversation:u,replyOrReference:d,env:f,enableTyping:g}=Jt(r),v=Ne(),_=Ne((j=r==null?void 0:r.env)==null?void 0:j.isH5),M=ki&&ki();$t(()=>u.value,(V,x)=>{var $;(V==null?void 0:V.conversationID)!==(x==null?void 0:x.conversationID)&&(($=v==null?void 0:v.value)==null||$.resetEditor())},{immediate:!0});const C=async()=>{var z,G,O,T;if(console.log(M.state.imConnent,"store.imConnent"),!M.state.imConnent){au.emit("reConnectIm",!0);return}const V=(G=(z=window==null?void 0:window.TUIKitTUICore)==null?void 0:z.TUIServer)==null?void 0:G.TUIChat,x=(O=v==null?void 0:v.value)==null?void 0:O.getEditorContent(),$=d.value;await(x==null?void 0:x.forEach(async P=>{var Z,K,oe,J,ie,pe,ue,de;try{let Y,re;switch(Y=w(Y),P==null?void 0:P.type){case"text":Y=S(Y),(Z=P==null?void 0:P.payload)!=null&&Z.atUserList?re=await(V==null?void 0:V.sendTextAtMessage({text:JSON.parse(JSON.stringify((K=P==null?void 0:P.payload)==null?void 0:K.text)),atUserList:(oe=P==null?void 0:P.payload)==null?void 0:oe.atUserList},Y)):re=await(V==null?void 0:V.sendTextMessage(JSON.parse(JSON.stringify((J=P==null?void 0:P.payload)==null?void 0:J.text)),Y)),($==null?void 0:$.show)==="reply"&&await V.replyMessage((ie=re==null?void 0:re.data)==null?void 0:ie.message);break;case"image":await(V==null?void 0:V.sendImageMessage((pe=P==null?void 0:P.payload)==null?void 0:pe.file));break;case"video":await(V==null?void 0:V.sendVideoMessage((ue=P==null?void 0:P.payload)==null?void 0:ue.file));break;case"file":await(V==null?void 0:V.sendFileMessage((de=P==null?void 0:P.payload)==null?void 0:de.file));break;default:break}n("sendMessage")}catch(Y){xr(Y,f.value)}})),(T=v==null?void 0:v.value)==null||T.resetEditor(),A()},D=(V,x)=>{n("onTyping",V,x)},w=V=>(g.value&&(V||(V={}),V.messageFeature={needTyping:1,version:1}),V),S=V=>{var x,$,z,G,O,T,P,Z,K,oe,J,ie,pe,ue,de,Y,re,fe,Ae,ye;if(((x=d==null?void 0:d.value)==null?void 0:x.show)!=="reply"&&(($=d==null?void 0:d.value)==null?void 0:$.show)!=="reference")return V;if(V||(V={}),V.messageReply={messageAbstract:(z=d==null?void 0:d.value)==null?void 0:z.content,messageSender:((O=(G=d==null?void 0:d.value)==null?void 0:G.message)==null?void 0:O.nick)||((P=(T=d==null?void 0:d.value)==null?void 0:T.message)==null?void 0:P.from),messageID:(K=(Z=d==null?void 0:d.value)==null?void 0:Z.message)==null?void 0:K.ID,messageType:(oe=d==null?void 0:d.value)==null?void 0:oe.type,version:1},((J=d==null?void 0:d.value)==null?void 0:J.show)==="reply")try{if(V.messageReply.messageRootID=(pe=(ie=d==null?void 0:d.value)==null?void 0:ie.message)==null?void 0:pe.ID,(de=(ue=d==null?void 0:d.value)==null?void 0:ue.message)!=null&&de.cloudCustomData){const le=dr((re=(Y=d==null?void 0:d.value)==null?void 0:Y.message)==null?void 0:re.cloudCustomData);V.messageReply.messageRootID=((fe=le==null?void 0:le.messageReply)==null?void 0:fe.messageRootID)||((ye=(Ae=d==null?void 0:d.value)==null?void 0:Ae.message)==null?void 0:ye.ID)}}catch(le){console.warn(le)}return V},N=V=>{var x;(x=v==null?void 0:v.value)==null||x.addEmoji(V)},A=()=>{n("resetReplyOrReference")};return t({addEmoji:N,reEdit:V=>{var x,$;(x=v==null?void 0:v.value)==null||x.resetEditor(),A(),($=v==null?void 0:v.value)==null||$.setEditorContent(V)}}),(V,x)=>{var $,z;return X(),ae("div",{class:st(["message-input",_.value&&"message-input-h5"])},[St(Oee,{ref_key:"editor",ref:v,isH5:_.value,placeholder:Oe(o),isGroup:Oe(i),isMute:e.isMute,muteText:e.muteText,enableInput:e.enableInput,enableAt:e.enableAt,enableTyping:Oe(g),enableDragUpload:e.enableDragUpload,onSendMessage:C,onOnTyping:D},null,8,["isH5","placeholder","isGroup","isMute","muteText","enableInput","enableAt","enableTyping","enableDragUpload"]),e.isMute?Ce("",!0):(X(),It(Pee,{key:0,isH5:_.value,onSendMessage:C},null,8,["isH5"])),e.enableAt?(X(),It(Aee,{key:1,memberList:Oe(s),isGroup:Oe(i),selfInfo:(z=($=Oe(u))==null?void 0:$.groupProfile)==null?void 0:z.selfInfo,isH5:_.value},null,8,["memberList","isGroup","selfInfo","isH5"])):Ce("",!0),St(jee,{replyOrReference:Oe(d),isH5:_.value,onResetReplyOrReference:A},null,8,["replyOrReference","isH5"])],2)}}});const u5=jt(Wee,[["__scopeId","data-v-6ccc76f6"]]),c5=ot({name:"TUIChat",components:{MessageSystem:VH,MessageTimestamp:pY,Manage:ll,MessageInput:u5,MessageItem:dY},props:{isMsgNeedReadReceipt:{type:Boolean,default:!1},isNeedTyping:{type:Boolean,default:!0},isNeedEmojiReact:{type:Boolean,default:!0},currentModal:{type:String,default:"message"}},setup(e){var ce,Se,Pe,xe,He,Ie;const{TUIServer:t}=c5;(Se=(ce=t==null?void 0:t.TUICore)==null?void 0:ce.TUIServer)==null||Se.TUIGroup,(xe=(Pe=t==null?void 0:t.TUICore)==null?void 0:Pe.TUIServer)==null||xe.TUIProfile;const n=t.TUICore.isOfficial&&ki&&ki()||{},{t:r}=window.TUIKitTUICore.config.i18n.useI18n(),o=zt({messageList:[],conversation:{},text:"",atText:"",types:t.TUICore.TIM.TYPES,currentMessage:{},dialogID:"",forwardStatus:!1,receiptDialogStatus:!1,repliesDialogStatus:!1,showImagePreview:!1,currentImagePreview:{},isCompleted:!1,userInfoView:!1,userInfo:{isGroup:!1,list:[]},selfInfo:{},messageComponents:X2("message"),isShow:!1,muteText:"您已被管理员禁言",isFirstSend:!0,isFirstRender:!0,showGroupMemberList:!1,reference:{message:{},content:"",type:0,show:""},historyReference:!1,referenceID:"",allMemberList:[],env:t.TUICore.TUIEnv,showResend:!1,resendMessage:{},inputBlur:!1,inputComposition:!1,inputCompositionCont:"",needTyping:e.isNeedTyping,needReadReceipt:!1,peerNeedReceipt:!1,needToBottom:!1,toBottomTipCont:"",messageInView:[],readSet:new Set,isUserAction:!1,scroll:{scrollTop:0,scrollHeight:0,scrollTopMin:1/0,scrollTopMax:0},isMsgNeedReadReceipt:!1,isNeedEmojiReact:!1,dropDownRef:null,typingRef:null}),i=!!pg().default,s=async q=>{var ne,_e,Be;q&&await((Be=(_e=(ne=t==null?void 0:t.TUICore)==null?void 0:ne.TUIServer)==null?void 0:_e.TUIConversation)==null?void 0:Be.setMessageRead(q))},u=async q=>{var _e;const ne=q.filter(Be=>(Be==null?void 0:Be.flow)==="in"&&(Be==null?void 0:Be.needReadReceipt)&&!o.readSet.has(Be==null?void 0:Be.ID));ne.length&&await(t==null?void 0:t.sendMessageReadReceipt(ne).then(()=>{ne.forEach(Be=>o.readSet.add(Be==null?void 0:Be.ID))})),await s((_e=o==null?void 0:o.conversation)==null?void 0:_e.conversationID)},d=[];Object.keys(X2("send")).forEach(q=>{d.push(q)}),ll.TUIServer=t,ll.GroupServer=(Ie=(He=t==null?void 0:t.TUICore)==null?void 0:He.TUIServer)==null?void 0:Ie.TUIGroup;const f=Ne(),g=Ne(),v=Ne(),_=Ne(),M=Ne();t.bind(o);const C={list:[],handleAvatar:kC,handleName:jh},D=Ne();Js(D,()=>{o.showGroupMemberList=!1});const w=Ve(()=>{const{conversation:q}=o;return q!=null&&q.conversationID?(q==null?void 0:q.type)===t.TUICore.TIM.TYPES.CONV_SYSTEM?"system":"chat":""}),S=Ve(()=>{var ne,_e,Be;const{conversation:q}=o;if((q==null?void 0:q.type)===t.TUICore.TIM.TYPES.CONV_GROUP){if(((ne=q==null?void 0:q.groupProfile)==null?void 0:ne.selfInfo.role)===t.TUICore.TIM.TYPES.GRP_MBR_ROLE_MEMBER&&((_e=q==null?void 0:q.groupProfile)!=null&&_e.muteAllMembers))return!0;const Fe=new Date().getTime();if(((Be=o.selfInfo)==null?void 0:Be.muteUntil)*1e3-Fe>0)return!0}return!1});nn(()=>{o.isMsgNeedReadReceipt=e.isMsgNeedReadReceipt,o.needReadReceipt=o.isMsgNeedReadReceipt,o.needTyping=e.isNeedTyping,o.isNeedEmojiReact=e.isNeedEmojiReact}),$t(()=>{var q;return(q=o==null?void 0:o.conversation)==null?void 0:q.conversationID},(q,ne)=>{q!==ne&&(o.scroll.scrollTop=0,o.scroll.scrollHeight=0,o.scroll.scrollTopMin=1/0,o.scroll.scrollTopMax=0,o.text="",o.atText="",o.reference={message:{},content:"",type:0,show:""})},{deep:!0}),$t(S,(q,ne)=>{var Be,je,lt;const{conversation:_e}=o;if(q&&(_e==null?void 0:_e.type)===t.TUICore.TIM.TYPES.CONV_GROUP){((Be=_e==null?void 0:_e.groupProfile)==null?void 0:Be.selfInfo.role)===t.TUICore.TIM.TYPES.GRP_MBR_ROLE_MEMBER&&((je=_e==null?void 0:_e.groupProfile)!=null&&je.muteAllMembers)&&(o.muteText="管理员开启学生禁言");const Tt=new Date().getTime();((lt=o.selfInfo)==null?void 0:lt.muteUntil)*1e3-Tt>0&&(o.muteText="您已被管理员禁言")}});const N=Ve(()=>{const{conversation:q}=o;return jh(q)}),A=Ve(()=>o.messageList.filter(q=>!q.isDeleted&&!uf(q))),L=Ve(()=>{var q;return(q=A==null?void 0:A.value)==null?void 0:q.filter(ne=>!ne.isRevoked&&ne.type===o.types.MSG_IMAGE)}),j=Ve(()=>{const{conversation:q,needReadReceipt:ne}=o;return!!((q==null?void 0:q.type)===t.TUICore.TIM.TYPES.CONV_C2C||ne)});$t(A,(q,ne)=>{var _e,Be;if(br(()=>{var lt,Fe;const je=((lt=q[q.length-1])==null?void 0:lt.ID)===((Fe=ne[ne.length-1])==null?void 0:Fe.ID);q.length===0||je||fe()}),o.currentMessage){const je=(_e=o.currentMessage)==null?void 0:_e.ID,lt=q.find(Fe=>Fe.ID===je);lt&&(o.currentMessage=EC(lt))}if(o.historyReference){for(let je=0;jeo.scroll.scrollTop,q=>{setTimeout(()=>{var ne;q===((ne=f==null?void 0:f.value)==null?void 0:ne.scrollTop)&&(o.scroll.scrollTopMin!==1/0&&o.scroll.scrollTopMax!==0&&ve("scroll"),o.scroll.scrollTopMin=1/0,o.scroll.scrollTopMax=0)},20)},{deep:!0}),On(()=>{$t(()=>f==null?void 0:f.value,()=>{f!=null&&f.value&&f.value.addEventListener("scroll",le)},{deep:!0})});const V=q=>{var ne;(ne=M==null?void 0:M.value)==null||ne.addEmoji(q)},x=async q=>{o.isFirstSend&&(o.isFirstSend=!1),o.reference.show="",t.TUICore.isOfficial&&(n!=null&&n.commit)&&(n==null||n.commit("handleTask",0))},$=q=>{o.currentMessage=q,o.dialogID=q.ID},z=q=>{o.env.isH5?(o.showResend=!0,o.resendMessage=q):t.resendMessage(q).catch(ne=>{xr(ne,o.env)})},G=q=>{o.currentMessage=q,C.list=t.TUICore.getStore().TUIConversation.conversationList,o.forwardStatus=!0},O=(q,ne)=>{let _e=b$(q);o.reference={message:q,content:_e==null?void 0:_e.referenceMessageForShow,type:_e==null?void 0:_e.referenceMessageType,show:ne}},T=()=>{t.resendMessage(o.resendMessage).then(()=>{o.showResend=!1}).catch(q=>{xr(q,o.env),o.showResend=!1})},P=q=>{var ne,_e,Be;(ne=q==null?void 0:q.payload)!=null&&ne.text&&((Be=M==null?void 0:M.value)==null||Be.reEdit((_e=q==null?void 0:q.payload)==null?void 0:_e.text))},Z=q=>{t.handleGroupApplication(q)},K=q=>{q.clipboardData.files[0]&&t.sendImageMessage(q.clipboardData.files[0])},oe=async()=>{await t.getHistoryMessageList().then(()=>{var q;Ae("target",(q=f==null?void 0:f.value)==null?void 0:q.firstElementChild)})},J=q=>{var _e,Be;o.referenceID=q;const ne=[];for(let je=0;je{v.value[je].getElementsByClassName("content")[0].classList.add("reference-content")}));ne.indexOf(q)===-1&&t.getHistoryMessageList().then(()=>{o.historyReference=!0})},ie=()=>{o.showGroupMemberList=!o.showGroupMemberList},pe=()=>{t.TUICore.TUIServer.TUIConversation.handleCurrentConversation()},ue=q=>{window.open(q.url)},de=(q,ne)=>{var _e,Be,je;if(!(!q||!ne))switch(ne){case"reference":O(q,ne);break;case"reply":O(q,ne);break;case"reedit":(_e=q==null?void 0:q.payload)!=null&&_e.text&&((je=M==null?void 0:M.value)==null||je.reEdit((Be=q==null?void 0:q.payload)==null?void 0:Be.text));break}},Y=async(q,ne)=>{var _e;if(!(!(q!=null&&q.ID)||!ne))switch(ne){case"receipt":if(q.conversationType!==t.TUICore.TIM.TYPES.CONV_GROUP||((_e=q.readReceiptInfo)==null?void 0:_e.unreadCount)===0)return;o.currentMessage=q,o.receiptDialogStatus=!0;break;case"replies":o.currentMessage=q,o.repliesDialogStatus=!0;break;case"forward":o.currentMessage=q,C.list=t.TUICore.getStore().TUIConversation.conversationList,o.forwardStatus=!0;break;case"previewImage":o.showImagePreview=!o.showImagePreview,o.currentImagePreview=q;break}},re=async q=>{if(q)switch(q){case"receipt":o.currentMessage={},o.receiptDialogStatus=!1;break;case"replies":o.currentMessage={},o.repliesDialogStatus=!1;break}},fe=()=>{var q;if(o.isFirstRender){o.needToBottom=!1,Ae("bottom"),o.isFirstRender=!1;return}if(f.value){const{scrollHeight:ne,scrollTop:_e,clientHeight:Be}=f.value;ne-(_e+Be)<=Be||((q=A.value[A.value.length-1])==null?void 0:q.flow)==="out"?Ae("bottom"):Q(!0)}},Ae=(q,ne)=>{var _e;switch((_e=f==null?void 0:f.value)==null||_e.removeEventListener("scroll",le),o.isUserAction=!0,q){case cn.scrollType.toBottom:o.needToBottom=!1,br(()=>{var Be,je,lt;(Be=o==null?void 0:o.env)!=null&&Be.isH5?ye():(lt=(je=f==null?void 0:f.value)==null?void 0:je.lastElementChild)==null||lt.scrollIntoView(!1),ik(f==null?void 0:f.value,"message-img",async()=>{var Fe,it,Tt;(Fe=o==null?void 0:o.env)!=null&&Fe.isH5?ye():(Tt=(it=f==null?void 0:f.value)==null?void 0:it.lastElementChild)==null||Tt.scrollIntoView(!1),f.value.addEventListener("scroll",le),await ve("page")})});break;case cn.scrollType.toTarget:br(()=>{ne==null||ne.scrollIntoView(!1),ik(f==null?void 0:f.value,"message-img",async()=>{ne==null||ne.scrollIntoView(!1),f.value.addEventListener("scroll",le),await ve("page")})});break}},ye=()=>{var q;(q=document==null?void 0:document.getElementById("app"))!=null&&q.style&&(document.getElementById("app").style.marginBottom="",document.getElementById("app").style.height="100%"),f.value.scrollTop=f.value.scrollHeight},le=()=>{const{scrollHeight:q,scrollTop:ne,clientHeight:_e}=f.value;j.value&&(o.scroll.scrollHeight=q,o.scroll.scrollTop=ne,o.scroll.scrollTopMin=o.isUserAction?o.scroll.scrollTopMin:Math.min(o.scroll.scrollTopMin,o.scroll.scrollTop),o.scroll.scrollTopMax=o.isUserAction?o.scroll.scrollTopMax:Math.max(o.scroll.scrollTopMax,o.scroll.scrollTop)),q-(ne+_e)>_e?Q(!0):Q(!1),o.isUserAction=!1},Q=q=>{var ne,_e,Be;switch(q){case!0:o.needToBottom=!0,(ne=o==null?void 0:o.conversation)!=null&&ne.unreadCount&&((_e=o==null?void 0:o.conversation)==null?void 0:_e.unreadCount)>0?o.toBottomTipCont=`${(Be=o==null?void 0:o.conversation)==null?void 0:Be.unreadCount} ${r("TUIChat.条新消息")}`:o.toBottomTipCont=r("TUIChat.回到最新位置");break;case!1:o.needToBottom=!1;break;default:o.needToBottom=!1;break}},ve=async q=>{var Be,je,lt,Fe;if(!j.value){s((Be=o==null?void 0:o.conversation)==null?void 0:Be.conversationID);return}o.messageInView.length&&(o.messageInView=[]);let ne=0,_e=0;switch(q){case cn.inViewType.page:ne=o.scroll.scrollTop,_e=o.scroll.scrollTop+((je=f==null?void 0:f.value)==null?void 0:je.clientHeight);break;case cn.inViewType.scroll:ne=o.scroll.scrollTopMin,_e=o.scroll.scrollTopMax+((lt=f==null?void 0:f.value)==null?void 0:lt.clientHeight);break}for(let it=0;it<((Fe=v==null?void 0:v.value)==null?void 0:Fe.length);it++)if(Le(q,v==null?void 0:v.value[it],ne,_e)){const Tt=A.value[it];o.messageInView.push(Tt)}await u(o.messageInView)},Le=(q,ne,_e,Be)=>{const je=f.value.getBoundingClientRect().top,lt=f.value.getBoundingClientRect().bottom,{top:Fe,bottom:it}=ne.getBoundingClientRect(),{offsetTop:Tt,clientHeight:mn}=ne;switch(q){case cn.inViewType.page:return Math.round(Fe)>=Math.round(je)&&Math.round(it)<=Math.round(lt);case cn.inViewType.scroll:return Math.round(Tt)>=Math.round(_e)&&Math.round(Tt+mn)<=Math.round(Be);default:return!1}},me=q=>{o.dropDownRef&&o.dropDownRef.removeChild(o.dropDownRef.children[0]),o.dropDownRef=q},W=()=>{Ae("bottom")},te=q=>{o.showImagePreview=!o.showImagePreview,o.currentImagePreview=q},se=()=>{o.reference={message:{},content:"",type:0,show:""}},Te=(q,ne)=>{var _e;(_e=o==null?void 0:o.typingRef)==null||_e.onTyping(q,ne)};return{...Jt(o),conversationType:w,messages:A,messageEle:f,inputEle:g,messageInput:M,messageAimID:v,conversationData:C,conversationName:N,constant:cn,reportMessageSend:x,handleTyping:Te,handleItem:$,handleEdit:P,handleEditor:de,getHistoryMessageList:oe,handleApplication:Z,pluginComponentList:d,handleSend:V,closeDialog:re,isMute:S,pasting:K,setMessageRead:s,sendMessageReadReceipt:u,dialog:D,jumpID:J,back:pe,slotDefault:i,toggleshowGroupMemberList:ie,resendMessage:z,submit:T,Link:FR,openLink:ue,readReceiptDialog:_,scrollToTarget:Ae,needGroupReceipt:j,handleDropDownOpen:me,isMessageTip:PO,showDialog:Y,forwardMessage:G,referOrReplyMessage:O,handleUploadingImageOrVideo:W,handleImagePreview:te,imageList:L,resetReplyOrReference:se}}});const d5=e=>(Mr("data-v-2ff60418"),e=e(),Ir(),e),Kee={class:"TUIChat-header"},Yee={class:"setting"},Jee={class:"TUIChat-main"},Xee=["id"],Zee=d5(()=>B("i",{class:"icon icon-bottom-double"},null,-1)),Qee={class:"to-bottom-tip-cont"},ete={key:0,class:"dialog dialog-conversation"},tte=["src"],nte={class:"name"},rte=["src"],ote={key:0,class:"name"},ite={class:"dialog dialog-conversation"},ste={class:"func",id:"func"},ate={class:"func-main"},lte={class:"mask-main"},ute=d5(()=>B("i",null,null,-1)),cte={key:1,class:"TUIChat"},dte={class:"TUIChat-header"};function fte(e,t,n,r,o,i){var D;const s=Yt("TypingHeader"),u=Yt("Manage"),d=Yt("Replies"),f=Yt("MessageTimestamp"),g=Yt("MessageItem"),v=Yt("ReadReceiptDialog"),_=Yt("imagePreviewer"),M=Yt("MessageInput"),C=Yt("MessageSystem");return e.conversationType==="chat"?(X(),ae("div",{key:0,class:st(["TUIChat",[e.env.isH5?"TUIChat-H5":""]])},[B("header",Kee,[e.env.isH5?(X(),ae("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...w)=>e.back&&e.back(...w))})):Ce("",!0),St(s,{needTyping:e.needTyping,conversation:e.conversation,messageList:e.messageList,ref:"typingRef"},null,8,["needTyping","conversation","messageList"]),B("aside",Yee,[e.conversation.groupProfile?(X(),It(u,{key:0,conversation:e.conversation,userInfo:e.userInfo,isH5:e.env.isH5},null,8,["conversation","userInfo","isH5"])):Ce("",!0),St(d,{message:e.currentMessage,conversation:e.conversation,show:e.repliesDialogStatus,isH5:e.env.isH5,messageList:e.messageList,onCloseDialog:e.closeDialog,ref:"repliesDialog"},null,8,["message","conversation","show","isH5","messageList","onCloseDialog"])])]),B("div",Jee,[B("ul",{class:"TUI-message-list",onClick:t[3]||(t[3]=w=>e.dialogID=""),ref:"messageEle",id:"messageEle"},[e.isCompleted?Ce("",!0):(X(),ae("p",{key:0,class:"message-more",onClick:t[1]||(t[1]=(...w)=>e.getHistoryMessageList&&e.getHistoryMessageList(...w))},Ee(e.$t("TUIChat.查看更多")),1)),(X(!0),ae(dt,null,qt(e.messages,(w,S)=>{var N;return X(),ae("li",{key:S,id:w==null?void 0:w.ID,ref_for:!0,ref:"messageAimID"},[St(f,{currTime:w==null?void 0:w.time,prevTime:S>0?(N=e.messages[S-1])==null?void 0:N.time:0},null,8,["currTime","prevTime"]),St(g,{message:w,env:e.env,types:e.types,displayGroupMessageReadReceipt:e.needGroupReceipt,displayEmojiReactions:e.isNeedEmojiReact,messageList:e.messages,onHandleEditor:e.handleEditor,onShowDialog:e.showDialog,onUploading:e.handleUploadingImageOrVideo,onJumpID:e.jumpID,onResendMessage:e.resendMessage},null,8,["message","env","types","displayGroupMessageReadReceipt","displayEmojiReactions","messageList","onHandleEditor","onShowDialog","onUploading","onJumpID","onResendMessage"])],8,Xee)}),128)),e.needToBottom?(X(),ae("div",{key:1,class:"to-bottom-tip",onClick:t[2]||(t[2]=w=>e.scrollToTarget("bottom"))},[Zee,B("div",Qee,[B("span",null,Ee(e.toBottomTipCont),1)])])):Ce("",!0)],512),e.forwardStatus&&e.messageComponents.Forward?(X(),ae("div",ete,[(X(),It(af("Forward"),{list:e.conversationData.list,message:e.currentMessage,show:e.forwardStatus,isH5:e.env.isH5,"onUpdate:show":t[4]||(t[4]=w=>e.forwardStatus=w)},{left:xt(({data:w})=>[B("img",{class:"avatar",src:e.conversationData.handleAvatar(w)},null,8,tte),B("label",nte,Ee(e.conversationData.handleName(w)),1)]),right:xt(({data:w})=>[B("img",{class:"avatar",src:e.conversationData.handleAvatar(w)},null,8,rte),e.env.isH5?Ce("",!0):(X(),ae("label",ote,Ee(e.conversationData.handleName(w)),1))]),_:1},40,["list","message","show","isH5"]))])):Ce("",!0),B("div",ite,[St(v,{message:e.currentMessage,conversation:e.conversation,show:e.receiptDialogStatus,isH5:e.env.isH5,onCloseDialog:e.closeDialog,ref:"readReceiptDialog"},null,8,["message","conversation","show","isH5","onCloseDialog"])]),e.showImagePreview?(X(),It(_,{key:1,currentImage:e.currentImagePreview,imageList:e.imageList,onClose:t[5]||(t[5]=w=>e.showImagePreview=!1)},null,8,["currentImage","imageList"])):Ce("",!0)]),B("div",{class:st(["TUIChat-footer",[e.isMute&&"disabled",e.env.isH5&&"TUIChat-H5-footer"]])},[B("div",ste,[B("main",ate,[(X(!0),ae(dt,null,qt(e.pluginComponentList,(w,S)=>(X(),It(af(w),{key:S,isMute:e.isMute,isH5:e.env.isH5,conversation:e.conversation,parentID:"func",onSend:e.handleSend},null,40,["isMute","isH5","conversation","onSend"]))),128))])]),St(M,{ref:"messageInput",conversation:e.conversation,memberList:e.allMemberList,env:e.env,isGroup:(D=e.userInfo)==null?void 0:D.isGroup,replyOrReference:e.reference,isMute:e.isMute,muteText:e.muteText,placeholder:e.$t("TUIChat.请输入消息"),onSendMessage:e.reportMessageSend,onResetReplyOrReference:e.resetReplyOrReference,onOnTyping:e.handleTyping},null,8,["conversation","memberList","env","isGroup","replyOrReference","isMute","muteText","placeholder","onSendMessage","onResetReplyOrReference","onOnTyping"])],2),$n(B("div",{class:"mask",onClick:t[8]||(t[8]=w=>e.showResend=!1)},[B("div",lte,[B("header",null,Ee(e.$t("TUIChat.确认重发该消息?")),1),B("footer",null,[B("p",{onClick:t[6]||(t[6]=w=>e.showResend=!1)},Ee(e.$t("TUIChat.取消")),1),ute,B("p",{onClick:t[7]||(t[7]=(...w)=>e.submit&&e.submit(...w))},Ee(e.$t("TUIChat.确定")),1)])])],512),[[eo,e.showResend]])],2)):e.conversationType==="system"?(X(),ae("div",cte,[B("header",dte,[B("h1",null,Ee(e.conversationName),1)]),St(C,{data:e.messages,types:e.types,onApplication:e.handleApplication},null,8,["data","types","onApplication"])])):e.slotDefault?Ft(e.$slots,"default",{key:2},void 0,!0):Ce("",!0)}const yc=jt(c5,[["render",fte],["__scopeId","data-v-2ff60418"]]),f5=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1},parentID:{type:String,default:()=>""}},setup(e,t){var f;const n=zt({emojiUrl:lh,emojiMap:lf,emojiName:wO,faceUrl:m$,bigEmojiList:((f=window==null?void 0:window.TUIKitTUICore)==null?void 0:f.isOfficial)&&v$||[],show:!1,currentIndex:0,isMute:!1,transDom:!1}),r=Ne();nn(()=>{n.show=e.show,n.isMute=e.isMute});const o=()=>{const g=document.getElementsByClassName("face-main")[0];n.isMute||(g.style.display=g.style.display==="none"?"flex":"none"),g.style.display==="none"&&d(0),i()},i=()=>{const g=document.getElementById(e.parentID),v=document.getElementsByClassName("face-H5-main")[0];e.isH5&&(g==null||g.appendChild(v))};Js(r,()=>{const g=document.getElementsByClassName("face-main")[0];g&&(g.style.display="none")});const s=async(g,v)=>{const _={name:g};if(n.currentIndex===0)return _.type="emo",_.url=lh+lf[g],_.template=``,e.isH5||o(),t.emit("send",_);try{await f5.TUIServer.sendFaceMessage({index:n.bigEmojiList[n.currentIndex-1].icon,data:n.bigEmojiList[n.currentIndex-1].list[v]})}catch(M){xr(M,e)}e.isH5||o()},u=Ve(()=>{const g=[n.emojiName];for(let v=0;v{n.currentIndex=g};return{...Jt(n),toggleShow:o,select:s,selectFace:d,list:u,dialog:r}}});const pte=e=>(Mr("data-v-66fdb436"),e=e(),Ir(),e),hte={class:"face",id:"face"},gte=["onClick"],mte=["src"],vte=["src"],yte={class:"face-tab"},_te=pte(()=>B("i",{class:"icon icon-face"},null,-1)),bte=[_te],Mte=["onClick"],Ite=["src"];function Cte(e,t,n,r,o,i){return X(),ae("div",hte,[B("i",{class:"icon icon-face",title:"表情",onClick:t[0]||(t[0]=(...s)=>e.toggleShow&&e.toggleShow(...s))}),$n(B("main",{class:st(["face-main",[e.isH5&&"face-H5-main"]]),ref:"dialog"},[(X(!0),ae(dt,null,qt(e.list,(s,u)=>$n((X(),ae("ul",{class:"face-list",key:u},[(X(!0),ae(dt,null,qt(s,(d,f)=>(X(),ae("li",{class:"face-list-item",key:f,onClick:g=>e.select(d,f)},[u===0?(X(),ae("img",{key:0,src:e.emojiUrl+e.emojiMap[d]},null,8,mte)):(X(),ae("img",{key:1,class:"face-img",src:e.faceUrl+d+"@2x.png"},null,8,vte))],8,gte))),128))])),[[eo,e.currentIndex===u]])),128)),B("ul",yte,[B("li",{class:"face-tab-item",onClick:t[1]||(t[1]=s=>e.selectFace(0))},bte),(X(!0),ae(dt,null,qt(e.bigEmojiList,(s,u)=>(X(),ae("li",{class:"face-tab-item",key:u,onClick:d=>e.selectFace(u+1)},[B("img",{src:e.faceUrl+s.list[0]+"@2x.png"},null,8,Ite)],8,Mte))),128))])],2),[[eo,e.show]])])}const Tte=jt(f5,[["render",Cte],["__scopeId","data-v-66fdb436"]]),p5=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({isMute:!1});nn(()=>{n.isMute=e.isMute});const r=async o=>{if(o.target.files.length>0)try{await p5.TUIServer.sendImageMessage(o.target)}catch(i){xr(i,e)}o.target.value=""};return{...Jt(n),sendUploadMessage:r}}});const wte={class:"upload-btn icon icon-image"};function Ste(e,t,n,r,o,i){return X(),ae("span",wte,[e.isMute?Ce("",!0):(X(),ae("input",{key:0,title:"图片",type:"file","data-type":"image",accept:"image/*",onChange:t[0]||(t[0]=(...s)=>e.sendUploadMessage&&e.sendUploadMessage(...s))},null,32)),Ft(e.$slots,"default",{},void 0,!0)])}const kte=jt(p5,[["render",Ste],["__scopeId","data-v-5154d9d1"]]),h5=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({isMute:!1});nn(()=>{n.isMute=e.isMute});const r=async o=>{if(o.target.files.length>0)try{await h5.TUIServer.sendVideoMessage(o.target)}catch(i){xr(i,e)}o.target.value=""};return{...Jt(n),sendUploadMessage:r}}});const Dte={class:"upload-btn icon icon-video"};function Ete(e,t,n,r,o,i){return X(),ae("span",Dte,[e.isMute?Ce("",!0):(X(),ae("input",{key:0,title:"视频",type:"file","data-type":"video",accept:"video/*",onChange:t[0]||(t[0]=(...s)=>e.sendUploadMessage&&e.sendUploadMessage(...s))},null,32)),Ft(e.$slots,"default",{},void 0,!0)])}const Ate=jt(h5,[["render",Ete],["__scopeId","data-v-b53ef5ce"]]),g5=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({isMute:!1});nn(()=>{n.isMute=e.isMute});const r=async o=>{if(o.target.files.length>0)try{await g5.TUIServer.sendFileMessage(o.target)}catch(i){xr(i,e)}o.target.value=""};return{...Jt(n),sendUploadMessage:r}}});const Lte={class:"upload-btn icon icon-files"};function Ote(e,t,n,r,o,i){return X(),ae("span",Lte,[e.isMute?Ce("",!0):(X(),ae("input",{key:0,title:"文件",type:"file","data-type":"file",accept:"*",onChange:t[0]||(t[0]=(...s)=>e.sendUploadMessage&&e.sendUploadMessage(...s))},null,32)),Ft(e.$slots,"default",{},void 0,!0)])}const Rte=jt(g5,[["render",Ote],["__scopeId","data-v-0ea80c3b"]]),m5=ot({components:{Transfer:GC},name:"转发",props:{list:{type:Array,default:()=>[]},message:{type:Object,default:()=>({})},show:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({list:[],show:!1,to:-1}),r=Ne();nn(()=>{n.list=e.list,n.show=e.show});const o=()=>{n.show=!n.show,n.show||(t.emit("update:show",n.show),n.to=-1)};Js(r,()=>{n.show=!1,t.emit("update:show",n.show),n.to=-1});const i=async s=>{s.map(async u=>{try{await m5.TUIServer.forwardMessage(e.message,u)}catch(d){xr(d,e)}}),o()};return{...Jt(n),toggleShow:o,handleForWordMessage:i,dialog:r}}});function Nte(e,t,n,r,o,i){const s=Yt("Transfer");return X(),ae("div",null,[e.show?(X(),ae("div",{key:0,class:st(["forward",[e.isH5?"forward-h5":""]]),ref:"dialog"},[St(s,{title:"转发",list:e.list,isSearch:!1,isH5:e.isH5,isCustomItem:!0,resultShow:!0,onSubmit:e.handleForWordMessage,onCancel:e.toggleShow},{left:xt(({data:u})=>[Ft(e.$slots,"left",{data:u},void 0,!0)]),right:xt(({data:u})=>[Ft(e.$slots,"right",{data:u},void 0,!0)]),_:3},8,["list","isH5","onSubmit","onCancel"])],2)):Ce("",!0)])}const Pte=jt(m5,[["render",Nte],["__scopeId","data-v-d1d04d9f"]]),v5=ot({props:{needTyping:{type:Boolean,default:!1},conversation:{type:Object,default:()=>({})},messageList:{type:Array,default:()=>[]}},setup(e,t){const n=zt({messageList:[],conversation:{},title:"",timeValid:0,myTypingStatus:0,otherTypingStatus:0,needTyping:!1,lastOtherMessageTime:0,lastMyTypingTime:0,lastOtherTypingTime:0,options:{data:{businessID:cn.typeUserTyping,typingStatus:0,version:1,userAction:0,actionParam:cn.typeInputStatusEnd},description:"",extension:""}});nn(()=>{n.messageList=e.messageList,n.conversation=e.conversation,n.needTyping=e.needTyping});const r=Ve(()=>{const{conversation:M}=n;return M!=null&&M.conversationID?M.conversationID:""}),o=Ve(()=>{const{conversation:M}=n;return jh(M)}),i=Ve(()=>{const{conversation:M}=n;return M!=null&&M.type?M==null?void 0:M.type:""}),s=Ve(()=>n.needTyping&&n.otherTypingStatus?"对方正在输入":o==null?void 0:o.value),u=(M,C)=>{if(!(!n.needTyping||i.value!=="C2C")&&(new Date().getTime()/1e3-n.lastOtherMessageTime<30&&(n.timeValid=1),!!n.timeValid))if(!M&&!C){n.myTypingStatus=1;const D=new Date().getTime();D-n.lastMyTypingTime>4e3&&(n.lastMyTypingTime=D,f(n.myTypingStatus))}else n.myTypingStatus=0,n.lastMyTypingTime=0,f(n.myTypingStatus)};$t(r,(M,C)=>{M!==C&&(n.needTyping=!1,n.timeValid=0)}),$t(()=>n.needTyping,(M,C)=>{M||(n.myTypingStatus=0,n.otherTypingStatus=0,n.lastOtherMessageTime=0)}),$t(()=>n.messageList,(M,C)=>{br(()=>{var D,w;M.length===0||i.value!=="C2C"||(n.lastOtherMessageTime=g(M),((D=M[M.length-1])==null?void 0:D.flow)==="in"&&(uf(M[M.length-1])?(n.otherTypingStatus=d(M[M.length-1]),_()):(n.lastOtherMessageTime=(w=M[M.length-1])==null?void 0:w.time,n.otherTypingStatus=0)))})},{deep:!0});const d=M=>{var C;try{const{typingStatus:D,actionParam:w}=dr((C=M==null?void 0:M.payload)==null?void 0:C.data);return D===1&&w===cn.typeInputStatusIng?1:0}catch{return 0}},f=M=>{n.options={data:{businessID:cn.typeUserTyping,typingStatus:M?1:0,version:1,userAction:M?14:0,actionParam:M?cn.typeInputStatusIng:cn.typeInputStatusEnd},description:"",extension:""},v5.TUIServer.sendTypingMessage(n.options)},g=M=>{if(!M)return 0;for(let C=M.length-1;C>=0;C--)if(!uf(M[C])&&M[C].flow==="in")return M[C].time;return 0},v=(M,C=2e3)=>{let D;return function(){D&&clearTimeout(D),D=setTimeout(M,C)}},_=v(()=>{n.otherTypingStatus=0},5e3);return{...Jt(n),conversationID:r,conversationName:o,conversationType:i,title:s,isTypingMessage:uf,sendTypingMessage:f,handleTypingMessageStatus:d,getLastOtherMessageTime:g,debounce:v,waitTypingEnd:_,onTyping:u}}});function xte(e,t,n,r,o,i){return X(),ae("h1",null,Ee(e.title==="对方正在输入"?e.$t("TUIChat.对方正在输入"):e.title),1)}const Ute=jt(v5,[["render",xte],["__scopeId","data-v-8592c23b"]]),vs=ot({type:"custom",props:{message:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1},show:{type:Boolean,default:()=>!1}},setup(e,t){const{t:n}=window.TUIKitTUICore.config.i18n.useI18n(),r=zt({message:{},isGroup:!1,show:!1,isH5:!1,messageInfo:{isImg:!1,content:""},readReceiptList:[{label:e.isH5?n("TUIChat.人已读"):n("TUIChat.已读"),count:0,userList:[],isCompleted:!0,cursor:"",show:!0},{label:e.isH5?n("TUIChat.人未读"):n("TUIChat.未读"),count:0,userList:[],isCompleted:!0,cursor:"",show:!0},{label:e.isH5?n("TUIChat.人关闭阅读状态"):n("TUIChat.关闭阅读状态"),count:0,userList:[],isCompleted:!0,cursor:"",show:!1}],showListNow:0,isMenuOpen:!0,env:zh()}),o=Ne();nn(()=>{r.show=e.show,r.isH5=e.isH5}),$t(()=>{e.message,r.show},async()=>{var C,D,w,S;r.show&&(M(),r.message=e.message,f(),_(),r.readReceiptList[0].count=((D=(C=r.message)==null?void 0:C.readReceiptInfo)==null?void 0:D.readCount)||r.readReceiptList[0].count,r.readReceiptList[1].count=((S=(w=r.message)==null?void 0:w.readReceiptInfo)==null?void 0:S.unreadCount)||r.readReceiptList[1].count,s(),u())},{deep:!0});const i=()=>{r.show=!r.show,r.show||(t.emit("closeDialog","receipt"),v())};Js(o,()=>{r.show=!1,t.emit("closeDialog","receipt"),v()});const s=async(C=!1)=>{var D,w;if(!(!r.isGroup||!r.message||Object.keys(r.message).length===0))try{const S=await vs.TUIServer.getGroupReadMemberList(r.message,C?r.readReceiptList[0].cursor:"");r.readReceiptList[0].isCompleted=(D=S==null?void 0:S.data)==null?void 0:D.isCompleted,r.readReceiptList[0].cursor=((w=S==null?void 0:S.data)==null?void 0:w.cursor)||"";const N=S.data.readUserIDList,A=await d(N);r.readReceiptList[0].userList=C?[...r.readReceiptList[0].userList,...A]:A}catch(S){if(S&&(S==null?void 0:S.code)===10062){const N=n("TUIChat.您当前购买使用的套餐包暂未开通群消息已读回执功能");xr(N,r.env),console.warn(N)}}},u=async(C=!1)=>{var N;if(!r.isGroup||!r.message||Object.keys(r.message).length===0)return;const D=await vs.TUIServer.getGroupUnreadMemberList(r.message,C?r.readReceiptList[1].cursor:"");r.readReceiptList[1].isCompleted=D==null?void 0:D.data.isCompleted,r.readReceiptList[1].cursor=((N=D==null?void 0:D.data)==null?void 0:N.cursor)||"";const w=D.data.unreadUserIDList,S=await d(w);r.readReceiptList[1].userList=C?[...r.readReceiptList[1].userList,...S]:S},d=async C=>{const D=[];return C.length&&r.isGroup&&(await vs.TUIServer.getUserProfile(C)).data.forEach(N=>{D.push({nick:N==null?void 0:N.nick,avatar:N==null?void 0:N.avatar,userID:N==null?void 0:N.userID})}),D},f=()=>{var C;((C=r.message)==null?void 0:C.conversationType)===vs.TUIServer.TUICore.TIM.TYPES.CONV_GROUP?r.isGroup=!0:r.isGroup=!1},g=()=>{switch(r.showListNow){case 0:s(!0);break;case 1:u(!0);break}},v=()=>{r.message={},r.readReceiptList=[{label:e.isH5?n("TUIChat.人已读"):n("TUIChat.已读"),count:0,userList:[],isCompleted:!0,cursor:"",show:!0},{label:e.isH5?n("TUIChat.人未读"):n("TUIChat.未读"),count:0,userList:[],isCompleted:!0,cursor:"",show:!0},{label:e.isH5?n("TUIChat.人关闭阅读状态"):n("TUIChat.关闭阅读状态"),count:0,userList:[],isCompleted:!0,cursor:"",show:!1}],r.showListNow=0,r.messageInfo={isImg:!1,content:""}},_=()=>{var C,D,w,S,N,A,L;if(!(!r.message||!r.isH5))switch(r.message.type){case vs.TUIServer.TUICore.TIM.TYPES.MSG_TEXT:r.messageInfo.content=(D=(C=r.message)==null?void 0:C.payload)==null?void 0:D.text,r.messageInfo.isImg=!1;break;case vs.TUIServer.TUICore.TIM.TYPES.MSG_CUSTOM:r.messageInfo.content=n("TUIChat.自定义"),r.messageInfo.isImg=!1;break;case vs.TUIServer.TUICore.TIM.TYPES.MSG_IMAGE:r.messageInfo.content=(w=LO(r.message))==null?void 0:w.url,r.messageInfo.isImg=!0;break;case vs.TUIServer.TUICore.TIM.TYPES.MSG_AUDIO:r.messageInfo.content=n("TUIChat.语音"),r.messageInfo.isImg=!1;break;case vs.TUIServer.TUICore.TIM.TYPES.MSG_VIDEO:r.messageInfo.content=(S=OO(r.message))==null?void 0:S.snapshotUrl,r.messageInfo.isImg=!0;break;case vs.TUIServer.TUICore.TIM.TYPES.MSG_FILE:r.messageInfo.content=n("TUIChat.文件")+((A=(N=r.message)==null?void 0:N.payload)==null?void 0:A.fileName),r.messageInfo.isImg=!1;break;case vs.TUIServer.TUICore.TIM.TYPES.MSG_FACE:r.messageInfo.content=(L=AO(r.message))==null?void 0:L.url,r.messageInfo.isImg=!0;break}},M=()=>{var C;r.isMenuOpen=!!((C=document==null?void 0:document.getElementsByClassName("home-menu"))!=null&&C.length)};return{...Jt(r),dialog:o,toggleShow:i,getReadList:s,getUnreadList:u,isGroup:f,handleAvatarAndName:d,close:v,getMoreList:g,showMessage:_,caculateTimeago:gg,handleDialogPosition:M}}});const Fte={class:"header"},Gte={class:"header-back"},$te={class:"header-title"},Bte={class:"header-close"},Hte={class:"body"},qte={key:0,class:"body-message"},Vte={class:"message"},zte={class:"message-info"},jte={class:"message-cont"},Wte=["src"],Kte={key:1},Yte={class:"body-tab"},Jte=["onClick"],Xte={class:"tab-item-title"},Zte={class:"tab-item-count"},Qte={class:"body-list"},ene=["src"],tne={class:"name"};function nne(e,t,n,r,o,i){return e.show?(X(),ae("div",{key:0,class:st(["read-receipt",[e.isH5?"read-receipt-H5":"",e.isMenuOpen?"read-receipt-menu-open":""]]),ref:"dialog"},[B("div",Fte,[B("div",Gte,[e.isH5?(X(),ae("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...s)=>e.toggleShow&&e.toggleShow(...s))})):Ce("",!0)]),B("div",$te,[B("span",null,Ee(e.$t("TUIChat.消息详情")),1)]),B("div",Bte,[e.isH5?Ce("",!0):(X(),ae("i",{key:0,class:"icon icon-close",onClick:t[1]||(t[1]=(...s)=>e.toggleShow&&e.toggleShow(...s))}))])]),B("div",Hte,[e.isH5?(X(),ae("div",qte,[B("div",Vte,[B("div",zte,[B("span",null,Ee(e.message.from),1),B("span",null,Ee(e.caculateTimeago(e.message.time*1e3)),1)]),B("div",jte,[e.messageInfo.isImg?(X(),ae("img",{key:0,class:"message-cont-img",src:e.messageInfo.content},null,8,Wte)):(X(),ae("p",Kte,Ee(e.messageInfo.content),1))])])])):Ce("",!0),B("div",Yte,[(X(!0),ae(dt,null,qt(e.readReceiptList,(s,u)=>(X(),ae(dt,null,[s.show?(X(),ae("div",{class:st(["tab-item",u===e.showListNow&&"tab-item-now"]),key:u,onClick:d=>e.showListNow=u},[B("div",Xte,Ee(s==null?void 0:s.label),1),B("div",Zte,Ee(s==null?void 0:s.count),1)],10,Jte)):Ce("",!0)],64))),256))]),B("div",Qte,[B("ul",null,[(X(!0),ae(dt,null,qt(e.readReceiptList[e.showListNow].userList,(s,u)=>(X(),ae("li",{key:u,class:"body-list-item"},[B("img",{class:"avatar",src:(s==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,ene),B("div",tne,Ee((s==null?void 0:s.nick)||(s==null?void 0:s.userID)),1)]))),128))]),e.readReceiptList[e.showListNow].isCompleted?Ce("",!0):(X(),ae("div",{key:0,class:"more",onClick:t[2]||(t[2]=(...s)=>e.getMoreList&&e.getMoreList(...s))},"查看更多"))])])],2)):Ce("",!0)}const rne=jt(vs,[["render",nne],["__scopeId","data-v-feb5f684"]]),one=ot({props:{message:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1},isRoot:{type:Boolean,default:!1}},components:{MessageText:UO,MessageEmojiReact:FC},setup(e,t){const n=zt({message:{},isH5:!1,url:"",isRoot:!1,constant:cn,TIM:vt});return nn(()=>{var r,o;n.message=e.message,n.isH5=e.isH5,n.isRoot=e.isRoot,n.message.type===vt.TYPES.MSG_FACE&&(n.url=`https://web.sdk.qcloud.com/im/assets/face-elem/${(o=(r=n.message)==null?void 0:r.payload)==null?void 0:o.data}@2x.png`)}),{...Jt(n),handleTextMessageShowContext:EO,handleCustomMessageShowContext:NO,handleFileMessageShowContext:RO,caculateTimeago:gg}}});const y5=e=>(Mr("data-v-e24b9070"),e=e(),Ir(),e),ine={class:"message-bubble",ref:"htmlRefHook"},sne=["src"],ane={class:"message-area"},lne={class:"message-area-title"},une={class:"name"},cne={class:"time"},dne={class:"content content-in"},fne={key:1},pne=["src"],hne=y5(()=>B("i",{class:"icon icon-voice"},null,-1)),gne={key:4,class:"message-video-cover"},mne=["src"],vne=["src"],yne={key:6,class:"message-file"},_ne=y5(()=>B("i",{class:"icon icon-files"},null,-1)),bne={class:"message-file-content"};function Mne(e,t,n,r,o,i){var d,f,g,v,_,M,C,D,w,S,N,A,L,j,V,x,$,z,G,O;const s=Yt("MessageText"),u=Yt("MessageEmojiReact");return X(),ae("div",{class:st(["replies-item",e.isRoot?"":"replies-item-normal"])},[B("div",ine,[B("img",{class:"avatar",src:((d=e.message)==null?void 0:d.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,sne),B("main",ane,[B("div",lne,[B("label",une,Ee(e.isRoot?e.message.nameCard||e.message.nick||e.message.from:e.message.messageSender),1),B("label",cne,Ee(e.caculateTimeago((e.isRoot?(f=e.message)==null?void 0:f.time:(g=e.message)==null?void 0:g.messageTime)*1e3)),1)]),B("div",dne,[e.message.messageType===e.constant.typeText||e.message.type===e.TIM.TYPES.MSG_TEXT||!e.isRoot?(X(),It(s,{key:0,data:e.handleTextMessageShowContext(e.isRoot?e.message:{payload:{text:(v=e.message)==null?void 0:v.messageAbstract}})},null,8,["data"])):Ce("",!0),e.message.messageType===e.constant.typeCustom||e.message.type===e.TIM.TYPES.MSG_CUSTOM?(X(),ae("span",fne,Ee((_=e.handleCustomMessageShowContext(e.message))==null?void 0:_.custom),1)):Ce("",!0),e.message.messageType===e.constant.typeImage||e.message.type===e.TIM.TYPES.MSG_IMAGE?(X(),ae("img",{key:2,class:"message-img",src:(C=(M=e.message)==null?void 0:M.payload)==null?void 0:C.imageInfoArray[1].url},null,8,pne)):Ce("",!0),e.message.messageType===e.constant.typeAudio||e.message.type===e.TIM.TYPES.MSG_AUDIO?(X(),ae("div",{key:3,class:"message-audio",style:Oo(`width: ${((w=(D=e.message)==null?void 0:D.payload)==null?void 0:w.second)*10+40}Px`)},[hne,B("label",null,Ee((N=(S=e.message)==null?void 0:S.payload)==null?void 0:N.second)+"s",1)],4)):Ce("",!0),e.message.messageType===e.constant.typeVideo||e.message.type===e.TIM.TYPES.MSG_VIDEO?(X(),ae("div",gne,[B("img",{class:"message-videoimg",src:((L=(A=e.message)==null?void 0:A.payload)==null?void 0:L.snapshotUrl)||((V=(j=e.message)==null?void 0:j.payload)==null?void 0:V.thumbUrl)},null,8,mne)])):Ce("",!0),e.message.messageType===e.constant.typeFace||e.message.type===e.TIM.TYPES.MSG_FACE?(X(),ae("img",{key:5,class:"message-img",src:e.url},null,8,vne)):Ce("",!0),e.message.messageType===e.constant.typeFile||e.message.type===e.TIM.TYPES.MSG_FILE?(X(),ae("div",yne,[_ne,B("div",bne,[B("label",null,Ee(($=(x=e.message)==null?void 0:x.payload)==null?void 0:$.fileName),1),B("span",null,Ee(((z=e.handleFileMessageShowContext(e.message))==null?void 0:z.size)||((O=(G=e.message)==null?void 0:G.payload)==null?void 0:O.fileSize)),1)])])):Ce("",!0),St(u,{message:e.message,type:"content"},null,8,["message"])])])],512)],2)}const Ine=jt(one,[["render",Mne],["__scopeId","data-v-e24b9070"]]),Cne=ot({type:"custom",components:{RepliesItem:Ine},props:{message:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1},show:{type:Boolean,default:()=>!1},url:{type:String,default:""},messageList:{type:Array,default:()=>[]}},setup(e,t){const n=zt({message:{},isGroup:!1,show:!1,isH5:!1,url:"",showListNow:0,isMenuOpen:!0,replies:[],messageList:[],TIM:vt}),r=Ne();nn(()=>{n.message=e.message,n.show=e.show,n.isH5=e.isH5,n.url=e.url,n.messageList=e.messageList}),$t(()=>{n.message,n.messageList},()=>{n.message=e.message,n.messageList=e.messageList,i(n.message)},{deep:!0});const o=()=>{n.show=!n.show,n.show||(t.emit("closeDialog","replies"),s())};Js(r,()=>{n.show=!1,t.emit("closeDialog","replies"),s()});const i=d=>{var f,g;try{const{cloudCustomData:v}=d;if(!v)return;const _=dr(v);n.replies=(f=_==null?void 0:_.messageReplies)==null?void 0:f.replies,(g=n==null?void 0:n.replies)==null||g.forEach(M=>{const{messageID:C,messageSender:D}=M,w=n.messageList.find(S=>S.ID===C||S.from===D);M.avatar=w?w==null?void 0:w.avatar:""})}catch(v){console.log(v)}},s=()=>{n.message={}},u=()=>{var d;n.isMenuOpen=!!((d=document==null?void 0:document.getElementsByClassName("home-menu"))!=null&&d.length)};return{...Jt(n),dialog:r,toggleShow:o,close:s,caculateTimeago:gg,handleDialogPosition:u}}});const Tne={class:"header"},wne={class:"header-back"},Sne={class:"header-title"},kne={class:"header-close"},Dne={class:"body"},Ene={class:"body-message"},Ane={class:"body-list"};function Lne(e,t,n,r,o,i){const s=Yt("RepliesItem");return e.show?(X(),ae("div",{key:0,class:st(["replies",[e.isH5?"replies-H5":"",e.isMenuOpen?"replies-menu-open":""]]),ref:"dialog"},[B("div",Tne,[B("div",wne,[e.isH5?(X(),ae("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...u)=>e.toggleShow&&e.toggleShow(...u))})):Ce("",!0)]),B("div",Sne,[B("span",null,Ee(e.$t("TUIChat.回复详情")),1)]),B("div",kne,[e.isH5?Ce("",!0):(X(),ae("i",{key:0,class:"icon icon-close",onClick:t[1]||(t[1]=(...u)=>e.toggleShow&&e.toggleShow(...u))}))])]),B("div",Dne,[B("div",Ene,[St(s,{message:e.message,isH5:e.isH5,isRoot:!0},null,8,["message","isH5"])]),B("div",Ane,[B("ul",null,[(X(!0),ae(dt,null,qt(e.replies,(u,d)=>(X(),ae("li",{key:d,class:"body-list-item"},[St(s,{message:u,isH5:e.isH5,isRoot:!1},null,8,["message","isH5"])]))),128))])])])],2)):Ce("",!0)}const One=jt(Cne,[["render",Lne],["__scopeId","data-v-b1f11af2"]]),_5=e=>(Mr("data-v-76bd8c1c"),e=e(),Ir(),e),Rne=["src"],Nne=_5(()=>B("i",{class:"icon icon-left-arrow"},null,-1)),Pne=[Nne],xne=_5(()=>B("i",{class:"icon icon-right-arrow"},null,-1)),Une=[xne],Fne={class:"actions-bar"},Gne={class:"image-counter"},$ne=ot({__name:"imagePreviewer",props:{imageList:{type:Array,default:()=>[]},currentImage:{type:Object,default:()=>({})}},emits:["close"],setup(e,{emit:t}){const n=e;function r(J){return typeof J=="number"&&isFinite(J)}const o=Ne(1),i=Ne(0),s=Ne(.1),u=Ne(0),d=Ne(),f=Ne(),{isH5:g}=zh();let v=0,_={},M=!1,C=!1,D=null;nn(()=>{u.value=n.imageList.findIndex(J=>J.ID===n.currentImage.ID)});const w=J=>{J.preventDefault(),j(J),V(J)},S=J=>{J.preventDefault(),M=!0,J.touches&&J.touches.length===2&&(C=!0,x(J))},N=J=>{var ue;J.preventDefault();let ie=0,pe=0;if(C){D||(C=!1,delete _.pageX2,delete _.pageY2,D=setTimeout(()=>{D=null},200));return}if(D===null){switch(M){case!0:ie=(ue=J==null?void 0:J.changedTouches[0])==null?void 0:ue.pageX,pe=ie-v,pe>100?K():pe<-100&&Z();break;case!1:O();break}D=setTimeout(()=>{D=null},200)}},A=J=>{C=!1,delete _.pageX1,delete _.pageY1},L=J=>{if(J.preventDefault(),Math.abs(J.deltaX)!==0&&Math.abs(J.deltaY)!==0)return;let ie=o.value;ie+=J.deltaY*(J.ctrlKey?-.01:.002),ie=Math.min(Math.max(.125,ie),4),o.value=ie},j=J=>{var ie;v=(ie=J==null?void 0:J.changedTouches[0])==null?void 0:ie.pageX,M=!1},V=J=>{let ie=J==null?void 0:J.touches[0],pe=J==null?void 0:J.touches[1];_.pageX1=ie==null?void 0:ie.pageX,_.pageY1=ie==null?void 0:ie.pageY,pe&&(_.pageX2=pe==null?void 0:pe.pageX,_.pageY2=pe==null?void 0:pe.pageY)},x=J=>{let ie=J==null?void 0:J.touches[0],pe=J==null?void 0:J.touches[1];pe&&(r(_.pageX2)||(_.pageX2=pe.pageX),r(_.pageY2)||(_.pageY2=pe.pageY));const ue=(Y,re,fe,Ae)=>Math.hypot(fe-Y,Ae-re);if(!r(_.pageX1)||!r(_.pageY1)||!r(_.pageX2)||!r(_.pageY2))return;let de=ue(ie.pageX,ie.pageY,pe.pageX,pe.pageY)/ue(_.pageX1,_.pageY1,_.pageX2,_.pageY2);o.value=Math.min(Math.max(.5,o.value*de),4)};On(()=>{var J,ie,pe,ue,de;(J=d==null?void 0:d.value)==null||J.addEventListener("touchstart",w),(ie=d==null?void 0:d.value)==null||ie.addEventListener("touchmove",S),(pe=d==null?void 0:d.value)==null||pe.addEventListener("touchend",N),(ue=d==null?void 0:d.value)==null||ue.addEventListener("touchcancel;",A),(de=d==null?void 0:d.value)==null||de.addEventListener("wheel",L),document==null||document.addEventListener("keydown",$)});const $=J=>{J.preventDefault(),(J==null?void 0:J.keyCode)===27&&O()},z=()=>{o.value+=.1},G=()=>{o.value=o.value-.1>s.value?o.value-.1:s.value},O=()=>{t("close")},T=()=>{i.value-=90},P=()=>{i.value+=90},Z=()=>{f.value.style.transition="0.5s",u.value{f.value.style.transition="0.5s",u.value>0&&u.value--,oe()},oe=()=>{o.value=1,i.value=0};return pl(()=>{var J,ie,pe,ue,de;(J=d==null?void 0:d.value)==null||J.removeEventListener("touchstart",w),(ie=d==null?void 0:d.value)==null||ie.removeEventListener("touchmove",S),(pe=d==null?void 0:d.value)==null||pe.removeEventListener("touchend",N),(ue=d==null?void 0:d.value)==null||ue.removeEventListener("touchcancel;",A),(de=d==null?void 0:d.value)==null||de.removeEventListener("wheel",L),document==null||document.removeEventListener("keydown",$)}),(J,ie)=>{var pe;return X(),ae("div",{class:st(["image-previewer",[Oe(g)&&"image-previewer-h5"]])},[B("div",{class:"image-wrapper",ref_key:"image",ref:d},[B("ul",{class:"image-list",style:Oo({width:`${e.imageList.length*100}%`,transform:`translateX(-${u.value*100/e.imageList.length}%)`}),ref_key:"ul",ref:f},[(X(!0),ae(dt,null,qt(e.imageList,(ue,de)=>{var Y,re;return X(),ae("li",{class:"image-item",key:de},[B("img",{class:"image-preview",style:Oo({transform:`scale(${o.value}) rotate(${i.value}deg)`}),src:(re=(Y=ue==null?void 0:ue.payload)==null?void 0:Y.imageInfoArray[0])==null?void 0:re.url},null,12,Rne)])}),128))],4)],512),$n(B("i",{class:"icon icon-close",onClick:O},null,512),[[eo,!Oe(g)]]),$n(B("div",{class:"image-button image-button-left",onClick:K},Pne,512),[[eo,!Oe(g)&&u.value>0]]),$n(B("div",{class:"image-button image-button-right",onClick:Z},Une,512),[[eo,!Oe(g)&&u.value<((pe=e.imageList)==null?void 0:pe.length)-1]]),B("div",Fne,[B("i",{class:"icon icon-zoom-in",onClick:z}),B("i",{class:"icon icon-zoom-out",onClick:G}),B("i",{class:"icon icon-refresh-left",onClick:T}),B("i",{class:"icon icon-refresh-right",onClick:P}),B("span",Gne,Ee(u.value+1)+" / "+Ee(e.imageList.length),1)])],2)}}});const Bne=jt($ne,[["__scopeId","data-v-76bd8c1c"]]);let Nf={Face:Tte,Image:kte,Video:Ate,File:Rte};const hT={Forward:Pte},gT={TypingHeader:Ute,ReadReceiptDialog:rne,Replies:One,ImagePreviewer:Bne,MessageInput:u5};function X2(e){let t={};switch(e){case"send":t=Nf;break;case"message":t=hT;break;case"other":t=gT;break}return t}const Hne=e=>{const t={...Nf,...hT,...gT};Object.keys(t).forEach(n=>{t[n].TUIServer=ol.server}),yc.TUIServer=ol.server,yc.components={...yc.components,...t},e.component(ol.name,yc)},qne=e=>(ol.server=new xO(e),e.component(ol.name,ol),ol),Vne=e=>{Nf={...Nf,...e}},zne=e=>{e.map(t=>(delete Nf[t],t))},ol={name:"TUIChat",component:yc,server:xO,sendComponents:Nf,messageComponents:hT,otherComponents:gT,install:Hne,plugin:qne,setPluginComponents:Vne,removePluginComponents:zne};class b5 extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});Kt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIConversation",{},this.updateStore.bind(this))}destroyed(){this.unbindTIMEvent()}updateStore(n,r){var o,i;(o=this==null?void 0:this.currentStore)!=null&&o.conversationData&&(this.currentStore.conversationData.list=n.conversationList,this.currentStore.userIDList=(i=this.currentStore.conversationData.list)==null?void 0:i.filter(s=>{var u;return(u=s==null?void 0:s.userProfile)==null?void 0:u.userID}).map(s=>{var u;return(u=s==null?void 0:s.userProfile)==null?void 0:u.userID}))}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUIConversation",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.CONVERSATION_LIST_UPDATED,this.handleConversationListUpdate,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.NET_STATE_CHANGE,this.handleNetStateChange,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.CONVERSATION_LIST_UPDATED,this.handleConversationListUpdate),this.TUICore.tim.off(this.TUICore.TIM.EVENT.NET_STATE_CHANGE,this.handleNetStateChange)}handleConversationListUpdate(n){this.TUICore.tim.isReady()&&window.parent&&window.parent.postMessage({api:"getNoReadMessageCount",count:this.TUICore.tim.getTotalUnreadMessageCount()},"*"),this.handleFilterSystem(n.data)}handleNetStateChange(n){var r;this.currentStore.netWork=((r=n==null?void 0:n.data)==null?void 0:r.state)||""}handleFilterSystem(n){const r={allConversationList:n,conversationList:[]};return n.filter(i=>{var s;return(i==null?void 0:i.conversationID)===((s=this==null?void 0:this.currentStore)==null?void 0:s.currentConversationID)}).length===0&&this.handleCurrentConversation({}),r.conversationList=n.filter(i=>i.type!==this.TUICore.TIM.TYPES.CONV_SYSTEM),this.store.allConversationList=r.allConversationList,this.store.conversationList=r.conversationList,r}handleFilterName(n,r){const o={allConversationList:n,conversationList:[]};console.log(n,"list");const i=[];return n.forEach(s=>{var u,d,f,g,v,_;console.log(s,"item",r),s.type==="GROUP"&&(console.log(s.type,(u=s.groupProfile)==null?void 0:u.name,(d=s.groupProfile)==null?void 0:d.name.indexOf(r)),((f=s.groupProfile)==null?void 0:f.name.indexOf(r))>=0&&i.push(s)),s.type==="C2C"&&(console.log(s.type,(g=s.userProfile)==null?void 0:g.nick,(v=s.userProfile)==null?void 0:v.nick.indexOf(r)),((_=s.userProfile)==null?void 0:_.nick.indexOf(r))>=0&&i.push(s))}),o.conversationList=i.filter(s=>s.type!==this.TUICore.TIM.TYPES.CONV_SYSTEM),this.store.allConversationList=o.allConversationList,this.store.conversationList=o.conversationList,o}async setMessageRead(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.setMessageRead({conversationID:n});r(i)}catch(i){o(i)}})}async deleteConversation(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.deleteConversation(n);r(i)}catch(i){o(i)}})}async pinConversation(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.pinConversation(n);r(i)}catch(i){o(i)}})}async muteConversation(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.setMessageRemindType(n);r(i)}catch(i){o(i)}})}async getConversationProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getConversationProfile(n);r(i)}catch(i){o(i)}})}async getConversationList(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getConversationList();this.handleFilterSystem(o.data.conversationList),n(o)}catch(o){r(o)}})}async getConversationListForName(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getConversationList();console.log(i,"getConversationListForName"),this.handleFilterName(i.data.conversationList,n),r(i)}catch(i){o(i)}})}async getUserProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getUserProfile({userIDList:n});r(i)}catch(i){o(i)}})}async bind(n,r){return this.currentStore=n,await this.getConversationList(),r&&r(),this.currentStore}handleCurrentConversation(n){if(this.TUICore.getStore().TUIChat.conversation=n||{},!(n!=null&&n.conversationID)){this.currentStore.currentConversationID="";return}this.currentStore.currentConversationID===(n==null?void 0:n.conversationID)&&(this.currentStore.currentConversationID=""),this.currentStore.currentConversationID&&this.setMessageRead(this.currentStore.currentConversationID),this.currentStore.currentConversationID=n==null?void 0:n.conversationID,this.setMessageRead(n.conversationID)}}const jne=ot({props:{conversation:{type:Object,default:()=>({})},handleConversation:{type:Object,default:()=>({})},currentID:{type:String,default:()=>""},toggleID:{type:String,default:()=>""},isH5:{type:Boolean,default:()=>!1},displayOnlineStatus:{type:Boolean,default:()=>!1},userStatusList:{type:Map,default:()=>new Map},types:{type:Object,default:()=>({})}},setup(e,t){const n=zt({conversation:{},currentID:"",currentConversation:{},toggle:!1,currentuserID:"",conversationType:"",loop:0,displayOnlineStatus:!1,userStatusList:new Map}),r=Ne(),o=Ne();Js(o,()=>{n.toggle===!0&&t.emit("toggle","")}),nn(()=>{n.conversation=e.conversation,n.currentID=e.currentID,n.toggle=!1,n.displayOnlineStatus=e.displayOnlineStatus,n.userStatusList=e.userStatusList,e.toggleID===e.conversation.conversationID&&(n.toggle=!0)}),$t(()=>n.toggle,f=>{f&&br(()=>{var M;const g=Ev(r),v=(M=o==null?void 0:o.value)==null?void 0:M.offsetParent,_=Ev(v);g.top.value-_.top.value-g.height.value-30>0&&(r.value.style.top="auto",r.value.style.bottom="30Px")})});const i=f=>{t.emit("open",f),t.emit("toggle","")},s=f=>{var g;(g=f==null?void 0:f.target)!=null&&g.oncontextmenu&&(f.target.oncontextmenu=function(){return!1}),t.emit("toggle",n.conversation.conversationID)},u=f=>{t.emit("handle",{name:f,conversation:n.conversation}),t.emit("toggle","")},d=()=>{var f;return!!(n.displayOnlineStatus&&((f=n.conversation)==null?void 0:f.type)===e.types.CONV_C2C)};return{...Jt(n),handleListItem:i,handleItem:u,dialog:r,content:o,toggleDialog:s,showUserOnlineStatus:d}}}),M5=""+new URL("mute-81a6d6d5.svg",import.meta.url).href;const Wne=e=>(Mr("data-v-ae130881"),e=e(),Ir(),e),Kne=["id"],Yne={class:"left"},Jne=["src"],Xne={key:1,class:"num"},Zne={key:2,class:"num-notify"},Qne={class:"content"},ere={class:"content-header"},tre={class:"name"},nre={class:"middle-box"},rre={key:0,class:"middle-box-at"},ore={class:"content-footer"},ire={class:"time"},sre={key:0,class:"mute-icon",src:M5},are=Wne(()=>B("i",null,null,-1)),lre={key:0,class:"dialog dialog-item",ref:"dialog"};function ure(e,t,n,r,o,i){var u,d,f,g,v,_,M,C,D;const s=wU("TUILongPress");return X(),ae("li",{ref:"content",class:st(["TUI-conversation-content",[e.currentID===e.conversation.conversationID&&"selected",e.conversation.isPinned&&"pinned",e.isH5?"list-item-h5":""]]),id:e.conversation.conversationID},[$n((X(),ae("div",{class:"TUI-conversation-item",onClick:t[0]||(t[0]=bn(w=>e.handleListItem(e.conversation),["prevent","stop"])),onContextmenu:t[1]||(t[1]=bn((...w)=>e.toggleDialog&&e.toggleDialog(...w),["prevent","right"]))},[B("aside",Yne,[B("img",{class:"avatar",src:(u=e.handleConversation)==null?void 0:u.avator(e.conversation)},null,8,Jne),e.showUserOnlineStatus()?(X(),ae("div",{key:0,class:st(["online-status",((v=(g=e.userStatusList)==null?void 0:g.get((f=(d=e.conversation)==null?void 0:d.userProfile)==null?void 0:f.userID))==null?void 0:v.statusType)===1?"online-status-online":"online-status-offline"])},null,2)):Ce("",!0),e.conversation.unreadCount>0&&e.conversation.messageRemindType!=="AcceptNotNotify"?(X(),ae("span",Xne,Ee(e.conversation.unreadCount>99?"99+":e.conversation.unreadCount),1)):Ce("",!0),e.conversation.unreadCount>0&&e.conversation.messageRemindType==="AcceptNotNotify"?(X(),ae("span",Zne)):Ce("",!0)]),B("div",Qne,[B("div",ere,[B("label",null,[B("p",tre,Ee((_=e.handleConversation)==null?void 0:_.name(e.conversation)),1)]),B("div",nre,[e.conversation.type==="GROUP"&&e.conversation.groupAtInfoList.length>0?(X(),ae("span",rre,Ee((M=e.handleConversation)==null?void 0:M.showAt(e.conversation)),1)):Ce("",!0),B("p",null,Ee((C=e.handleConversation)==null?void 0:C.showMessage(e.conversation)),1)])]),B("div",ore,[B("span",ire,Ee((D=e.handleConversation)==null?void 0:D.time(e.conversation.lastMessage.lastTime)),1),e.conversation.messageRemindType==="AcceptNotNotify"?(X(),ae("img",sre)):Ce("",!0),are])])],32)),[[s,e.toggleDialog,void 0,{self:!0}]]),e.toggle?(X(),ae("div",lre,[B("p",{class:"conversation-options",onClick:t[2]||(t[2]=bn(w=>e.handleItem("delete"),["stop"]))},Ee(e.$t("TUIConversation.删除会话")),1),e.conversation.isPinned?Ce("",!0):(X(),ae("p",{key:0,class:"conversation-options",onClick:t[3]||(t[3]=bn(w=>e.handleItem("ispinned"),["stop"]))},Ee(e.$t("TUIConversation.置顶会话")),1)),e.conversation.isPinned?(X(),ae("p",{key:1,class:"conversation-options",onClick:t[4]||(t[4]=bn(w=>e.handleItem("dispinned"),["stop"]))},Ee(e.$t("TUIConversation.取消置顶")),1)):Ce("",!0),e.conversation.messageRemindType===""||e.conversation.messageRemindType==="AcceptAndNotify"?(X(),ae("p",{key:2,class:"conversation-options",onClick:t[5]||(t[5]=bn(w=>e.handleItem("mute"),["stop"]))},Ee(e.$t("TUIConversation.消息免打扰")),1)):Ce("",!0),e.conversation.messageRemindType==="AcceptNotNotify"?(X(),ae("p",{key:3,class:"conversation-options",onClick:t[6]||(t[6]=bn(w=>e.handleItem("notMute"),["stop"]))},Ee(e.$t("TUIConversation.取消免打扰")),1)):Ce("",!0)],512)):Ce("",!0)],10,Kne)}const cre=jt(jne,[["render",ure],["__scopeId","data-v-ae130881"]]),iv=ot({props:{data:{type:Object,default:()=>({})},currentID:{type:String,default:()=>""},isH5:{type:Boolean,default:()=>!1},displayOnlineStatus:{type:Boolean,default:()=>!1},userStatusList:{type:Map,default:()=>new Map}},components:{LiteItem:cre},setup(e,t){const n=iv==null?void 0:iv.TUIServer,r=zt({data:{},currentID:"",toggleID:"",displayOnlineStatus:!1,userStatusList:new Map,types:n.TUICore.TIM.TYPES}),o=Ne();nn(()=>{r.data=e.data,r.currentID=e.currentID,r.displayOnlineStatus=e.displayOnlineStatus,r.userStatusList=e.userStatusList}),$t(()=>e.userStatusList,()=>{r.userStatusList=e.userStatusList},{deep:!0});const i=_=>{t.emit("handleItem",_)},s=_=>{const{name:M,conversation:C}=_;switch(M){case"delete":u(C);break;case"ispinned":d(M,C);break;case"dispinned":d(M,C);break;case"mute":f(M,C);break;case"notMute":f(M,C);break}},u=_=>{n.deleteConversation(_.conversationID).then(M=>{const{conversationID:C}=M.data,{conversation:D}=n.TUICore.getStore().TUIChat;D.conversationID===C&&(n.TUICore.getStore().TUIChat.conversation={conversationID:""})})},d=(_,M)=>{const C={conversationID:M.conversationID,isPinned:!0};_==="dispinned"&&(C.isPinned=!1),console.log("dispinned",C),n.pinConversation(C)},f=(_,M)=>{const C={messageRemindType:n.TUICore.TIM.TYPES.MSG_REMIND_ACPT_NOT_NOTE};M.type===n.TUICore.TIM.TYPES.CONV_C2C?C.userIDList=[M.userProfile.userID]:M.type===n.TUICore.TIM.TYPES.CONV_GROUP&&(C.groupID=M.groupProfile.groupID),_==="notMute"&&(C.messageRemindType=n.TUICore.TIM.TYPES.MSG_REMIND_ACPT_AND_NOTE),n.muteConversation(C)},g=_=>{r.toggleID=_},v=()=>{r.toggleID&&(r.toggleID="")};return{...Jt(r),handleListItem:i,handleItem:s,handleToggleListItem:g,list:o,scrollChange:v}}});function dre(e,t,n,r,o,i){const s=Yt("LiteItem");return X(),ae("ul",{class:st(["TUI-conversation-list",[e.isH5?"list-h5":""]]),ref:"list",onMousewheel:t[0]||(t[0]=(...u)=>e.scrollChange&&e.scrollChange(...u)),onScroll:t[1]||(t[1]=(...u)=>e.scrollChange&&e.scrollChange(...u))},[(X(!0),ae(dt,null,qt(e.data.list,(u,d)=>(X(),It(s,{isH5:e.isH5,key:d,currentID:e.currentID,conversation:u,toggleID:e.toggleID,handleConversation:{avator:e.data.handleItemAvator,name:e.data.handleItemName,showAt:e.data.handleShowAt,showMessage:e.data.handleShowMessage,time:e.data.handleItemTime,userID:e.data.handleItemUserID},displayOnlineStatus:e.displayOnlineStatus,userStatusList:e.userStatusList,onToggle:e.handleToggleListItem,onOpen:e.handleListItem,onHandle:e.handleItem,types:e.types},null,8,["isH5","currentID","conversation","toggleID","handleConversation","displayOnlineStatus","userStatusList","onToggle","onOpen","onHandle","types"]))),128))],34)}const Z2=jt(iv,[["render",dre],["__scopeId","data-v-b277067c"]]),sv=ot({name:"TUIConversation",components:{TUIConversationList:Z2},props:{displayOnlineStatus:{type:Boolean,default:!1}},setup(e,t){const n=sv==null?void 0:sv.TUIServer,r=zt({currentConversationID:"",keyword:"",loading:!1,conversationData:{list:[],handleItemAvator:g=>kC(g),handleItemName:g=>jh(g),handleShowAt:g=>DO(g),handleShowMessage:g=>M$(g),handleItemTime:g=>g>0?gg(g*1e3):""},userIDList:[],netWork:"",env:n.TUICore.TUIEnv,displayOnlineStatus:!1,userStatusList:new Map});try{r.loading=!0,n.bind(r,()=>{setTimeout(()=>{r.loading=!1},500)})}catch{r.loading=!1}Z2.TUIServer=n;const o=g=>{var v;window.parent&&((v=window.parent)==null||v.postMessage({api:"getNoReadMessageCount",count:g}))};On(()=>{window.addEventListener("message",g=>{var v;(v=g.data)!=null&&v.imUserId&&n.getConversationProfile(`C2C${g==null?void 0:g.data.imUserId}`).then(_=>{n.handleCurrentConversation(_.data.conversation)}).catch(_=>{console.log(_,"error")})}),n.TUICore.tim.on(n.TUICore.TIM.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,o)}),Bf(()=>{n.TUICore.tim.off(n.TUICore.TIM.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,o)}),$t(()=>r.currentConversationID,g=>{t.emit("current",g)},{deep:!0});const i=Ve(()=>{const g=r.netWork===n.TUICore.TIM.TYPES.NET_STATE_DISCONNECTED,v=r.netWork===n.TUICore.TIM.TYPES.NET_STATE_CONNECTING;return g||v}),s=g=>{n.handleCurrentConversation(g)},u=async g=>{r.loading=!0;try{r.conversationData.list=[],await n.getConversationListForName(g)}catch{}r.loading=!1},d=Vy(g=>{e.loading||u(g)},500),f=g=>{g.stopPropagation(),g.code==="Enter"&&d(r.keyword)};return{...Jt(r),handleCurrentConversation:s,isNetwork:i,noSearch:u,onKeyup:f,debouncedRequest:d}}});const o0=e=>(Mr("data-v-e0ac6afb"),e=e(),Ir(),e),fre={style:{height:"100%"}},pre={class:"sectionSearch"},hre=o0(()=>B("span",{class:"icon-search-input"},null,-1)),gre={class:"TUI-conversation"},mre={key:0,class:"network"},vre=o0(()=>B("i",{class:"icon icon-error"},"!",-1)),yre={class:"TUI-conversation-list"},_re={key:1,class:"theEmtpy",style:{height:"90%"}},bre=o0(()=>B("img",{class:"emptyImg",src:ud},null,-1)),Mre=o0(()=>B("p",null,"暂无数据",-1)),Ire=[bre,Mre];function Cre(e,t,n,r,o,i){const s=Yt("n-input"),u=Yt("TUIConversationList");return X(),ae("div",fre,[B("div",pre,[St(s,{class:"TheSearch",style:{"--n-font-size":"12px","--n-height":"32px","--n-caret-color":"#198cfe","--n-border-hover":"1px solid #198cfe","--n-border-focus":"1px solid #198cfe","--n-loading-color":"#198cfe","--n-box-shadow-focus":"0 0 0 2px rgba(25 140 254, 0.2)"},round:"",clearable:"",placeholder:"请输入名称",value:e.keyword,"onUpdate:value":t[0]||(t[0]=d=>e.keyword=d),onClear:t[1]||(t[1]=()=>{e.debouncedRequest("")}),onKeyup:e.onKeyup},{prefix:xt(()=>[hre]),_:1},8,["value","onKeyup"])]),B("div",gre,[e.isNetwork?(X(),ae("div",mre,[vre,B("p",null,"️"+Ee(e.$t("TUIConversation.网络异常,请您检查网络设置")),1)])):Ce("",!0),B("main",yre,[St(u,{currentID:e.currentConversationID,data:e.conversationData,onHandleItem:e.handleCurrentConversation,isH5:e.env.isH5,displayOnlineStatus:e.displayOnlineStatus,userStatusList:e.userStatusList},null,8,["currentID","data","onHandleItem","isH5","displayOnlineStatus","userStatusList"])]),!e.loading&&e.conversationData.list.length<=0?(X(),ae("div",_re,Ire)):Ce("",!0)])])}const aI=jt(sv,[["render",Cre],["__scopeId","data-v-e0ac6afb"]]),Tre=e=>{aI.TUIServer=Yl.server,e.component(Yl.name,aI)},wre=e=>(Yl.server=new b5(e),e.component(Yl.name,Yl),Yl),Yl={name:"TUIConversation",component:aI,server:b5,install:Tre,plugin:wre},Sre={profile:{}};class I5 extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIProfile",Sre,this.updateStore.bind(this)),this.getMyProfile()}destroyed(){this.unbindTIMEvent()}updateStore(n,r){this.currentStore.profile=JSON.parse(JSON.stringify(n.profile))}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.PROFILE_UPDATED,this.handleProfileUpdated,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.PROFILE_UPDATED,this.handleProfileUpdated)}handleProfileUpdated(n){n.data.map(r=>(r.userID===this.store.profile.userID&&(this.store.profile={},this.store.profile=r),r))}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUIProfile",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}async getMyProfile(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getMyProfile();this.store.profile=o.data,this.currentStore.profile=JSON.parse(JSON.stringify(this.store.profile)),n(o)}catch(o){r(o)}})}async getUserProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getUserProfile({userIDList:n});r(i)}catch(i){o(i)}})}async updateMyProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.updateMyProfile(n);this.store.profile=i.data,r(i)}catch(i){o(i)}})}async bind(n){return this.currentStore=n,this.getMyProfile(),this.currentStore}setEdit(n){return this.currentStore.isEdit=n,this.currentStore.isEdit}}function Ds(e){"@babel/helpers - typeof";return Ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ds(e)}function on(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Xt(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function an(e){Xt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Ds(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function zc(e,t){Xt(2,arguments);var n=an(e),r=on(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function cl(e,t){Xt(2,arguments);var n=an(e),r=on(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var s=i.getDate();return o>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function C5(e,t){if(Xt(2,arguments),!t||Ds(t)!=="object")return new Date(NaN);var n=t.years?on(t.years):0,r=t.months?on(t.months):0,o=t.weeks?on(t.weeks):0,i=t.days?on(t.days):0,s=t.hours?on(t.hours):0,u=t.minutes?on(t.minutes):0,d=t.seconds?on(t.seconds):0,f=an(e),g=r||n?cl(f,r+n*12):f,v=i||o?zc(g,i+o*7):g,_=u+s*60,M=d+_*60,C=M*1e3,D=new Date(v.getTime()+C);return D}function kre(e,t){Xt(2,arguments);var n=an(e).getTime(),r=on(t);return new Date(n+r)}var Dre={};function Au(){return Dre}function mT(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Au(),v=on((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:g.weekStartsOn)!==null&&r!==void 0?r:(d=g.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&n!==void 0?n:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=an(e),M=_.getDay(),C=(M=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Are(e){Xt(1,arguments);var t=Ere(e),n=new Date(0);n.setFullYear(t,0,4),n.setHours(0,0,0,0);var r=Qv(n);return r}function ey(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function Q2(e){Xt(1,arguments);var t=an(e);return t.setHours(0,0,0,0),t}var Lre=864e5;function Ore(e,t){Xt(2,arguments);var n=Q2(e),r=Q2(t),o=n.getTime()-ey(n),i=r.getTime()-ey(r);return Math.round((o-i)/Lre)}function T5(e,t){Xt(2,arguments);var n=on(t);return cl(e,n*12)}var Rre=6e4,Nre=36e5,Pre=1e3;function w5(e){return Xt(1,arguments),e instanceof Date||Ds(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function yh(e){if(Xt(1,arguments),!w5(e)&&typeof e!="number")return!1;var t=an(e);return!isNaN(Number(t))}function xre(e,t){var n;Xt(1,arguments);var r=e||{},o=an(r.start),i=an(r.end),s=i.getTime();if(!(o.getTime()<=s))throw new RangeError("Invalid interval");var u=[],d=o;d.setHours(0,0,0,0);var f=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(f<1||isNaN(f))throw new RangeError("`options.step` must be a number greater than 1");for(;d.getTime()<=s;)u.push(an(d)),d.setDate(d.getDate()+f),d.setHours(0,0,0,0);return u}function Ure(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Au(),v=on((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:g.weekStartsOn)!==null&&r!==void 0?r:(d=g.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&n!==void 0?n:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=an(e),M=_.getDay(),C=(M=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function $re(e){Xt(1,arguments);var t=k5(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Pf(n);return r}var Bre=6048e5;function D5(e){Xt(1,arguments);var t=an(e),n=Pf(t).getTime()-$re(t).getTime();return Math.round(n/Bre)+1}function nd(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Au(),v=on((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:g.weekStartsOn)!==null&&r!==void 0?r:(d=g.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&n!==void 0?n:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=an(e),M=_.getUTCDay(),C=(M=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=new Date(0);C.setUTCFullYear(v+1,0,M),C.setUTCHours(0,0,0,0);var D=nd(C,t),w=new Date(0);w.setUTCFullYear(v,0,M),w.setUTCHours(0,0,0,0);var S=nd(w,t);return g.getTime()>=D.getTime()?v+1:g.getTime()>=S.getTime()?v:v-1}function Hre(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Au(),v=on((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:g.firstWeekContainsDate)!==null&&r!==void 0?r:(d=g.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&n!==void 0?n:1),_=vT(e,t),M=new Date(0);M.setUTCFullYear(_,0,v),M.setUTCHours(0,0,0,0);var C=nd(M,t);return C}var qre=6048e5;function E5(e,t){Xt(1,arguments);var n=an(e),r=nd(n,t).getTime()-Hre(n,t).getTime();return Math.round(r/qre)+1}function or(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return or(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):or(r+1,2)},d:function(t,n){return or(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return or(t.getUTCHours()%12||12,n.length)},H:function(t,n){return or(t.getUTCHours(),n.length)},m:function(t,n){return or(t.getUTCMinutes(),n.length)},s:function(t,n){return or(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return or(i,n.length)}};const Al=Vre;var Fd={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},zre={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Al.y(t,n)},Y:function(t,n,r,o){var i=vT(t,o),s=i>0?i:1-i;if(n==="YY"){var u=s%100;return or(u,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):or(s,n.length)},R:function(t,n){var r=k5(t);return or(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return or(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return or(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return or(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return Al.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return or(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=E5(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):or(i,n.length)},I:function(t,n,r){var o=D5(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):or(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Al.d(t,n)},D:function(t,n,r){var o=Gre(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):or(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return or(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return or(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return or(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=Fd.noon:o===0?i=Fd.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=Fd.evening:o>=12?i=Fd.afternoon:o>=4?i=Fd.morning:i=Fd.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Al.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Al.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):or(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):or(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Al.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Al.s(t,n)},S:function(t,n){return Al.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return tD(s);case"XXXX":case"XX":return ec(s);case"XXXXX":case"XXX":default:return ec(s,":")}},x:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"x":return tD(s);case"xxxx":case"xx":return ec(s);case"xxxxx":case"xxx":default:return ec(s,":")}},O:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+eD(s,":");case"OOOO":default:return"GMT"+ec(s,":")}},z:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+eD(s,":");case"zzzz":default:return"GMT"+ec(s,":")}},t:function(t,n,r,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return or(s,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,s=i.getTime();return or(s,n.length)}};function eD(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=t||"";return n+String(o)+s+or(i,2)}function tD(e,t){if(e%60===0){var n=e>0?"-":"+";return n+or(Math.abs(e)/60,2)}return ec(e,t)}function ec(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=or(Math.floor(o/60),2),s=or(o%60,2);return r+i+n+s}const jre=zre;var nD=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},A5=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Wre=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return nD(t,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",nD(o,n)).replace("{{time}}",A5(i,n))},Kre={p:A5,P:Wre};const lI=Kre;var Yre=["D","DD"],Jre=["YY","YYYY"];function L5(e){return Yre.indexOf(e)!==-1}function O5(e){return Jre.indexOf(e)!==-1}function ty(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Xre={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Zre=function(t,n,r){var o,i=Xre[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const Qre=Zre;function lb(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var eoe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},toe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},noe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},roe={date:lb({formats:eoe,defaultWidth:"full"}),time:lb({formats:toe,defaultWidth:"full"}),dateTime:lb({formats:noe,defaultWidth:"full"})};const ooe=roe;var ioe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},soe=function(t,n,r,o){return ioe[t]};const aoe=soe;function Gp(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var u=e.defaultWidth,d=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[d]||e.values[u]}var f=e.argumentCallback?e.argumentCallback(t):t;return o[f]}}var loe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uoe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},coe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},doe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},foe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},poe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hoe=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},goe={ordinalNumber:hoe,era:Gp({values:loe,defaultWidth:"wide"}),quarter:Gp({values:uoe,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Gp({values:coe,defaultWidth:"wide"}),day:Gp({values:doe,defaultWidth:"wide"}),dayPeriod:Gp({values:foe,defaultWidth:"wide",formattingValues:poe,defaultFormattingWidth:"wide"})};const moe=goe;function $p(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?yoe(u,function(v){return v.test(s)}):voe(u,function(v){return v.test(s)}),f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;var g=t.slice(s.length);return{value:f,rest:g}}}function voe(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function yoe(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var u=t.slice(o.length);return{value:s,rest:u}}}var boe=/^(\d+)(th|st|nd|rd)?/i,Moe=/\d+/i,Ioe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Coe={any:[/^b/i,/^(a|c)/i]},Toe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},woe={any:[/1/i,/2/i,/3/i,/4/i]},Soe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},koe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Doe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Eoe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Aoe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Loe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ooe={ordinalNumber:_oe({matchPattern:boe,parsePattern:Moe,valueCallback:function(t){return parseInt(t,10)}}),era:$p({matchPatterns:Ioe,defaultMatchWidth:"wide",parsePatterns:Coe,defaultParseWidth:"any"}),quarter:$p({matchPatterns:Toe,defaultMatchWidth:"wide",parsePatterns:woe,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$p({matchPatterns:Soe,defaultMatchWidth:"wide",parsePatterns:koe,defaultParseWidth:"any"}),day:$p({matchPatterns:Doe,defaultMatchWidth:"wide",parsePatterns:Eoe,defaultParseWidth:"any"}),dayPeriod:$p({matchPatterns:Aoe,defaultMatchWidth:"any",parsePatterns:Loe,defaultParseWidth:"any"})};const Roe=Ooe;var Noe={code:"en-US",formatDistance:Qre,formatLong:ooe,formatRelative:aoe,localize:moe,match:Roe,options:{weekStartsOn:0,firstWeekContainsDate:1}};const yT=Noe;var Poe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xoe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Uoe=/^'([^]*?)'?$/,Foe=/''/g,Goe=/[a-zA-Z]/;function rD(e,t,n){var r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,N,A,L;Xt(2,arguments);var j=String(t),V=Au(),x=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:V.locale)!==null&&r!==void 0?r:yT,$=on((i=(s=(u=(d=n==null?void 0:n.firstWeekContainsDate)!==null&&d!==void 0?d:n==null||(f=n.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&u!==void 0?u:V.firstWeekContainsDate)!==null&&s!==void 0?s:(v=V.locale)===null||v===void 0||(_=v.options)===null||_===void 0?void 0:_.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var z=on((M=(C=(D=(w=n==null?void 0:n.weekStartsOn)!==null&&w!==void 0?w:n==null||(S=n.locale)===null||S===void 0||(N=S.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&D!==void 0?D:V.weekStartsOn)!==null&&C!==void 0?C:(A=V.locale)===null||A===void 0||(L=A.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&M!==void 0?M:0);if(!(z>=0&&z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var G=an(e);if(!yh(G))throw new RangeError("Invalid time value");var O=ey(G),T=S5(G,O),P={firstWeekContainsDate:$,weekStartsOn:z,locale:x,_originalDate:G},Z=j.match(xoe).map(function(K){var oe=K[0];if(oe==="p"||oe==="P"){var J=lI[oe];return J(K,x.formatLong)}return K}).join("").match(Poe).map(function(K){if(K==="''")return"'";var oe=K[0];if(oe==="'")return $oe(K);var J=jre[oe];if(J)return!(n!=null&&n.useAdditionalWeekYearTokens)&&O5(K)&&ty(K,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&L5(K)&&ty(K,t,String(e)),J(T,K,x.localize,P);if(oe.match(Goe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+oe+"`");return K}).join("");return Z}function $oe(e){var t=e.match(Uoe);return t?t[1].replace(Foe,"'"):e}function Boe(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Hoe(e){Xt(1,arguments);var t=an(e),n=t.getDay();return n}function qoe(e){Xt(1,arguments);var t=an(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Fs(e){Xt(1,arguments);var t=an(e),n=t.getHours();return n}var Voe=6048e5;function zoe(e){Xt(1,arguments);var t=an(e),n=Qv(t).getTime()-Are(t).getTime();return Math.round(n/Voe)+1}function Gs(e){Xt(1,arguments);var t=an(e),n=t.getMinutes();return n}function Jr(e){Xt(1,arguments);var t=an(e),n=t.getMonth();return n}function Jl(e){Xt(1,arguments);var t=an(e),n=t.getSeconds();return n}function qr(e){return Xt(1,arguments),an(e).getFullYear()}function R5(e,t){Xt(2,arguments);var n=an(e),r=an(t);return n.getTime()>r.getTime()}function N5(e,t){Xt(2,arguments);var n=an(e),r=an(t);return n.getTime()e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,u;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return i=f.done,f},e:function(f){s=!0,u=f},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw u}}}}function Ot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uI(e,t){return uI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},uI(e,t)}function Kn(e,t){if(typeof t!="function"&&t!==null)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&&uI(e,t)}function ny(e){return ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ny(e)}function Koe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yoe(e,t){if(t&&(Ds(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ot(e)}function Yn(e){var t=Koe();return function(){var r=ny(e),o;if(t){var i=ny(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Yoe(this,o)}}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Joe(e,t){if(Ds(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ds(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function P5(e){var t=Joe(e,"string");return Ds(t)==="symbol"?t:String(t)}function sD(e,t){for(var n=0;n0,r=n?t:1-t,o;if(r<=50)o=e||100;else{var i=r+50,s=Math.floor(i/100)*100,u=e>=i%100;o=e+s-(u?100:0)}return n?o:1-o}function G5(e){return e%400===0||e%4===0&&e%100!==0}var tie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s){var u=o.getUTCFullYear();if(s.isTwoDigitYear){var d=F5(s.year,u);return o.setUTCFullYear(d,0,1),o.setUTCHours(0,0,0,0),o}var f=!("era"in i)||i.era===1?s.year:1-s.year;return o.setUTCFullYear(f,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(er),nie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s,u){var d=vT(o,u);if(s.isTwoDigitYear){var f=F5(s.year,d);return o.setUTCFullYear(f,0,u.firstWeekContainsDate),o.setUTCHours(0,0,0,0),nd(o,u)}var g=!("era"in i)||i.era===1?s.year:1-s.year;return o.setUTCFullYear(g,0,u.firstWeekContainsDate),o.setUTCHours(0,0,0,0),nd(o,u)}}]),n}(er),rie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=4}},{key:"set",value:function(o,i,s){return o.setUTCMonth((s-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(er),sie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=4}},{key:"set",value:function(o,i,s){return o.setUTCMonth((s-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(er),aie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(er),lie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(er);function uie(e,t,n){Xt(2,arguments);var r=an(e),o=on(t),i=E5(r,n)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var cie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s,u){return nd(uie(o,s,u),u)}}]),n}(er);function die(e,t){Xt(2,arguments);var n=an(e),r=on(t),o=D5(n)-r;return n.setUTCDate(n.getUTCDate()-o*7),n}var fie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s){return Pf(die(o,s))}}]),n}(er),pie=[31,28,31,30,31,30,31,31,30,31,30,31],hie=[31,29,31,30,31,30,31,31,30,31,30,31],gie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=hie[d]:i>=1&&i<=pie[d]}},{key:"set",value:function(o,i,s){return o.setUTCDate(s),o.setUTCHours(0,0,0,0),o}}]),n}(er),mie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=366:i>=1&&i<=365}},{key:"set",value:function(o,i,s){return o.setUTCMonth(0,s),o.setUTCHours(0,0,0,0),o}}]),n}(er);function bT(e,t,n){var r,o,i,s,u,d,f,g;Xt(2,arguments);var v=Au(),_=on((r=(o=(i=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(u=n.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:v.weekStartsOn)!==null&&o!==void 0?o:(f=v.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&r!==void 0?r:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var M=an(e),C=on(t),D=M.getUTCDay(),w=C%7,S=(w+7)%7,N=(S<_?7:0)+C-D;return M.setUTCDate(M.getUTCDate()+N),M}var vie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,u){return o=bT(o,s,u),o.setUTCHours(0,0,0,0),o}}]),n}(er),yie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,u){return o=bT(o,s,u),o.setUTCHours(0,0,0,0),o}}]),n}(er),_ie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,u){return o=bT(o,s,u),o.setUTCHours(0,0,0,0),o}}]),n}(er);function bie(e,t){Xt(2,arguments);var n=on(t);n%7===0&&(n=n-7);var r=1,o=an(e),i=o.getUTCDay(),s=n%7,u=(s+7)%7,d=(u=1&&i<=7}},{key:"set",value:function(o,i,s){return o=bie(o,s),o.setUTCHours(0,0,0,0),o}}]),n}(er),Iie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=12}},{key:"set",value:function(o,i,s){var u=o.getUTCHours()>=12;return u&&s<12?o.setUTCHours(s+12,0,0,0):!u&&s===12?o.setUTCHours(0,0,0,0):o.setUTCHours(s,0,0,0),o}}]),n}(er),Sie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=23}},{key:"set",value:function(o,i,s){return o.setUTCHours(s,0,0,0),o}}]),n}(er),kie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){var u=o.getUTCHours()>=12;return u&&s<12?o.setUTCHours(s+12,0,0,0):o.setUTCHours(s,0,0,0),o}}]),n}(er),Die=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=24}},{key:"set",value:function(o,i,s){var u=s<=24?s%24:s;return o.setUTCHours(u,0,0,0),o}}]),n}(er),Eie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCMinutes(s,0,0),o}}]),n}(er),Aie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCSeconds(s,0),o}}]),n}(er),Lie=function(e){Kn(n,e);var t=Yn(n);function n(){var r;Rn(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&G<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=on((C=(D=(w=(S=r==null?void 0:r.weekStartsOn)!==null&&S!==void 0?S:r==null||(N=r.locale)===null||N===void 0||(A=N.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&w!==void 0?w:$.weekStartsOn)!==null&&D!==void 0?D:(L=$.locale)===null||L===void 0||(j=L.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&C!==void 0?C:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(x==="")return V===""?an(n):new Date(NaN);var T={firstWeekContainsDate:G,weekStartsOn:O,locale:z},P=[new Qoe],Z=x.match(Fie).map(function(Q){var ve=Q[0];if(ve in lI){var Le=lI[ve];return Le(Q,z.formatLong)}return Q}).join("").match(Uie),K=[],oe=iD(Z),J;try{var ie=function(){var ve=J.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&O5(ve)&&ty(ve,x,e),!(r!=null&&r.useAdditionalDayOfYearTokens)&&L5(ve)&&ty(ve,x,e);var Le=ve[0],me=xie[Le];if(me){var W=me.incompatibleTokens;if(Array.isArray(W)){var te=K.find(function(Te){return W.includes(Te.token)||Te.token===Le});if(te)throw new RangeError("The format string mustn't contain `".concat(te.fullToken,"` and `").concat(ve,"` at the same time"))}else if(me.incompatibleTokens==="*"&&K.length>0)throw new RangeError("The format string mustn't contain `".concat(ve,"` and any other token at the same time"));K.push({token:Le,fullToken:ve});var se=me.run(V,ve,z.match,T);if(!se)return{v:new Date(NaN)};P.push(se.setter),V=se.rest}else{if(Le.match(Hie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Le+"`");if(ve==="''"?ve="'":Le==="'"&&(ve=Vie(ve)),V.indexOf(ve)===0)V=V.slice(ve.length);else return{v:new Date(NaN)}}};for(oe.s();!(J=oe.n()).done;){var pe=ie();if(Ds(pe)==="object")return pe.v}}catch(Q){oe.e(Q)}finally{oe.f()}if(V.length>0&&Bie.test(V))return new Date(NaN);var ue=P.map(function(Q){return Q.priority}).sort(function(Q,ve){return ve-Q}).filter(function(Q,ve,Le){return Le.indexOf(Q)===ve}).map(function(Q){return P.filter(function(ve){return ve.priority===Q}).sort(function(ve,Le){return Le.subPriority-ve.subPriority})}).map(function(Q){return Q[0]}),de=an(n);if(isNaN(de.getTime()))return new Date(NaN);var Y=S5(de,ey(de)),re={},fe=iD(ue),Ae;try{for(fe.s();!(Ae=fe.n()).done;){var ye=Ae.value;if(!ye.validate(Y,T))return new Date(NaN);var le=ye.set(Y,re,T);Array.isArray(le)?(Y=le[0],Boe(re,le[1])):Y=le}}catch(Q){fe.e(Q)}finally{fe.f()}return Y}function Vie(e){return e.match(Gie)[1].replace($ie,"'")}function zie(e,t){Xt(2,arguments);var n=on(t);return zc(e,-n)}function _h(e,t){Xt(2,arguments);var n=an(e),r=on(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var u=qoe(s);return n.setMonth(r,Math.min(i,u)),n}function Ts(e,t){if(Xt(2,arguments),Ds(t)!=="object"||t===null)throw new RangeError("values parameter must be an object");var n=an(e);return isNaN(n.getTime())?new Date(NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=_h(n,t.month)),t.date!=null&&n.setDate(on(t.date)),t.hours!=null&&n.setHours(on(t.hours)),t.minutes!=null&&n.setMinutes(on(t.minutes)),t.seconds!=null&&n.setSeconds(on(t.seconds)),t.milliseconds!=null&&n.setMilliseconds(on(t.milliseconds)),n)}function $5(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setHours(r),n}function MT(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setMilliseconds(r),n}function B5(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setMinutes(r),n}function H5(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setSeconds(r),n}function hf(e,t){Xt(2,arguments);var n=an(e),r=on(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function tg(e,t){Xt(2,arguments);var n=on(t);return cl(e,-n)}function jie(e,t){if(Xt(2,arguments),!t||Ds(t)!=="object")return new Date(NaN);var n=t.years?on(t.years):0,r=t.months?on(t.months):0,o=t.weeks?on(t.weeks):0,i=t.days?on(t.days):0,s=t.hours?on(t.hours):0,u=t.minutes?on(t.minutes):0,d=t.seconds?on(t.seconds):0,f=tg(e,r+n*12),g=zie(f,i+o*7),v=u+s*60,_=d+v*60,M=_*1e3,C=new Date(g.getTime()-M);return C}function Wie(e,t){Xt(2,arguments);var n=on(t);return T5(e,-n)}var Kie=Object.defineProperty,Yie=Object.defineProperties,Jie=Object.getOwnPropertyDescriptors,aD=Object.getOwnPropertySymbols,Xie=Object.prototype.hasOwnProperty,Zie=Object.prototype.propertyIsEnumerable,lD=(e,t,n)=>t in e?Kie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dn=(e,t)=>{for(var n in t||(t={}))Xie.call(t,n)&&lD(e,n,t[n]);if(aD)for(var n of aD(t))Zie.call(t,n)&&lD(e,n,t[n]);return e},ss=(e,t)=>Yie(e,Jie(t)),dd=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n};const Qie={},ese={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},tse=B("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"},null,-1),nse=B("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"},null,-1),rse=B("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"},null,-1),ose=B("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"},null,-1),ise=[tse,nse,rse,ose];function sse(e,t){return X(),ae("svg",ese,ise)}var i0=dd(Qie,[["render",sse]]);const ase={},lse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},use=B("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"},null,-1),cse=B("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"},null,-1),dse=[use,cse];function fse(e,t){return X(),ae("svg",lse,dse)}var pse=dd(ase,[["render",fse]]);const hse={},gse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},mse=B("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"},null,-1),vse=[mse];function yse(e,t){return X(),ae("svg",gse,vse)}var uD=dd(hse,[["render",yse]]);const _se={},bse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},Mse=B("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"},null,-1),Ise=[Mse];function Cse(e,t){return X(),ae("svg",bse,Ise)}var cD=dd(_se,[["render",Cse]]);const Tse={},wse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},Sse=B("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"},null,-1),kse=B("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"},null,-1),Dse=[Sse,kse];function Ese(e,t){return X(),ae("svg",wse,Dse)}var q5=dd(Tse,[["render",Ese]]);const Ase={},Lse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},Ose=B("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"},null,-1),Rse=[Ose];function Nse(e,t){return X(),ae("svg",Lse,Rse)}var V5=dd(Ase,[["render",Nse]]);const Pse={},xse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},Use=B("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"},null,-1),Fse=[Use];function Gse(e,t){return X(),ae("svg",xse,Fse)}var z5=dd(Pse,[["render",Gse]]);const ub=(e,t)=>{const n=qie(e,t.slice(0,e.length),new Date);return yh(n)&&w5(n)?n:null},Ea=e=>{let t=new Date(JSON.parse(JSON.stringify(e)));return t=$5(t,0),t=B5(t,0),t=H5(t,0),t=MT(t,0),t},cI=e=>Array.isArray(e)?yh(e[0])&&(e[1]?yh(e[1]):!0):e?yh(e):!1,Bi=(e,t,n,r)=>{let o=e?new Date(e):new Date;return(t||t===0)&&(o=$5(o,+t)),(n||n===0)&&(o=B5(o,+n)),(r||r===0)&&(o=H5(o,+r)),MT(o,0)},$se=e=>{const t=cl(e,1);return{month:Jr(t),year:qr(t)}},jc=(e,t,n)=>{let r=e?new Date(e):new Date;return(t||t===0)&&(r=_h(r,t)),n&&(r=hf(r,n)),r},dD=(e,t)=>e?`HH:mm${t?":ss":""}`:`hh:mm${t?":ss":""} aa`,j5=(e,t,n,r,o,i,s,u)=>e||(r?"MM/yyyy":o?dD(t,n):i?"MM/dd/yyyy":s?"yyyy":u?`MM/dd/yyyy, ${dD(t,n)}`:"MM/dd/yyyy"),cb=e=>{const t=e||new Date;return{hours:Fs(t),minutes:Gs(t),seconds:Jl(t)}},av=e=>({month:Jr(e),year:qr(e)}),fD=e=>Array.isArray(e)?[av(e[0]),e[1]?av(e[1]):null]:av(e),dI=e=>Array.isArray(e)?[cb(e[0]),cb(e[1])]:cb(e),db=(e,t,n)=>n?rD(e,t,{locale:n}):rD(e,t),oy=(e,t,n,r)=>Array.isArray(e)?`${db(e[0],t,n)} ${r||"-"} ${e[1]?db(e[1],t,n):""}`:db(e,t,n),ns=(e,t)=>!e||!t?!1:R5(Ea(e),Ea(t)),li=(e,t)=>!e||!t?!1:N5(Ea(e),Ea(t)),Nr=(e,t)=>!e||!t?!1:joe(Ea(e),Ea(t)),Bse=(e,t)=>C5(Ts(new Date,e),t),Hse=(e,t)=>jie(Ts(new Date,e),t),fb=e=>Ts(new Date,{hours:Fs(e),minutes:Gs(e),seconds:Jl(e)}),pD=e=>Ts(new Date,{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}),fI=(e,t,n)=>{let r=!0;if(!e)return!0;const o=Array.isArray(e)?[e[0]?fb(e[0]):null,e[1]?fb(e[1]):null]:fb(e);if(t){const i=pD(t);Array.isArray(o)?r=(o[0]?o[0].getTime()<=i.getTime():!0)&&(o[1]?o[1].getTime()<=i.getTime():!0):r=o.getTime()<=i.getTime()}if(n){const i=pD(n);Array.isArray(o)?r=(o[0]?o[0].getTime()>=i.getTime():!0)&&(o[1]?o[1].getTime()>=i.getTime():!0)&&r:r=o.getTime()>=i.getTime()&&r}return r},qse=(e,t,n)=>{let r=!0;return t&&n&&(r=ns(new Date(e),new Date(t))&&li(new Date(e),new Date(n))),t&&(r=ns(new Date(e),new Date(t))),n&&(r=li(new Date(e),new Date(n))),r},_s=e=>{const t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(t).toISOString()},W5=(e,t,n)=>e&&e[0]&&e[1]?ns(n,e[0])&&li(n,e[1]):e&&e[0]&&t?ns(n,e[0])&&li(n,t)||li(n,e[0])&&ns(n,t):!1,Sm=(e,t)=>{const n=mT(e,{weekStartsOn:t}),r=Ure(e,{weekStartsOn:t});return[n,r]},Vse=(e,t,n,r,o,i,s,u)=>{const d=n?ns(_s(e),_s(new Date(n))):!1,f=t?li(_s(e),_s(new Date(t))):!1,g=typeof r=="function"?r(e):r.some(w=>Nr(_s(new Date(w)),_s(e))),v=(i.months.length?i.months.map(w=>+w):[]).includes(Jr(e)),_=s.length?s.some(w=>+w===Hoe(e)):!1,M=o.length?!o.some(w=>Nr(_s(new Date(w)),_s(e))):!1,C=qr(e),D=C<+u[0]||C>+u[1];return!(d||f||g||v||D||_||M)},K5=(e,t,n,r,o,i,s)=>({validate:u=>Vse(u,e,t,n,r,o,i,s)}),zse=(e,t,n)=>{const r=new Date(JSON.parse(JSON.stringify(e))),o=[];for(let i=0;i<7;i++){const s=zc(r,i),u=Jr(s)!==t;o.push({text:n&&u?"":s.getDate(),value:s,current:!u})}return o},jse=(e,t,n,r)=>{const o=[],i=new Date(t,e),s=new Date(t,e+1,0),u=mT(i,{weekStartsOn:n}),d=f=>{const g=zse(f,e,r);if(o.push({days:g}),!o[o.length-1].days.some(v=>Nr(Ea(v.value),Ea(s)))){const v=zc(f,7);d(v)}};return d(u),o},Wse=(e,t=3)=>{const n=[];for(let r=0;r{const n=[1,2,3,4,5,6,7].map(i=>new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${i}T00:00:00+00:00`)).slice(0,2)),r=n.slice(0,t),o=n.slice(t+1,n.length);return[n[t]].concat(...o).concat(...r)},Yse=e=>{const t=[];for(let n=+e[0];n<=+e[1];n++)t.push({value:+n,text:`${n}`});return t},Jse=(e,t)=>{const n=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC"});return[1,2,3,4,5,6,7,8,9,10,11,12].map(r=>{const o=r<10?`0${r}`:r;return new Date(`2017-${o}-01T00:00:00+00:00`)}).map((r,o)=>({text:n.format(r),value:o}))},Xse=e=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][e],Zse=()=>({enterSubmit:!0,tabSubmit:!0,openMenu:!0,rangeSeparator:" - "}),Qse=e=>Object.assign({months:[],years:[],times:{hours:[],minutes:[],seconds:[]}},e),eae=e=>{function t(n){let r="";const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=o.length;for(let s=0;s{var t;const n=Oe(e);return(t=n==null?void 0:n.$el)!=null?t:n},tae=e=>Object.assign({type:"dot"},e),hD=e=>Object.assign({menuAppear:"dp-menu-appear",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down"},e),nae=e=>Object.assign({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",calendarWrap:"Calendar wrapper",calendarDays:"Calendar days",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:t=>`Increment ${t}`,decrementValue:t=>`Decrement ${t}`,openTpOverlay:t=>`Open ${t} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month"},e),Lu=Symbol(),s0=Symbol(),IT=Symbol(),Y5=Symbol(),J5=Symbol(),Ou=Symbol(),CT={disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},autoApply:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},textInput:{type:Boolean,default:!1}},TT={range:{type:Boolean,default:!1},uid:{type:String,default:null}},X5={enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1}},Z5=ss(Dn({},X5),{fixedStart:{type:Boolean,default:!1},fixedEnd:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1}}),Q5={name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},inputClassName:{type:String,default:null},inlineWithInput:{type:Boolean,default:!1},textInputOptions:{type:Object,default:()=>null},openMenuOnFocus:{type:Boolean,default:!0}},eP={minTime:{type:Object,default:null},maxTime:{type:Object,default:null}},wT={minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null}},tP=Dn({selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:Boolean,default:!1}},eP),ST={monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1}},nP={locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:Boolean,default:!1},calendarClassName:{type:String,default:null},noSwipe:{type:Boolean,default:!1}},rP=ss(Dn(Dn(Dn(Dn(Dn(Dn({},Z5),tP),ST),wT),nP),TT),{vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},menuClassName:{type:String,default:null},yearRange:{type:Array,default:()=>[1900,2100]},multiCalendarsSolo:{type:Boolean,default:!1},calendarCellClassName:{type:String,default:null},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},monthYearComponent:{type:Object,default:null},timePickerComponent:{type:Object,default:null},actionRowComponent:{type:Object,default:null},hideOffsetDates:{type:Boolean,default:!1},autoRange:{type:[Number,String],default:null},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:()=>[]},showNowButton:{type:Boolean,default:!1},nowButtonLabel:{type:String,default:"Now"},monthChangeOnScroll:{type:[Boolean,String],default:!0},markers:{type:Array,default:()=>[]},modeHeight:{type:[Number,String],default:255},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetRanges:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},preventMinMaxNavigation:{type:Boolean,default:!1},minRange:{type:[Number,String],default:null},maxRange:{type:[Number,String],default:null},multiDatesLimit:{type:[Number,String],default:null},reverseYears:{type:Boolean,default:!1},keepActionRow:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},multiStatic:{type:Boolean,default:!0}}),rae=ss(Dn(Dn(Dn({},Q5),CT),rP),{multiCalendars:{type:[Boolean,Number,String],default:null},modelValue:{type:[String,Date,Array,Object,Number],default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},closeOnScroll:{type:Boolean,default:!1},autoPosition:{type:Boolean,default:!0},closeOnAutoApply:{type:Boolean,default:!0},teleport:{type:[String,Object],default:"body"},altPosition:{type:[Boolean,Function],default:!1},partialRange:{type:Boolean,default:!0},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:Boolean,default:!1},ariaLabels:{type:Object,default:()=>({})}}),oP={range:{type:Boolean,default:!1},multiCalendars:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null}},iP=ss(Dn(Dn({},ST),oP),{vertical:{type:Boolean,default:!1},month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:1}}),km=zt({menuFocused:!1,shiftKeyInMenu:!1}),kT=()=>({setMenuFocused:e=>{km.menuFocused=e},getStore:()=>km,setShiftKey:e=>{km.shiftKeyInMenu!==e&&(km.shiftKeyInMenu=e)}}),oae=["aria-label","aria-disabled","aria-readonly"],iae={key:1,class:"dp__input_wrap"},sae=["id","name","placeholder","disabled","readonly","required","value","autocomplete","onKeydown"],aae={key:4,class:"dp__clear_icon"},lae=ot({props:ss(Dn(Dn(Dn({},Q5),CT),TT),{inputValue:{type:String,default:""},inline:{type:Boolean,default:!1},isMenuOpen:{type:Boolean,default:!1},pattern:{type:String,default:""}}),emits:["clear","open","update:inputValue","setInputDate","close","selectDate","setEmptyDate","toggle","focus-prev"],setup(e,{expose:t,emit:n}){const r=e,o=Ne(),i=Ne(null),s=Ne(!1),u=tn(Lu),d=pg(),{getStore:f}=kT(),g=Ve(()=>({dp__pointer:!r.disabled&&!r.readonly&&!r.textInput,dp__disabled:r.disabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:r.state,dp__input_invalid:r.state===!1,dp__input_focus:s.value||r.isMenuOpen,[r.inputClassName]:!!r.inputClassName})),v=A=>{const{value:L}=A.target,{format:j,rangeSeparator:V}=r.textInputOptions;if(L!==""){if(r.range){const[x,$]=L.split(`${V}`);if(x&&$){const z=ub(x.trim(),j||r.pattern),G=ub($.trim(),j||r.pattern);o.value=z&&G?[z,G]:null}}else o.value=ub(L,j||r.pattern);n("setInputDate",o.value)}else n("setInputDate",null),r.autoApply&&(n("setEmptyDate"),o.value=null);n("update:inputValue",L)},_=()=>{var A,L;(A=r.textInputOptions)!=null&&A.enterSubmit&&cI(o.value)&&r.inputValue!==""?(n("setInputDate",o.value,!0),o.value=null):(L=r.textInputOptions)!=null&&L.enterSubmit&&r.inputValue===""&&(o.value=null,n("clear"))},M=()=>{var A,L;(A=r.textInputOptions)!=null&&A.tabSubmit&&cI(o.value)&&r.inputValue!==""?(n("setInputDate",o.value,!0),o.value=null):(L=r.textInputOptions)!=null&&L.tabSubmit&&r.inputValue===""&&(o.value=null,n("clear")),n("close")},C=()=>{var A;if(f().shiftKeyInMenu&&r.openMenuOnFocus)return n("close"),n("focus-prev");!r.inline&&(!r.textInput||r.textInput&&((A=r.textInputOptions)!=null&&A.openMenu))&&(s.value=!0,r.openMenuOnFocus&&!r.isMenuOpen?n("open"):r.isMenuOpen&&!f().menuFocused&&(N(),n("close")))},D=()=>{var A;!r.openMenuOnFocus||d["dp-input"]||d.trigger?r.textInput&&((A=r.textInputOptions)!=null&&A.openMenu)&&!r.isMenuOpen?n("open"):r.textInput||n("toggle"):r.textInput||s.value&&n("toggle")},w=()=>{s.value=!1,r.autoApply&&r.textInput&&o.value&&(n("setInputDate",o.value),n("selectDate"),o.value=null)},S=()=>{n("clear")},N=()=>{s.value=!1;const A=Ro(i);A&&A.blur()};return t({unFocus:N}),(A,L)=>(X(),ae("div",{onClick:D,"aria-label":Oe(u).input,role:"textbox","aria-multiline":"false","aria-disabled":A.disabled,"aria-readonly":A.readonly},[A.$slots.trigger&&!A.$slots["dp-input"]&&!e.inline?Ft(A.$slots,"trigger",{key:0}):Ce("",!0),!A.$slots.trigger&&(!e.inline||A.inlineWithInput)?(X(),ae("div",iae,[A.$slots["dp-input"]&&!A.$slots.trigger&&!e.inline?Ft(A.$slots,"dp-input",{key:0,value:e.inputValue,onInput:v,onEnter:_,onTab:M,onClear:S}):Ce("",!0),A.$slots["dp-input"]?Ce("",!0):(X(),ae("input",{key:1,ref_key:"inputRef",ref:i,id:A.uid?`dp-input-${A.uid}`:void 0,name:A.name,class:st(Oe(g)),placeholder:A.placeholder,disabled:A.disabled,readonly:A.readonly||!A.textInput,required:A.required,value:e.inputValue,autocomplete:A.autocomplete,onInput:v,onKeydown:[fr(_,["enter"]),fr(M,["tab"])],onBlur:w,onFocus:C},null,42,sae)),A.$slots["input-icon"]&&!A.hideInputIcon?(X(),ae("span",{key:2,class:"dp__input_icon",onClick:L[0]||(L[0]=j=>n("toggle"))},[Ft(A.$slots,"input-icon")])):Ce("",!0),!A.$slots["input-icon"]&&!A.hideInputIcon&&!A.$slots["dp-input"]?(X(),It(Oe(i0),{key:3,class:"dp__input_icon dp__input_icons",onClick:L[1]||(L[1]=j=>n("toggle"))})):Ce("",!0),A.$slots["clear-icon"]&&e.inputValue&&A.clearable&&!A.disabled&&!A.readonly?(X(),ae("span",aae,[Ft(A.$slots,"clear-icon",{clear:S})])):Ce("",!0),A.clearable&&!A.$slots["clear-icon"]&&e.inputValue&&!A.disabled&&!A.readonly?(X(),It(Oe(pse),{key:5,class:"dp__clear_icon dp__input_icons",onClick:bn(S,["stop","prevent"])},null,8,["onClick"])):Ce("",!0)])):Ce("",!0)],8,oae))}}),kr=zt({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),pb=Ne(null),Dm=Ne(!1),hb=Ne(!1),gb=Ne(!1),mb=Ne(!1),bi=Ne(0),Ho=Ne(0),Ru=()=>{const e=Ve(()=>Dm.value?[...kr.selectionGrid,kr.actionRow].filter(v=>v.length):hb.value?[...kr.timePicker[0],...kr.timePicker[1],mb.value?[]:[pb.value],kr.actionRow].filter(v=>v.length):gb.value?[...kr.monthPicker,kr.actionRow]:[kr.monthYear,...kr.calendar,kr.time,kr.actionRow].filter(v=>v.length)),t=v=>{bi.value=v?bi.value+1:bi.value-1;let _=null;e.value[Ho.value]&&(_=e.value[Ho.value][bi.value]),_||(bi.value=v?bi.value-1:bi.value+1)},n=v=>{Ho.value===0&&!v||Ho.value===e.value.length&&v||(Ho.value=v?Ho.value+1:Ho.value-1,e.value[Ho.value]?e.value[Ho.value]&&!e.value[Ho.value][bi.value]&&bi.value!==0&&(bi.value=e.value[Ho.value].length-1):Ho.value=v?Ho.value-1:Ho.value+1)},r=v=>{let _=null;e.value[Ho.value]&&(_=e.value[Ho.value][bi.value]),_?_.focus({preventScroll:!Dm.value}):bi.value=v?bi.value-1:bi.value+1},o=()=>{t(!0),r(!0)},i=()=>{t(!1),r(!1)},s=()=>{n(!1),r(!0)},u=()=>{n(!0),r(!0)},d=(v,_)=>{kr[_]=v},f=(v,_)=>{kr[_]=v},g=()=>{bi.value=0,Ho.value=0};return{buildMatrix:d,buildMultiLevelMatrix:f,setTimePickerBackRef:v=>{pb.value=v},setSelectionGrid:v=>{Dm.value=v,g(),v||(kr.selectionGrid=[])},setTimePicker:(v,_=!1)=>{hb.value=v,mb.value=_,g(),v||(kr.timePicker[0]=[],kr.timePicker[1]=[])},setTimePickerElements:(v,_=0)=>{kr.timePicker[_]=v},arrowRight:o,arrowLeft:i,arrowUp:s,arrowDown:u,clearArrowNav:()=>{kr.monthYear=[],kr.calendar=[],kr.time=[],kr.actionRow=[],kr.selectionGrid=[],kr.timePicker[0]=[],kr.timePicker[1]=[],Dm.value=!1,hb.value=!1,mb.value=!1,gb.value=!1,g(),pb.value=null},setMonthPicker:v=>{gb.value=v,g()}}},uae=["aria-label"],cae={class:"dp__calendar_header",role:"row"},dae={key:0,class:"dp__calendar_header_item",role:"gridcell"},fae=B("div",{class:"dp__calendar_header_separator"},null,-1),pae=["aria-label"],hae={key:0,role:"gridcell",class:"dp__calendar_item dp__week_num"},gae={class:"dp__cell_inner"},mae=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],vae=B("div",{class:"dp__arrow_bottom_tp"},null,-1),yae=ot({props:ss(Dn(Dn({},iP),nP),{mappedDates:{type:Array,default:()=>[]},getWeekNum:{type:Function,default:()=>""},modeHeight:{type:[Number,String],default:255},specificMode:{type:Boolean,default:!1}}),emits:["selectDate","setHoverDate","handleScroll","mount","handleSwipe"],setup(e,{expose:t,emit:n}){const r=e,o=Ne(null),i=Ne({bottom:"",left:"",transform:""}),s=Ne([]),u=Ne(null),d=Ne(!0),f=tn(s0),g=tn(Lu),v=tn(Ou),_=Ne(""),M=Ne({startX:0,endX:0,startY:0,endY:0}),C=Ve(()=>Kse(r.locale,+r.weekStart)),{buildMultiLevelMatrix:D}=Ru();On(()=>{n("mount",{cmp:"calendar",refs:s}),r.noSwipe||u.value&&(u.value.addEventListener("touchstart",$),u.value.addEventListener("touchend",z),u.value.addEventListener("touchmove",G))});const w=(P,Z)=>{if(f!=null&&f.value){const K=Ea(jc(new Date,r.month,r.year));_.value=ns(Ea(jc(new Date,P,Z)),K)?f.value[r.vertical?"vNext":"next"]:f.value[r.vertical?"vPrevious":"previous"],d.value=!1,br(()=>{d.value=!0})}},S=Ve(()=>({dp__calendar_wrap:!0,[r.calendarClassName]:!!r.calendarClassName})),N=Ve(()=>P=>{const Z=tae(P);return{dp__marker_dot:Z.type==="dot",dp__marker_line:Z.type==="line"}}),A=Ve(()=>P=>Nr(P,o.value)),L=Ve(()=>({dp__calendar:!0,dp__calendar_next:r.multiCalendars>0&&r.instance!==0})),j=Ve(()=>r.specificMode?{height:`${r.modeHeight}px`}:null),V=(P,Z,K)=>{var oe,J;if(n("setHoverDate",P),(J=(oe=P.marker)==null?void 0:oe.tooltip)!=null&&J.length){const ie=Ro(s.value[Z][K]);if(ie){const{width:pe,height:ue}=ie.getBoundingClientRect();i.value={bottom:`${ue}px`,left:`${pe/2}px`,transform:"translateX(-50%)"},o.value=P.value}}},x=()=>{o.value=null},$=P=>{M.value.startX=P.changedTouches[0].screenX,M.value.startY=P.changedTouches[0].screenY},z=P=>{M.value.endX=P.changedTouches[0].screenX,M.value.endY=P.changedTouches[0].screenY,O()},G=P=>{P.preventDefault()},O=()=>{const P=r.vertical?"Y":"X";Math.abs(M.value[`start${P}`]-M.value[`end${P}`])>10&&n("handleSwipe",M.value[`start${P}`]>M.value[`end${P}`]?"right":"left")},T=(P,Z,K)=>{P&&(Array.isArray(s.value[Z])?s.value[Z][K]=P:s.value[Z]=[P]),v!=null&&v.value&&D(s.value,"calendar")};return t({triggerTransition:w}),(P,Z)=>(X(),ae("div",{class:st(Oe(L))},[B("div",{style:Oo(Oe(j))},[e.specificMode?Ce("",!0):(X(),ae("div",{key:0,ref_key:"calendarWrapRef",ref:u,class:st(Oe(S)),role:"grid","aria-label":Oe(g).calendarWrap,onWheel:Z[1]||(Z[1]=bn(K=>P.$emit("handleScroll",K),["prevent"]))},[B("div",cae,[P.weekNumbers?(X(),ae("div",dae,Ee(P.weekNumName),1)):Ce("",!0),(X(!0),ae(dt,null,qt(Oe(C),(K,oe)=>(X(),ae("div",{class:"dp__calendar_header_item",role:"gridcell",key:oe},[P.$slots["calendar-header"]?Ft(P.$slots,"calendar-header",{key:0,day:K,index:oe}):Ce("",!0),P.$slots["calendar-header"]?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(K),1)],64))]))),128))]),fae,St(bo,{name:_.value,css:!!Oe(f)},{default:xt(()=>[d.value?(X(),ae("div",{key:0,class:"dp__calendar",role:"grid","aria-label":Oe(g).calendarDays},[(X(!0),ae(dt,null,qt(e.mappedDates,(K,oe)=>(X(),ae("div",{class:"dp__calendar_row",role:"row",key:oe},[P.weekNumbers?(X(),ae("div",hae,[B("div",gae,Ee(e.getWeekNum(K.days)),1)])):Ce("",!0),(X(!0),ae(dt,null,qt(K.days,(J,ie)=>(X(),ae("div",{role:"gridcell",class:"dp__calendar_item",ref_for:!0,ref:pe=>T(pe,oe,ie),key:ie+oe,"aria-selected":J.classData.dp__active_date||J.classData.dp__range_start||J.classData.dp__range_start,"aria-disabled":J.classData.dp__cell_disabled,tabindex:"0",onClick:bn(pe=>P.$emit("selectDate",J),["stop","prevent"]),onKeydown:fr(pe=>P.$emit("selectDate",J),["enter"]),onMouseover:pe=>V(J,oe,ie),onMouseleave:x},[B("div",{class:st(["dp__cell_inner",J.classData])},[P.$slots.day?Ft(P.$slots,"day",{key:0,day:+J.text,date:J.value}):Ce("",!0),P.$slots.day?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(J.text),1)],64)),J.marker?(X(),ae("div",{key:2,class:st(Oe(N)(J.marker)),style:Oo(J.marker.color?{backgroundColor:J.marker.color}:{})},null,6)):Ce("",!0),Oe(A)(J.value)?(X(),ae("div",{key:3,class:"dp__marker_tooltip",style:Oo(i.value)},[B("div",{class:"dp__tooltip_content",onClick:Z[0]||(Z[0]=bn(()=>{},["stop"]))},[(X(!0),ae(dt,null,qt(J.marker.tooltip,(pe,ue)=>(X(),ae("div",{key:ue,class:"dp__tooltip_text"},[P.$slots["marker-tooltip"]?Ft(P.$slots,"marker-tooltip",{key:0,tooltop:pe,day:J.value}):Ce("",!0),P.$slots["marker-tooltip"]?Ce("",!0):(X(),ae(dt,{key:1},[B("div",{class:"dp__tooltip_mark",style:Oo(pe.color?{backgroundColor:pe.color}:{})},null,4),B("div",null,Ee(pe.text),1)],64))]))),128)),vae])],4)):Ce("",!0)],2)],40,mae))),128))]))),128))],8,pae)):Ce("",!0)]),_:3},8,["name","css"])],42,uae))],4)],2))}}),_ae=e=>typeof e=="object",gD=(e,t)=>t,bae=e=>Array.isArray(e)&&e.length===2,Mae=e=>Array.isArray(e),Iae=e=>typeof e=="object",Zp=e=>Array.isArray(e),xs=e=>Array.isArray(e),lv=e=>Array.isArray(e)&&e.length===2,Cae=(e,t)=>t?Array.isArray(e):lv(e),Tae=e=>Array.isArray(e),wae=e=>typeof e=="string"||typeof e=="object",mD=e=>typeof e=="string",Sae={class:"dp__selection_preview"},kae={class:"dp__action_buttons"},Dae=["onKeydown"],Eae=ot({props:ss(Dn(Dn(Dn(Dn(Dn({},tP),wT),eP),ST),oP),{inline:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},menuMount:{type:Boolean,default:!1},enableTimePicker:{type:Boolean,default:!0}}),emits:["closePicker","selectDate"],setup(e,{emit:t}){const n=e,{buildMatrix:r}=Ru(),o=tn(J5),i=tn(Ou),s=Ne(null),u=Ne(null);On(()=>{i!=null&&i.value&&r([Ro(s),Ro(u)],"actionRow")});const d=Ve(()=>({dp__action:!0,dp__select:!0,dp__action_disabled:!f.value||!g.value})),f=Ve(()=>n.enableTimePicker?fI(n.internalModelValue,n.maxTime,n.minTime):!0),g=Ve(()=>n.monthPicker?qse(n.internalModelValue,n.minDate,n.maxDate):!0),v=C=>oy(C,n.previewFormat,o==null?void 0:o.value),_=Ve(()=>!n.internalModelValue||!n.menuMount?"":typeof n.previewFormat=="string"?Zp(n.internalModelValue)?n.internalModelValue.length===2&&n.internalModelValue[1]?n.multiCalendars>0?`${v(n.internalModelValue[0])} - ${v(n.internalModelValue[1])}`:[v(n.internalModelValue[0]),v(n.internalModelValue[1])]:n.multiDates?n.internalModelValue.map(C=>`${v(C)}`):`${v(n.internalModelValue[0])} -`:oy(n.internalModelValue,n.previewFormat,o==null?void 0:o.value):n.timePicker?n.previewFormat(dI(n.internalModelValue)):n.monthPicker?n.previewFormat(av(n.internalModelValue)):n.previewFormat(n.internalModelValue)),M=()=>{f.value&&g.value&&t("selectDate")};return(C,D)=>(X(),ae("div",{class:"dp__action_row",style:Oo(e.calendarWidth?{width:`${e.calendarWidth}px`}:{})},[B("div",Sae,[C.$slots["action-preview"]?Ft(C.$slots,"action-preview",{key:0,value:C.internalModelValue}):Ce("",!0),C.$slots["action-preview"]?Ce("",!0):(X(),ae(dt,{key:1},[Array.isArray(Oe(_))?Ce("",!0):(X(),ae(dt,{key:0},[jr(Ee(Oe(_)),1)],64)),Array.isArray(Oe(_))?(X(!0),ae(dt,{key:1},qt(Oe(_),(w,S)=>(X(),ae("div",{key:S},Ee(w),1))),128)):Ce("",!0)],64))]),B("div",kae,[C.$slots["action-select"]?Ft(C.$slots,"action-select",{key:0,value:C.internalModelValue}):Ce("",!0),C.$slots["action-select"]?Ce("",!0):(X(),ae(dt,{key:1},[e.inline?Ce("",!0):(X(),ae("span",{key:0,class:"dp__action dp__cancel",ref_key:"cancelButtonRef",ref:s,tabindex:"0",onClick:D[0]||(D[0]=w=>C.$emit("closePicker")),onKeydown:D[1]||(D[1]=fr(w=>C.$emit("closePicker"),["enter"]))},Ee(C.cancelText),545)),B("span",{class:st(Oe(d)),tabindex:"0",onKeydown:fr(M,["enter"]),onClick:M,ref_key:"selectButtonRef",ref:u},Ee(C.selectText),43,Dae)],64))])],4))}}),Aae={class:"dp__overlay_container",role:"grid"},Lae={class:"dp__selection_grid_header"},Oae=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],Rae=["aria-label","onKeydown"],bh=ot({props:{items:{type:Array,default:()=>[]},modelValue:{type:[String,Number],default:null},multiModelValue:{type:Array,default:()=>[]},disabledValues:{type:Array,default:()=>[]},minValue:{type:[Number,String],default:null},maxValue:{type:[Number,String],default:null},year:{type:Number,default:0},skipActive:{type:Boolean,default:!1},headerRefs:{type:Array,default:()=>[]},skipButtonRef:{type:Boolean,default:!1}},emits:["update:modelValue","selected","toggle","reset-flow"],setup(e,{expose:t,emit:n}){const r=e,o=Ne(!1),i=Ne(null),s=Ne(null),u=Ne([]),d=tn(IT,!1),f=tn(Y5,Ne(!1)),g=tn(Lu),v=tn(Ou),_=Ne(),M=Ne(),{setSelectionGrid:C,buildMultiLevelMatrix:D,setMonthPicker:w}=Ru();RL(()=>{i.value=null}),On(()=>{br().then(()=>$()),N(),S(!0)}),pl(()=>S(!1));const S=P=>{var Z;v!=null&&v.value&&((Z=r.headerRefs)!=null&&Z.length?w(P):C(P))},N=()=>{const P=Ro(s);P&&(f.value||P.focus({preventScroll:!0}),o.value=P.clientHeight({dp__overlay:!0})),L=Ve(()=>({dp__overlay_col:!0})),j=Ve(()=>r.items.map(P=>P.filter(Z=>Z).map(Z=>{var K,oe,J;const ie=r.disabledValues.some(ue=>ue===Z.value)||x(Z.value),pe=(K=r.multiModelValue)!=null&&K.length?(oe=r.multiModelValue)==null?void 0:oe.some(ue=>Nr(ue,hf(_h(new Date,Z.value),r.year))):r.skipActive?!1:Z.value===r.modelValue;return ss(Dn({},Z),{className:{dp__overlay_cell_active:pe,dp__overlay_cell:!pe,dp__overlay_cell_disabled:ie,dp__overlay_cell_active_disabled:ie&&pe,dp__overlay_cell_pad:!0,dp__cell_in_between:(J=r.multiModelValue)!=null&&J.length?G(Z.value):!1}})}))),V=Ve(()=>({dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:o.value,dp__button_bottom:d})),x=P=>{const Z=r.maxValue?+P>+r.maxValue:!1,K=r.minValue?+P<+r.minValue:!1;return Z||K},$=()=>{const P=Ro(i);if(P){const Z=Ro(s);Z&&(Z.scrollTop=P.offsetTop-Z.offsetTop-(Z.getBoundingClientRect().height/2-P.getBoundingClientRect().height))}},z=P=>{!r.disabledValues.some(Z=>Z===P)&&(!r.minValue||+r.minValue<=P)&&(!r.maxValue||+r.maxValue>=P)&&(n("update:modelValue",P),n("selected"))},G=P=>W5(r.multiModelValue,hf(_h(new Date,_.value||0),r.year),hf(_h(new Date,P),r.year)),O=()=>{n("toggle"),n("reset-flow")},T=(P,Z,K,oe)=>{var J,ie;if(P&&(Z.value===+r.modelValue&&!r.disabledValues.includes(Z.value)&&(i.value=P),v!=null&&v.value)){Array.isArray(u.value[K])?u.value[K][oe]=P:u.value[K]=[P];const pe=(J=r.headerRefs)!=null&&J.length?[r.headerRefs].concat(u.value):u.value.concat([r.skipButtonRef?[]:[M.value]]);D(pe,(ie=r.headerRefs)!=null&&ie.length?"monthPicker":"selectionGrid")}};return t({focusGrid:N}),(P,Z)=>(X(),ae("div",{ref_key:"gridWrapRef",ref:s,class:st(Oe(A)),role:"dialog",tabindex:"0"},[B("div",Aae,[B("div",Lae,[Ft(P.$slots,"header")]),(X(!0),ae(dt,null,qt(Oe(j),(K,oe)=>(X(),ae("div",{class:"dp__overlay_row",key:Oe(eae)(oe),role:"row"},[(X(!0),ae(dt,null,qt(K,(J,ie)=>(X(),ae("div",{role:"gridcell",class:st(Oe(L)),key:J.value,"aria-selected":J.value===e.modelValue&&!e.disabledValues.includes(J.value),"aria-disabled":J.className.dp__overlay_cell_disabled,ref_for:!0,ref:pe=>T(pe,J,oe,ie),tabindex:"0",onClick:pe=>z(J.value),onKeydown:fr(pe=>z(J.value),["enter"]),onMouseover:pe=>_.value=J.value},[B("div",{class:st(J.className)},[P.$slots.item?Ft(P.$slots,"item",{key:0,item:J}):Ce("",!0),P.$slots.item?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(J.text),1)],64))],2)],42,Oae))),128))]))),128)),P.$slots["button-icon"]?(X(),ae("div",{key:0,role:"button","aria-label":Oe(g).toggleOverlay,class:st(Oe(V)),tabindex:"0",ref_key:"toggleButton",ref:M,onClick:O,onKeydown:fr(O,["enter"])},[Ft(P.$slots,"button-icon")],42,Rae)):Ce("",!0)])],2))}}),a0=()=>{const e=tn(s0);return{transitionName:Ve(()=>t=>e!=null&&e.value?t?e.value.open:e.value.close:""),showTransition:!!(e!=null&&e.value)}},Nae={key:0,class:"dp__time_input"},Pae=jr(" : "),xae=["aria-label","onKeydown","onClick"],Uae=["aria-label","onKeydown","onClick"],Fae=["aria-label","onKeydown","onClick"],Gae={key:0},$ae=["aria-label","onKeydown"],Bae=ot({props:ss(Dn({},X5),{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},filters:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0}}),emits:["setHours","setMinutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed"],setup(e,{expose:t,emit:n}){const r=e,o=zt({hours:!1,minutes:!1,seconds:!1}),i=Ne("AM"),s=Ne(null),u=tn(Lu),d=tn(Ou),f=Ne([]),{transitionName:g,showTransition:v}=a0(),{setTimePickerElements:_,setTimePickerBackRef:M}=Ru();On(()=>{n("mounted")});const C=Ve(()=>({dp__time_col:!0,dp__time_col_reg:!r.enableSeconds&&r.is24,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),D=Ve(()=>{const O=[{type:"hours"},"separator",{type:"minutes"}];return r.enableSeconds?O.concat(["separator",{type:"seconds"}]):O}),w=Ve(()=>D.value.filter(O=>typeof O!="string")),S=Ve(()=>O=>{if(O==="hours"){const T=V(r.hours);return{text:T<10?`0${T}`:`${T}`,value:T}}return{text:r[O]<10?`0${r[O]}`:`${r[O]}`,value:r[O]}}),N=O=>{const T=O==="hours"?r.is24?24:12:60,P=+r[`${O}GridIncrement`],Z=[];for(let K=0;Kr[`no${O[0].toUpperCase()+O.slice(1)}Overlay`],L=O=>{A(O)||(o[O]=!o[O],o[O]||n("overlay-closed"))},j=(O,T=!0)=>{const P=O==="hours"?Fs:O==="minutes"?Gs:Jl,Z=T?Bse:Hse;n(`update:${O}`,P(Z({[O]:+r[O]},{[O]:+r[`${O}Increment`]})))},V=O=>r.is24?O:(O>=12?i.value="PM":i.value="AM",Xse(O)),x=()=>{i.value==="PM"?(i.value="AM",n("update:hours",r.hours-12)):(i.value="PM",n("update:hours",r.hours+12))},$=O=>{o[O]=!0},z=(O,T,P)=>{if(O&&(d!=null&&d.value)){Array.isArray(f.value[T])?f.value[T][P]=O:f.value[T]=[O];let Z=f.value.reduce((K,oe)=>oe.map((J,ie)=>[...K[ie]||[],oe[ie]]),[]);M(r.closeTimePickerBtn),s.value&&(Z[1]=Z[1].concat(s.value)),_(Z,r.order)}},G=(O,T)=>O==="hours"&&!r.is24?n(`update:${O}`,i.value==="PM"?T+12:T):n(`update:${O}`,T);return t({openChildCmp:$}),(O,T)=>e.disabled?Ce("",!0):(X(),ae("div",Nae,[(X(!0),ae(dt,null,qt(Oe(D),(P,Z)=>(X(),ae("div",{key:Z,class:st(Oe(C))},[P==="separator"?(X(),ae(dt,{key:0},[Pae],64)):(X(),ae(dt,{key:1},[B("div",{class:"dp__inc_dec_button",role:"button","aria-label":Oe(u).incrementValue(P.type),tabindex:"0",onKeydown:fr(K=>j(P.type),["enter"]),onClick:K=>j(P.type),ref_for:!0,ref:K=>z(K,Z,0)},[O.$slots["arrow-up"]?Ft(O.$slots,"arrow-up",{key:0}):Ce("",!0),O.$slots["arrow-up"]?Ce("",!0):(X(),It(Oe(V5),{key:1}))],40,xae),B("div",{role:"button","aria-label":Oe(u).openTpOverlay(P.type),class:st(A(P.type)?"":"dp__time_display"),tabindex:"0",onKeydown:fr(K=>L(P.type),["enter"]),onClick:K=>L(P.type),ref_for:!0,ref:K=>z(K,Z,1)},[O.$slots[P.type]?Ft(O.$slots,P.type,{key:0,text:Oe(S)(P.type).text,value:Oe(S)(P.type).value}):Ce("",!0),O.$slots[P.type]?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(Oe(S)(P.type).text),1)],64))],42,Uae),B("div",{class:"dp__inc_dec_button",role:"button","aria-label":Oe(u).decrementValue(P.type),tabindex:"0",onKeydown:fr(K=>j(P.type,!1),["enter"]),onClick:K=>j(P.type,!1),ref_for:!0,ref:K=>z(K,Z,2)},[O.$slots["arrow-down"]?Ft(O.$slots,"arrow-down",{key:0}):Ce("",!0),O.$slots["arrow-down"]?Ce("",!0):(X(),It(Oe(z5),{key:1}))],40,Fae)],64))],2))),128)),O.is24?Ce("",!0):(X(),ae("div",Gae,[O.$slots["am-pm-button"]?Ft(O.$slots,"am-pm-button",{key:0,toggle:x,value:i.value}):Ce("",!0),O.$slots["am-pm-button"]?Ce("",!0):(X(),ae("button",{key:1,ref_key:"amPmButton",ref:s,type:"button",class:"dp__pm_am_button",role:"button","aria-label":Oe(u).amPmButton,tabindex:"0",onClick:x,onKeydown:fr(bn(x,["prevent"]),["enter"])},Ee(i.value),41,$ae))])),(X(!0),ae(dt,null,qt(Oe(w),(P,Z)=>(X(),It(bo,{key:Z,name:Oe(g)(Oe(o)[P.type]),css:Oe(v)},{default:xt(()=>[Oe(o)[P.type]?(X(),It(bh,{key:0,items:N(P.type),"disabled-values":e.filters.times[P.type],"onUpdate:modelValue":K=>G(P.type,K),onSelected:K=>L(P.type),onToggle:K=>L(P.type),onResetFlow:T[0]||(T[0]=K=>O.$emit("reset-flow"))},zi({"button-icon":xt(()=>[O.$slots["clock-icon"]?Ft(O.$slots,"clock-icon",{key:0}):Ce("",!0),O.$slots["clock-icon"]?Ce("",!0):(X(),It(Oe(q5),{key:1}))]),_:2},[O.$slots[`${P.type}-overlay`]?{name:"item",fn:xt(({item:K})=>[Ft(O.$slots,`${P.type}-overlay`,{text:K.text,value:K.value})])}:void 0]),1032,["items","disabled-values","onUpdate:modelValue","onSelected","onToggle"])):Ce("",!0)]),_:2},1032,["name","css"]))),128))]))}}),Bp=[{name:"clock-icon",use:["time","calendar"]},{name:"arrow-left",use:["month-year","calendar"]},{name:"arrow-right",use:["month-year","calendar"]},{name:"arrow-up",use:["time","calendar"]},{name:"arrow-down",use:["time","calendar"]},{name:"calendar-icon",use:["month-year","time","calendar"]},{name:"day",use:["calendar"]},{name:"month-overlay",use:["calendar","month-year"]},{name:"year-overlay",use:["calendar","month-year"]},{name:"hours-overlay",use:["calendar","time"]},{name:"minutes-overlay",use:["calendar","time"]},{name:"seconds-overlay",use:["calendar","time"]},{name:"hours",use:["calendar","time"]},{name:"minutes",use:["calendar","time"]},{name:"month",use:["calendar","month-year"]},{name:"year",use:["calendar","month-year"]},{name:"action-select",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar"]},{name:"marker-tooltip",use:["calendar"]},{name:"now-button",use:[]},{name:"time-picker-overlay",use:["calendar","time"]},{name:"am-pm-button",use:["calendar","time"]}],Hae=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],qae={all:()=>Bp,monthYear:()=>Bp.filter(e=>e.use.includes("month-year")),input:()=>Hae,timePicker:()=>Bp.filter(e=>e.use.includes("time")),action:()=>Bp.filter(e=>e.use.includes("action")),calendar:()=>Bp.filter(e=>e.use.includes("calendar"))},_c=(e,t)=>{const n=[];return qae[t]().forEach(r=>{e[r.name]&&n.push(r.name)}),n},Vae=["aria-label"],zae={class:"dp__overlay_container"},jae={key:1,class:"dp__overlay_row"},Wae=["aria-label"],Kae=ot({props:ss(Dn({},Z5),{range:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},customProps:{type:Object,default:null}}),emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-closed"],setup(e,{expose:t,emit:n}){const r=e,o=pg(),i=Ne(null),s=Ne(null),u=tn(IT,!1),d=Ne([]),f=Ne(null),g=tn(Lu),v=tn(Ou),{transitionName:_,showTransition:M}=a0(),{buildMatrix:C,setTimePicker:D}=Ru();On(()=>{n("mount"),!r.timePicker&&(v!=null&&v.value)?C([Ro(i.value)],"time"):D(!0,r.timePicker)});const w=Ne(!1),S=O=>({hours:Array.isArray(r.hours)?r.hours[O]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[O]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[O]:r.seconds}),N=Ve(()=>{const O=[];if(r.range)for(let T=0;T<2;T++)O.push(S(T));else O.push(S(0));return O}),A=(O,T=!1,P="")=>{T||n("reset-flow"),w.value=O,v!=null&&v.value&&(D(O),O||n("overlay-closed")),br(()=>{P!==""&&d.value[0]&&d.value[0].openChildCmp(P)})},L=Ve(()=>({dp__button:!0,dp__button_bottom:u})),j=_c(o,"timePicker"),V=(O,T,P)=>r.range?T===0?[O,N.value[1][P]]:[N.value[0][P],O]:O,x=O=>{n("update:hours",O)},$=O=>{n("update:minutes",O)},z=O=>{n("update:seconds",O)},G=()=>{f.value&&(v!=null&&v.value)&&f.value.focus({preventScroll:!0})};return t({toggleTimePicker:A}),(O,T)=>(X(),ae("div",null,[O.timePicker?Ce("",!0):(X(),ae("div",{key:0,class:st(Oe(L)),role:"button","aria-label":Oe(g).openTimePicker,tabindex:"0",ref_key:"openTimePickerBtn",ref:i,onKeydown:T[0]||(T[0]=fr(P=>A(!0),["enter"])),onClick:T[1]||(T[1]=P=>A(!0))},[O.$slots["clock-icon"]?Ft(O.$slots,"clock-icon",{key:0}):Ce("",!0),O.$slots["clock-icon"]?Ce("",!0):(X(),It(Oe(q5),{key:1}))],42,Vae)),St(bo,{name:Oe(_)(w.value),css:Oe(M)},{default:xt(()=>[w.value||O.timePicker?(X(),ae("div",{key:0,class:"dp__overlay",ref_key:"overlayRef",ref:f,tabindex:"0"},[B("div",zae,[O.$slots["time-picker-overlay"]?Ft(O.$slots,"time-picker-overlay",{key:0,range:e.range,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:x,setMinutes:$,setSeconds:z}):Ce("",!0),O.$slots["time-picker-overlay"]?Ce("",!0):(X(),ae("div",jae,[(X(!0),ae(dt,null,qt(Oe(N),(P,Z)=>(X(),It(Bae,Eo({key:Z,disabled:Z===0?O.fixedStart:O.fixedEnd,hours:P.hours,minutes:P.minutes,seconds:P.seconds,filters:e.filters,ref_for:!0,ref_key:"timeInputRefs",ref:d},{is24:O.is24,hoursGridIncrement:O.hoursGridIncrement,minutesGridIncrement:O.minutesGridIncrement,secondsGridIncrement:O.secondsGridIncrement,hoursIncrement:O.hoursIncrement,minutesIncrement:O.minutesIncrement,secondsIncrement:O.secondsIncrement,filters:e.filters,noHoursOverlay:O.noHoursOverlay,noMinutesOverlay:O.noMinutesOverlay,noSecondsOverlay:O.noSecondsOverlay,enableSeconds:O.enableSeconds,closeTimePickerBtn:s.value,order:Z},{"onUpdate:hours":K=>x(V(K,Z,"hours")),"onUpdate:minutes":K=>$(V(K,Z,"minutes")),"onUpdate:seconds":K=>z(V(K,Z,"seconds")),onMounted:G,onOverlayClosed:G}),zi({_:2},[qt(Oe(j),(K,oe)=>({name:K,fn:xt(J=>[Ft(O.$slots,K,ql(Vl(J)))])}))]),1040,["disabled","hours","minutes","seconds","filters","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"]))),128))])),O.timePicker?Ce("",!0):(X(),ae("div",{key:2,ref_key:"closeTimePickerBtn",ref:s,class:st(Oe(L)),role:"button","aria-label":Oe(g).closeTimePicker,tabindex:"0",onKeydown:T[2]||(T[2]=fr(P=>A(!1),["enter"])),onClick:T[3]||(T[3]=P=>A(!1))},[O.$slots["calendar-icon"]?Ft(O.$slots,"calendar-icon",{key:0}):Ce("",!0),O.$slots["calendar-icon"]?Ce("",!0):(X(),It(Oe(i0),{key:1}))],42,Wae))])],512)):Ce("",!0)]),_:3},8,["name","css"])]))}}),Yae=["aria-label"],vb=ot({props:{ariaLabel:{type:String,default:""}},emits:["activate","setRef"],setup(e,{emit:t}){const n=Ne(null);return On(()=>t("setRef",n)),(r,o)=>(X(),ae("div",{class:"dp__month_year_col_nav",onClick:o[0]||(o[0]=i=>r.$emit("activate")),onKeydown:o[1]||(o[1]=fr(i=>r.$emit("activate"),["enter"])),tabindex:"0",ref_key:"elRef",ref:n},[B("div",{class:"dp__inner_nav",role:"button","aria-label":e.ariaLabel},[Ft(r.$slots,"default")],8,Yae)],544))}}),Jae=["aria-label"],vD=ot({props:{ariaLabel:{type:String,default:""},showSelectionGrid:{type:Boolean,default:!1},modelValue:{type:Number,default:null},items:{type:Array,default:()=>[]},disabledValues:{type:Array,default:()=>[]},minValue:{type:Number,default:null},maxValue:{type:Number,default:null},slotName:{type:String,default:""},headerRefs:{type:Array,default:()=>[]}},emits:["update:model-value","toggle","setRef"],setup(e,{emit:t}){const{transitionName:n,showTransition:r}=a0(),o=Ne(null);return On(()=>t("setRef",o)),(i,s)=>(X(),ae(dt,null,[B("div",{class:"dp__month_year_select",onClick:s[0]||(s[0]=u=>i.$emit("toggle")),onKeydown:s[1]||(s[1]=fr(u=>i.$emit("toggle"),["enter"])),role:"button","aria-label":e.ariaLabel,tabindex:"0",ref_key:"elRef",ref:o},[Ft(i.$slots,"default")],40,Jae),St(bo,{name:Oe(n)(e.showSelectionGrid),css:Oe(r)},{default:xt(()=>[e.showSelectionGrid?(X(),It(bh,Eo({key:0},{modelValue:e.modelValue,items:e.items,disabledValues:e.disabledValues,minValue:e.minValue,maxValue:e.maxValue},{"header-refs":[],"onUpdate:modelValue":s[2]||(s[2]=u=>i.$emit("update:model-value",u)),onToggle:s[3]||(s[3]=u=>i.$emit("toggle"))}),zi({"button-icon":xt(()=>[i.$slots["calendar-icon"]?Ft(i.$slots,"calendar-icon",{key:0}):Ce("",!0),i.$slots["calendar-icon"]?Ce("",!0):(X(),It(Oe(i0),{key:1}))]),_:2},[i.$slots[e.slotName]?{name:"item",fn:xt(({item:u})=>[Ft(i.$slots,e.slotName,{item:u})])}:void 0]),1040)):Ce("",!0)]),_:3},8,["name","css"])],64))}}),iy=(e,t,n)=>[Ts(new Date(e),{date:1}),Ts(new Date,{month:t,year:n,date:1})],yD=(e,t,n)=>li(...iy(e,t,n))||Nr(...iy(e,t,n)),_D=(e,t,n)=>ns(...iy(e,t,n))||Nr(...iy(e,t,n)),sP=(e,t,n,r,o,i)=>{let s=!1;return i?e&&t?(t&&o&&_D(t,n,r)&&(s=!0),e&&!o&&yD(e,n,r)&&(s=!0)):(e&&yD(e,n,r)||t&&_D(t,n,r))&&(s=!0):s=!0,s},Xae=(e,t)=>{const n=(s,u)=>{let d=s;return e.filters.months.includes(Jr(d))?(d=u?cl(s,1):tg(s,1),n(d,u)):d},r=(s,u)=>{let d=s;return e.filters.years.includes(qr(d))?(d=u?T5(s,1):Wie(s,1),r(d,u)):d},o=s=>{const u=Ts(new Date,{month:e.month,year:e.year});let d=s?cl(u,1):tg(u,1),f=Jr(d),g=qr(d);e.filters.months.includes(f)&&(d=n(d,s),f=Jr(d),g=qr(d)),e.filters.years.includes(g)&&(d=r(d,s),g=qr(d)),sP(e.minDate,e.maxDate,f,g,s,e.preventMinMaxNavigation)&&i(f,g)},i=(s,u)=>{t("update:month",s),t("update:year",u)};return{handleMonthYearChange:o}},Zae={class:"dp__month_year_row"},Qae={class:"dp__month_picker_header"},ele=["aria-label"],tle=["aria-label","onKeydown"],nle=["aria-label"],rle=ot({props:ss(Dn(Dn({},iP),wT),{preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},filters:{type:Object,default:()=>({})},multiCalendarsSolo:{type:Boolean,default:!1},yearPicker:{type:Boolean,default:!1}}),emits:["update:month","update:year","monthYearSelect","mount","reset-flow","overlay-closed"],setup(e,{expose:t,emit:n}){const r=e,{transitionName:o,showTransition:i}=a0(),{buildMatrix:s}=Ru(),u=Ne(!1),d=Ne(!1),f=Ne([null,null,null,null]),g=Ne(null),v=Ne(null),_=Ne(null),M=tn(Lu),C=tn(Ou),{handleMonthYearChange:D}=Xae(r,n);On(()=>{n("mount")});const w=ue=>({get:()=>r[ue],set:de=>{n(`update:${ue}`,de),n("monthYearSelect",ue==="year"),ue==="month"?K(!0):oe(!0)}}),S=Ve(w("month")),N=Ve(w("year")),A=Ve(()=>ue=>{const de=ue==="month";return{showSelectionGrid:(de?u:d).value,items:(de?O:T).value,disabledValues:r.filters[de?"months":"years"],minValue:(de?V:L).value,maxValue:(de?x:j).value,headerRefs:de&&r.monthPicker?[g.value,v.value,_.value]:[]}}),L=Ve(()=>r.minDate?qr(new Date(r.minDate)):null),j=Ve(()=>r.maxDate?qr(new Date(r.maxDate)):null),V=Ve(()=>{if(r.minDate&&L.value){if(L.value>r.year)return 12;if(L.value===r.year)return Jr(new Date(r.minDate))}return null}),x=Ve(()=>{if(r.maxDate&&j.value){if(j.valuer.range&&r.internalModelValue&&r.monthPicker?r.internalModelValue:[]),z=(ue,de=!1)=>{const Y=[];for(let re=0;rer.months.find(de=>de.value===r.month)||{text:"",value:0}),O=Ve(()=>z(r.months)),T=Ve(()=>z(r.years,r.reverseYears)),P=Ve(()=>r.multiCalendars?r.multiCalendarsSolo?!0:r.instance===0:!0),Z=Ve(()=>r.multiCalendars?r.multiCalendarsSolo?!0:r.instance===r.multiCalendars-1:!0),K=(ue=!1)=>{J(ue),u.value=!u.value,u.value||n("overlay-closed")},oe=(ue=!1)=>{J(ue),d.value=!d.value,d.value||n("overlay-closed")},J=ue=>{ue||n("reset-flow")},ie=(ue=!1)=>{n("update:year",ue?r.year+1:r.year-1)},pe=(ue,de)=>{C!=null&&C.value&&(f.value[de]=Ro(ue),s(f.value,"monthYear"))};return t({toggleMonthPicker:K,toggleYearPicker:oe}),(ue,de)=>(X(),ae("div",Zae,[!ue.monthPicker&&!e.yearPicker?(X(),ae(dt,{key:0},[Oe(P)&&!ue.vertical?(X(),It(vb,{key:0,"aria-label":Oe(M).prevMonth,onActivate:de[0]||(de[0]=Y=>Oe(D)(!1)),onSetRef:de[1]||(de[1]=Y=>pe(Y,0))},{default:xt(()=>[ue.$slots["arrow-left"]?Ft(ue.$slots,"arrow-left",{key:0}):Ce("",!0),ue.$slots["arrow-left"]?Ce("",!0):(X(),It(Oe(uD),{key:1}))]),_:3},8,["aria-label"])):Ce("",!0),St(vD,Eo({"aria-label":Oe(M).openMonthsOverlay,"slot-name":"month-overlay",modelValue:Oe(S),"onUpdate:modelValue":de[2]||(de[2]=Y=>gr(S)?S.value=Y:null)},Oe(A)("month"),{onToggle:K,onSetRef:de[3]||(de[3]=Y=>pe(Y,1))}),zi({default:xt(()=>[ue.$slots.month?Ft(ue.$slots,"month",ql(Eo({key:0},Oe(G)))):Ce("",!0),ue.$slots.month?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(Oe(G).text),1)],64))]),_:2},[ue.$slots["calendar-icon"]?{name:"calendar-icon",fn:xt(()=>[Ft(ue.$slots,"calendar-icon")])}:void 0,ue.$slots["month-overlay"]?{name:"month-overlay",fn:xt(({item:Y})=>[Ft(ue.$slots,"month-overlay",{text:Y.text,value:Y.value})])}:void 0]),1040,["aria-label","modelValue"]),St(vD,Eo({"aria-label":Oe(M).openYearsOverlay,"slot-name":"year-overlay",modelValue:Oe(N),"onUpdate:modelValue":de[4]||(de[4]=Y=>gr(N)?N.value=Y:null)},Oe(A)("year"),{onToggle:oe,onSetRef:de[5]||(de[5]=Y=>pe(Y,2))}),zi({default:xt(()=>[ue.$slots.year?Ft(ue.$slots,"year",{key:0,year:ue.year}):Ce("",!0),ue.$slots.year?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(ue.year),1)],64))]),_:2},[ue.$slots["calendar-icon"]?{name:"calendar-icon",fn:xt(()=>[Ft(ue.$slots,"calendar-icon")])}:void 0,ue.$slots["year-overlay"]?{name:"year-overlay",fn:xt(({item:Y})=>[Ft(ue.$slots,"year-overlay",{text:Y.text,value:Y.value})])}:void 0]),1040,["aria-label","modelValue"]),Oe(P)&&ue.vertical?(X(),It(vb,{key:1,"aria-label":Oe(M).prevMonth,onActivate:de[6]||(de[6]=Y=>Oe(D)(!1))},{default:xt(()=>[ue.$slots["arrow-up"]?Ft(ue.$slots,"arrow-up",{key:0}):Ce("",!0),ue.$slots["arrow-up"]?Ce("",!0):(X(),It(Oe(V5),{key:1}))]),_:3},8,["aria-label"])):Ce("",!0),Oe(Z)?(X(),It(vb,{key:2,"arial-label":Oe(M).nextMonth,onActivate:de[7]||(de[7]=Y=>Oe(D)(!0)),ref:"rightIcon",onSetRef:de[8]||(de[8]=Y=>pe(Y,3))},{default:xt(()=>[ue.$slots[ue.vertical?"arrow-down":"arrow-right"]?Ft(ue.$slots,ue.vertical?"arrow-down":"arrow-right",{key:0}):Ce("",!0),ue.$slots[ue.vertical?"arrow-down":"arrow-right"]?Ce("",!0):(X(),It(af(ue.vertical?Oe(z5):Oe(cD)),{key:1}))]),_:3},8,["arial-label"])):Ce("",!0)],64)):Ce("",!0),ue.monthPicker?(X(),It(bh,Eo({key:1},Oe(A)("month"),{"skip-active":r.range,year:ue.year,"multi-model-value":Oe($),modelValue:Oe(S),"onUpdate:modelValue":de[15]||(de[15]=Y=>gr(S)?S.value=Y:null),onToggle:K,onSelected:de[16]||(de[16]=Y=>ue.$emit("overlay-closed"))}),zi({header:xt(()=>[B("div",Qae,[B("div",{class:"dp__month_year_col_nav",tabindex:"0",ref_key:"mpPrevIconRef",ref:g,onClick:de[9]||(de[9]=Y=>ie(!1)),onKeydown:de[10]||(de[10]=fr(Y=>ie(!1),["enter"]))},[B("div",{class:"dp__inner_nav",role:"button","aria-label":Oe(M).prevMonth},[ue.$slots["arrow-left"]?Ft(ue.$slots,"arrow-left",{key:0}):Ce("",!0),ue.$slots["arrow-left"]?Ce("",!0):(X(),It(Oe(uD),{key:1}))],8,ele)],544),B("div",{class:"dp__pointer",role:"button",ref_key:"mpYearButtonRef",ref:v,"aria-label":Oe(M).openYearsOverlay,tabindex:"0",onClick:oe,onKeydown:fr(oe,["enter"])},[ue.$slots.year?Ft(ue.$slots,"year",{key:0,year:ue.year}):Ce("",!0),ue.$slots.year?Ce("",!0):(X(),ae(dt,{key:1},[jr(Ee(ue.year),1)],64))],40,tle),B("div",{class:"dp__month_year_col_nav",tabindex:"0",ref_key:"mpNextIconRef",ref:_,onClick:de[11]||(de[11]=Y=>ie(!0)),onKeydown:de[12]||(de[12]=fr(Y=>ie(!0),["enter"]))},[B("div",{class:"dp__inner_nav",role:"button","aria-label":Oe(M).nextMonth},[ue.$slots["arrow-right"]?Ft(ue.$slots,"arrow-right",{key:0}):Ce("",!0),ue.$slots["arrow-right"]?Ce("",!0):(X(),It(Oe(cD),{key:1}))],8,nle)],544)]),St(bo,{name:Oe(o)(d.value),css:Oe(i)},{default:xt(()=>[d.value?(X(),It(bh,Eo({key:0},Oe(A)("year"),{modelValue:Oe(N),"onUpdate:modelValue":de[13]||(de[13]=Y=>gr(N)?N.value=Y:null),onToggle:oe,onSelected:de[14]||(de[14]=Y=>ue.$emit("overlay-closed"))}),zi({"button-icon":xt(()=>[ue.$slots["calendar-icon"]?Ft(ue.$slots,"calendar-icon",{key:0}):Ce("",!0),ue.$slots["calendar-icon"]?Ce("",!0):(X(),It(Oe(i0),{key:1}))]),_:2},[ue.$slots["year-overlay"]?{name:"item",fn:xt(({item:Y})=>[Ft(ue.$slots,"year-overlay",{text:Y.text,value:Y.value})])}:void 0]),1040,["modelValue"])):Ce("",!0)]),_:3},8,["name","css"])]),_:2},[ue.$slots["month-overlay"]?{name:"item",fn:xt(({item:Y})=>[Ft(ue.$slots,"month-overlay",{text:Y.text,value:Y.value})])}:void 0]),1040,["skip-active","year","multi-model-value","modelValue"])):Ce("",!0),e.yearPicker?(X(),It(bh,Eo({key:2},Oe(A)("year"),{modelValue:Oe(N),"onUpdate:modelValue":de[17]||(de[17]=Y=>gr(N)?N.value=Y:null),"skip-button-ref":"",onToggle:oe,onSelected:de[18]||(de[18]=Y=>ue.$emit("overlay-closed"))}),zi({_:2},[ue.$slots["year-overlay"]?{name:"item",fn:xt(({item:Y})=>[Ft(ue.$slots,"year-overlay",{text:Y.text,value:Y.value})])}:void 0]),1040,["modelValue"])):Ce("",!0)]))}}),ole=(e,t,n,r)=>{const o=Ne(new Date),i=Ne(),s=Ne([{month:Jr(new Date),year:qr(new Date)}]),u=Ne(e.range?[Fs(new Date),Fs(new Date)]:Fs(new Date)),d=Ne(e.range?[Gs(new Date),Gs(new Date)]:Gs(new Date)),f=Ne(e.range?[0,0]:0);$t(s,()=>{setTimeout(()=>{e.openOnTop&&t("dpOpen")},0)},{deep:!0}),On(()=>{z(),S.value||(e.startDate&&(s.value[0].month=Jr(new Date(e.startDate)),s.value[0].year=qr(new Date(e.startDate)),e.multiCalendars&&Y(0)),e.startTime&&w())});const g=Ve(()=>q=>s.value[q]?s.value[q].month:0),v=Ve(()=>q=>s.value[q]?s.value[q].year:0),_=(q,ne,_e)=>{s.value[q].month=ne,s.value[q].year=_e},M=(q,ne)=>s.value[q].month=ne,C=(q,ne)=>s.value[q].year=ne,D=(q=!0)=>e.enableSeconds?Array.isArray(f.value)?q?f.value[0]:f.value[1]:f.value:0,w=()=>{e.startTime&&(Tae(e.startTime)?(u.value=[+e.startTime[0].hours,+e.startTime[1].hours],d.value=[+e.startTime[0].minutes,+e.startTime[1].minutes],e.enableSeconds&&(f.value=[+e.startTime[0].seconds,+e.startTime[1].seconds])):(u.value=+e.startTime.hours,d.value=+e.startTime.minutes,e.enableSeconds&&(f.value=+e.startTime.seconds)))},S=Ve({get:()=>e.internalModelValue,set:q=>{!e.readonly&&!e.disabled&&t("update:internalModelValue",q)}});$t(S,()=>z());const N=q=>{const{validate:ne}=K5(e.minDate,e.maxDate,e.disabledDates,e.allowedDates,e.filters,e.disabledWeekDays,e.yearRange);return!ne(q)},A=q=>!S.value||e.hideOffsetDates&&!q.current||e.range?!1:e.multiDates&&Array.isArray(S.value)?S.value.some(ne=>Nr(ne,q.value)):Nr(q.value,S.value?S.value:o.value),L=q=>W5(S.value,i.value,q.value),j=q=>{if((!e.multiCalendars||!e.multiStatic)&&(M(0,Jr(q)),C(0,qr(q))),e.multiCalendars)for(let ne=1;ne<=e.multiCalendars;ne++){const _e=Ts(new Date,{month:g.value(ne-1),year:v.value(ne-1)}),Be=C5(_e,{months:1});s.value[ne]={month:Jr(Be),year:qr(Be)}}},V=()=>{if(Array.isArray(S.value)&&S.value.length===2){const q=new Date(S.value[1]?S.value[1]:cl(S.value[0],1)),[ne,_e]=[Jr(S.value[0]),qr(S.value[0])],[Be,je]=[Jr(S.value[1]),qr(S.value[1])];(ne!==Be||ne===Be&&_e!==je)&&e.multiCalendarsSolo&&(M(1,Jr(q)),C(1,qr(q)))}},x=q=>{j(q),u.value=Fs(q),d.value=Gs(q),f.value=Jl(q)},$=()=>Array.isArray(S.value)&&S.value.length?S.value[S.value.length-1]:null,z=()=>{if(S.value)if(Zp(S.value)){if(S.value.length===2&&!e.multiDates)j(S.value[0]),u.value=[Fs(S.value[0]),S.value[1]?Fs(S.value[1]):Fs(new Date)],d.value=[Gs(S.value[0]),S.value[1]?Gs(S.value[1]):Gs(new Date)],f.value=[Jl(S.value[0]),S.value[1]?Jl(S.value[1]):Jl(new Date)];else if(Zp(S.value)&&e.multiDates){const q=S.value[S.value.length-1];q&&x(q)}e.multiCalendars&&e.multiCalendarsSolo&&V()}else x(S.value);else e.timePicker?(w(),e.range?xs(u.value)&&xs(d.value)&&(S.value=[Bi(new Date,u.value[0],d.value[0],D()),Bi(new Date,u.value[1],d.value[1],D(!1))]):S.value=Bi(new Date,u.value,d.value,D())):e.monthPicker&&!e.range?S.value=jc(new Date,g.value(0),v.value(0)):e.multiCalendars?j(new Date):e.yearPicker&&(S.value=new Date)},G=q=>{const ne=Jr(new Date(q)),_e=qr(new Date(q));if(M(0,ne),C(0,_e),e.multiCalendars>0)for(let Be=1;Be{if(S.value&&Array.isArray(S.value))if(S.value.some(ne=>Nr(q,ne))){const ne=S.value.filter(_e=>!Nr(_e,q));S.value=ne.length?ne:null}else(e.multiDatesLimit&&+e.multiDatesLimit>S.value.length||!e.multiDatesLimit)&&S.value.push(q);else S.value=[q]},T=q=>{if(Array.isArray(S.value)&&S.value[0]){const ne=Ore(q,S.value[0]),_e=Math.abs(ne<0?ne+1:ne-1);if(e.minRange&&e.maxRange)return _e>=+e.minRange&&_e<=+e.maxRange;if(e.minRange)return _e>=+e.minRange;if(e.maxRange)return _e<=+e.maxRange}return!0},P=q=>Array.isArray(S.value)&&S.value.length===2?e.fixedStart&&(ns(q,S.value[0])||Nr(q,S.value[0]))?[S.value[0],q]:e.fixedEnd&&(li(q,S.value[1])||Nr(q,S.value[1]))?[q,S.value[1]]:S.value:[],Z=()=>{e.autoApply&&t("autoApply")},K=q=>!xre({start:q[0],end:q[1]}).some(ne=>N(ne)),oe=(q,ne=!1)=>{if(!N(q.value)&&!(!q.current&&e.hideOffsetDates)){if(e.weekPicker)return S.value=Sm(new Date(q.value),+e.weekStart),Z();if(!e.range&&!xs(u.value)&&!xs(d.value)){const _e=Bi(new Date(q.value),u.value,d.value,D());e.multiDates?O(_e):S.value=_e,n(),Z()}else if(xs(u.value)&&xs(d.value)&&!e.multiDates){let _e=S.value?S.value.slice():[];if(_e.length===2&&!(e.fixedStart||e.fixedEnd)&&(_e=[]),e.autoRange){const Be=[new Date(q.value),zc(new Date(q.value),+e.autoRange)];K(Be)&&(ne&&G(q.value),_e=Be)}else e.fixedStart||e.fixedEnd?_e=P(new Date(q.value)):_e[0]?T(new Date(q.value))&&(li(new Date(q.value),new Date(_e[0]))?_e.unshift(new Date(q.value)):_e[1]=new Date(q.value)):_e[0]=new Date(q.value);_e.length&&(_e[0]&&!_e[1]?_e[0]=Bi(_e[0],u.value[0],d.value[0],D()):(_e[0]=Bi(_e[0],u.value[0],d.value[0],D()),_e[1]=Bi(_e[1],u.value[1],d.value[1],D(!1)),n()),S.value=_e,_e[0]&&_e[1]&&e.autoApply&&t("autoApply"))}}},J=q=>{const ne=q.find(_e=>_e.current);return ne?zoe(ne.value):""},ie=q=>{!q.current&&e.hideOffsetDates||(i.value=q.value)},pe=q=>{if(e.autoRange||e.weekPicker){if(i.value){if(e.hideOffsetDates&&!q.current)return!1;const ne=zc(i.value,+e.autoRange),_e=Sm(new Date(i.value),+e.weekStart);return e.weekPicker?Nr(_e[1],new Date(q.value)):Nr(ne,new Date(q.value))}return!1}return!1},ue=q=>{if(e.autoRange||e.weekPicker){if(i.value){const ne=zc(i.value,+e.autoRange);if(e.hideOffsetDates&&!q.current)return!1;const _e=Sm(new Date(i.value),+e.weekStart);return e.weekPicker?ns(q.value,_e[0])&&li(q.value,_e[1]):ns(q.value,i.value)&&li(q.value,ne)}return!1}return!1},de=q=>{if(e.autoRange||e.weekPicker){if(i.value){if(e.hideOffsetDates&&!q.current)return!1;const ne=Sm(new Date(i.value),+e.weekStart);return e.weekPicker?Nr(ne[0],q.value):Nr(i.value,q.value)}return!1}return!1},Y=q=>{for(let ne=q-1;ne>=0;ne--){const _e=tg(Ts(new Date,{month:g.value(ne+1),year:v.value(ne+1)}),1);_(ne,Jr(_e),qr(_e))}for(let ne=q+1;ne<=e.multiCalendars-1;ne++){const _e=cl(Ts(new Date,{month:g.value(ne-1),year:v.value(ne-1)}),1);_(ne,Jr(_e),qr(_e))}},re=q=>jc(new Date,g.value(q),v.value(q)),fe=(q,ne,_e=!0)=>{if(_e?M(q,ne):C(q,ne),e.multiCalendars&&!e.multiCalendarsSolo&&Y(q),e.monthPicker)if(e.range){if(_e){let Be=S.value?S.value.slice():[];Be.length===2&&Be[1]!==null&&(Be=[]),Be.length?li(re(q),Be[0])?Be.unshift(re(q)):Be[1]=re(q):Be=[re(q)],S.value=Be}}else S.value=re(q);n(),t("updateMonthYear",{instance:q,value:ne,isMonth:_e}),Ie(e.multiCalendarsSolo?q:void 0)},Ae=q=>Bi(q,u.value,d.value,D()),ye=q=>{Zp(q)&&Zp(S.value)&&xs(u.value)&&xs(d.value)?(q[0]&&S.value[0]&&(S.value[0]=Bi(q[0],u.value[0],d.value[0],D())),q[1]&&S.value[1]&&(S.value[1]=Bi(q[1],u.value[1],d.value[1],D(!1)))):e.multiDates&&Array.isArray(S.value)?S.value[S.value.length-1]=Ae(q):!e.range&&!lv(q)&&(S.value=Ae(q)),t("timeUpdate")},le=(q,ne=!0,_e=!1)=>{const Be=ne?q:u.value,je=!ne&&!_e?q:d.value,lt=_e?q:f.value;if(e.range&&lv(S.value)&&xs(Be)&&xs(je)&&xs(lt)){const Fe=Tt=>Bi(S.value[Tt],Be[Tt],je[Tt],lt[Tt]),it=Tt=>MT(S.value[Tt],0);if(Nr(S.value[0],S.value[1])&&(R5(Fe(0),it(1))||N5(Fe(1),it(0))))return}if(u.value=Be,d.value=je,f.value=lt,S.value)if(e.multiDates){const Fe=$();Fe&&ye(Fe)}else ye(S.value);else e.timePicker&&ye(e.range?[new Date,new Date]:new Date);n()},Q=()=>{i.value=null},ve=q=>gD(S.value,e.range)&&S.value[0]&&i.value?q?ns(i.value,S.value[0]):li(i.value,S.value[0]):!0,Le=(q,ne=!0)=>(e.range||e.weekPicker)&&lv(S.value)?e.hideOffsetDates&&!q.current?!1:Nr(new Date(q.value),S.value[ne?0:1]):e.range?Nr(new Date(q.value),S.value&&Array.isArray(S.value)?ne?S.value[0]||null:S.value[1]:null)&&(ne?!li(i.value||null,Array.isArray(S.value)?S.value[0]:null):!0)||Nr(q.value,Array.isArray(S.value)?S.value[0]:null)&&ve(ne):!1,me=(q,ne)=>Array.isArray(e.internalModelValue)&&e.internalModelValue.length||e.weekPicker?!1:!q&&!A(ne)&&!(!ne.current&&e.hideOffsetDates)&&(e.range?!Le(ne)&&!Le(ne,!1):!0),W=(q,ne,_e)=>Array.isArray(e.internalModelValue)&&e.internalModelValue[0]&&e.internalModelValue.length===1?q?!1:_e?ns(e.internalModelValue[0],ne.value):li(e.internalModelValue[0],ne.value):!1,te=(q=!1)=>{q&&e.yearPicker&&(S.value=hf(new Date,s.value[0].year),e.autoApply&&t("autoApply")),e.autoApply&&e.monthPicker&&br().then(()=>{e.range?t("autoApply",q||!S.value||S.value.length===1):t("autoApply",q)})},se=(q,ne)=>{const _e=Ts(new Date,{month:g.value(ne),year:v.value(ne)}),Be=q<0?cl(_e,1):tg(_e,1);sP(e.minDate,e.maxDate,Jr(Be),qr(Be),q<0,e.preventMinMaxNavigation)&&(_(ne,Jr(Be),qr(Be)),e.multiCalendars&&!e.multiCalendarsSolo&&Y(ne),Ie())},Te=(q,ne)=>{e.monthChangeOnScroll&&se(e.monthChangeOnScroll!=="inverse"?-q.deltaY:q.deltaY,ne)},ce=(q,ne,_e=!1)=>{e.monthChangeOnArrows&&e.vertical===_e&&Se(q,ne)},Se=(q,ne)=>{se(q==="right"?-1:1,ne)},Pe=q=>e.markers.find(ne=>Nr(_s(new Date(q.value)),_s(new Date(ne.date)))),xe=()=>{e.range?gD(S.value,e.range)&&(S.value&&S.value[0]?S.value=li(new Date,S.value[0])?[new Date,S.value[0]]:[S.value[0],new Date]:S.value=[new Date]):t("update:internalModelValue",new Date),e.autoApply&&t("selectDate")},He=q=>{q.length&&q.length<=2&&e.range&&(S.value=q.map(ne=>new Date(ne)),e.autoApply&&t("selectDate"))},Ie=q=>{q||q===0?r.value[q].triggerTransition(g.value(q),v.value(q)):r.value.forEach((ne,_e)=>ne.triggerTransition(g.value(_e),v.value(_e)))};return{today:o,hours:u,minutes:d,seconds:f,month:g,year:v,monthYearSelect:te,isDisabled:N,updateTime:le,setHoverDate:ie,getWeekNum:J,selectDate:oe,rangeActive:L,isActiveDate:A,updateMonthYear:fe,isHoverRangeEnd:pe,isAutoRangeInBetween:ue,isAutoRangeStart:de,clearHoverDate:Q,rangeActiveStartEnd:Le,handleScroll:Te,getMarker:Pe,handleArrow:ce,handleSwipe:Se,selectCurrentDate:xe,isHoverDate:me,isHoverDateStartEnd:W,presetDateRange:He}},ile=["id","aria-label","onKeydown"],sle={key:0,class:"dp__preset_ranges"},ale=["onClick"],lle={key:1,class:"dp__now_wrap"},ule=ot({props:ss(Dn(Dn(Dn({},rP),TT),CT),{internalModelValue:{type:[Date,Array],default:null},multiCalendars:{type:Number,default:0},openOnTop:{type:Boolean,default:!1}}),emits:["update:internalModelValue","closePicker","selectDate","dpOpen","autoApply","timeUpdate","flow-step","updateMonthYear"],setup(e,{emit:t}){const n=e,r=pg(),o=Ne(null),i=zt({timePicker:!!(!n.enableTimePicker||n.timePicker||n.monthPicker),monthYearInput:!!n.timePicker,calendar:!1}),s=Ne([]),u=Ne([]),d=Ne(null),f=Ne(null),g=Ne(0),v=Ne(!1),_=Ne(0),M=tn(s0),C=tn(Lu),D=tn(Ou),{setMenuFocused:w,setShiftKey:S}=kT();On(()=>{var ze;v.value=!0,(ze=n.presetRanges)!=null&&ze.length||_e();const wt=Ro(f);if(wt&&!n.textInput&&!n.inline&&(w(!0),V()),wt){const _t=Bt=>{Bt.stopImmediatePropagation(),Bt.stopPropagation()};wt.addEventListener("pointerdown",_t),wt.addEventListener("mousedown",_t)}document.addEventListener("resize",_e)}),pl(()=>{document.removeEventListener("resize",_e)});const{arrowRight:N,arrowLeft:A,arrowDown:L,arrowUp:j}=Ru(),V=()=>{const ze=Ro(f);ze&&ze.focus({preventScroll:!0})},x=()=>{var ze;(ze=n.flow)!=null&&ze.length&&_.value!==-1&&(_.value+=1,t("flow-step",_.value),en())},$=()=>{_.value=-1},{updateTime:z,updateMonthYear:G,today:O,month:T,year:P,hours:Z,minutes:K,seconds:oe,isDisabled:J,isActiveDate:ie,selectDate:pe,getWeekNum:ue,setHoverDate:de,isHoverRangeEnd:Y,isAutoRangeInBetween:re,isAutoRangeStart:fe,rangeActive:Ae,clearHoverDate:ye,rangeActiveStartEnd:le,monthYearSelect:Q,handleScroll:ve,handleArrow:Le,handleSwipe:me,getMarker:W,selectCurrentDate:te,isHoverDateStartEnd:se,isHoverDate:Te,presetDateRange:ce}=ole(n,t,x,u),Se=_c(r,"calendar"),Pe=_c(r,"action"),xe=_c(r,"timePicker"),He=_c(r,"monthYear"),Ie=Ve(()=>n.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),q=Ve(()=>Yse(n.yearRange)),ne=Ve(()=>Jse(n.locale,n.monthNameFormat)),_e=()=>{const ze=Ro(o);ze&&(g.value=ze.getBoundingClientRect().width)},Be=Ve(()=>ze=>jse(T.value(ze),P.value(ze),+n.weekStart,n.hideOffsetDates)),je=Ve(()=>n.multiCalendars>0&&n.range?[...Array(n.multiCalendars).keys()]:[0]),lt=Ve(()=>ze=>ze===1),Fe=Ve(()=>n.monthPicker||n.timePicker||n.yearPicker),it=Ve(()=>({dp__flex_display:n.multiCalendars>0})),Tt=Ve(()=>({dp__instance_calendar:n.multiCalendars>0})),mn=Ve(()=>({dp__menu_disabled:n.disabled,dp__menu_readonly:n.readonly})),In=Ve(()=>ze=>vn(Be,ze)),Cn=Ve(()=>({locale:n.locale,weekNumName:n.weekNumName,weekStart:n.weekStart,weekNumbers:n.weekNumbers,customProps:n.customProps,calendarClassName:n.calendarClassName,specificMode:Fe.value,getWeekNum:ue,multiCalendars:n.multiCalendars,modeHeight:n.modeHeight,internalModelValue:n.internalModelValue,noSwipe:n.noSwipe,vertical:n.vertical})),En=Ve(()=>({dp__menu:!0,dp__menu_index:!n.inline,dp__relative:n.inline,[n.menuClassName]:!!n.menuClassName})),vn=(ze,wt)=>ze.value(wt).map(_t=>ss(Dn({},_t),{days:_t.days.map(Bt=>{const Wt=J(Bt.value),mr=Te(Wt,Bt),Cr=(n.range||n.weekPicker)&&(!(n.multiCalendars>0)||Bt.current)&&!Wt&&!(!Bt.current&&n.hideOffsetDates)&&!ie(Bt)?Ae(Bt):!1;return Bt.marker=W(Bt),Bt.classData={dp__cell_offset:!Bt.current,dp__pointer:!Wt&&!(!Bt.current&&n.hideOffsetDates),dp__active_date:n.range?!1:ie(Bt),dp__date_hover:mr,dp__date_hover_start:se(mr,Bt,!0),dp__date_hover_end:se(mr,Bt,!1),dp__range_between:Cr&&!n.weekPicker,dp__range_between_week:Cr&&n.weekPicker,dp__today:!n.noToday&&Nr(Bt.value,O.value)&&Bt.current,dp__cell_disabled:Wt,dp__cell_auto_range:re(Bt),dp__cell_auto_range_start:fe(Bt),dp__cell_auto_range_end:Y(Bt),dp__range_start:n.multiCalendars>0?Bt.current&&le(Bt):le(Bt),dp__range_end:n.multiCalendars>0?Bt.current&&le(Bt,!1):le(Bt,!1),[n.calendarCellClassName]:!!n.calendarCellClassName},Bt})})),Qe=ze=>{ze.stopPropagation(),ze.preventDefault(),ze.stopImmediatePropagation()},yt=()=>{n.escClose&&t("closePicker")},Nt=ze=>{ze.stopImmediatePropagation(),ze.preventDefault(),n.spaceConfirm&&t("selectDate")},ln=ze=>{var wt;(wt=n.flow)!=null&&wt.length&&(i[ze]=!0,Object.keys(i).filter(_t=>!i[_t]).length||en())},en=()=>{n.flow[_.value]==="month"&&s.value[0]&&s.value[0].toggleMonthPicker(!0),n.flow[_.value]==="year"&&s.value&&s.value[0].toggleYearPicker(!0),n.flow[_.value]==="calendar"&&d.value&&d.value.toggleTimePicker(!1,!0),n.flow[_.value]==="time"&&d.value&&d.value.toggleTimePicker(!0,!0);const ze=n.flow[_.value];(ze==="hours"||ze==="minutes"||ze==="seconds")&&d.value&&d.value.toggleTimePicker(!0,!0,ze)},Tn=ze=>{if(D!=null&&D.value){if(ze==="up")return j();if(ze==="down")return L();if(ze==="left")return A();if(ze==="right")return N()}else ze==="left"||ze==="up"?Le("left",0,ze==="up"):Le("right",0,ze==="down")},qn=ze=>{S(ze.shiftKey)};return(ze,wt)=>(X(),It(bo,{appear:"",name:Oe(M).menuAppear,mode:"out-in",css:!!Oe(M)},{default:xt(()=>[B("div",{id:ze.uid?`dp-menu-${ze.uid}`:void 0,tabindex:"0",ref_key:"dpMenuRef",ref:f,role:"dialog","aria-label":Oe(C).menu,class:st(Oe(En)),onMouseleave:wt[11]||(wt[11]=(..._t)=>Oe(ye)&&Oe(ye)(..._t)),onClick:Qe,onKeydown:[fr(yt,["esc"]),fr(Nt,["space"]),wt[12]||(wt[12]=fr(bn(_t=>Tn("left"),["prevent"]),["left"])),wt[13]||(wt[13]=fr(bn(_t=>Tn("up"),["prevent"]),["up"])),wt[14]||(wt[14]=fr(bn(_t=>Tn("down"),["prevent"]),["down"])),wt[15]||(wt[15]=fr(bn(_t=>Tn("right"),["prevent"]),["right"])),qn]},[(ze.disabled||ze.readonly)&&ze.inline?(X(),ae("div",{key:0,class:st(Oe(mn))},null,2)):Ce("",!0),ze.inline?Ce("",!0):(X(),ae("div",{key:1,class:st(Oe(Ie))},null,2)),B("div",{class:st(ze.presetRanges.length?"dp__menu_content_wrapper":null)},[ze.presetRanges.length?(X(),ae("div",sle,[(X(!0),ae(dt,null,qt(ze.presetRanges,(_t,Bt)=>(X(),ae("div",{key:Bt,class:"dp__preset_range",onClick:Wt=>Oe(ce)(_t.range)},Ee(_t.label),9,ale))),128))])):Ce("",!0),B("div",{class:"dp__instance_calendar",ref_key:"calendarWrapperRef",ref:o,role:"document"},[B("div",{class:st(Oe(it))},[(X(!0),ae(dt,null,qt(Oe(je),(_t,Bt)=>(X(),ae("div",{key:_t,class:st(Oe(Tt))},[!ze.disableMonthYearSelect&&!ze.timePicker?(X(),It(af(ze.monthYearComponent?ze.monthYearComponent:rle),Eo({key:0,ref_for:!0,ref:Wt=>{Wt&&(s.value[Bt]=Wt)}},{months:Oe(ne),years:Oe(q),filters:ze.filters,monthPicker:ze.monthPicker,month:Oe(T)(_t),year:Oe(P)(_t),customProps:ze.customProps,multiCalendars:e.multiCalendars,multiCalendarsSolo:ze.multiCalendarsSolo,instance:_t,minDate:ze.minDate,maxDate:ze.maxDate,preventMinMaxNavigation:ze.preventMinMaxNavigation,internalModelValue:e.internalModelValue,range:ze.range,reverseYears:ze.reverseYears,vertical:ze.vertical,yearPicker:ze.yearPicker},{onMount:wt[0]||(wt[0]=Wt=>ln("monthYearInput")),onResetFlow:$,"onUpdate:month":Wt=>Oe(G)(_t,Wt,!0),"onUpdate:year":Wt=>Oe(G)(_t,Wt,!1),onMonthYearSelect:Oe(Q),onOverlayClosed:V}),zi({_:2},[qt(Oe(He),(Wt,mr)=>({name:Wt,fn:xt(Cr=>[Ft(ze.$slots,Wt,ql(Vl(Cr)))])}))]),1040,["onUpdate:month","onUpdate:year","onMonthYearSelect"])):Ce("",!0),St(yae,Eo({ref_for:!0,ref:Wt=>{Wt&&(u.value[Bt]=Wt)}},Oe(Cn),{"flow-step":_.value,"onUpdate:flow-step":wt[1]||(wt[1]=Wt=>_.value=Wt),instance:_t,"mapped-dates":Oe(In)(_t),month:Oe(T)(_t),year:Oe(P)(_t),onSelectDate:Wt=>Oe(pe)(Wt,!Oe(lt)(_t)),onSetHoverDate:wt[2]||(wt[2]=Wt=>Oe(de)(Wt)),onHandleScroll:Wt=>Oe(ve)(Wt,_t),onHandleSwipe:Wt=>Oe(me)(Wt,_t),onMount:wt[3]||(wt[3]=Wt=>ln("calendar")),onResetFlow:$}),zi({_:2},[qt(Oe(Se),(Wt,mr)=>({name:Wt,fn:xt(Cr=>[Ft(ze.$slots,Wt,ql(Vl(Dn({},Cr))))])}))]),1040,["flow-step","instance","mapped-dates","month","year","onSelectDate","onHandleScroll","onHandleSwipe"])],2))),128))],2),B("div",null,[ze.enableTimePicker&&!ze.monthPicker&&!ze.weekPicker?(X(),It(af(ze.timePickerComponent?ze.timePickerComponent:Kae),Eo({key:0,ref_key:"timePickerRef",ref:d},{is24:ze.is24,hoursIncrement:ze.hoursIncrement,minutesIncrement:ze.minutesIncrement,hoursGridIncrement:ze.hoursGridIncrement,secondsIncrement:ze.secondsIncrement,minutesGridIncrement:ze.minutesGridIncrement,secondsGridIncrement:ze.secondsGridIncrement,noHoursOverlay:ze.noHoursOverlay,noMinutesOverlay:ze.noMinutesOverlay,noSecondsOverlay:ze.noSecondsOverlay,range:ze.range,filters:ze.filters,timePicker:ze.timePicker,hours:Oe(Z),minutes:Oe(K),seconds:Oe(oe),customProps:ze.customProps,enableSeconds:ze.enableSeconds,fixedStart:ze.fixedStart,fixedEnd:ze.fixedEnd},{onMount:wt[4]||(wt[4]=_t=>ln("timePicker")),"onUpdate:hours":wt[5]||(wt[5]=_t=>Oe(z)(_t)),"onUpdate:minutes":wt[6]||(wt[6]=_t=>Oe(z)(_t,!1)),"onUpdate:seconds":wt[7]||(wt[7]=_t=>Oe(z)(_t,!1,!0)),onResetFlow:$,onOverlayClosed:V}),zi({_:2},[qt(Oe(xe),(_t,Bt)=>({name:_t,fn:xt(Wt=>[Ft(ze.$slots,_t,ql(Vl(Wt)))])}))]),1040)):Ce("",!0)])],512),ze.showNowButton?(X(),ae("div",lle,[ze.$slots["now-button"]?Ft(ze.$slots,"now-button",{key:0,selectCurrentDate:Oe(te)}):Ce("",!0),ze.$slots["now-button"]?Ce("",!0):(X(),ae("button",{key:1,type:"button",role:"button",class:"dp__now_button",onClick:wt[8]||(wt[8]=(..._t)=>Oe(te)&&Oe(te)(..._t))},Ee(ze.nowButtonLabel),1))])):Ce("",!0)],2),!ze.autoApply||ze.keepActionRow?(X(),It(af(ze.actionRowComponent?ze.actionRowComponent:Eae),Eo({key:2},{calendarWidth:g.value,selectText:ze.selectText,cancelText:ze.cancelText,internalModelValue:e.internalModelValue,range:ze.range,previewFormat:ze.previewFormat,inline:ze.inline,monthPicker:ze.monthPicker,timePicker:ze.timePicker,customProps:ze.customProps,multiCalendars:e.multiCalendars,menuMount:v.value,maxTime:ze.maxTime,minTime:ze.minTime,enableTimePicker:ze.enableTimePicker,minDate:ze.minDate,maxDate:ze.maxDate,multiDates:ze.multiDates},{onClosePicker:wt[9]||(wt[9]=_t=>ze.$emit("closePicker")),onSelectDate:wt[10]||(wt[10]=_t=>ze.$emit("selectDate"))}),zi({_:2},[qt(Oe(Pe),(_t,Bt)=>({name:_t,fn:xt(Wt=>[Ft(ze.$slots,_t,ql(Vl(Dn({},Wt))))])}))]),1040)):Ce("",!0)],42,ile)]),_:3},8,["name","css"]))}});var uv=(e=>(e.center="center",e.left="left",e.right="right",e))(uv||{});const cle=(e,t,n,r,o,i,s)=>{const u=Ne({top:"0",left:"0",transform:"none"}),d=Ne(!1),f=10,g=390,v=A=>{const L=A.getBoundingClientRect();return{left:L.left+window.scrollX,top:L.top+window.scrollY}},_=A=>{const L=A.getBoundingClientRect();let j=0,V=0;for(;A&&!isNaN(A.offsetLeft)&&!isNaN(A.offsetTop);)j+=A.offsetLeft-A.scrollLeft,V=L.top+A.scrollTop,A=A.offsetParent;return{top:V,left:j}},M=(A,L)=>{u.value.left=`${A+L}px`,u.value.transform="translateX(-100%)"},C=A=>{u.value.left=`${A}px`,u.value.transform="translateX(0)"},D=(A,L)=>{e===uv.left&&C(A),e===uv.right&&M(A,L),e===uv.center&&(u.value.left=`${A+L/2}px`,u.value.transform="translateX(-50%)")},w=()=>{const A=Ro(o);if(A){const L=window.innerHeight,{top:j}=t?_(A):v(A),{left:V,width:x,top:$,height:z}=A.getBoundingClientRect(),G=L-$-z;u.value.top=$>G?`${j-g}px`:`${j}px`,D(V,x)}},S=(A=!0)=>{if(!i){const L=Ro(o);if(t&&typeof t!="boolean")u.value=t(L);else if(L){const{left:j,width:V,height:x}=L.getBoundingClientRect(),{top:$}=t?_(L):v(L);u.value.top=`${x+$+f}px`,D(j,V),A&&n&&N()}}},N=()=>{const A=Ro(o);if(A&&n&&!i){const{height:L,top:j,left:V,width:x}=A.getBoundingClientRect(),{top:$}=t?_(A):v(A),z=window.innerHeight-j-L,G=Ro(r);if(G){const{height:O,left:T,right:P}=G.getBoundingClientRect(),Z=O+L;Z>j&&Z>z?jz?(u.value.top=`${$-O-f}px`,d.value=!0):(S(!1),d.value=!1),T<0?C(V):P>document.documentElement.clientWidth&&M(V,x)}}s("recalculatePosition")};return{openOnTop:d,menuPosition:u,setMenuPosition:S,setInitialPosition:w,recalculatePosition:N}},dle=(e,t,n,r,o,i,s,u,d,f,g,v,_,M,C)=>{const D=Ne(""),w=Ne();$t(w,()=>{C("internalModelChange",w.value)});const S=A=>{let L=null;A?t?bae(A)&&"hours"in A[0]&&"minutes"in A[0]?L=[Bi(null,+A[0].hours,+A[0].minutes,+A[0].seconds),Bi(null,+A[1].hours,+A[1].minutes,+A[1].seconds)]:_ae(A)&&(L=Bi(null,+A.hours,+A.minutes,+A.seconds)):n?Mae(A)&&"month"in A[0]&&"year"in A[0]?(L=[jc(null,+A[0].month,+A[0].year)],A[1]?L[1]=jc(null,+A[1].month,+A[1].year):!A[1]&&o&&(L[1]=null)):Iae(A)&&"month"in A&&"year"in A&&(L=jc(null,+A.month,+A.year)):_?L=hf(new Date,A):f&&Array.isArray(A)?L=A.map(j=>new Date(j)):v&&Array.isArray(A)?L=[new Date(A[0]),new Date(A[1])]:r?Cae(A,o)&&(L=[new Date(A[0]),A[1]?new Date(A[1]):null]):wae(A)&&(L=new Date(A)):L=null,cI(L)?(w.value=L,N()):(w.value=null,D.value="")},N=()=>{if(!w.value)D.value="";else if(!e||typeof e=="string"){const A=j5(e,i,u,n,t,v,_,s);Array.isArray(w.value)&&f?D.value=w.value.map(L=>oy(L,A,d==null?void 0:d.value)).join("; "):D.value=oy(w.value,A,d==null?void 0:d.value,M==null?void 0:M.rangeSeparator)}else t?D.value=e(dI(w.value)):n?D.value=e(fD(w.value)):D.value=e(w.value)};return{parseExternalModelValue:S,formatInputValue:N,internalModelValue:w,inputValue:D,emitModelValue:()=>{if(n)C("update:modelValue",fD(w.value));else if(t)C("update:modelValue",dI(w.value));else if(v)C("update:modelValue",w.value);else if(_)C("update:modelValue",qr(w.value));else{w.value&&r&&o&&w.value.length===1&&w.value.push(null);const A=g?Array.isArray(w.value)?w.value.map(L=>L&&_s(L)):_s(w.value):w.value;C("update:modelValue",A)}N()},checkBeforeEmit:()=>w.value?r?o?w.value.length>=1:w.value.length===2:!!w.value:!1}},fle=typeof window<"u"?window:void 0,yb=()=>{},ple=e=>ZI()?(iL(e),!0):!1,hle=(e,t,n,r)=>{if(!e)return yb;let o=yb;const i=$t(()=>Oe(e),u=>{o(),u&&(u.addEventListener(t,n,r),o=()=>{u.removeEventListener(t,n,r),o=yb})},{immediate:!0,flush:"post"}),s=()=>{i(),o()};return ple(s),s},gle=(e,t,n,r={})=>{const{window:o=fle,event:i="pointerdown"}=r;return o?hle(o,i,s=>{const u=Ro(e),d=Ro(t);!u||!d||u===s.target||s.composedPath().includes(u)||s.composedPath().includes(d)||n(s)},{passive:!0}):void 0},mle=ot({props:Dn({},rae),emits:["update:modelValue","textSubmit","closed","cleared","open","focus","blur","internalModelChange","recalculatePosition","flow-step","focus-prev","updateMonthYear"],setup(e,{expose:t,emit:n}){const r=e,o=pg(),i=Ne(!1),s=cr(r,"modelValue"),u=Ne(null),d=Ne(null),f=Ne(null),g=Ne(null);ui(IT,r.autoApply);const v=Ve(()=>r.formatLocale);ui(J5,v),ui(Y5,cr(r,"textInput")),ui(Ou,cr(r,"arrowNavigation")),On(()=>{j(r.modelValue),r.inline||(window.addEventListener("scroll",Y),window.addEventListener("resize",re)),r.inline&&(i.value=!0)}),pl(()=>{r.inline||(window.removeEventListener("scroll",Y),window.removeEventListener("resize",re))});const _=_c(o,"all"),M=_c(o,"input");$t(s,()=>{j(s.value)},{deep:!0});const{openOnTop:C,menuPosition:D,setMenuPosition:w,recalculatePosition:S,setInitialPosition:N}=cle(r.position,r.altPosition,r.autoPosition,u,d,r.inline,n),{internalModelValue:A,inputValue:L,parseExternalModelValue:j,emitModelValue:V,checkBeforeEmit:x,formatInputValue:$}=dle(r.format,r.timePicker,r.monthPicker,r.range,r.partialRange,r.is24,r.enableTimePicker,r.enableSeconds,v,r.multiDates,r.utc,r.weekPicker,r.yearPicker,r.textInputOptions,n),{clearArrowNav:z}=Ru(),{setMenuFocused:G,setShiftKey:O}=kT(),T=Ve(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:r.inline,dp__flex_display_with_input:r.inlineWithInput})),P=Ve(()=>mD(r.format)?r.format:j5(null,r.is24,r.enableSeconds,r.monthPicker,r.timePicker,r.weekPicker,r.yearPicker,r.enableTimePicker)),Z=Ve(()=>r.previewFormat?r.previewFormat:mD(P.value)?P.value:r.format),K=Ve(()=>typeof r.transitions=="boolean"?r.transitions?hD({}):!1:hD(r.transitions));ui(s0,K);const oe=Ve(()=>r.dark?"dp__theme_dark":"dp__theme_light"),J=Ve(()=>Object.assign(Zse(),r.textInputOptions)),ie=Ve(()=>nae(r.ariaLabels));ui(Lu,ie);const pe=Ve(()=>Qse(r.filters)),ue=Ve(()=>{const ce=Se=>{const Pe={hours:Fs(new Date),minutes:Gs(new Date),seconds:Jl(new Date)};return Object.assign(Pe,Se)};return r.range?r.startTime&&Array.isArray(r.startTime)?[ce(r.startTime[0]),ce(r.startTime[1])]:null:r.startTime&&!Array.isArray(r.startTime)?ce(r.startTime):null}),de=Ve(()=>r.multiCalendars===null?0:typeof r.multiCalendars=="boolean"?r.multiCalendars?2:0:+r.multiCalendars>=2?+r.multiCalendars:2),Y=()=>{i.value&&(r.closeOnScroll?me():r.autoPosition?w():window.removeEventListener("scroll",Y))},re=()=>{i.value&&w()},fe=()=>{!r.disabled&&!r.readonly&&(N(),i.value=!0,br().then(()=>{w(),i.value&&(n("open"),n("focus"))}),i.value||Le(),j(r.modelValue))},Ae=()=>{L.value="",Le(),n("update:modelValue",null),n("cleared"),me()},ye=()=>{const{validate:ce}=K5(r.minDate,r.maxDate,r.disabledDates,r.allowedDates,pe.value,r.disabledWeekDays,r.yearRange),Se=A.value;return!Array.isArray(Se)&&ce(Se)?!0:Array.isArray(Se)?Se.length===2&&ce(Se[0])&&ce(Se[1])?!0:!!ce(Se[0]):!1},le=()=>{x()&&ye()&&(V(),me())},Q=ce=>{V(),r.closeOnAutoApply&&!ce&&me()},ve=(ce=!1)=>{r.autoApply&&(!r.enableTimePicker||r.monthPicker||r.yearPicker||fI(A.value,r.maxTime,r.minTime))&&ye()&&(r.range&&Array.isArray(A.value)?(r.partialRange||A.value.length===2)&&Q(ce):Q(ce))},Le=()=>{A.value=null},me=()=>{r.inline||(i.value&&(i.value=!1,G(!1),O(!1),z(),n("closed"),n("blur"),N(),L.value&&j(s.value)),Le(),d.value&&d.value.unFocus(),se())},W=(ce,Se)=>{if(!ce){A.value=null;return}A.value=ce,Se&&(le(),n("textSubmit"))},te=()=>{r.autoApply&&fI(A.value,r.maxTime,r.minTime)&&V()},se=()=>{f.value&&f.value.focus({preventScroll:!0})},Te=()=>i.value?me():fe();return gle(u,d,me),t({closeMenu:me,selectDate:le,clearValue:Ae,openMenu:fe,onScroll:Y,formatInputValue:$}),(ce,Se)=>(X(),ae("div",{class:st(Oe(T))},[B("span",{tabindex:"-1",ref_key:"focusRefBefore",ref:g},null,512),St(lae,Eo({ref_key:"inputRef",ref:d},{placeholder:ce.placeholder,hideInputIcon:ce.hideInputIcon,readonly:ce.readonly,disabled:ce.disabled,inputClassName:ce.inputClassName,clearable:ce.clearable,state:ce.state,inline:ce.inline,inlineWithInput:ce.inlineWithInput,textInput:ce.textInput,textInputOptions:Oe(J),range:ce.range,isMenuOpen:i.value,pattern:Oe(P),autoApply:ce.autoApply,uid:ce.uid,openMenuOnFocus:ce.openMenuOnFocus,required:ce.required,name:ce.name,autocomplete:ce.autocomplete},{"input-value":Oe(L),"onUpdate:input-value":Se[0]||(Se[0]=Pe=>gr(L)?L.value=Pe:null),onClear:Ae,onOpen:fe,onSetInputDate:W,onSetEmptyDate:Oe(V),onSelectDate:le,onToggle:Te,onClose:me,onFocusPrev:Se[1]||(Se[1]=Pe=>ce.$emit("focus-prev"))}),zi({_:2},[qt(Oe(M),(Pe,xe)=>({name:Pe,fn:xt(He=>[Ft(ce.$slots,Pe,ql(Vl(He)))])}))]),1040,["input-value","onSetEmptyDate"]),B("span",{tabindex:"-1",ref_key:"focusRef",ref:f},null,512),i.value?(X(),It(yC,{key:0,to:ce.teleport,disabled:ce.inline},[i.value?(X(),It(ule,Eo({key:0,ref_key:"dpMenuRef",ref:u,class:Oe(oe),style:Oe(D)},{weekNumbers:ce.weekNumbers,weekStart:ce.weekStart,disableMonthYearSelect:ce.disableMonthYearSelect,menuClassName:ce.menuClassName,calendarClassName:ce.calendarClassName,yearRange:ce.yearRange,range:ce.range,multiCalendars:Oe(de),multiCalendarsSolo:ce.multiCalendarsSolo,multiStatic:ce.multiStatic,calendarCellClassName:ce.calendarCellClassName,enableTimePicker:ce.enableTimePicker,is24:ce.is24,hoursIncrement:ce.hoursIncrement,minutesIncrement:ce.minutesIncrement,hoursGridIncrement:ce.hoursGridIncrement,minutesGridIncrement:ce.minutesGridIncrement,minDate:ce.minDate,maxDate:ce.maxDate,autoApply:ce.autoApply,selectText:ce.selectText,cancelText:ce.cancelText,previewFormat:Oe(Z),locale:ce.locale,weekNumName:ce.weekNumName,disabledDates:ce.disabledDates,filters:Oe(pe),minTime:ce.minTime,maxTime:ce.maxTime,inline:ce.inline,openOnTop:Oe(C),monthPicker:ce.monthPicker,timePicker:ce.timePicker,monthNameFormat:ce.monthNameFormat,startDate:ce.startDate,startTime:Oe(ue),monthYearComponent:ce.monthYearComponent,timePickerComponent:ce.timePickerComponent,actionRowComponent:ce.actionRowComponent,customProps:ce.customProps,hideOffsetDates:ce.hideOffsetDates,autoRange:ce.autoRange,noToday:ce.noToday,noHoursOverlay:ce.noHoursOverlay,noMinutesOverlay:ce.noMinutesOverlay,disabledWeekDays:ce.disabledWeekDays,allowedDates:ce.allowedDates,showNowButton:ce.showNowButton,nowButtonLabel:ce.nowButtonLabel,monthChangeOnScroll:ce.monthChangeOnScroll,markers:ce.markers,uid:ce.uid,modeHeight:ce.modeHeight,enableSeconds:ce.enableSeconds,secondsIncrement:ce.secondsIncrement,secondsGridIncrement:ce.secondsGridIncrement,noSecondsOverlay:ce.noSecondsOverlay,escClose:ce.escClose,spaceConfirm:ce.spaceConfirm,monthChangeOnArrows:ce.monthChangeOnArrows,textInput:ce.textInput,disabled:ce.disabled,readonly:ce.readonly,multiDates:ce.multiDates,presetRanges:ce.presetRanges,flow:ce.flow,preventMinMaxNavigation:ce.preventMinMaxNavigation,minRange:ce.minRange,maxRange:ce.maxRange,fixedStart:ce.fixedStart,fixedEnd:ce.fixedEnd,multiDatesLimit:ce.multiDatesLimit,reverseYears:ce.reverseYears,keepActionRow:ce.keepActionRow,weekPicker:ce.weekPicker,noSwipe:ce.noSwipe,vertical:ce.vertical,arrowNavigation:ce.arrowNavigation,yearPicker:ce.yearPicker},{internalModelValue:Oe(A),"onUpdate:internalModelValue":Se[2]||(Se[2]=Pe=>gr(A)?A.value=Pe:null),onClosePicker:me,onSelectDate:le,onDpOpen:Oe(S),onAutoApply:ve,onTimeUpdate:te,onFlowStep:Se[3]||(Se[3]=Pe=>ce.$emit("flow-step",Pe)),onUpdateMonthYear:Se[4]||(Se[4]=Pe=>ce.$emit("updateMonthYear",Pe))}),zi({_:2},[qt(Oe(_),(Pe,xe)=>({name:Pe,fn:xt(He=>[Ft(ce.$slots,Pe,ql(Vl(Dn({},He))))])}))]),1040,["class","style","internalModelValue","onDpOpen"])):Ce("",!0)],8,["to","disabled"])):Ce("",!0)],2))}});var DT=(()=>{const e=mle;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),vle=Object.freeze(Object.defineProperty({__proto__:null,default:DT},Symbol.toStringTag,{value:"Module"}));Object.entries(vle).forEach(([e,t])=>{e!=="default"&&(DT[e]=t)});const cv=ot({props:{userInfo:{type:Object,default:()=>({})},isH5:{type:Boolean,default:()=>!1}},components:{Datepicker:DT},setup(e,t){const n=cv==null?void 0:cv.TUIServer,r=zt({profile:{},isEdit:!1,avatarList:[{name:"avatar_01",avatar:" https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_1.png"},{name:"avatar_02",avatar:" https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_2.png"},{name:"avatar_03",avatar:" https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png"},{name:"avatar_04",avatar:" https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_4.png"},{name:"avatar_05",avatar:" https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_5.png"},{name:"avatar_06",avatar:" https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_6.png"}],type:[{label:"男",type:n.TUICore.TIM.TYPES.GENDER_MALE},{label:"女",type:n.TUICore.TIM.TYPES.GENDER_FEMALE}],genderLabel:{[n.TUICore.TIM.TYPES.GENDER_MALE]:"男",[n.TUICore.TIM.TYPES.GENDER_FEMALE]:"女",[n.TUICore.TIM.TYPES.GENDER_UNKNOWN]:"不显示"},setName:"",editConfig:{title:"",list:[],type:"",subText:"",placeholder:"",value:""}}),o=D=>{const w=D.getDate()>9?D.getDate():`0${D.getDate()}`,S=D.getMonth()>8?D.getMonth()+1:`0${D.getMonth()+1}`;return`${D.getFullYear()}${S}${w}`};nn(()=>{r.profile=JSON.parse(JSON.stringify(e.userInfo))});const i=Ve(()=>{let D=r.profile.birthday;return r.setName==="birthday"&&e.isH5&&(D=r.editConfig.value),s(D)}),s=D=>{const w=`${D}`;if(w.length===8){const S=w.slice(0,4),N=w.slice(4,6),A=w.slice(-2);return`${S}-${N}-${A}`}return""},u=D=>{r.profile.gender=D.type},d=D=>{r.profile.avatar=D.avatar},f=D=>{e.isH5?r.editConfig.value=D?Number(o(D)):0:r.profile.birthday=D?Number(o(D)):0},g=()=>{e.isH5&&(r.profile[r.setName]=r.editConfig.value,C()),t.emit("submit",r.profile)},v=()=>{t.emit("cancel",r.profile)},_=D=>{switch(r.editConfig.value=`${r.profile[D]}`,r.setName=D,D){case"avatar":r.editConfig.title="选择头像",r.editConfig.list=r.avatarList,r.editConfig.type="select";break;case"nick":r.editConfig.title="设置昵称",r.editConfig.subText="仅限中文、字母、数字和下划线,2-20个字",r.editConfig.placeholder="请输入昵称",r.editConfig.type="text";break;case"gender":r.editConfig.title="性别选择",r.editConfig.list=r.type,r.editConfig.type="select";break;case"selfSignature":r.editConfig.title="个性签名",r.editConfig.type="textarea",r.editConfig.placeholder="请输入内容";break;case"birthday":r.editConfig.title="出生年月",r.editConfig.type="date",r.editConfig.placeholder="请选择出生日期";break}},M=D=>{r.editConfig.value=(D==null?void 0:D.avatar)||(D==null?void 0:D.type)},C=()=>{r.setName="",r.editConfig={title:"",list:[],type:"",subText:"",placeholder:"",value:""}};return{...Jt(r),showChooseGender:u,chooseAvatar:d,showBirthday:f,birthday:i,submit:g,cancel:v,setProfile:_,choose:M,closeMask:C,format:o}}});const yle={class:"edit-header"},_le={class:"edit-header-title"},ble={class:"edit-list"},Mle={class:"edit-list-item space-top"},Ile={key:0},Cle=["src"],Tle={key:1,class:"avatar-list"},wle=["onClick"],Sle=["src"],kle={key:0,class:"icon icon-right"},Dle={class:"edit-list-item space-top"},Ele={key:0},Ale={key:0,class:"icon icon-right"},Lle={class:"edit-list-item"},Ole={class:"edit-list-item-content"},Rle={class:"edit-list-item space-top"},Nle={key:0},Ple={key:0,class:"icon icon-right"},xle={class:"edit-list-item"},Ule={key:0},Fle={key:1,class:"gender-list"},Gle=["onClick"],$le={class:"name"},Ble={key:0,class:"icon icon-right"},Hle={class:"edit-list-item"},qle={key:0},Vle={key:0,class:"icon icon-right"},zle={key:0,class:"edit-footer"},jle={class:"mask-main"},Wle={class:"edit-h5-header"},Kle={class:"edit-h5-main"},Yle={key:0,class:"list"},Jle=["onClick"],Xle=["src"],Zle={key:1,class:"input"},Qle=["placeholder"],eue=["type","placeholder"],tue={key:2},nue={class:"edit-h5-footer"},rue=["disabled"];function oue(e,t,n,r,o,i){const s=Yt("Datepicker");return X(),ae("div",{class:st(["edit",[e.isH5?"edit-h5":""]])},[B("header",yle,[e.isH5?(X(),ae("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...u)=>e.cancel&&e.cancel(...u))})):Ce("",!0),B("h1",_le,Ee(e.$t("TUIProfile.资料设置")),1)]),B("ul",ble,[B("li",Mle,[B("main",{class:"edit-list-item-content",onClick:t[1]||(t[1]=u=>e.setProfile("avatar"))},[B("label",null,Ee(e.$t("TUIProfile.头像")),1),e.isH5?(X(),ae("span",Ile,[B("img",{src:e.profile.avatar?e.profile.avatar:"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,Cle)])):(X(),ae("ul",Tle,[(X(!0),ae(dt,null,qt(e.avatarList,(u,d)=>(X(),ae("li",{class:"avatar-list-item",key:d,onClick:f=>e.chooseAvatar(u)},[B("img",{class:st([e.profile.avatar===u.avatar&&"selected"]),src:u.avatar},null,10,Sle)],8,wle))),128))]))]),e.isH5?(X(),ae("i",kle)):Ce("",!0)]),B("li",Dle,[B("main",{class:"edit-list-item-content",onClick:t[3]||(t[3]=u=>e.setProfile("nick"))},[B("label",null,Ee(e.$t("TUIProfile.昵称")),1),e.isH5?(X(),ae("span",Ele,Ee(e.profile.nick),1)):$n((X(),ae("input",{key:1,type:"text","onUpdate:modelValue":t[2]||(t[2]=u=>e.profile.nick=u)},null,512)),[[al,e.profile.nick]])]),e.isH5?(X(),ae("i",Ale)):Ce("",!0)]),B("li",Lle,[B("main",Ole,[B("label",null,Ee(e.$t("TUIProfile.账号")),1),B("span",null,Ee(e.profile.userID),1)])]),B("li",Rle,[B("main",{class:"edit-list-item-content",onClick:t[5]||(t[5]=u=>e.setProfile("selfSignature"))},[B("label",null,Ee(e.$t("TUIProfile.个性签名")),1),e.isH5?(X(),ae("span",Nle,Ee(e.profile.selfSignature),1)):$n((X(),ae("input",{key:1,type:"text","onUpdate:modelValue":t[4]||(t[4]=u=>e.profile.selfSignature=u)},null,512)),[[al,e.profile.selfSignature]])]),e.isH5?(X(),ae("i",Ple)):Ce("",!0)]),B("li",xle,[B("main",{class:"edit-list-item-content",onClick:t[6]||(t[6]=u=>e.setProfile("gender"))},[B("label",null,Ee(e.$t("TUIProfile.性别")),1),e.isH5?(X(),ae("span",Ule,Ee(e.profile.gender?e.$t(`TUIProfile.${e.genderLabel[e.profile.gender]}`):""),1)):(X(),ae("ul",Fle,[(X(!0),ae(dt,null,qt(e.type,(u,d)=>(X(),ae("li",{class:"gender-list-item",key:d,onClick:f=>e.showChooseGender(u)},[B("i",{class:st(["gender",[e.profile.gender===u.type&&"gender-selected"]])},null,2),B("p",$le,Ee(e.$t(`TUIProfile.${u.label}`)),1)],8,Gle))),128))]))]),e.isH5?(X(),ae("i",Ble)):Ce("",!0)]),B("li",Hle,[B("main",{class:"edit-list-item-content",onClick:t[7]||(t[7]=u=>e.setProfile("birthday"))},[B("label",null,Ee(e.$t("TUIProfile.出生年月")),1),e.isH5?(X(),ae("span",qle,Ee(e.profile.birthday),1)):(X(),It(s,{key:1,placeholder:e.$t("TUIProfile.请选择出生日期"),enableTimePicker:!1,format:e.format,previewFormat:e.format,modelValue:e.birthday,"onUpdate:modelValue":e.showBirthday},null,8,["placeholder","format","previewFormat","modelValue","onUpdate:modelValue"]))]),e.isH5?(X(),ae("i",Vle)):Ce("",!0)])]),e.isH5?Ce("",!0):(X(),ae("footer",zle,[B("button",{class:"btn-default",onClick:t[8]||(t[8]=(...u)=>e.cancel&&e.cancel(...u))},Ee(e.$t("TUIProfile.取消")),1),B("button",{class:"btn-submit",onClick:t[9]||(t[9]=(...u)=>e.submit&&e.submit(...u))},Ee(e.$t("TUIProfile.保存")),1)])),e.setName&&e.isH5?(X(),ae("div",{key:1,class:"mask",onClick:t[14]||(t[14]=bn((...u)=>e.closeMask&&e.closeMask(...u),["self"]))},[B("div",jle,[B("header",Wle,[B("h1",null,Ee(e.$t(`TUIProfile.${e.editConfig.title}`)),1),B("span",{class:"close",onClick:t[10]||(t[10]=(...u)=>e.closeMask&&e.closeMask(...u))},Ee(e.$t("关闭")),1)]),B("main",Kle,[e.editConfig.type==="select"?(X(),ae("ul",Yle,[(X(!0),ae(dt,null,qt(e.editConfig.list,(u,d)=>(X(),ae("li",{class:"list-item",key:d,onClick:f=>e.choose(u)},[u!=null&&u.avatar?(X(),ae("img",{key:0,class:st([e.editConfig.value===u.avatar&&"selected"]),src:u.avatar},null,10,Xle)):(X(),ae("span",{key:1,class:st([e.editConfig.value===u.type&&"selected"])},Ee(e.$t(`TUIProfile.${u.label}`)),3))],8,Jle))),128))])):(X(),ae("div",Zle,[e.editConfig.type==="textarea"?$n((X(),ae("textarea",{key:0,placeholder:e.editConfig.placeholder,"onUpdate:modelValue":t[11]||(t[11]=u=>e.editConfig.value=u)},null,8,Qle)),[[al,e.editConfig.value]]):e.editConfig.type==="date"?(X(),It(s,{key:1,class:"datePicker",placeholder:e.$t("TUIProfile.请选择出生日期"),enableTimePicker:!1,format:e.format,previewFormat:e.format,modelValue:e.birthday,"onUpdate:modelValue":e.showBirthday},null,8,["placeholder","format","previewFormat","modelValue","onUpdate:modelValue"])):$n((X(),ae("input",{key:2,type:e.editConfig.type,placeholder:e.$t(`TUIProfile.${e.editConfig.placeholder}`),"onUpdate:modelValue":t[12]||(t[12]=u=>e.editConfig.value=u)},null,8,eue)),[[R7,e.editConfig.value]])])),e.editConfig.subText?(X(),ae("sub",tue,Ee(e.$t(`TUIProfile.${e.editConfig.subText}`)),1)):Ce("",!0)]),B("footer",nue,[B("button",{class:"btn btn-submit",disabled:!e.editConfig.value,onClick:t[13]||(t[13]=(...u)=>e.submit&&e.submit(...u))},Ee(e.$t("确定")),9,rue)])])])):Ce("",!0)],2)}const bD=jt(cv,[["render",oue],["__scopeId","data-v-600eeaf7"]]),dv=ot({name:"TUIProfile",components:{TUIProfileEdit:bD},setup(e,t){var f;const n=dv==null?void 0:dv.TUIServer,r=zt({profile:{},isEdit:!1,genderLabel:{[n.TUICore.TIM.TYPES.GENDER_MALE]:"男",[n.TUICore.TIM.TYPES.GENDER_FEMALE]:"女",[n.TUICore.TIM.TYPES.GENDER_UNKNOWN]:"不显示"},env:n.TUICore.TUIEnv});bD.TUIServer=n,n.bind(r);const o=((f=window==null?void 0:window.TUIKitTUICore)==null?void 0:f.isOfficial)&&ki&&ki()||{},i=async g=>{var _;const v={nick:g.nick,avatar:g.avatar,gender:g.gender||n.TUICore.TIM.TYPES.GENDER_UNKNOWN,selfSignature:g.selfSignature,birthday:g.birthday};n.TUICore.getStore().TUIProfile.profile.nick!==g.nick&&(_=window==null?void 0:window.TUIKitTUICore)!=null&&_.isOfficial&&o!=null&&o.commit&&(o==null||o.commit("handleTask",2));try{await n.updateMyProfile(v)}catch(M){console.log(M)}r.env.isH5||s()},s=()=>{r.env.isH5?r.isEdit=!1:u()},u=()=>{t.emit("changeStatus")},d=()=>{r.env.isH5&&(r.isEdit=!0)};return{...Jt(r),submit:i,cancel:s,changeStatus:u,toggleEdit:d}}});const iue={class:"profile-header"},sue={class:"profile-avatar"},aue=["src"],lue={class:"profile-main"},uue={class:"profile-main-item"},cue={class:"profile-main-name"},due={key:0,class:"gender"},fue={class:"profile-main-item"},pue={class:"profile-main-label"},hue={key:0,class:"profile-main-item"},gue={class:"profile-main-label"},mue={key:0,class:"profile-main"},vue={class:"profile-main-item"},yue={class:"profile-main-label"},_ue={class:"profile-main-item"},bue={class:"profile-main-label"},Mue={key:1,class:"icon icon-right"};function Iue(e,t,n,r,o,i){const s=Yt("TUIProfileEdit");return X(),ae("div",{class:st(["TUI-profile",[e.env.isH5?"TUI-profile-h5":""]])},[e.isEdit?(X(),It(s,{key:1,userInfo:e.profile,isH5:e.env.isH5,onSubmit:e.submit,onCancel:e.cancel},null,8,["userInfo","isH5","onSubmit","onCancel"])):(X(),ae("div",{key:0,class:"profile",onClick:t[0]||(t[0]=(...u)=>e.toggleEdit&&e.toggleEdit(...u))},[B("header",iue,[B("aside",sue,[B("img",{class:"avatar",src:e.profile.avatar?e.profile.avatar:"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,aue)]),B("ul",lue,[B("li",uue,[B("h1",cue,Ee(e.profile.nick||"-"),1),e.env.isH5?Ce("",!0):(X(),ae("p",due,Ee(e.profile.gender?e.$t(`TUIProfile.${e.genderLabel[e.profile.gender]}`):""),1))]),B("li",fue,[B("label",pue,Ee(e.$t("TUIProfile.用户ID"))+":",1),B("span",null,Ee(e.profile.userID),1)]),e.env.isH5?(X(),ae("li",hue,[B("label",gue,Ee(e.$t("TUIProfile.个性签名"))+":",1),B("span",null,Ee(e.profile.selfSignature||e.$t("TUIProfile.暂未设置")),1)])):Ce("",!0)])]),e.env.isH5?Ce("",!0):(X(),ae("ul",mue,[B("li",vue,[B("label",yue,Ee(e.$t("TUIProfile.个性签名")),1),B("span",null,Ee(e.profile.selfSignature||e.$t("TUIProfile.暂未设置")),1)]),B("li",_ue,[B("label",bue,Ee(e.$t("TUIProfile.出生年月")),1),B("span",null,Ee(e.profile.birthday?e.profile.birthday:e.$t("TUIProfile.暂未设置")),1)])])),e.env.isH5?(X(),ae("i",Mue)):Ce("",!0)]))],2)}const pI=jt(dv,[["render",Iue],["__scopeId","data-v-5741fe51"]]),Cue=e=>{pI.TUIServer=Xl.server,e.component(Xl.name,pI)},Tue=e=>(Xl.server=new I5(e),e.component(Xl.name,Xl),Xl),Xl={name:"TUIProfile",component:pI,server:I5,install:Cue,plugin:Tue},wue={};class aP extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});Kt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIGroup",wue,this.updateStore.bind(this))}destroyed(){this.unbindTIMEvent()}updateStore(n,r){this.currentStore.groupList=n.groupList,this.currentStore.searchGroup=n.searchGroup}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED,this.handleGroupAttributesUpdated,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated),this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED,this.handleGroupAttributesUpdated)}handleGroupListUpdated(n){this.store.groupList=n.data}handleGroupAttributesUpdated(n){const{groupID:r,groupAttributes:o}=n.data;console.log(r,o)}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUIGroup",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}async getGroupList(n){return this.handlePromiseCallback(async(r,o)=>{try{let i={};n?i=await this.TUICore.tim.getGroupList(n):i=await this.TUICore.tim.getGroupList(),this.store.groupList=i.data.groupList,r(i)}catch(i){o(i)}})}getGroupProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupProfile(n);this.store.groupList=i.data.groupList,r(i)}catch(i){o(i)}})}createGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.createGroup(n);r(i)}catch(i){o(i)}})}dismissGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.dismissGroup(n);this.store.groupProfile=i.data.group,r(i)}catch(i){o(i)}})}updateGroupProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.updateGroupProfile(n);this.store.groupProfile=i.data.group,r(i)}catch(i){o(i)}})}joinGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.joinGroup(n);r(i)}catch(i){o(i)}})}quitGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.quitGroup(n);r(i)}catch(i){o(i)}})}searchGroupByID(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.searchGroupByID(n);this.store.searchGroup=i.data.group,r(i)}catch(i){o(i)}})}getGroupOnlineMemberCount(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupOnlineMemberCount(n);r(i)}catch(i){o(i)}})}changeGroupOwner(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.changeGroupOwner(n);r(i)}catch(i){o(i)}})}handleGroupApplication(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.handleGroupApplication(n);r(i)}catch(i){o(i)}})}initGroupAttributes(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.initGroupAttributes(n);r(i)}catch(i){o(i)}})}setGroupAttributes(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.setGroupAttributes(n);r(i)}catch(i){o(i)}})}deleteGroupAttributes(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.deleteGroupAttributes(n);r(i)}catch(i){o(i)}})}getGroupAttributes(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupAttributes(n);r(i)}catch(i){o(i)}})}getGroupMemberList(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupMemberList(n);r(i)}catch(i){o(i)}})}addGroupMember(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.addGroupMember(n);r(i)}catch(i){o(i)}})}deleteGroupMember(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.deleteGroupMember(n);r(i)}catch(i){o(i)}})}setGroupMemberMuteTime(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.setGroupMemberMuteTime(n);r(i)}catch(i){o(i)}})}setGroupMemberRole(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.setGroupMemberRole(n);r(i)}catch(i){o(i)}})}setGroupMemberNameCard(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.setGroupMemberNameCard(n);r(i)}catch(i){o(i)}})}getGroupMemberProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupMemberProfile(n);r(i)}catch(i){o(i)}})}async bind(n){return this.currentStore=n,await this.getGroupList(),this.currentStore}}const lP=ot({name:"TUIGroup",components:{DialogTUI:jy},props:{displayOnlineStatus:{type:Boolean,default:!1}},setup(e){const t=lP.TUIServer,n=zt({loading:!0,page:1,rows:100,keyword:"",finshed:!1,groupList:[],searchGroup:[],searchID:"",currentGroup:null,netWork:"",userStatusList:new Map,dialogShow:!1,dialogItem:{}}),r=_=>_>0?gg(_*1e3):"",o=async _=>{var M;try{if((M=(await UR({id:_.groupId})).data)!=null&&M.id){const D=`GROUP${_.groupId}`;t.TUICore.TUIServer.TUIConversation.getConversationProfile(D).then(w=>{t.TUICore.TUIServer.TUIConversation.handleCurrentConversation(w.data.conversation),n.currentGroup={}})}else n.dialogShow=!0,n.dialogItem=_}catch{}},i=()=>{const _=n.groupList.findIndex(M=>M.groupId==n.dialogItem.groupId);n.groupList.splice(_,1)},s=Ve(()=>!0),u=async()=>{n.loading=!0;try{const _=await Gj({keyword:n.keyword,page:n.page,rows:n.rows,roleType:"TEACHER"});n.groupList.push(..._.data.rows||[]),n.finshed=_.data.pages<=_.data.current}catch{}n.loading=!1},d=_=>{const M=n.groupList.findIndex(C=>C.groupId==_);n.groupList.splice(M,1)};On(()=>{u(),au.on("removeGroup",_=>{d(_)})}),pl(()=>{au.off("removeGroup",d)});const f=_=>{console.log(_,"val"),n.page=1,n.keyword=_,n.groupList=[],u()},g=Vy(_=>{f(_)},500),v=_=>{_.stopPropagation(),_.code==="Enter"&&g(n.keyword)};return{...Jt(n),handleListItem:o,handleManage:i,isNetwork:s,handleAvatar:kC,handleName:jh,handleAt:DO,handleItemTime:r,noSearch:f,onKeyup:v,debouncedRequest:g}}});const Jf=e=>(Mr("data-v-ec29dec3"),e=e(),Ir(),e),Sue={style:{height:"100%"}},kue={class:"sectionSearch"},Due=Jf(()=>B("span",{class:"icon-search-input"},null,-1)),Eue={class:"TUI-group"},Aue={class:"TUI-conversation-list"},Lue={class:"TUI-contact-left"},Oue={class:"TUI-contact-list"},Rue=["onClick"],Nue={class:"left"},Pue=["src"],xue={class:"content-header"},Uue={class:"name"},Fue={class:"middle-box"},Gue={class:"content-footer"},$ue=Jf(()=>B("span",{class:"time"},null,-1)),Bue={key:0,class:"mute-icon",src:M5},Hue=Jf(()=>B("i",null,null,-1)),que={key:0,class:"theEmtpy",style:{height:"90%"}},Vue=Jf(()=>B("img",{class:"emptyImg",src:ud},null,-1)),zue=Jf(()=>B("p",null,"暂无数据",-1)),jue=[Vue,zue],Wue=Jf(()=>B("p",null,"该群已解散,是否删除?",-1));function Kue(e,t,n,r,o,i){const s=Yt("n-input"),u=Yt("DialogTUI");return X(),ae("div",Sue,[B("div",kue,[St(s,{class:"TheSearch",style:{"--n-font-size":"12px","--n-height":"32px","--n-caret-color":"#198cfe","--n-border-hover":"1px solid #198cfe","--n-border-focus":"1px solid #198cfe","--n-loading-color":"#198cfe","--n-box-shadow-focus":"0 0 0 2px rgba(25 140 254, 0.2)"},round:"",clearable:"",placeholder:"请输入名称",value:e.keyword,"onUpdate:value":t[0]||(t[0]=d=>e.keyword=d),onClear:t[1]||(t[1]=()=>{e.debouncedRequest("")}),onKeyup:e.onKeyup},{prefix:xt(()=>[Due]),_:1},8,["value","onKeyup"])]),B("div",Eue,[B("main",Aue,[B("aside",Lue,[B("ul",Oue,[(X(!0),ae(dt,null,qt(e.groupList,(d,f)=>{var g;return X(),ae("li",{class:"TUI-contact-list-item",key:f,onClick:v=>e.handleListItem(d)},[B("aside",Nue,[B("img",{class:"avatar",src:d.img||"https://oss.dayaedu.com/news-info/07/1690775328089.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690775328089.png'"},null,8,Pue)]),B("div",xue,[B("label",null,[B("p",Uue,Ee(d.name),1)]),B("div",Fue,[B("p",null,"共"+Ee(d.memberNum||0)+"人",1)])]),B("div",Gue,[$ue,((g=d.selfInfo)==null?void 0:g.messageRemindType)==="AcceptNotNotify"?(X(),ae("img",Bue)):Ce("",!0),Hue])],8,Rue)}),128))])])]),!e.loading&&e.groupList.length<=0?(X(),ae("div",que,jue)):Ce("",!0),St(u,{show:e.dialogShow,isHeaderShow:!0,title:"提示","is-footer-show":!0,onSubmit:t[2]||(t[2]=d=>e.handleManage()),"onUpdate:show":t[3]||(t[3]=d=>e.dialogShow=d)},{default:xt(()=>[Wue]),_:1},8,["show"])])])}const hI=jt(lP,[["render",Kue],["__scopeId","data-v-ec29dec3"]]),Yue=e=>{hI.TUIServer=Zl.server,e.component(Zl.name,hI)},Jue=e=>(Zl.server=new aP(e),e.component(Zl.name,Zl),Zl),Zl={name:"TUIGroup",component:hI,server:aP,install:Yue,plugin:Jue},Xue={};class uP extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});Kt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIPerson",Xue,this.updateStore.bind(this))}destroyed(){this.unbindTIMEvent()}updateStore(n,r){this.currentStore.groupList=n.groupList,this.currentStore.searchGroup=n.searchGroup}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED,this.handleGroupAttributesUpdated,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated),this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED,this.handleGroupAttributesUpdated)}handleGroupListUpdated(n){this.store.groupList=n.data}handleGroupAttributesUpdated(n){const{groupID:r,groupAttributes:o}=n.data;console.log(r,o)}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUIGroup",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}async getFriendList(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getFriendList();this.currentStore.friendList=o.data,this.currentStore.userIDList=this.currentStore.friendList.map(i=>i.userID)||[],n(o)}catch(o){r(o)}})}async bind(n,r){return this.currentStore=n,await this.getFriendList(),r&&r(this.currentStore),this.currentStore}}const cP=ot({name:"TUIPerson",setup(e){const t=cP.TUIServer,n=zt({loading:!0,page:1,rows:100,keyword:"",finshed:!1,friendList:[],searchGroup:[],searchID:"",currentGroup:null}),r=async()=>{n.loading=!0;try{const d=await xR({keyword:n.keyword,page:n.page,rows:n.rows,roleType:"TEACHER"});n.friendList.push(...d.data.rows||[]),n.finshed=d.data.pages<=d.data.current}catch{}n.loading=!1},o=async d=>{const f=`C2C${d.imUserId}`;t.TUICore.TUIServer.TUIConversation.getConversationProfile(f).then(g=>{t.TUICore.TUIServer.TUIConversation.handleCurrentConversation(g.data.conversation),n.currentGroup={}})},i=d=>{n.page=1,n.keyword=d,n.friendList=[],r()};On(()=>{r()});const s=Vy(d=>{i(d)},500),u=d=>{d.stopPropagation(),d.code==="Enter"&&s(n.keyword)};return{...Jt(n),handleListItem:o,noSearch:i,onKeyup:u,debouncedRequest:s}}});const ET=e=>(Mr("data-v-edb730d3"),e=e(),Ir(),e),Zue={style:{height:"100%"}},Que={class:"sectionSearch"},ece=ET(()=>B("span",{class:"icon-search-input"},null,-1)),tce={class:"TUI-person"},nce={class:"TUI-conversation-list"},rce={class:"TUI-contact-left"},oce={class:"TUI-contact-list"},ice=["onClick"],sce={class:"left"},ace=["src"],lce={class:"content-header"},uce={class:"name"},cce={class:"middle-box"},dce={key:0,class:"theEmtpy",style:{height:"90%"}},fce=ET(()=>B("img",{class:"emptyImg",src:ud},null,-1)),pce=ET(()=>B("p",null,"暂无数据",-1)),hce=[fce,pce];function gce(e,t,n,r,o,i){const s=Yt("n-input");return X(),ae("div",Zue,[B("div",Que,[St(s,{class:"TheSearch",style:{"--n-font-size":"12px","--n-height":"32px","--n-caret-color":"#198cfe","--n-border-hover":"1px solid #198cfe","--n-border-focus":"1px solid #198cfe","--n-loading-color":"#198cfe","--n-box-shadow-focus":"0 0 0 2px rgba(25 140 254, 0.2)"},round:"",clearable:"",placeholder:"请输入名称",value:e.keyword,"onUpdate:value":t[0]||(t[0]=u=>e.keyword=u),onClear:t[1]||(t[1]=()=>{e.debouncedRequest("")}),onKeyup:e.onKeyup},{prefix:xt(()=>[ece]),_:1},8,["value","onKeyup"])]),B("div",tce,[B("main",nce,[B("aside",rce,[B("ul",oce,[(X(!0),ae(dt,null,qt(e.friendList,(u,d)=>(X(),ae("li",{class:"TUI-contact-list-item",key:d,onClick:f=>e.handleListItem(u)},[B("aside",sce,[B("img",{class:"avatar",src:u.friendAvatar||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,ace)]),B("div",lce,[B("label",null,[B("p",uce,Ee(u.friendNickname),1)]),B("div",cce,[B("p",null,Ee(u.subjectName),1)])])],8,ice))),128))])])]),!e.loading&&e.friendList.length<=0?(X(),ae("div",dce,hce)):Ce("",!0)])])}const gI=jt(cP,[["render",gce],["__scopeId","data-v-edb730d3"]]),mce=e=>{gI.TUIServer=Ql.server,e.component(Ql.name,gI)},vce=e=>(Ql.server=new uP(e),e.component(Ql.name,Ql),Ql),Ql={name:"TUIPerson",component:gI,server:uP,install:mce,plugin:vce},yce={};class dP extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});Kt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIContact",yce,this.updateStore.bind(this))}destroyed(){this.unbindTIMEvent()}updateStore(n,r){this.currentStore.groupList=n.groupList,this.currentStore.searchGroup=n.searchGroup,this.currentStore.systemConversation=n.systemConversation,this.currentStore.systemMessageList=n.systemMessageList}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED,this.handleGroupAttributesUpdated,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.CONVERSATION_LIST_UPDATED,this.handleConversationListUpdate,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.FRIEND_LIST_UPDATED,this.handleFriendListUpdated,this),this.TUICore.tim.on(this.TUICore.TIM.EVENT.USER_STATUS_UPDATED,this.handleUserStatusUpdated,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED,this.handleGroupListUpdated),this.TUICore.tim.off(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED,this.handleGroupAttributesUpdated),this.TUICore.tim.off(this.TUICore.TIM.EVENT.CONVERSATION_LIST_UPDATED,this.handleConversationListUpdate),this.TUICore.tim.off(this.TUICore.TIM.EVENT.FRIEND_LIST_UPDATED,this.handleFriendListUpdated),this.TUICore.tim.off(this.TUICore.TIM.EVENT.USER_STATUS_UPDATED,this.handleUserStatusUpdated)}handleGroupListUpdated(n){this.store.groupList=n.data}handleGroupAttributesUpdated(n){const{groupID:r,groupAttributes:o}=n.data;console.log(r,o)}handleConversationListUpdate(n){this.handleFilterSystem(n.data)}handleFriendListUpdated(n){this.currentStore.friendList=n.data,this.currentStore.userIDList=this.currentStore.friendList.map(r=>r.userID)}handleUserStatusUpdated(n){n.data.forEach(o=>{var d,f,g,v,_,M,C;const{userID:i,statusType:s,customStatus:u}=o;(f=(d=this.currentStore)==null?void 0:d.userStatusList)==null||f.set(i,{statusType:s,customStatus:u}),(C=(M=(_=(v=(g=this.TUICore)==null?void 0:g.TUIServer)==null?void 0:v.TUIConversation)==null?void 0:_.currentStore)==null?void 0:M.userStatusList)==null||C.set(i,{statusType:s,customStatus:u})})}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUIContact",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}handleFilterSystem(n){const r={allConversationList:n,systemConversationList:[]};r.systemConversationList=n.filter(i=>i.type===this.TUICore.TIM.TYPES.CONV_SYSTEM),this.store.allConversationList=r.allConversationList,this.store.systemConversationList=r.systemConversationList;const[o]=r.systemConversationList;return this.store.systemConversation=o,r}async getConversationList(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getConversationList();this.handleFilterSystem(o.data.conversationList),n(o)}catch(o){r(o)}})}async getSystemMessageList(){const n={conversationID:this.store.systemConversation.conversationID,count:15};return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getMessageList(n);this.store.systemMessageList=i.data.messageList,r(i)}catch(i){o(i)}})}async setMessageRead(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.setMessageRead({conversationID:this.store.systemConversation.conversationID});n(o)}catch(o){r(o)}})}async getGroupList(n){return this.handlePromiseCallback(async(r,o)=>{try{let i={};n?i=await this.TUICore.tim.getGroupList(n):i=await this.TUICore.tim.getGroupList(),this.store.groupList=i.data.groupList,r(i)}catch(i){o(i)}})}getGroupProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getGroupProfile(n);this.store.groupList=i.data.groupList,r(i)}catch(i){o(i)}})}dismissGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.dismissGroup(n);this.store.groupProfile=i.data.group,r(i)}catch(i){o(i)}})}updateGroupProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.updateGroupProfile(n);this.store.groupProfile=i.data.group,r(i)}catch(i){o(i)}})}joinGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.joinGroup(n);r(i)}catch(i){o(i)}})}quitGroup(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.quitGroup(n);r(i)}catch(i){o(i)}})}searchGroupByID(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.searchGroupByID(n);this.store.searchGroup=i.data.group,r(i)}catch(i){this.store.searchGroup={},o(i)}})}handleGroupApplication(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.handleGroupApplication(n);r(i)}catch(i){o(i)}})}async getFriendList(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getFriendList();this.currentStore.friendList=o.data,this.currentStore.userIDList=this.currentStore.friendList.map(i=>i.userID)||[],n(o)}catch(o){r(o)}})}async getUserStatus(n){return this.handlePromiseCallback(async(r,o)=>{var i,s;try{if(!n.length)return;const u=await this.TUICore.tim.getUserStatus({userIDList:n});(s=(i=u==null?void 0:u.data)==null?void 0:i.successUserList)==null||s.forEach(d=>{var f,g,v,_,M,C,D;d&&(d!=null&&d.userID)&&((g=(f=this.currentStore)==null?void 0:f.userStatusList)==null||g.set(d==null?void 0:d.userID,{statusType:d==null?void 0:d.statusType,customStatus:d==null?void 0:d.customStatus}),(D=(C=(M=(_=(v=this.TUICore)==null?void 0:v.TUIServer)==null?void 0:_.TUIConversation)==null?void 0:M.currentStore)==null?void 0:C.userStatusList)==null||D.set(d==null?void 0:d.userID,{statusType:d==null?void 0:d.statusType,customStatus:d==null?void 0:d.customStatus}))}),r(u)}catch(u){o(u)}})}async subscribeUserStatus(n){return this.handlePromiseCallback(async(r,o)=>{try{if(!n.length)return;const i=await this.TUICore.tim.subscribeUserStatus({userIDList:n});r(i)}catch(i){o(i)}})}async unsubscribeUserStatus(n){return this.handlePromiseCallback(async(r,o)=>{var i,s;try{if(n&&!n.length)return;const u=await this.TUICore.tim.unsubscribeUserStatus({userIDList:n});(s=(i=this.currentStore)==null?void 0:i.userStatusList)==null||s.clear(),r(u)}catch(u){o(u)}})}async handleUserStatus(n,r){return this.handlePromiseCallback(async(o,i)=>{try{setTimeout(async()=>{n?(await this.subscribeUserStatus(r),await this.getUserStatus(r)):await this.unsubscribeUserStatus(r)},1e3)}catch(s){i(s)}})}async bind(n){return this.currentStore=n,await this.getGroupList(),await this.getConversationList(),await this.getFriendList(),this.currentStore}}const fP=ot({name:"TUIContact",components:{},props:{displayOnlineStatus:{type:Boolean,default:!1}},setup(e,t){const n=fP.TUIServer,{t:r}=n.TUICore.config.i18n.useI18n(),o=zt({groupList:[],searchGroup:{},searchID:"",currentGroup:null,systemConversation:{unreadCount:0},systemMessageList:[],columnName:"",types:n.TUICore.TIM.TYPES,isSearch:!1,env:n.TUICore.TUIEnv,friendList:[],userIDList:[],currentFriend:{},displayOnlineStatus:!1,onlineStatus:!1,userStatusList:new Map});n.bind(o),$t(()=>e.displayOnlineStatus,async(N,A)=>{N!==A&&(o.displayOnlineStatus=N,n.handleUserStatus(o.displayOnlineStatus,o.userIDList))},{immediate:!0}),$t(()=>o.userIDList,(N,A)=>{VB(N,A)||n.handleUserStatus(o.displayOnlineStatus,o.userIDList)});const i=Ve(()=>{const N=o.currentGroup.selfInfo.userID,A=o.currentGroup.joinOption===n.TUICore.TIM.TYPES.JOIN_OPTIONS_NEED_PERMISSION;return!N&&A}),s=async N=>{switch(o.columnName){case"group":o.currentGroup=N;break;case"friend":o.currentFriend=N;break}o.isSearch&&(o.currentGroup=N)},u=async N=>{if(o.currentGroup=null,o.searchID.trim())try{await n.searchGroupByID(o.searchID.trim())}catch{const L=r("TUIContact.该群组不存在");xr(L,o.env)}},d=async N=>{const A={groupID:N.groupID,applyMessage:N.applyMessage||r("TUIContact.加群"),type:N==null?void 0:N.type};await n.joinGroup(A),o.currentGroup.apply=!0},f=async N=>{await n.quitGroup(N.groupID),o.currentGroup=null},g=async(N,A)=>{const L=`${A}${N}`;n.TUICore.TUIServer.TUIConversation.getConversationProfile(L).then(j=>{n.TUICore.TUIServer.TUIConversation.handleCurrentConversation(j.data.conversation),w()})},v=N=>{n.dismissGroup(N.groupID),o.currentGroup=null},_=async N=>{var A;o.columnName!=="system"&&N==="system"&&((A=o.systemConversation)!=null&&A.conversationID)&&(await n.getSystemMessageList(),await n.setMessageRead()),o.currentGroup={},o.columnName!=="group"&&N==="group"&&!o.env.isH5?o.currentGroup=o.groupList[0]:o.currentGroup={},o.searchID="",o.columnName=o.columnName===N?"":N},M=()=>{o.isSearch=!o.isSearch,o.columnName="",o.searchID="",o.searchGroup={},o.currentGroup={}},C=()=>{o.isSearch=!1,o.columnName="",o.searchID="",o.searchGroup={},o.currentGroup={}},D=N=>{n.handleGroupApplication(N)},w=()=>{o.currentGroup={},o.currentFriend={},o.columnName=""},S=N=>{n.TUICore.getUserStatusList(N)};return{...Jt(o),handleListItem:s,handleSearchGroup:u,join:d,quit:f,dismiss:v,isNeedPermission:i,select:_,handleGroupApplication:D,toggleSearch:M,init:C,back:w,enter:g,getUserStatusList:S}}});const pP=e=>(Mr("data-v-4457e2c6"),e=e(),Ir(),e),_ce={class:"TUI-contact-left"},bce={key:0,class:"TUI-contact-column"},Mce={class:"TUI-contact-column-item"},Ice={key:0,class:"num"},Cce={key:0,class:"TUI-contact-list"},Tce={class:"TUI-contact-list-item selected not-aside"},wce={key:0,class:"num"},Sce={class:"TUI-contact-column-item"},kce={class:"TUI-contact-list"},Dce=["onClick"],Ece={class:"left"},Ace=["src"],Lce={class:"content"},Oce={class:"name"},Rce={class:"ID"},Nce=pP(()=>B("label",null,"ID:",-1)),Pce={class:"type"},xce={class:"TUI-contact-column-item"},Uce={class:"TUI-contact-list"},Fce=["onClick"],Gce={class:"left"},$ce=["src"],Bce={class:"content"},Hce={class:"name"},qce={key:1,class:"TUI-contact-list"},Vce={class:"left"},zce=["src"],jce={class:"content"},Wce={class:"name"},Kce={class:"ID"},Yce=pP(()=>B("label",null,"ID:",-1)),Jce={class:"type"};function Xce(e,t,n,r,o,i){return X(),It(bo,{onBeforeLeave:e.init},{default:xt(()=>{var s,u,d,f,g,v,_;return[B("div",{class:st(["TUI-contact",[e.env.isH5?"TUI-contact-H5":""]])},[B("aside",_ce,[e.isSearch?(X(),ae("ul",qce,[(s=e.searchGroup)!=null&&s.groupID?(X(),ae("li",{key:0,class:st(["TUI-contact-list-item",[((u=e.currentGroup)==null?void 0:u.groupID)===((d=e.searchGroup)==null?void 0:d.groupID)&&"selected"]]),onClick:t[3]||(t[3]=M=>e.handleListItem(e.searchGroup))},[B("aside",Vce,[B("img",{class:"avatar",src:((f=e.searchGroup)==null?void 0:f.avatar)||"https://oss.dayaedu.com/news-info/07/1690775328089.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690775328089.png'"},null,8,zce)]),B("main",jce,[B("ul",null,[B("li",Wce,Ee((g=e.searchGroup)==null?void 0:g.name),1),B("li",Kce,[Yce,B("span",null,Ee((v=e.searchGroup)==null?void 0:v.groupID),1)])]),B("span",Jce,Ee((_=e.searchGroup)==null?void 0:_.type),1)])],2)):Ce("",!0)])):(X(),ae("ul",bce,[B("li",Mce,[B("header",{onClick:t[0]||(t[0]=M=>e.select("system"))},[B("i",{class:st(["icon icon-right",[e.columnName==="system"&&"icon-down"]])},null,2),B("main",null,[B("label",null,Ee(e.$t("TUIContact.群聊通知")),1),e.systemConversation&&e.systemConversation.unreadCount>0?(X(),ae("span",Ice,Ee(e.systemConversation.unreadCount),1)):Ce("",!0)])]),e.columnName==="system"?(X(),ae("ul",Cce,[B("li",Tce,[B("label",null,Ee(e.$t("TUIContact.系统通知")),1),e.systemConversation&&e.systemConversation.unreadCount>0?(X(),ae("span",wce,Ee(e.systemConversation.unreadCount),1)):Ce("",!0)])])):Ce("",!0)]),B("li",Sce,[B("header",{onClick:t[1]||(t[1]=M=>e.select("group"))},[B("i",{class:st(["icon icon-right",[e.columnName==="group"&&"icon-down"]])},null,2),B("main",null,[B("label",null,Ee(e.$t("TUIContact.我的群聊")),1)])]),$n(B("ul",kce,[(X(!0),ae(dt,null,qt(e.groupList,(M,C)=>{var D;return X(),ae("li",{class:st(["TUI-contact-list-item",[((D=e.currentGroup)==null?void 0:D.groupID)===(M==null?void 0:M.groupID)&&"selected"]]),key:C,onClick:w=>e.handleListItem(M)},[B("aside",Ece,[B("img",{class:"avatar",src:(M==null?void 0:M.avatar)||"https://oss.dayaedu.com/news-info/07/1690775328089.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690775328089.png'"},null,8,Ace)]),B("main",Lce,[B("ul",null,[B("li",Oce,Ee(M==null?void 0:M.name),1),B("li",Rce,[Nce,B("span",null,Ee(M==null?void 0:M.groupID),1)])]),B("span",Pce,Ee(M==null?void 0:M.type),1)])],10,Dce)}),128))],512),[[eo,e.columnName==="group"]])]),B("li",xce,[B("header",{onClick:t[2]||(t[2]=M=>e.select("friend"))},[B("i",{class:st(["icon icon-right",[e.columnName==="friend"&&"icon-down"]])},null,2),B("main",null,[B("label",null,Ee(e.$t("TUIContact.我的好友")),1)])]),$n(B("ul",Uce,[(X(!0),ae(dt,null,qt(e.friendList,(M,C)=>{var D,w,S,N;return X(),ae("li",{class:st(["TUI-contact-list-item",[((D=e.currentFriend)==null?void 0:D.userID)===(M==null?void 0:M.userID)&&"selected"]]),key:C,onClick:A=>e.handleListItem(M)},[B("aside",Gce,[B("img",{class:"avatar",src:((w=M==null?void 0:M.profile)==null?void 0:w.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,$ce),e.displayOnlineStatus?(X(),ae("div",{key:0,class:st(["online-status",((S=e.userStatusList.get(M==null?void 0:M.userID))==null?void 0:S.statusType)===1?"online-status-online":"online-status-offline"])},null,2)):Ce("",!0)]),B("main",Bce,[B("ul",null,[B("li",Hce,Ee(((N=M==null?void 0:M.profile)==null?void 0:N.nick)||(M==null?void 0:M.userID)),1)])])],10,Fce)}),128))],512),[[eo,e.columnName==="friend"]])])]))])],2)]}),_:1},8,["onBeforeLeave"])}const mI=jt(fP,[["render",Xce],["__scopeId","data-v-4457e2c6"]]),Zce=e=>{mI.TUIServer=eu.server,e.component(eu.name,mI)},Qce=e=>(eu.server=new dP(e),e.component(eu.name,eu),eu),eu={name:"TUIContact",component:mI,server:dP,install:Zce,plugin:Qce};class hP extends sd{constructor(n){super();Kt(this,"TUICore");Kt(this,"store");Kt(this,"currentStore",{});Kt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUISearch",{},this.updateStore.bind(this))}destroyed(){this.unbindTIMEvent()}updateStore(n,r){var o,i;(i=(o=this==null?void 0:this.currentStore)==null?void 0:o.conversationData)!=null&&i.list&&(this.currentStore.conversationData.list=n.conversationList)}handlePromiseCallback(n){return new Promise((r,o)=>{const i={TUIName:"TUISearch",callback:()=>{n&&n(r,o)}};this.TUICore.setAwaitFunc(i.TUIName,i.callback)})}bindTIMEvent(){this.TUICore.tim.on(this.TUICore.TIM.EVENT.FRIEND_LIST_UPDATED,this.handleFriendListUpdated,this)}unbindTIMEvent(){this.TUICore.tim.off(this.TUICore.TIM.EVENT.FRIEND_LIST_UPDATED,this.handleFriendListUpdated)}handleFriendListUpdated(n){this.currentStore.searchUserList=n.data.map(r=>r==null?void 0:r.profile),this.currentStore.allUserList=n.data.map(r=>r==null?void 0:r.profile)}async getConversationProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getConversationProfile(n);r(i)}catch(i){o(i)}})}async getUserProfile(n){return this.handlePromiseCallback(async(r,o)=>{try{const i=await this.TUICore.tim.getUserProfile({userIDList:n});r(i)}catch(i){o(i)}})}async getFriendList(){return this.handlePromiseCallback(async(n,r)=>{try{const o=await this.TUICore.tim.getFriendList();this.currentStore.searchUserList=o.data.map(i=>i==null?void 0:i.profile),this.currentStore.allUserList=o.data.map(i=>i==null?void 0:i.profile),n(o)}catch(o){r(o)}})}async bind(n){return this.currentStore=n,await this.getFriendList(),this.currentStore}}const Qp=ot({name:"group",props:{isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=zt({profile:{groupID:"",name:"",type:"",avatar:"",introduction:"",notification:"",joinOption:""},editConfig:{title:"",value:"",key:"",type:"",placeholder:""},isEdit:!1,type:[{icon:"https://web.sdk.qcloud.com/im/assets/images/Public.svg",label:"陌生人社交群(Public)",type:Qp.TUIServer.TUICore.TIM.TYPES.GRP_PUBLIC,detail:"类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Meeting.svg",label:"临时会议群(Meeting)",type:Qp.TUIServer.TUICore.TIM.TYPES.GRP_MEETING,detail:"创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Work.svg",label:"好友工作群(Work)",type:Qp.TUIServer.TUICore.TIM.TYPES.GRP_WORK,detail:"类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/AVChatroom.svg",label:"直播群(AVChatroom)",type:Qp.TUIServer.TUICore.TIM.TYPES.GRP_AVCHATROOM,detail:"创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见",src:"产品文档"}]});n.profile.type=n.type[0].type,n.profile.avatar=n.type[0].icon;const r=Ve(()=>n.type.filter(f=>f.type===n.profile.type)[0]),o=f=>{n.profile.type!==f.type&&(n.profile.type=f.type,n.profile.avatar=f.icon)},i=f=>{if(n.isEdit)return n.profile[n.editConfig.key]=n.editConfig.value,n.isEdit=!n.isEdit;const g={name:f.name,type:f.type,groupID:f.groupID,avatar:f.avatar};t.emit("submit",g)},s=()=>{if(n.isEdit)return n.isEdit=!n.isEdit;t.emit("cancel")},u=f=>{switch(n.isEdit=!n.isEdit,n.editConfig.key=f,n.editConfig.value=n.profile[f],f){case"name":n.editConfig.title="设置群名称",n.editConfig.placeholder="请输入群名称",n.editConfig.type="input";break;case"groupID":n.editConfig.title="设置群ID",n.editConfig.placeholder="请输入群ID",n.editConfig.type="input";break;case"type":n.editConfig.title="选择群类型",n.editConfig.type="select";break}},d=f=>{n.editConfig.value!==f.type&&(n.editConfig.value=f.type)};return{...Jt(n),selected:o,submit:i,cancel:s,Link:FR,edit:u,selectedEdit:d,groupTypeDetail:r}}});const AT=e=>(Mr("data-v-8d663893"),e=e(),Ir(),e),ede={class:"group-box"},tde={key:0},nde={key:1},rde={key:0,class:"group-list"},ode={class:"group-list-item"},ide=["src"],sde={class:"group-list-item"},ade={class:"content"},lde=AT(()=>B("i",{class:"icon icon-right"},null,-1)),ude={class:"group-list-item"},cde={class:"content"},dde=AT(()=>B("i",{class:"icon icon-right"},null,-1)),fde={class:"group-list-introduction"},pde={class:"group-list-item"},hde={key:0,class:"select"},gde=["onClick"],mde={class:"select-item-header"},vde={class:"left"},yde=["src"],_de={class:"select-item-label"},bde={key:0,class:"icon icon-selected"},Mde={class:"select-item-detail"},Ide=["href"],Cde={class:"content"},Tde=AT(()=>B("i",{class:"icon icon-right"},null,-1)),wde={key:0,class:"group-h5-list-item-introduction"},Sde={class:"introduction-name"},kde={class:"introduction-detail"},Dde=["href"],Ede={key:1,class:"group-list group-list-edit"},Ade=["placeholder"],Lde={key:1,class:"select"},Ode=["onClick"],Rde={class:"select-item-header"},Nde={class:"left"},Pde=["src"],xde={class:"select-item-label"},Ude={key:0,class:"icon icon-selected"},Fde={class:"select-item-detail"},Gde=["href"],$de={class:"group-profile-footer"},Bde=["disabled"];function Hde(e,t,n,r,o,i){return X(),ae("div",{class:st(["group",[e.isH5?"group-h5":""]])},[B("div",ede,[B("header",null,[e.isEdit?(X(),ae("h1",nde,Ee(e.$t(`TUISearch.${e.editConfig.title}`)),1)):(X(),ae("h1",tde,Ee(e.$t("TUISearch.发起群聊")),1)),B("i",{class:st(["icon",[e.isH5?"icon-back":"icon-close"]]),onClick:t[0]||(t[0]=(...s)=>e.cancel&&e.cancel(...s))},null,2)]),e.isEdit?(X(),ae("div",Ede,[e.editConfig.type==="input"?$n((X(),ae("input",{key:0,type:"text","onUpdate:modelValue":t[6]||(t[6]=s=>e.editConfig.value=s),placeholder:e.$t(`TUISearch.${e.editConfig.placeholder}`)},null,8,Ade)),[[al,e.editConfig.value]]):(X(),ae("ul",Lde,[(X(!0),ae(dt,null,qt(e.type,(s,u)=>(X(),ae("li",{class:st(["select-item",[e.editConfig.value===s.type&&"selected"]]),key:u,onClick:d=>e.selectedEdit(s)},[B("main",null,[B("div",Rde,[B("aside",Nde,[B("img",{class:"icon",src:s.icon},null,8,Pde),B("span",xde,Ee(s.label),1)]),e.editConfig.value===s.type?(X(),ae("i",Ude)):Ce("",!0)]),B("span",Fde,Ee(e.$t(`TUISearch.${s.detail}`)),1),B("a",{href:e.Link.product.url,target:"view_window"},Ee(e.$t(`TUISearch.${s.src}`)),9,Gde)])],10,Ode))),128))]))])):(X(),ae("ul",rde,[B("li",ode,[B("label",null,Ee(e.$t("TUISearch.群头像")),1),B("img",{class:"icon",src:e.profile.avatar},null,8,ide)]),B("ul",null,[B("li",sde,[B("label",null,Ee(e.$t("TUISearch.群名称")),1),e.isH5?(X(),ae("span",{key:1,class:"group-h5-list-item-content",onClick:t[2]||(t[2]=s=>e.edit("name"))},[B("p",ade,Ee(e.profile.name),1),lde])):$n((X(),ae("input",{key:0,type:"text","onUpdate:modelValue":t[1]||(t[1]=s=>e.profile.name=s),placeholder:"请输入群名称"},null,512)),[[al,e.profile.name]])]),B("li",ude,[B("label",null,[jr(Ee(e.$t("TUISearch.群ID")),1),B("text",null,"("+Ee(e.$t("TUISearch.选填"))+")",1)]),e.isH5?(X(),ae("span",{key:1,class:"group-h5-list-item-content",onClick:t[4]||(t[4]=s=>e.edit("groupID"))},[B("p",cde,Ee(e.profile.groupID),1),dde])):$n((X(),ae("input",{key:0,type:"text","onUpdate:modelValue":t[3]||(t[3]=s=>e.profile.groupID=s)},null,512)),[[al,e.profile.groupID]])]),B("li",fde,[B("div",pde,[B("label",null,Ee(e.$t("TUISearch.群类型")),1),e.isH5?(X(),ae("span",{key:1,class:"group-h5-list-item-content",onClick:t[5]||(t[5]=s=>e.edit("type"))},[B("p",Cde,Ee(e.groupTypeDetail.label),1),Tde])):(X(),ae("ul",hde,[(X(!0),ae(dt,null,qt(e.type,(s,u)=>(X(),ae("li",{class:st(["select-item",[e.profile.type===s.type&&"selected"]]),key:u,onClick:d=>e.selected(s)},[B("main",null,[B("div",mde,[B("aside",vde,[B("img",{class:"icon",src:s.icon},null,8,yde),B("span",_de,Ee(s.label),1)]),e.profile.type===s.type?(X(),ae("i",bde)):Ce("",!0)]),B("span",Mde,Ee(e.$t(`TUISearch.${s.detail}`)),1),B("a",{href:e.Link.product.url,target:"view_window"},Ee(e.$t(`TUISearch.${s.src}`)),9,Ide)])],10,gde))),128))]))]),e.isH5?(X(),ae("article",wde,[B("label",Sde,Ee(e.groupTypeDetail.label)+":",1),B("span",kde,Ee(e.$t(`TUISearch.${e.groupTypeDetail.detail}`)),1),B("a",{href:e.Link.product.url,target:"view_window"},Ee(e.$t(`TUISearch.${e.groupTypeDetail.src}`)),9,Dde)])):Ce("",!0)])])])),B("footer",$de,[!e.isEdit&&!e.isH5?(X(),ae("button",{key:0,class:"btn-default",onClick:t[7]||(t[7]=(...s)=>e.cancel&&e.cancel(...s))},Ee(e.$t("TUISearch.取消")),1)):Ce("",!0),B("button",{class:"btn-submit",onClick:t[8]||(t[8]=s=>e.submit(e.profile)),disabled:e.profile.name===""&&!e.isEdit},Ee(e.$t("TUISearch.创建")),9,Bde)])])],2)}const _b=jt(Qp,[["render",Hde],["__scopeId","data-v-8d663893"]]),fv=ot({name:"TUISearch",components:{Transfer:GC,DialogTUI:jy,CreateGroup:_b},setup(e){var D,w,S;const t=fv==null?void 0:fv.TUIServer,{t:n}=t.TUICore.config.i18n.useI18n(),r=zt({open:!1,searchUserID:"",selectedList:[],allUserList:[],searchUserList:[],step:1,group:{groupID:"",name:"",type:"",avatar:"",introduction:"",notification:"",joinOption:"",memberList:[{userID:""}]},showTitle:"",createConversationType:"",env:t.TUICore.TUIEnv,optionalShow:!t.TUICore.TUIEnv.isH5,needSearch:!t.TUICore.isOfficial});t.bind(r);const o=(w=(D=t==null?void 0:t.TUICore)==null?void 0:D.TUIServer)==null?void 0:w.TUIGroup;_b.TUIServer=t;const i=((S=window==null?void 0:window.TUIKitTUICore)==null?void 0:S.isOfficial)&&ki&&ki()||{},s=Ne();Js(s,()=>{r.env.isH5&&(r.optionalShow=!1,r.searchUserList=[...r.allUserList])});const u=()=>{r.group={groupID:"",name:"",type:"",avatar:"",introduction:"",notification:"",joinOption:"",memberList:[{userID:""}]}},d=()=>{r.open=!r.open,r.open||(r.searchUserID="",r.step=1,u())},f=N=>{if(r.createConversationType===cn.typeC2C){const{userID:A}=N[0];v(A,"C2C"),d()}else{if(!_b.TUIServer){const A=n("TUISearch.创建群聊,请注册 TUIGroup 模块");xr(A,r.env)}u(),r.group.memberList=N.map(A=>({userID:A.userID})),r.step=2}r.searchUserList=[...r.allUserList]},g=async N=>{var L;N.type===t.TUICore.TIM.TYPES.GRP_PUBLIC&&(r.group.joinOption=t.TUICore.TIM.TYPES.JOIN_OPTIONS_NEED_PERMISSION);const A={...r.group,...N};N.type===t.TUICore.TIM.TYPES.GRP_AVCHATROOM&&(delete A.memberList,delete A.joinOption);try{const j=await o.createGroup(A),V=n("TUISearch.创建成功");qB(V,r.env),(L=window==null?void 0:window.TUIKitTUICore)!=null&&L.isOfficial&&(i!=null&&i.commit)&&(i==null||i.commit("handleTask",3)),d(),N.type===t.TUICore.TIM.TYPES.GRP_AVCHATROOM&&o.joinGroup({groupID:j.data.group.groupID,applyMessage:"",type:j.data.group.type}),v(j.data.group.groupID,"GROUP")}catch(j){xr(j,r.env)}},v=(N,A)=>{const L=`${A}${N}`;t.getConversationProfile(L).then(j=>{t.TUICore.TUIServer.TUIConversation.handleCurrentConversation(j.data.conversation)})},_=N=>{switch(r.open=!0,r.searchUserList=[...r.allUserList],N){case"isC2C":return r.createConversationType=cn.typeC2C,r.showTitle=n("TUISearch.发起单聊"),r.showTitle;case"isGroup":return r.createConversationType=cn.typeGroup,r.showTitle=n("TUISearch.发起群聊"),r.showTitle}},M=()=>{r.env.isH5&&(r.optionalShow=!r.optionalShow)},C=async N=>{try{const A=await t.getUserProfile([N]);if(!A.data.length){xr(n("TUISearch.该用户不存在"),r.env),r.searchUserList=[...r.allUserList];return}r.searchUserList=A.data;const L=r.allUserList.filter(j=>j.userID===A.data[0].userID);r.allUserList=L.length?r.allUserList:[...r.allUserList,...r.searchUserList]}catch{xr(n("TUISearch.该用户不存在"),r.env),r.searchUserList=[...r.allUserList];return}};return{...Jt(r),toggleOpen:d,handleSearch:C,submit:f,create:g,showOpen:_,toggleOptionalShow:M,dialog:s}}});const gP=e=>(Mr("data-v-f11d045f"),e=e(),Ir(),e),qde=gP(()=>B("i",{class:"plus"},null,-1)),Vde={key:0},zde={key:0,class:"icon icon-c2c"},jde=gP(()=>B("i",{class:"icon icon-group"},null,-1));function Wde(e,t,n,r,o,i){const s=Yt("Transfer"),u=Yt("CreateGroup"),d=Yt("DialogTUI");return X(),ae("div",{class:st(["TUI-search",[e.env.isH5?"TUI-search-H5":""]]),ref:"dialog"},[B("header",{onClick:t[2]||(t[2]=(...f)=>e.toggleOptionalShow&&e.toggleOptionalShow(...f))},[qde,e.env.isH5?(X(),ae("h1",Vde,Ee(e.$t("TUISearch.发起会话")),1)):Ce("",!0),$n(B("ul",null,[B("li",null,[e.env.isH5?(X(),ae("i",zde)):Ce("",!0),B("h1",{onClick:t[0]||(t[0]=f=>e.showOpen("isC2C"))},Ee(e.$t("TUISearch.发起单聊")),1)]),B("li",null,[jde,B("h1",{onClick:t[1]||(t[1]=f=>e.showOpen("isGroup"))},Ee(e.$t("TUISearch.发起群聊")),1)])],512),[[eo,e.optionalShow]])]),St(d,{show:e.open,isH5:e.env.isH5,isHeaderShow:!1,isFooterShow:!1,background:!1,"onUpdate:show":t[3]||(t[3]=f=>e.open=f)},{default:xt(()=>[e.step===1?(X(),It(s,{key:0,isSearch:e.needSearch,title:e.showTitle,list:e.searchUserList,isH5:e.env.isH5,isRadio:e.createConversationType==="isC2C",onSearch:e.handleSearch,onSubmit:e.submit,onCancel:e.toggleOpen},null,8,["isSearch","title","list","isH5","isRadio","onSearch","onSubmit","onCancel"])):(X(),It(u,{key:1,onSubmit:e.create,onCancel:e.toggleOpen,isH5:e.env.isH5},null,8,["onSubmit","onCancel","isH5"]))]),_:1},8,["show","isH5"])],2)}const vI=jt(fv,[["render",Wde],["__scopeId","data-v-f11d045f"]]),Kde=e=>{vI.TUIServer=tu.server,e.component(tu.name,vI)},Yde=e=>(tu.server=new hP(e),e.component(tu.name,tu),tu),tu={name:"TUISearch",component:vI,server:hP,install:Kde,plugin:Yde},mP=[ol,Yl,Xl,Zl,Ql,eu,tu],Jde=e=>{mP.forEach(t=>{t.install(e)})},Xde=e=>{mP.forEach(t=>{t.plugin(e)})},Zde={name:"TUIComponents",version:"1.0.0",TUIChat:ol,TUIConversation:Yl,TUIProfile:Xl,TUIGroup:Zl,TUIPerson:Ql,TUIContact:eu,TUISearch:tu,install:Jde,plugin:Xde};var vP={exports:{}};(function(e,t){var n;n=function(){function r(G,O){var T=Object.keys(G);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(G);O&&(P=P.filter(function(Z){return Object.getOwnPropertyDescriptor(G,Z).enumerable})),T.push.apply(T,P)}return T}function o(G){for(var O=1;O=0||(ue[ie]=oe[ie]);return ue}(G,O);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(G);for(P=0;P=0||Object.prototype.propertyIsEnumerable.call(G,T)&&(Z[T]=G[T])}return Z}var v=typeof wx<"u"&&typeof wx.getSystemInfoSync=="function"&&!!wx.getSystemInfoSync().fontSizeSetting,_=typeof qq<"u"&&typeof qq.getSystemInfoSync=="function"&&!!qq.getSystemInfoSync().fontSizeSetting,M=typeof tt<"u"&&typeof tt.getSystemInfoSync=="function"&&!!tt.getSystemInfoSync().fontSizeSetting,C=typeof swan<"u"&&typeof swan.getSystemInfoSync=="function"&&!!swan.getSystemInfoSync().fontSizeSetting,D=typeof my<"u"&&typeof my.getSystemInfoSync=="function"&&!!my.getSystemInfoSync().fontSizeSetting,w=typeof uni<"u"&&typeof window>"u"&&typeof uni.requireNativePlugin=="function",S=w&&uni.getDeviceInfo().platform.toLocaleLowerCase()==="ios",N=(w&&uni.getDeviceInfo().platform.toLocaleLowerCase(),v||_||M||C||D||w),A=_?qq:M?tt:C?swan:D?my:v?wx:w?uni:{},L=function(G){if(i(G)!=="object"||G===null)return!1;var O=Object.getPrototypeOf(G);if(O===null)return!0;for(var T=O;Object.getPrototypeOf(T)!==null;)T=Object.getPrototypeOf(T);return O===T};function j(G){if(G==null)return!0;if(typeof G=="boolean")return!1;if(typeof G=="number")return G===0;if(typeof G=="string"||typeof G=="function"||Array.isArray(G))return G.length===0;if(G instanceof Error)return G.message==="";if(L(G)){for(var O in G)if(Object.prototype.hasOwnProperty.call(G,O))return!1;return!0}return!1}var V=function(){function G(){s(this,G)}return d(G,[{key:"request",value:function(O,T){var P=this,Z=O.downloadUrl||"",K=(O.method||"PUT").toUpperCase(),oe=O.url;if(O.qs){var J=function(de){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"=";return j(de)?"":L(de)?Object.keys(de).map(function(fe){var Ae=encodeURIComponent(fe)+re;return Array.isArray(de[fe])?de[fe].map(function(ye){return Ae+encodeURIComponent(ye)}).join(Y):Ae+encodeURIComponent(de[fe])}).filter(Boolean).join(Y):void 0}(O.qs);J&&(oe+="".concat(oe.indexOf("?")===-1?"?":"&").concat(J))}var ie=new XMLHttpRequest;ie.open(K,oe,!0),ie.responseType=O.dataType||"text";var pe=O.headers||{};if(!j(pe))for(var ue in pe)pe.hasOwnProperty(ue)&&ue.toLowerCase()!=="content-length"&&ue.toLowerCase()!=="user-agent"&&ue.toLowerCase()!=="origin"&&ue.toLowerCase()!=="host"&&ie.setRequestHeader(ue,pe[ue]);return ie.onload=function(){if(ie.status===200)T(null,P._xhrRes(ie,P._xhrBody(ie,Z)));else{var de={code:ie.status,message:JSON.stringify(ie.responseText)};T(de,P._xhrRes(ie,P._xhrBody(ie)))}},ie.onerror=function(de){var Y=P._xhrBody(ie),re={code:ie.status,message:JSON.stringify(ie.responseText)};Y||ie.statusText||ie.status!==0||(de.message="CORS blocked or network error"),T(re,P._xhrRes(ie,Y)),re=null},O.onProgress&&ie.upload&&(ie.upload.onprogress=function(de){var Y=de.total,re=de.loaded,fe=Math.floor(100*re/Y);O.onProgress({total:Y,loaded:re,percent:(fe>=100?100:fe)/100})}),ie.send(O.resources),ie}},{key:"_xhrRes",value:function(O,T){var P={};return O.getAllResponseHeaders().trim().split(` `).forEach(function(Z){if(Z){var K=Z.indexOf(":"),oe=Z.substr(0,K).trim().toLowerCase(),J=Z.substr(K+1).trim();P[oe]=J}}),{statusCode:O.status,statusMessage:O.statusText,headers:P,data:T}}},{key:"_xhrBody",value:function(O,T){return O.status===200&&T?{location:T}:{response:O.responseText}}}]),G}(),x=["unknown","image","video","audio","log"],$=["name"],z=function(){function G(){s(this,G)}return d(G,[{key:"request",value:function(O,T){var P=this,Z=O.resources,K=Z===void 0?"":Z,oe=O.headers,J=oe===void 0?{}:oe,ie=O.url,pe=O.downloadUrl,ue=pe===void 0?"":pe,de=ie,Y=null,re=ue.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/),fe=decodeURIComponent(re[3]),Ae=fe.indexOf("?")>-1?fe.split("?")[0]:fe,ye={key:O.fileKey?O.fileKey:Ae,success_action_status:200,"Content-Type":""},le={};if(S){var Q=ie.split("?sign=");if(Q.length>1){var ve=Q[1];de="".concat(Q[0],"?sign=").concat(encodeURIComponent("".concat(ve))),le.sign=decodeURIComponent(ve),le.signature=decodeURIComponent(ve)}}var Le={url:de,header:J,name:"file",filePath:K,formData:o(o({},ye),le),timeout:O.timeout||3e5};if(D){var me=Le;me.name,Le=o(o({},g(me,$)),{},{fileName:"file",fileType:x[O.fileType]})}return(Y=A.uploadFile(o(o({},Le),{},{success:function(W){P._handleResponse({response:W,downloadUrl:ue,callback:T})},fail:function(W){P._handleResponse({response:W,downloadUrl:ue,callback:T})}}))).onProgressUpdate&&Y.onProgressUpdate(function(W){O.onProgress&&O.onProgress({total:W.totalBytesExpectedToSend,loaded:W.totalBytesSent,percent:Math.floor(W.progress)/100})}),Y}},{key:"_handleResponse",value:function(O){var T=O.downloadUrl,P=O.response,Z=O.callback,K=P.header,oe={};if(K)for(var J in K)K.hasOwnProperty(J)&&(oe[J.toLowerCase()]=K[J]);var ie=+P.statusCode;ie===200?Z(null,{statusCode:ie,headers:oe,data:o(o({},P.data),{},{location:T})}):Z({code:ie,message:JSON.stringify(P.data)},{statusCode:ie,headers:oe,data:void 0})}}]),G}();return function(){function G(){s(this,G),console.log("TIMUploadPlugin.VERSION: ".concat("1.3.0")),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=N?new z:new V}return d(G,[{key:"uploadFile",value:function(O,T){var P=this;return this.httpRequest.request(O,function(Z,K){Z&&P.tryCount=3e4&&(this.systemClockOffset=ie-J,T=!0)}else Math.floor(O.statusCode/100)===5&&(T=!0)}return T}}]),G}()},e.exports=n()})(vP);var Qde=vP.exports;const efe=qf(Qde);var yP={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(pi,function(){function n(D,w){if(!(D instanceof w))throw new TypeError("Cannot call a class as a function")}function r(D,w){for(var S=0;SD.length)&&(w=D.length);for(var S=0,N=new Array(w);S=D.length?{done:!0}:{done:!1,value:D[N++]}},e:function(x){throw x},f:A}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L,j=!0,V=!1;return{s:function(){S=S.call(D)},n:function(){var x=S.next();return j=x.done,x},e:function(x){V=!0,L=x},f:function(){try{j||S.return==null||S.return()}finally{if(V)throw L}}}}var g=function(){for(var D=` \r ~!@#$%^&*()_+-=【】、{}|;':",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄`,w=new Map,S=0,N=D.length;S1&&(x+=$),G){if(j=!0,!N)break;var T=this._map.get(z)||"*";L=L.replace(new RegExp(z,"g"),T)}}return{isMatched:j,modifiedText:L}}},{key:"reset",value:function(){this._trieTree={},this._map=null}}]),D}(),_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof pi<"u"?pi:typeof self<"u"?self:{},M={},C=function(D,w){return D(w={exports:{}},w.exports),w.exports}(function(D,w){var S,N,A,L,j,V;D.exports=(V=V||function(x,$){var z;if(typeof window<"u"&&window.crypto&&(z=window.crypto),!z&&typeof window<"u"&&window.msCrypto&&(z=window.msCrypto),!z&&_!==void 0&&_.crypto&&(z=_.crypto),!z)try{z=M}catch{}var G=function(){if(z){if(typeof z.getRandomValues=="function")try{return z.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof z.randomBytes=="function")try{return z.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},O=Object.create||function(){function Y(){}return function(re){var fe;return Y.prototype=re,fe=new Y,Y.prototype=null,fe}}(),T={},P=T.lib={},Z=P.Base={extend:function(Y){var re=O(this);return Y&&re.mixIn(Y),re.hasOwnProperty("init")&&this.init!==re.init||(re.init=function(){re.$super.init.apply(this,arguments)}),re.init.prototype=re,re.$super=this,re},create:function(){var Y=this.extend();return Y.init.apply(Y,arguments),Y},init:function(){},mixIn:function(Y){for(var re in Y)Y.hasOwnProperty(re)&&(this[re]=Y[re]);Y.hasOwnProperty("toString")&&(this.toString=Y.toString)},clone:function(){return this.init.prototype.extend(this)}},K=P.WordArray=Z.extend({init:function(Y,re){Y=this.words=Y||[],this.sigBytes=re??4*Y.length},toString:function(Y){return(Y||J).stringify(this)},concat:function(Y){var re=this.words,fe=Y.words,Ae=this.sigBytes,ye=Y.sigBytes;if(this.clamp(),Ae%4)for(var le=0;le>>2]>>>24-le%4*8&255;re[Ae+le>>>2]|=Q<<24-(Ae+le)%4*8}else for(le=0;le>>2]=fe[le>>>2];return this.sigBytes+=ye,this},clamp:function(){var Y=this.words,re=this.sigBytes;Y[re>>>2]&=4294967295<<32-re%4*8,Y.length=x.ceil(re/4)},clone:function(){var Y=Z.clone.call(this);return Y.words=this.words.slice(0),Y},random:function(Y){for(var re=[],fe=0;fe>>2]>>>24-ye%4*8&255;Ae.push((le>>>4).toString(16)),Ae.push((15&le).toString(16))}return Ae.join("")},parse:function(Y){for(var re=Y.length,fe=[],Ae=0;Ae>>3]|=parseInt(Y.substr(Ae,2),16)<<24-Ae%8*4;return new K.init(fe,re/2)}},ie=oe.Latin1={stringify:function(Y){for(var re=Y.words,fe=Y.sigBytes,Ae=[],ye=0;ye>>2]>>>24-ye%4*8&255;Ae.push(String.fromCharCode(le))}return Ae.join("")},parse:function(Y){for(var re=Y.length,fe=[],Ae=0;Ae>>2]|=(255&Y.charCodeAt(Ae))<<24-Ae%4*8;return new K.init(fe,re)}},pe=oe.Utf8={stringify:function(Y){try{return decodeURIComponent(escape(ie.stringify(Y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(Y){return ie.parse(unescape(encodeURIComponent(Y)))}},ue=P.BufferedBlockAlgorithm=Z.extend({reset:function(){this._data=new K.init,this._nDataBytes=0},_append:function(Y){typeof Y=="string"&&(Y=pe.parse(Y)),this._data.concat(Y),this._nDataBytes+=Y.sigBytes},_process:function(Y){var re,fe=this._data,Ae=fe.words,ye=fe.sigBytes,le=this.blockSize,Q=ye/(4*le),ve=(Q=Y?x.ceil(Q):x.max((0|Q)-this._minBufferSize,0))*le,Le=x.min(4*ve,ye);if(ve){for(var me=0;me>>2]>>>24-T%4*8&255)<<16|($[T+1>>>2]>>>24-(T+1)%4*8&255)<<8|$[T+2>>>2]>>>24-(T+2)%4*8&255,Z=0;Z<4&&T+.75*Z>>6*(3-Z)&63));var K=G.charAt(64);if(K)for(;O.length%4;)O.push(K);return O.join("")},parse:function(x){var $=x.length,z=this._map,G=this._reverseMap;if(!G){G=this._reverseMap=[];for(var O=0;O>>6-pe%4*2,Y=ue|de;J[ie>>>2]|=Y<<24-ie%4*8,ie++}return j.create(J,ie)}(x,$,G)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(x){var $=V,z=$.lib,G=z.WordArray,O=z.Hasher,T=$.algo,P=[];(function(){for(var pe=0;pe<64;pe++)P[pe]=4294967296*x.abs(x.sin(pe+1))|0})();var Z=T.MD5=O.extend({_doReset:function(){this._hash=new G.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(pe,ue){for(var de=0;de<16;de++){var Y=ue+de,re=pe[Y];pe[Y]=16711935&(re<<8|re>>>24)|4278255360&(re<<24|re>>>8)}var fe=this._hash.words,Ae=pe[ue+0],ye=pe[ue+1],le=pe[ue+2],Q=pe[ue+3],ve=pe[ue+4],Le=pe[ue+5],me=pe[ue+6],W=pe[ue+7],te=pe[ue+8],se=pe[ue+9],Te=pe[ue+10],ce=pe[ue+11],Se=pe[ue+12],Pe=pe[ue+13],xe=pe[ue+14],He=pe[ue+15],Ie=fe[0],q=fe[1],ne=fe[2],_e=fe[3];Ie=K(Ie,q,ne,_e,Ae,7,P[0]),_e=K(_e,Ie,q,ne,ye,12,P[1]),ne=K(ne,_e,Ie,q,le,17,P[2]),q=K(q,ne,_e,Ie,Q,22,P[3]),Ie=K(Ie,q,ne,_e,ve,7,P[4]),_e=K(_e,Ie,q,ne,Le,12,P[5]),ne=K(ne,_e,Ie,q,me,17,P[6]),q=K(q,ne,_e,Ie,W,22,P[7]),Ie=K(Ie,q,ne,_e,te,7,P[8]),_e=K(_e,Ie,q,ne,se,12,P[9]),ne=K(ne,_e,Ie,q,Te,17,P[10]),q=K(q,ne,_e,Ie,ce,22,P[11]),Ie=K(Ie,q,ne,_e,Se,7,P[12]),_e=K(_e,Ie,q,ne,Pe,12,P[13]),ne=K(ne,_e,Ie,q,xe,17,P[14]),Ie=oe(Ie,q=K(q,ne,_e,Ie,He,22,P[15]),ne,_e,ye,5,P[16]),_e=oe(_e,Ie,q,ne,me,9,P[17]),ne=oe(ne,_e,Ie,q,ce,14,P[18]),q=oe(q,ne,_e,Ie,Ae,20,P[19]),Ie=oe(Ie,q,ne,_e,Le,5,P[20]),_e=oe(_e,Ie,q,ne,Te,9,P[21]),ne=oe(ne,_e,Ie,q,He,14,P[22]),q=oe(q,ne,_e,Ie,ve,20,P[23]),Ie=oe(Ie,q,ne,_e,se,5,P[24]),_e=oe(_e,Ie,q,ne,xe,9,P[25]),ne=oe(ne,_e,Ie,q,Q,14,P[26]),q=oe(q,ne,_e,Ie,te,20,P[27]),Ie=oe(Ie,q,ne,_e,Pe,5,P[28]),_e=oe(_e,Ie,q,ne,le,9,P[29]),ne=oe(ne,_e,Ie,q,W,14,P[30]),Ie=J(Ie,q=oe(q,ne,_e,Ie,Se,20,P[31]),ne,_e,Le,4,P[32]),_e=J(_e,Ie,q,ne,te,11,P[33]),ne=J(ne,_e,Ie,q,ce,16,P[34]),q=J(q,ne,_e,Ie,xe,23,P[35]),Ie=J(Ie,q,ne,_e,ye,4,P[36]),_e=J(_e,Ie,q,ne,ve,11,P[37]),ne=J(ne,_e,Ie,q,W,16,P[38]),q=J(q,ne,_e,Ie,Te,23,P[39]),Ie=J(Ie,q,ne,_e,Pe,4,P[40]),_e=J(_e,Ie,q,ne,Ae,11,P[41]),ne=J(ne,_e,Ie,q,Q,16,P[42]),q=J(q,ne,_e,Ie,me,23,P[43]),Ie=J(Ie,q,ne,_e,se,4,P[44]),_e=J(_e,Ie,q,ne,Se,11,P[45]),ne=J(ne,_e,Ie,q,He,16,P[46]),Ie=ie(Ie,q=J(q,ne,_e,Ie,le,23,P[47]),ne,_e,Ae,6,P[48]),_e=ie(_e,Ie,q,ne,W,10,P[49]),ne=ie(ne,_e,Ie,q,xe,15,P[50]),q=ie(q,ne,_e,Ie,Le,21,P[51]),Ie=ie(Ie,q,ne,_e,Se,6,P[52]),_e=ie(_e,Ie,q,ne,Q,10,P[53]),ne=ie(ne,_e,Ie,q,Te,15,P[54]),q=ie(q,ne,_e,Ie,ye,21,P[55]),Ie=ie(Ie,q,ne,_e,te,6,P[56]),_e=ie(_e,Ie,q,ne,He,10,P[57]),ne=ie(ne,_e,Ie,q,me,15,P[58]),q=ie(q,ne,_e,Ie,Pe,21,P[59]),Ie=ie(Ie,q,ne,_e,ve,6,P[60]),_e=ie(_e,Ie,q,ne,ce,10,P[61]),ne=ie(ne,_e,Ie,q,le,15,P[62]),q=ie(q,ne,_e,Ie,se,21,P[63]),fe[0]=fe[0]+Ie|0,fe[1]=fe[1]+q|0,fe[2]=fe[2]+ne|0,fe[3]=fe[3]+_e|0},_doFinalize:function(){var pe=this._data,ue=pe.words,de=8*this._nDataBytes,Y=8*pe.sigBytes;ue[Y>>>5]|=128<<24-Y%32;var re=x.floor(de/4294967296),fe=de;ue[15+(Y+64>>>9<<4)]=16711935&(re<<8|re>>>24)|4278255360&(re<<24|re>>>8),ue[14+(Y+64>>>9<<4)]=16711935&(fe<<8|fe>>>24)|4278255360&(fe<<24|fe>>>8),pe.sigBytes=4*(ue.length+1),this._process();for(var Ae=this._hash,ye=Ae.words,le=0;le<4;le++){var Q=ye[le];ye[le]=16711935&(Q<<8|Q>>>24)|4278255360&(Q<<24|Q>>>8)}return Ae},clone:function(){var pe=O.clone.call(this);return pe._hash=this._hash.clone(),pe}});function K(pe,ue,de,Y,re,fe,Ae){var ye=pe+(ue&de|~ue&Y)+re+Ae;return(ye<>>32-fe)+ue}function oe(pe,ue,de,Y,re,fe,Ae){var ye=pe+(ue&Y|de&~Y)+re+Ae;return(ye<>>32-fe)+ue}function J(pe,ue,de,Y,re,fe,Ae){var ye=pe+(ue^de^Y)+re+Ae;return(ye<>>32-fe)+ue}function ie(pe,ue,de,Y,re,fe,Ae){var ye=pe+(de^(ue|~Y))+re+Ae;return(ye<>>32-fe)+ue}$.MD5=O._createHelper(Z),$.HmacMD5=O._createHmacHelper(Z)}(Math),function(){var x=V,$=x.lib,z=$.WordArray,G=$.Hasher,O=x.algo,T=[],P=O.SHA1=G.extend({_doReset:function(){this._hash=new z.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(Z,K){for(var oe=this._hash.words,J=oe[0],ie=oe[1],pe=oe[2],ue=oe[3],de=oe[4],Y=0;Y<80;Y++){if(Y<16)T[Y]=0|Z[K+Y];else{var re=T[Y-3]^T[Y-8]^T[Y-14]^T[Y-16];T[Y]=re<<1|re>>>31}var fe=(J<<5|J>>>27)+de+T[Y];fe+=Y<20?1518500249+(ie&pe|~ie&ue):Y<40?1859775393+(ie^pe^ue):Y<60?(ie&pe|ie&ue|pe&ue)-1894007588:(ie^pe^ue)-899497514,de=ue,ue=pe,pe=ie<<30|ie>>>2,ie=J,J=fe}oe[0]=oe[0]+J|0,oe[1]=oe[1]+ie|0,oe[2]=oe[2]+pe|0,oe[3]=oe[3]+ue|0,oe[4]=oe[4]+de|0},_doFinalize:function(){var Z=this._data,K=Z.words,oe=8*this._nDataBytes,J=8*Z.sigBytes;return K[J>>>5]|=128<<24-J%32,K[14+(J+64>>>9<<4)]=Math.floor(oe/4294967296),K[15+(J+64>>>9<<4)]=oe,Z.sigBytes=4*K.length,this._process(),this._hash},clone:function(){var Z=G.clone.call(this);return Z._hash=this._hash.clone(),Z}});x.SHA1=G._createHelper(P),x.HmacSHA1=G._createHmacHelper(P)}(),function(x){var $=V,z=$.lib,G=z.WordArray,O=z.Hasher,T=$.algo,P=[],Z=[];(function(){function J(de){for(var Y=x.sqrt(de),re=2;re<=Y;re++)if(!(de%re))return!1;return!0}function ie(de){return 4294967296*(de-(0|de))|0}for(var pe=2,ue=0;ue<64;)J(pe)&&(ue<8&&(P[ue]=ie(x.pow(pe,.5))),Z[ue]=ie(x.pow(pe,1/3)),ue++),pe++})();var K=[],oe=T.SHA256=O.extend({_doReset:function(){this._hash=new G.init(P.slice(0))},_doProcessBlock:function(J,ie){for(var pe=this._hash.words,ue=pe[0],de=pe[1],Y=pe[2],re=pe[3],fe=pe[4],Ae=pe[5],ye=pe[6],le=pe[7],Q=0;Q<64;Q++){if(Q<16)K[Q]=0|J[ie+Q];else{var ve=K[Q-15],Le=(ve<<25|ve>>>7)^(ve<<14|ve>>>18)^ve>>>3,me=K[Q-2],W=(me<<15|me>>>17)^(me<<13|me>>>19)^me>>>10;K[Q]=Le+K[Q-7]+W+K[Q-16]}var te=ue&de^ue&Y^de&Y,se=(ue<<30|ue>>>2)^(ue<<19|ue>>>13)^(ue<<10|ue>>>22),Te=le+((fe<<26|fe>>>6)^(fe<<21|fe>>>11)^(fe<<7|fe>>>25))+(fe&Ae^~fe&ye)+Z[Q]+K[Q];le=ye,ye=Ae,Ae=fe,fe=re+Te|0,re=Y,Y=de,de=ue,ue=Te+(se+te)|0}pe[0]=pe[0]+ue|0,pe[1]=pe[1]+de|0,pe[2]=pe[2]+Y|0,pe[3]=pe[3]+re|0,pe[4]=pe[4]+fe|0,pe[5]=pe[5]+Ae|0,pe[6]=pe[6]+ye|0,pe[7]=pe[7]+le|0},_doFinalize:function(){var J=this._data,ie=J.words,pe=8*this._nDataBytes,ue=8*J.sigBytes;return ie[ue>>>5]|=128<<24-ue%32,ie[14+(ue+64>>>9<<4)]=x.floor(pe/4294967296),ie[15+(ue+64>>>9<<4)]=pe,J.sigBytes=4*ie.length,this._process(),this._hash},clone:function(){var J=O.clone.call(this);return J._hash=this._hash.clone(),J}});$.SHA256=O._createHelper(oe),$.HmacSHA256=O._createHmacHelper(oe)}(Math),function(){var x=V,$=x.lib.WordArray,z=x.enc;function G(O){return O<<8&4278255360|O>>>8&16711935}z.Utf16=z.Utf16BE={stringify:function(O){for(var T=O.words,P=O.sigBytes,Z=[],K=0;K>>2]>>>16-K%4*8&65535;Z.push(String.fromCharCode(oe))}return Z.join("")},parse:function(O){for(var T=O.length,P=[],Z=0;Z>>1]|=O.charCodeAt(Z)<<16-Z%2*16;return $.create(P,2*T)}},z.Utf16LE={stringify:function(O){for(var T=O.words,P=O.sigBytes,Z=[],K=0;K>>2]>>>16-K%4*8&65535);Z.push(String.fromCharCode(oe))}return Z.join("")},parse:function(O){for(var T=O.length,P=[],Z=0;Z>>1]|=G(O.charCodeAt(Z)<<16-Z%2*16);return $.create(P,2*T)}}}(),function(){if(typeof ArrayBuffer=="function"){var x=V.lib.WordArray,$=x.init;(x.init=function(z){if(z instanceof ArrayBuffer&&(z=new Uint8Array(z)),(z instanceof Int8Array||typeof Uint8ClampedArray<"u"&&z instanceof Uint8ClampedArray||z instanceof Int16Array||z instanceof Uint16Array||z instanceof Int32Array||z instanceof Uint32Array||z instanceof Float32Array||z instanceof Float64Array)&&(z=new Uint8Array(z.buffer,z.byteOffset,z.byteLength)),z instanceof Uint8Array){for(var G=z.byteLength,O=[],T=0;T>>2]|=z[T]<<24-T%4*8;$.call(this,O,G)}else $.apply(this,arguments)}).prototype=x}}(),function(x){var $=V,z=$.lib,G=z.WordArray,O=z.Hasher,T=$.algo,P=G.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]),Z=G.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]),K=G.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]),oe=G.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]),J=G.create([0,1518500249,1859775393,2400959708,2840853838]),ie=G.create([1352829926,1548603684,1836072691,2053994217,0]),pe=T.RIPEMD160=O.extend({_doReset:function(){this._hash=G.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(ye,le){for(var Q=0;Q<16;Q++){var ve=le+Q,Le=ye[ve];ye[ve]=16711935&(Le<<8|Le>>>24)|4278255360&(Le<<24|Le>>>8)}var me,W,te,se,Te,ce,Se,Pe,xe,He,Ie,q=this._hash.words,ne=J.words,_e=ie.words,Be=P.words,je=Z.words,lt=K.words,Fe=oe.words;for(ce=me=q[0],Se=W=q[1],Pe=te=q[2],xe=se=q[3],He=Te=q[4],Q=0;Q<80;Q+=1)Ie=me+ye[le+Be[Q]]|0,Ie+=Q<16?ue(W,te,se)+ne[0]:Q<32?de(W,te,se)+ne[1]:Q<48?Y(W,te,se)+ne[2]:Q<64?re(W,te,se)+ne[3]:fe(W,te,se)+ne[4],Ie=(Ie=Ae(Ie|=0,lt[Q]))+Te|0,me=Te,Te=se,se=Ae(te,10),te=W,W=Ie,Ie=ce+ye[le+je[Q]]|0,Ie+=Q<16?fe(Se,Pe,xe)+_e[0]:Q<32?re(Se,Pe,xe)+_e[1]:Q<48?Y(Se,Pe,xe)+_e[2]:Q<64?de(Se,Pe,xe)+_e[3]:ue(Se,Pe,xe)+_e[4],Ie=(Ie=Ae(Ie|=0,Fe[Q]))+He|0,ce=He,He=xe,xe=Ae(Pe,10),Pe=Se,Se=Ie;Ie=q[1]+te+xe|0,q[1]=q[2]+se+He|0,q[2]=q[3]+Te+ce|0,q[3]=q[4]+me+Se|0,q[4]=q[0]+W+Pe|0,q[0]=Ie},_doFinalize:function(){var ye=this._data,le=ye.words,Q=8*this._nDataBytes,ve=8*ye.sigBytes;le[ve>>>5]|=128<<24-ve%32,le[14+(ve+64>>>9<<4)]=16711935&(Q<<8|Q>>>24)|4278255360&(Q<<24|Q>>>8),ye.sigBytes=4*(le.length+1),this._process();for(var Le=this._hash,me=Le.words,W=0;W<5;W++){var te=me[W];me[W]=16711935&(te<<8|te>>>24)|4278255360&(te<<24|te>>>8)}return Le},clone:function(){var ye=O.clone.call(this);return ye._hash=this._hash.clone(),ye}});function ue(ye,le,Q){return ye^le^Q}function de(ye,le,Q){return ye&le|~ye&Q}function Y(ye,le,Q){return(ye|~le)^Q}function re(ye,le,Q){return ye&Q|le&~Q}function fe(ye,le,Q){return ye^(le|~Q)}function Ae(ye,le){return ye<>>32-le}$.RIPEMD160=O._createHelper(pe),$.HmacRIPEMD160=O._createHmacHelper(pe)}(),function(){var x=V,$=x.lib.Base,z=x.enc.Utf8;x.algo.HMAC=$.extend({init:function(G,O){G=this._hasher=new G.init,typeof O=="string"&&(O=z.parse(O));var T=G.blockSize,P=4*T;O.sigBytes>P&&(O=G.finalize(O)),O.clamp();for(var Z=this._oKey=O.clone(),K=this._iKey=O.clone(),oe=Z.words,J=K.words,ie=0;ie>>24)|4278255360&(fe<<24|fe>>>8),Ae=16711935&(Ae<<8|Ae>>>24)|4278255360&(Ae<<24|Ae>>>8),(ne=de[re]).high^=Ae,ne.low^=fe}for(var ye=0;ye<24;ye++){for(var le=0;le<5;le++){for(var Q=0,ve=0,Le=0;Le<5;Le++)Q^=(ne=de[le+5*Le]).high,ve^=ne.low;var me=J[le];me.high=Q,me.low=ve}for(le=0;le<5;le++){var W=J[(le+4)%5],te=J[(le+1)%5],se=te.high,Te=te.low;for(Q=W.high^(se<<1|Te>>>31),ve=W.low^(Te<<1|se>>>31),Le=0;Le<5;Le++)(ne=de[le+5*Le]).high^=Q,ne.low^=ve}for(var ce=1;ce<25;ce++){var Se=(ne=de[ce]).high,Pe=ne.low,xe=Z[ce];xe<32?(Q=Se<>>32-xe,ve=Pe<>>32-xe):(Q=Pe<>>64-xe,ve=Se<>>64-xe);var He=J[K[ce]];He.high=Q,He.low=ve}var Ie=J[0],q=de[0];for(Ie.high=q.high,Ie.low=q.low,le=0;le<5;le++)for(Le=0;Le<5;Le++){var ne=de[ce=le+5*Le],_e=J[ce],Be=J[(le+1)%5+5*Le],je=J[(le+2)%5+5*Le];ne.high=_e.high^~Be.high&je.high,ne.low=_e.low^~Be.low&je.low}ne=de[0];var lt=oe[ye];ne.high^=lt.high,ne.low^=lt.low}},_doFinalize:function(){var pe=this._data,ue=pe.words,de=(this._nDataBytes,8*pe.sigBytes),Y=32*this.blockSize;ue[de>>>5]|=1<<24-de%32,ue[(x.ceil((de+1)/Y)*Y>>>5)-1]|=128,pe.sigBytes=4*ue.length,this._process();for(var re=this._state,fe=this.cfg.outputLength/8,Ae=fe/8,ye=[],le=0;le>>24)|4278255360&(ve<<24|ve>>>8),Le=16711935&(Le<<8|Le>>>24)|4278255360&(Le<<24|Le>>>8),ye.push(Le),ye.push(ve)}return new G.init(ye,fe)},clone:function(){for(var pe=O.clone.call(this),ue=pe._state=this._state.slice(0),de=0;de<25;de++)ue[de]=ue[de].clone();return pe}});$.SHA3=O._createHelper(ie),$.HmacSHA3=O._createHmacHelper(ie)}(Math),function(){var x=V,$=x.lib.Hasher,z=x.x64,G=z.Word,O=z.WordArray,T=x.algo;function P(){return G.create.apply(G,arguments)}var Z=[P(1116352408,3609767458),P(1899447441,602891725),P(3049323471,3964484399),P(3921009573,2173295548),P(961987163,4081628472),P(1508970993,3053834265),P(2453635748,2937671579),P(2870763221,3664609560),P(3624381080,2734883394),P(310598401,1164996542),P(607225278,1323610764),P(1426881987,3590304994),P(1925078388,4068182383),P(2162078206,991336113),P(2614888103,633803317),P(3248222580,3479774868),P(3835390401,2666613458),P(4022224774,944711139),P(264347078,2341262773),P(604807628,2007800933),P(770255983,1495990901),P(1249150122,1856431235),P(1555081692,3175218132),P(1996064986,2198950837),P(2554220882,3999719339),P(2821834349,766784016),P(2952996808,2566594879),P(3210313671,3203337956),P(3336571891,1034457026),P(3584528711,2466948901),P(113926993,3758326383),P(338241895,168717936),P(666307205,1188179964),P(773529912,1546045734),P(1294757372,1522805485),P(1396182291,2643833823),P(1695183700,2343527390),P(1986661051,1014477480),P(2177026350,1206759142),P(2456956037,344077627),P(2730485921,1290863460),P(2820302411,3158454273),P(3259730800,3505952657),P(3345764771,106217008),P(3516065817,3606008344),P(3600352804,1432725776),P(4094571909,1467031594),P(275423344,851169720),P(430227734,3100823752),P(506948616,1363258195),P(659060556,3750685593),P(883997877,3785050280),P(958139571,3318307427),P(1322822218,3812723403),P(1537002063,2003034995),P(1747873779,3602036899),P(1955562222,1575990012),P(2024104815,1125592928),P(2227730452,2716904306),P(2361852424,442776044),P(2428436474,593698344),P(2756734187,3733110249),P(3204031479,2999351573),P(3329325298,3815920427),P(3391569614,3928383900),P(3515267271,566280711),P(3940187606,3454069534),P(4118630271,4000239992),P(116418474,1914138554),P(174292421,2731055270),P(289380356,3203993006),P(460393269,320620315),P(685471733,587496836),P(852142971,1086792851),P(1017036298,365543100),P(1126000580,2618297676),P(1288033470,3409855158),P(1501505948,4234509866),P(1607167915,987167468),P(1816402316,1246189591)],K=[];(function(){for(var J=0;J<80;J++)K[J]=P()})();var oe=T.SHA512=$.extend({_doReset:function(){this._hash=new O.init([new G.init(1779033703,4089235720),new G.init(3144134277,2227873595),new G.init(1013904242,4271175723),new G.init(2773480762,1595750129),new G.init(1359893119,2917565137),new G.init(2600822924,725511199),new G.init(528734635,4215389547),new G.init(1541459225,327033209)])},_doProcessBlock:function(J,ie){for(var pe=this._hash.words,ue=pe[0],de=pe[1],Y=pe[2],re=pe[3],fe=pe[4],Ae=pe[5],ye=pe[6],le=pe[7],Q=ue.high,ve=ue.low,Le=de.high,me=de.low,W=Y.high,te=Y.low,se=re.high,Te=re.low,ce=fe.high,Se=fe.low,Pe=Ae.high,xe=Ae.low,He=ye.high,Ie=ye.low,q=le.high,ne=le.low,_e=Q,Be=ve,je=Le,lt=me,Fe=W,it=te,Tt=se,mn=Te,In=ce,Cn=Se,En=Pe,vn=xe,Qe=He,yt=Ie,Nt=q,ln=ne,en=0;en<80;en++){var Tn,qn,ze=K[en];if(en<16)qn=ze.high=0|J[ie+2*en],Tn=ze.low=0|J[ie+2*en+1];else{var wt=K[en-15],_t=wt.high,Bt=wt.low,Wt=(_t>>>1|Bt<<31)^(_t>>>8|Bt<<24)^_t>>>7,mr=(Bt>>>1|_t<<31)^(Bt>>>8|_t<<24)^(Bt>>>7|_t<<25),Cr=K[en-2],Xo=Cr.high,ho=Cr.low,$e=(Xo>>>19|ho<<13)^(Xo<<3|ho>>>29)^Xo>>>6,Ze=(ho>>>19|Xo<<13)^(ho<<3|Xo>>>29)^(ho>>>6|Xo<<26),Ht=K[en-7],wn=Ht.high,Mn=Ht.low,Pn=K[en-16],Kr=Pn.high,Gr=Pn.low;qn=(qn=(qn=Wt+wn+((Tn=mr+Mn)>>>0>>0?1:0))+$e+((Tn+=Ze)>>>0>>0?1:0))+Kr+((Tn+=Gr)>>>0>>0?1:0),ze.high=qn,ze.low=Tn}var ro,ls=In&En^~In&Qe,U=Cn&vn^~Cn&yt,us=_e&je^_e&Fe^je&Fe,Gt=Be<^Be&it^lt&it,yl=(_e>>>28|Be<<4)^(_e<<30|Be>>>2)^(_e<<25|Be>>>7),Zs=(Be>>>28|_e<<4)^(Be<<30|_e>>>2)^(Be<<25|_e>>>7),_l=(In>>>14|Cn<<18)^(In>>>18|Cn<<14)^(In<<23|Cn>>>9),bl=(Cn>>>14|In<<18)^(Cn>>>18|In<<14)^(Cn<<23|In>>>9),Oa=Z[en],Zo=Oa.high,Ra=Oa.low,cs=Nt+_l+((ro=ln+bl)>>>0>>0?1:0),Ji=Zs+Gt;Nt=Qe,ln=yt,Qe=En,yt=vn,En=In,vn=Cn,In=Tt+(cs=(cs=(cs=cs+ls+((ro+=U)>>>0>>0?1:0))+Zo+((ro+=Ra)>>>0>>0?1:0))+qn+((ro+=Tn)>>>0>>0?1:0))+((Cn=mn+ro|0)>>>0>>0?1:0)|0,Tt=Fe,mn=it,Fe=je,it=lt,je=_e,lt=Be,_e=cs+(yl+us+(Ji>>>0>>0?1:0))+((Be=ro+Ji|0)>>>0>>0?1:0)|0}ve=ue.low=ve+Be,ue.high=Q+_e+(ve>>>0>>0?1:0),me=de.low=me+lt,de.high=Le+je+(me>>>0>>0?1:0),te=Y.low=te+it,Y.high=W+Fe+(te>>>0>>0?1:0),Te=re.low=Te+mn,re.high=se+Tt+(Te>>>0>>0?1:0),Se=fe.low=Se+Cn,fe.high=ce+In+(Se>>>0>>0?1:0),xe=Ae.low=xe+vn,Ae.high=Pe+En+(xe>>>0>>0?1:0),Ie=ye.low=Ie+yt,ye.high=He+Qe+(Ie>>>0>>0?1:0),ne=le.low=ne+ln,le.high=q+Nt+(ne>>>0>>0?1:0)},_doFinalize:function(){var J=this._data,ie=J.words,pe=8*this._nDataBytes,ue=8*J.sigBytes;return ie[ue>>>5]|=128<<24-ue%32,ie[30+(ue+128>>>10<<5)]=Math.floor(pe/4294967296),ie[31+(ue+128>>>10<<5)]=pe,J.sigBytes=4*ie.length,this._process(),this._hash.toX32()},clone:function(){var J=$.clone.call(this);return J._hash=this._hash.clone(),J},blockSize:32});x.SHA512=$._createHelper(oe),x.HmacSHA512=$._createHmacHelper(oe)}(),function(){var x=V,$=x.x64,z=$.Word,G=$.WordArray,O=x.algo,T=O.SHA512,P=O.SHA384=T.extend({_doReset:function(){this._hash=new G.init([new z.init(3418070365,3238371032),new z.init(1654270250,914150663),new z.init(2438529370,812702999),new z.init(355462360,4144912697),new z.init(1731405415,4290775857),new z.init(2394180231,1750603025),new z.init(3675008525,1694076839),new z.init(1203062813,3204075428)])},_doFinalize:function(){var Z=T._doFinalize.call(this);return Z.sigBytes-=16,Z}});x.SHA384=T._createHelper(P),x.HmacSHA384=T._createHmacHelper(P)}(),V.lib.Cipher||function(x){var $=V,z=$.lib,G=z.Base,O=z.WordArray,T=z.BufferedBlockAlgorithm,P=$.enc,Z=(P.Utf8,P.Base64),K=$.algo.EvpKDF,oe=z.Cipher=T.extend({cfg:G.extend(),createEncryptor:function(ye,le){return this.create(this._ENC_XFORM_MODE,ye,le)},createDecryptor:function(ye,le){return this.create(this._DEC_XFORM_MODE,ye,le)},init:function(ye,le,Q){this.cfg=this.cfg.extend(Q),this._xformMode=ye,this._key=le,this.reset()},reset:function(){T.reset.call(this),this._doReset()},process:function(ye){return this._append(ye),this._process()},finalize:function(ye){return ye&&this._append(ye),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function ye(le){return typeof le=="string"?Ae:re}return function(le){return{encrypt:function(Q,ve,Le){return ye(ve).encrypt(le,Q,ve,Le)},decrypt:function(Q,ve,Le){return ye(ve).decrypt(le,Q,ve,Le)}}}}()}),J=(z.StreamCipher=oe.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),$.mode={}),ie=z.BlockCipherMode=G.extend({createEncryptor:function(ye,le){return this.Encryptor.create(ye,le)},createDecryptor:function(ye,le){return this.Decryptor.create(ye,le)},init:function(ye,le){this._cipher=ye,this._iv=le}}),pe=J.CBC=function(){var ye=ie.extend();function le(Q,ve,Le){var me,W=this._iv;W?(me=W,this._iv=void 0):me=this._prevBlock;for(var te=0;te>>2];ye.sigBytes-=le}},de=(z.BlockCipher=oe.extend({cfg:oe.cfg.extend({mode:pe,padding:ue}),reset:function(){var ye;oe.reset.call(this);var le=this.cfg,Q=le.iv,ve=le.mode;this._xformMode==this._ENC_XFORM_MODE?ye=ve.createEncryptor:(ye=ve.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==ye?this._mode.init(this,Q&&Q.words):(this._mode=ye.call(ve,this,Q&&Q.words),this._mode.__creator=ye)},_doProcessBlock:function(ye,le){this._mode.processBlock(ye,le)},_doFinalize:function(){var ye,le=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(le.pad(this._data,this.blockSize),ye=this._process(!0)):(ye=this._process(!0),le.unpad(ye)),ye},blockSize:4}),z.CipherParams=G.extend({init:function(ye){this.mixIn(ye)},toString:function(ye){return(ye||this.formatter).stringify(this)}})),Y=($.format={}).OpenSSL={stringify:function(ye){var le=ye.ciphertext,Q=ye.salt;return(Q?O.create([1398893684,1701076831]).concat(Q).concat(le):le).toString(Z)},parse:function(ye){var le,Q=Z.parse(ye),ve=Q.words;return ve[0]==1398893684&&ve[1]==1701076831&&(le=O.create(ve.slice(2,4)),ve.splice(0,4),Q.sigBytes-=16),de.create({ciphertext:Q,salt:le})}},re=z.SerializableCipher=G.extend({cfg:G.extend({format:Y}),encrypt:function(ye,le,Q,ve){ve=this.cfg.extend(ve);var Le=ye.createEncryptor(Q,ve),me=Le.finalize(le),W=Le.cfg;return de.create({ciphertext:me,key:Q,iv:W.iv,algorithm:ye,mode:W.mode,padding:W.padding,blockSize:ye.blockSize,formatter:ve.format})},decrypt:function(ye,le,Q,ve){return ve=this.cfg.extend(ve),le=this._parse(le,ve.format),ye.createDecryptor(Q,ve).finalize(le.ciphertext)},_parse:function(ye,le){return typeof ye=="string"?le.parse(ye,this):ye}}),fe=($.kdf={}).OpenSSL={execute:function(ye,le,Q,ve){ve||(ve=O.random(8));var Le=K.create({keySize:le+Q}).compute(ye,ve),me=O.create(Le.words.slice(le),4*Q);return Le.sigBytes=4*le,de.create({key:Le,iv:me,salt:ve})}},Ae=z.PasswordBasedCipher=re.extend({cfg:re.cfg.extend({kdf:fe}),encrypt:function(ye,le,Q,ve){var Le=(ve=this.cfg.extend(ve)).kdf.execute(Q,ye.keySize,ye.ivSize);ve.iv=Le.iv;var me=re.encrypt.call(this,ye,le,Le.key,ve);return me.mixIn(Le),me},decrypt:function(ye,le,Q,ve){ve=this.cfg.extend(ve),le=this._parse(le,ve.format);var Le=ve.kdf.execute(Q,ye.keySize,ye.ivSize,le.salt);return ve.iv=Le.iv,re.decrypt.call(this,ye,le,Le.key,ve)}})}(),V.mode.CFB=function(){var x=V.lib.BlockCipherMode.extend();function $(z,G,O,T){var P,Z=this._iv;Z?(P=Z.slice(0),this._iv=void 0):P=this._prevBlock,T.encryptBlock(P,0);for(var K=0;K>>2]|=O<<24-T%4*8,x.sigBytes+=O},unpad:function(x){var $=255&x.words[x.sigBytes-1>>>2];x.sigBytes-=$}},V.pad.Iso10126={pad:function(x,$){var z=4*$,G=z-x.sigBytes%z;x.concat(V.lib.WordArray.random(G-1)).concat(V.lib.WordArray.create([G<<24],1))},unpad:function(x){var $=255&x.words[x.sigBytes-1>>>2];x.sigBytes-=$}},V.pad.Iso97971={pad:function(x,$){x.concat(V.lib.WordArray.create([2147483648],1)),V.pad.ZeroPadding.pad(x,$)},unpad:function(x){V.pad.ZeroPadding.unpad(x),x.sigBytes--}},V.mode.OFB=(S=V.lib.BlockCipherMode.extend(),N=S.Encryptor=S.extend({processBlock:function(x,$){var z=this._cipher,G=z.blockSize,O=this._iv,T=this._keystream;O&&(T=this._keystream=O.slice(0),this._iv=void 0),z.encryptBlock(T,0);for(var P=0;P>>8^255&ye^99,G[fe]=ye,O[ye]=fe;var le=Y[fe],Q=Y[le],ve=Y[Q],Le=257*Y[ye]^16843008*ye;T[fe]=Le<<24|Le>>>8,P[fe]=Le<<16|Le>>>16,Z[fe]=Le<<8|Le>>>24,K[fe]=Le,Le=16843009*ve^65537*Q^257*le^16843008*fe,oe[ye]=Le<<24|Le>>>8,J[ye]=Le<<16|Le>>>16,ie[ye]=Le<<8|Le>>>24,pe[ye]=Le,fe?(fe=le^Y[Y[Y[ve^le]]],Ae^=Y[Y[Ae]]):fe=Ae=1}})();var ue=[0,1,2,4,8,16,32,64,128,27,54],de=z.AES=$.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var Y=this._keyPriorReset=this._key,re=Y.words,fe=Y.sigBytes/4,Ae=4*((this._nRounds=fe+6)+1),ye=this._keySchedule=[],le=0;le6&&le%fe==4&&(Le=G[Le>>>24]<<24|G[Le>>>16&255]<<16|G[Le>>>8&255]<<8|G[255&Le]):(Le=G[(Le=Le<<8|Le>>>24)>>>24]<<24|G[Le>>>16&255]<<16|G[Le>>>8&255]<<8|G[255&Le],Le^=ue[le/fe|0]<<24),ye[le]=ye[le-fe]^Le);for(var Q=this._invKeySchedule=[],ve=0;ve>>24]]^J[G[Le>>>16&255]]^ie[G[Le>>>8&255]]^pe[G[255&Le]]}}},encryptBlock:function(Y,re){this._doCryptBlock(Y,re,this._keySchedule,T,P,Z,K,G)},decryptBlock:function(Y,re){var fe=Y[re+1];Y[re+1]=Y[re+3],Y[re+3]=fe,this._doCryptBlock(Y,re,this._invKeySchedule,oe,J,ie,pe,O),fe=Y[re+1],Y[re+1]=Y[re+3],Y[re+3]=fe},_doCryptBlock:function(Y,re,fe,Ae,ye,le,Q,ve){for(var Le=this._nRounds,me=Y[re]^fe[0],W=Y[re+1]^fe[1],te=Y[re+2]^fe[2],se=Y[re+3]^fe[3],Te=4,ce=1;ce>>24]^ye[W>>>16&255]^le[te>>>8&255]^Q[255&se]^fe[Te++],Pe=Ae[W>>>24]^ye[te>>>16&255]^le[se>>>8&255]^Q[255&me]^fe[Te++],xe=Ae[te>>>24]^ye[se>>>16&255]^le[me>>>8&255]^Q[255&W]^fe[Te++],He=Ae[se>>>24]^ye[me>>>16&255]^le[W>>>8&255]^Q[255&te]^fe[Te++];me=Se,W=Pe,te=xe,se=He}Se=(ve[me>>>24]<<24|ve[W>>>16&255]<<16|ve[te>>>8&255]<<8|ve[255&se])^fe[Te++],Pe=(ve[W>>>24]<<24|ve[te>>>16&255]<<16|ve[se>>>8&255]<<8|ve[255&me])^fe[Te++],xe=(ve[te>>>24]<<24|ve[se>>>16&255]<<16|ve[me>>>8&255]<<8|ve[255&W])^fe[Te++],He=(ve[se>>>24]<<24|ve[me>>>16&255]<<16|ve[W>>>8&255]<<8|ve[255&te])^fe[Te++],Y[re]=Se,Y[re+1]=Pe,Y[re+2]=xe,Y[re+3]=He},keySize:8});x.AES=$._createHelper(de)}(),function(){var x=V,$=x.lib,z=$.WordArray,G=$.BlockCipher,O=x.algo,T=[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],P=[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],Z=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],K=[{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}],oe=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],J=O.DES=G.extend({_doReset:function(){for(var de=this._key.words,Y=[],re=0;re<56;re++){var fe=T[re]-1;Y[re]=de[fe>>>5]>>>31-fe%32&1}for(var Ae=this._subKeys=[],ye=0;ye<16;ye++){var le=Ae[ye]=[],Q=Z[ye];for(re=0;re<24;re++)le[re/6|0]|=Y[(P[re]-1+Q)%28]<<31-re%6,le[4+(re/6|0)]|=Y[28+(P[re+24]-1+Q)%28]<<31-re%6;for(le[0]=le[0]<<1|le[0]>>>31,re=1;re<7;re++)le[re]=le[re]>>>4*(re-1)+3;le[7]=le[7]<<5|le[7]>>>27}var ve=this._invSubKeys=[];for(re=0;re<16;re++)ve[re]=Ae[15-re]},encryptBlock:function(de,Y){this._doCryptBlock(de,Y,this._subKeys)},decryptBlock:function(de,Y){this._doCryptBlock(de,Y,this._invSubKeys)},_doCryptBlock:function(de,Y,re){this._lBlock=de[Y],this._rBlock=de[Y+1],ie.call(this,4,252645135),ie.call(this,16,65535),pe.call(this,2,858993459),pe.call(this,8,16711935),ie.call(this,1,1431655765);for(var fe=0;fe<16;fe++){for(var Ae=re[fe],ye=this._lBlock,le=this._rBlock,Q=0,ve=0;ve<8;ve++)Q|=K[ve][((le^Ae[ve])&oe[ve])>>>0];this._lBlock=le,this._rBlock=ye^Q}var Le=this._lBlock;this._lBlock=this._rBlock,this._rBlock=Le,ie.call(this,1,1431655765),pe.call(this,8,16711935),pe.call(this,2,858993459),ie.call(this,16,65535),ie.call(this,4,252645135),de[Y]=this._lBlock,de[Y+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function ie(de,Y){var re=(this._lBlock>>>de^this._rBlock)&Y;this._rBlock^=re,this._lBlock^=re<>>de^this._lBlock)&Y;this._lBlock^=re,this._rBlock^=re<192.");var Y=de.slice(0,2),re=de.length<4?de.slice(0,2):de.slice(2,4),fe=de.length<6?de.slice(0,2):de.slice(4,6);this._des1=J.createEncryptor(z.create(Y)),this._des2=J.createEncryptor(z.create(re)),this._des3=J.createEncryptor(z.create(fe))},encryptBlock:function(de,Y){this._des1.encryptBlock(de,Y),this._des2.decryptBlock(de,Y),this._des3.encryptBlock(de,Y)},decryptBlock:function(de,Y){this._des3.decryptBlock(de,Y),this._des2.encryptBlock(de,Y),this._des1.decryptBlock(de,Y)},keySize:6,ivSize:2,blockSize:2});x.TripleDES=G._createHelper(ue)}(),function(){var x=V,$=x.lib.StreamCipher,z=x.algo,G=z.RC4=$.extend({_doReset:function(){for(var P=this._key,Z=P.words,K=P.sigBytes,oe=this._S=[],J=0;J<256;J++)oe[J]=J;J=0;for(var ie=0;J<256;J++){var pe=J%K,ue=Z[pe>>>2]>>>24-pe%4*8&255;ie=(ie+oe[J]+ue)%256;var de=oe[J];oe[J]=oe[ie],oe[ie]=de}this._i=this._j=0},_doProcessBlock:function(P,Z){P[Z]^=O.call(this)},keySize:8,ivSize:0});function O(){for(var P=this._S,Z=this._i,K=this._j,oe=0,J=0;J<4;J++){K=(K+P[Z=(Z+1)%256])%256;var ie=P[Z];P[Z]=P[K],P[K]=ie,oe|=P[(P[Z]+P[K])%256]<<24-8*J}return this._i=Z,this._j=K,oe}x.RC4=$._createHelper(G);var T=z.RC4Drop=G.extend({cfg:G.cfg.extend({drop:192}),_doReset:function(){G._doReset.call(this);for(var P=this.cfg.drop;P>0;P--)O.call(this)}});x.RC4Drop=$._createHelper(T)}(),V.mode.CTRGladman=function(){var x=V.lib.BlockCipherMode.extend();function $(G){if((G>>24&255)==255){var O=G>>16&255,T=G>>8&255,P=255&G;O===255?(O=0,T===255?(T=0,P===255?P=0:++P):++T):++O,G=0,G+=O<<16,G+=T<<8,G+=P}else G+=1<<24;return G}var z=x.Encryptor=x.extend({processBlock:function(G,O){var T=this._cipher,P=T.blockSize,Z=this._iv,K=this._counter;Z&&(K=this._counter=Z.slice(0),this._iv=void 0),function(ie){(ie[0]=$(ie[0]))===0&&(ie[1]=$(ie[1]))}(K);var oe=K.slice(0);T.encryptBlock(oe,0);for(var J=0;J>>24)|4278255360&(K[J]<<24|K[J]>>>8);var ie=this._X=[K[0],K[3]<<16|K[2]>>>16,K[1],K[0]<<16|K[3]>>>16,K[2],K[1]<<16|K[0]>>>16,K[3],K[2]<<16|K[1]>>>16],pe=this._C=[K[2]<<16|K[2]>>>16,4294901760&K[0]|65535&K[1],K[3]<<16|K[3]>>>16,4294901760&K[1]|65535&K[2],K[0]<<16|K[0]>>>16,4294901760&K[2]|65535&K[3],K[1]<<16|K[1]>>>16,4294901760&K[3]|65535&K[0]];for(this._b=0,J=0;J<4;J++)Z.call(this);for(J=0;J<8;J++)pe[J]^=ie[J+4&7];if(oe){var ue=oe.words,de=ue[0],Y=ue[1],re=16711935&(de<<8|de>>>24)|4278255360&(de<<24|de>>>8),fe=16711935&(Y<<8|Y>>>24)|4278255360&(Y<<24|Y>>>8),Ae=re>>>16|4294901760&fe,ye=fe<<16|65535&re;for(pe[0]^=re,pe[1]^=Ae,pe[2]^=fe,pe[3]^=ye,pe[4]^=re,pe[5]^=Ae,pe[6]^=fe,pe[7]^=ye,J=0;J<4;J++)Z.call(this)}},_doProcessBlock:function(K,oe){var J=this._X;Z.call(this),G[0]=J[0]^J[5]>>>16^J[3]<<16,G[1]=J[2]^J[7]>>>16^J[5]<<16,G[2]=J[4]^J[1]>>>16^J[7]<<16,G[3]=J[6]^J[3]>>>16^J[1]<<16;for(var ie=0;ie<4;ie++)G[ie]=16711935&(G[ie]<<8|G[ie]>>>24)|4278255360&(G[ie]<<24|G[ie]>>>8),K[oe+ie]^=G[ie]},blockSize:4,ivSize:2});function Z(){for(var K=this._X,oe=this._C,J=0;J<8;J++)O[J]=oe[J];for(oe[0]=oe[0]+1295307597+this._b|0,oe[1]=oe[1]+3545052371+(oe[0]>>>0>>0?1:0)|0,oe[2]=oe[2]+886263092+(oe[1]>>>0>>0?1:0)|0,oe[3]=oe[3]+1295307597+(oe[2]>>>0>>0?1:0)|0,oe[4]=oe[4]+3545052371+(oe[3]>>>0>>0?1:0)|0,oe[5]=oe[5]+886263092+(oe[4]>>>0>>0?1:0)|0,oe[6]=oe[6]+1295307597+(oe[5]>>>0>>0?1:0)|0,oe[7]=oe[7]+3545052371+(oe[6]>>>0>>0?1:0)|0,this._b=oe[7]>>>0>>0?1:0,J=0;J<8;J++){var ie=K[J]+oe[J],pe=65535&ie,ue=ie>>>16,de=((pe*pe>>>17)+pe*ue>>>15)+ue*ue,Y=((4294901760&ie)*ie|0)+((65535&ie)*ie|0);T[J]=de^Y}K[0]=T[0]+(T[7]<<16|T[7]>>>16)+(T[6]<<16|T[6]>>>16)|0,K[1]=T[1]+(T[0]<<8|T[0]>>>24)+T[7]|0,K[2]=T[2]+(T[1]<<16|T[1]>>>16)+(T[0]<<16|T[0]>>>16)|0,K[3]=T[3]+(T[2]<<8|T[2]>>>24)+T[1]|0,K[4]=T[4]+(T[3]<<16|T[3]>>>16)+(T[2]<<16|T[2]>>>16)|0,K[5]=T[5]+(T[4]<<8|T[4]>>>24)+T[3]|0,K[6]=T[6]+(T[5]<<16|T[5]>>>16)+(T[4]<<16|T[4]>>>16)|0,K[7]=T[7]+(T[6]<<8|T[6]>>>24)+T[5]|0}x.Rabbit=$._createHelper(P)}(),V.mode.CTR=function(){var x=V.lib.BlockCipherMode.extend(),$=x.Encryptor=x.extend({processBlock:function(z,G){var O=this._cipher,T=O.blockSize,P=this._iv,Z=this._counter;P&&(Z=this._counter=P.slice(0),this._iv=void 0);var K=Z.slice(0);O.encryptBlock(K,0),Z[T-1]=Z[T-1]+1|0;for(var oe=0;oe>>16,K[1],K[0]<<16|K[3]>>>16,K[2],K[1]<<16|K[0]>>>16,K[3],K[2]<<16|K[1]>>>16],ie=this._C=[K[2]<<16|K[2]>>>16,4294901760&K[0]|65535&K[1],K[3]<<16|K[3]>>>16,4294901760&K[1]|65535&K[2],K[0]<<16|K[0]>>>16,4294901760&K[2]|65535&K[3],K[1]<<16|K[1]>>>16,4294901760&K[3]|65535&K[0]];this._b=0;for(var pe=0;pe<4;pe++)Z.call(this);for(pe=0;pe<8;pe++)ie[pe]^=J[pe+4&7];if(oe){var ue=oe.words,de=ue[0],Y=ue[1],re=16711935&(de<<8|de>>>24)|4278255360&(de<<24|de>>>8),fe=16711935&(Y<<8|Y>>>24)|4278255360&(Y<<24|Y>>>8),Ae=re>>>16|4294901760&fe,ye=fe<<16|65535&re;for(ie[0]^=re,ie[1]^=Ae,ie[2]^=fe,ie[3]^=ye,ie[4]^=re,ie[5]^=Ae,ie[6]^=fe,ie[7]^=ye,pe=0;pe<4;pe++)Z.call(this)}},_doProcessBlock:function(K,oe){var J=this._X;Z.call(this),G[0]=J[0]^J[5]>>>16^J[3]<<16,G[1]=J[2]^J[7]>>>16^J[5]<<16,G[2]=J[4]^J[1]>>>16^J[7]<<16,G[3]=J[6]^J[3]>>>16^J[1]<<16;for(var ie=0;ie<4;ie++)G[ie]=16711935&(G[ie]<<8|G[ie]>>>24)|4278255360&(G[ie]<<24|G[ie]>>>8),K[oe+ie]^=G[ie]},blockSize:4,ivSize:2});function Z(){for(var K=this._X,oe=this._C,J=0;J<8;J++)O[J]=oe[J];for(oe[0]=oe[0]+1295307597+this._b|0,oe[1]=oe[1]+3545052371+(oe[0]>>>0>>0?1:0)|0,oe[2]=oe[2]+886263092+(oe[1]>>>0>>0?1:0)|0,oe[3]=oe[3]+1295307597+(oe[2]>>>0>>0?1:0)|0,oe[4]=oe[4]+3545052371+(oe[3]>>>0>>0?1:0)|0,oe[5]=oe[5]+886263092+(oe[4]>>>0>>0?1:0)|0,oe[6]=oe[6]+1295307597+(oe[5]>>>0>>0?1:0)|0,oe[7]=oe[7]+3545052371+(oe[6]>>>0>>0?1:0)|0,this._b=oe[7]>>>0>>0?1:0,J=0;J<8;J++){var ie=K[J]+oe[J],pe=65535&ie,ue=ie>>>16,de=((pe*pe>>>17)+pe*ue>>>15)+ue*ue,Y=((4294901760&ie)*ie|0)+((65535&ie)*ie|0);T[J]=de^Y}K[0]=T[0]+(T[7]<<16|T[7]>>>16)+(T[6]<<16|T[6]>>>16)|0,K[1]=T[1]+(T[0]<<8|T[0]>>>24)+T[7]|0,K[2]=T[2]+(T[1]<<16|T[1]>>>16)+(T[0]<<16|T[0]>>>16)|0,K[3]=T[3]+(T[2]<<8|T[2]>>>24)+T[1]|0,K[4]=T[4]+(T[3]<<16|T[3]>>>16)+(T[2]<<16|T[2]>>>16)|0,K[5]=T[5]+(T[4]<<8|T[4]>>>24)+T[3]|0,K[6]=T[6]+(T[5]<<16|T[5]>>>16)+(T[4]<<16|T[4]>>>16)|0,K[7]=T[7]+(T[6]<<8|T[6]>>>24)+T[5]|0}x.RabbitLegacy=$._createHelper(P)}(),V.pad.ZeroPadding={pad:function(x,$){var z=4*$;x.clamp(),x.sigBytes+=z-(x.sigBytes%z||z)},unpad:function(x){var $=x.words,z=x.sigBytes-1;for(z=x.sigBytes-1;z>=0;z--)if($[z>>>2]>>>24-z%4*8&255){x.sigBytes=z+1;break}}},V)});return function(){function D(w){n(this,D);var S=w.logger,N=w.isArray,A=w.isMap,L=w.isDevMode;this._isArray=N,this._isMap=A,this._isDevMode=L,S.log("TIMProfanityFilterPlugin.VERSION:".concat("0.9.0")),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}return o(D,[{key:"onToken",value:function(w){this._key=C.enc.Utf8.parse(w.slice(0,32)),this._iv=this._key,this._decryptOptions={iv:this._iv,mode:C.mode.CBC,padding:C.pad.Pkcs7}}},{key:"onLexiconSliced",value:function(w){if(this._isArray(w)&&w.length!==0){var S,N,A,L=f(w);try{for(L.s();!(A=L.n()).done;){var j=A.value,V=j.filterType,x=j.profanityType,$=j.profanity,z=j.replacement;S=this._getDecryptedString($),N=this._getDecryptedString(z),V===1?x===1?this._interceptProfanityList.push(S):x===2&&this._interceptRegExpList.push(S):V===2&&(x===1?this._replacingProfanityMap.set(S,N):x===2&&this._replacingRegExpMap.set(S,N))}}catch(G){L.e(G)}finally{L.f()}}}},{key:"_getDecryptedString",value:function(w){var S=C.AES.decrypt(w,this._key,this._decryptOptions);return C.enc.Utf8.stringify(S).toLowerCase()}},{key:"onLexiconCompleted",value:function(w){this.onLexiconSliced(w),this._interceptFilter=new v({input:this._interceptProfanityList,isArray:this._isArray,isMap:this._isMap}),this._replacingFilter=new v({input:this._replacingProfanityMap,isArray:this._isArray,isMap:this._isMap}),this._isDevMode===!0&&(console.log("TIMProfanityFilterPlugin _interceptProfanityList ->",this._interceptProfanityList),console.log("TIMProfanityFilterPlugin _interceptRegExpList ->",this._interceptRegExpList),console.log("TIMProfanityFilterPlugin _replacingProfanityMap ->",this._replacingProfanityMap),console.log("TIMProfanityFilterPlugin _replacingRegExpMap ->",this._replacingRegExpMap))}},{key:"filter",value:function(w){var S={type:0,modifiedText:w};if(this._interceptFilter.filter({text:w,replacingEnabled:!1}).isMatched===!0)return S.type=1,S;for(var N=!1,A=0,L=this._interceptRegExpList.length;A{})}destroyed(){}component(t,n){}use(t,n){}setAwaitFunc(t,n){}setCommonStore(t){}setComponentStore(t,n,r){}getStore(){}storeCommonListener(t,n){}}class ofe{setCommonStore(t){}setComponentStore(t,n,r){}storeCommonListener(t,n){}}class ife extends ofe{constructor(){super();Kt(this,"store");Kt(this,"storeListener");this.storeListener={keys:[],callback:()=>{}},this.store={};const n={};this.store.common=new Proxy(n,{get:(r,o)=>r[o],set:(r,o,i)=>{const s={};return Object.assign(s,r),r[o]=i,r[o]!==s[o]&&this.storeListener.keys.indexOf(o)>=0&&this.storeListener.callback(r[o],s[o]),r[o]}})}setCommonStore(n){return Object.keys(n).forEach(r=>{if(r in this.store.common)return new Error(`${r} 在公共数据已存在,请重新设置`);this.store.common[r]=n[r]}),this.store}setComponentStore(n,r,o){return n in this.store?new Error(`${n} 该数据模块已存在,请重新设置`):this.store[n]=new Proxy(r,{get:(i,s)=>i[s],set:(i,s,u)=>{const d={};return Object.assign(d,i),i[s]=u,i[s]!==d[s]&&o&&o(i,d),i}})}storeCommonListener(n,r){this.storeListener={keys:n,callback:r}}}const MD=e=>typeof e=="function",Rr=class Rr extends rfe{constructor(n){super();Kt(this,"isOfficial",!1);Kt(this,"isIntl",!1);Kt(this,"tim");Kt(this,"TIM");Kt(this,"isSDKReady",!1);Kt(this,"store");Kt(this,"TUIEnv");Kt(this,"SDKAppID");Kt(this,"installedPlugins",new Set);Kt(this,"config",{});Kt(this,"TUIServer");Kt(this,"TUIComponents",new Set);Kt(this,"loginResolveRejectCache");this.loginResolveRejectCache=[],this.SDKAppID=n.SDKAppID,this.TUIServer={},this.store=new ife,this.TIM=vt,window.TIM=vt,n.tim?window.TUIKit=n.tim:window.TUIKit=vt.create({SDKAppID:this.SDKAppID}),this.tim=window.TUIKit,this.tim.registerPlugin({"tim-upload-plugin":efe}),this.tim.registerPlugin({"tim-profanity-filter-plugin":nfe}),this.bindTIMEvent(),this.TUIEnv=zh(),this.isOfficial=this.SDKAppID===1400187352||this.SDKAppID===1400188366}static init(n){return Rr.instance||(Rr.instance=new Rr(n)),zh(),window.TUIKitTUICore=Rr.instance,Rr.instance.use(V7),Rr.instance.use(EM),Rr.instance}install(n){n.config.globalProperties.$TUIKit=this.getInstance();let r=!0;this.installedPlugins.forEach(o=>{n.use(o),o.name==="TUIComponents"&&(r=!1)}),r&&this.TUIComponents.forEach(o=>{n.component(o.name,o.component)}),h$(n)}getInstance(){return Rr.instance}login(n){return new Promise((r,o)=>{this.tim.login(n).then(()=>{var i,s,u;return this.loginResolveRejectCache.push({resolve:r,reject:o}),Rr.isLogin=!0,window._isTIMCallKit=!0,(u=(s=(i=Rr==null?void 0:Rr.instance)==null?void 0:i.TUIServer)==null?void 0:s.TUICallKit)==null||u.init({SDKAppID:this.SDKAppID,userID:n.userID,userSig:n.userSig,tim:this.tim}),null}).catch(i=>{o(i)})})}logout(){return new Promise((n,r)=>{this.tim.logout().then(o=>{this.isSDKReady=!1,Rr.isLogin=!1,n(o)}).catch(o=>{r(o)})})}bindTIMEvent(){this.tim.on(vt.EVENT.SDK_READY,this.handleSDKReady,this)}unbindTIMEvent(){this.tim.off(vt.EVENT.SDK_READY,this.handleSDKReady)}handleSDKReady(){this.isSDKReady=!0,this.handelAwaitFunc(Rr.TUIServerFunMap),this.loginResolveRejectCache.forEach(({resolve:n})=>{n({msg:"登录成功,且SDK Ready"})})}handelAwaitFunc(n){const r=Object.keys(this.TUIServer);for(let o=0;o0&&i.map(s=>s()),n==null||n.delete(r[o])}return n}destroyed(){this.unbindTIMEvent(),this.isSDKReady=!1}component(n,r){const o=this.getInstance();return this.TUIServer||(this.TUIServer={}),this.TUIServer[n]=r.server,this.TUIComponents.has(r)?console.warn(`${n} component has already been applied to target TUICore.`):this.TUIComponents.add(r),o}use(n,r){const o=this.getInstance();return this.installedPlugins.has(n)?console.warn("Plugin has already been applied to target TUICore."):n&&MD(n==null?void 0:n.plugin)?(this.installedPlugins.add(n),n==null||n.plugin(o,r)):MD(n)?(this.installedPlugins.add(n),n(o,r)):console.warn('A plugin must either be a function or an object with an "plugin" function.'),o}usePlugin(n){let r={};return this.installedPlugins.forEach(o=>{o.name===n&&(r=o)}),r}setAwaitFunc(n,r){if(this.isSDKReady)r();else{Rr.TUIServerFunMap||(Rr.TUIServerFunMap=new Map);const o=Rr.TUIServerFunMap.get(n)||[];o.push(r),Rr.TUIServerFunMap.set(n,o)}}setCommonStore(n){return this.store.setCommonStore(n)}setComponentStore(n,r,o){return this.store.setComponentStore(n,r,o)}getStore(){return this.store.store}storeCommonListener(n,r){return this.store.storeCommonListener(n,r)}};Kt(Rr,"instance"),Kt(Rr,"isLogin",!1),Kt(Rr,"TUIServerFunMap");let yI=Rr;var xf=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},va=[],ys=[],sfe=typeof Uint8Array<"u"?Uint8Array:Array,LT=!1;function _P(){LT=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t>18&63]+va[o>>12&63]+va[o>>6&63]+va[63&o]);return i.join("")}function ID(e){var t;LT||_P();for(var n=e.length,r=n%3,o="",i=[],s=0,u=n-r;su?u:s+16383));return r===1?(t=e[n-1],o+=va[t>>2],o+=va[t<<4&63],o+="=="):r===2&&(t=(e[n-2]<<8)+e[n-1],o+=va[t>>10],o+=va[t>>4&63],o+=va[t<<2&63],o+="="),i.push(o),i.join("")}function Em(e,t,n,r,o){var i,s,u=8*o-r-1,d=(1<>1,g=-7,v=n?o-1:0,_=n?-1:1,M=e[t+v];for(v+=_,i=M&(1<<-g)-1,M>>=-g,g+=u;g>0;i=256*i+e[t+v],v+=_,g-=8);for(s=i&(1<<-g)-1,i>>=-g,g+=r;g>0;s=256*s+e[t+v],v+=_,g-=8);if(i===0)i=1-f;else{if(i===d)return s?NaN:1/0*(M?-1:1);s+=Math.pow(2,r),i-=f}return(M?-1:1)*s*Math.pow(2,i-r)}function bP(e,t,n,r,o,i){var s,u,d,f=8*i-o-1,g=(1<>1,_=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=r?0:i-1,C=r?1:-1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=g):(s=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-s))<1&&(s--,d*=2),(t+=s+v>=1?_/d:_*Math.pow(2,1-v))*d>=2&&(s++,d/=2),s+v>=g?(u=0,s=g):s+v>=1?(u=(t*d-1)*Math.pow(2,o),s+=v):(u=t*Math.pow(2,v-1)*Math.pow(2,o),s=0));o>=8;e[n+M]=255&u,M+=C,u/=256,o-=8);for(s=s<0;e[n+M]=255&s,M+=C,s/=256,f-=8);e[n+M-C]|=128*D}var lfe={}.toString,MP=Array.isArray||function(e){return lfe.call(e)=="[object Array]"};function _I(){return Xe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function il(e,t){if(_I()=_I())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_I().toString(16)+" bytes");return 0|e}function ya(e){return!(e==null||!e._isBuffer)}function TP(e,t){if(ya(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return sy(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return DP(e).length;default:if(r)return sy(e).length;t=(""+t).toLowerCase(),r=!0}}function ufe(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return yfe(this,t,n);case"utf8":case"utf-8":return SP(this,t,n);case"ascii":return mfe(this,t,n);case"latin1":case"binary":return vfe(this,t,n);case"base64":return gfe(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _fe(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ju(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function CD(e,t,n,r,o){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(typeof t=="string"&&(t=Xe.from(t,r)),ya(t))return t.length===0?-1:TD(e,t,n,r,o);if(typeof t=="number")return t&=255,Xe.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):TD(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function TD(e,t,n,r,o){var i,s=1,u=e.length,d=t.length;if(r!==void 0&&((r=String(r).toLowerCase())==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;s=2,u/=2,d/=2,n/=2}function f(M,C){return s===1?M[C]:M.readUInt16BE(C*s)}if(o){var g=-1;for(i=n;iu&&(n=u-d),i=n;i>=0;i--){for(var v=!0,_=0;_o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s>8,d=s%256,f.push(d),f.push(u);return f}(t,e.length-n),e,n,r)}function gfe(e,t,n){return t===0&&n===e.length?ID(e):ID(e.slice(t,n))}function SP(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:f>223?3:f>191?2:1;if(o+v<=n)switch(v){case 1:f<128&&(g=f);break;case 2:(192&(i=e[o+1]))==128&&(d=(31&f)<<6|63&i)>127&&(g=d);break;case 3:i=e[o+1],s=e[o+2],(192&i)==128&&(192&s)==128&&(d=(15&f)<<12|(63&i)<<6|63&s)>2047&&(d<55296||d>57343)&&(g=d);break;case 4:i=e[o+1],s=e[o+2],u=e[o+3],(192&i)==128&&(192&s)==128&&(192&u)==128&&(d=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&d<1114112&&(g=d)}g===null?(g=65533,v=1):g>65535&&(g-=65536,r.push(g>>>10&1023|55296),g=56320|1023&g),r.push(g),o+=v}return function(_){var M=_.length;if(M<=wD)return String.fromCharCode.apply(String,_);for(var C="",D=0;D0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},Xe.prototype.compare=function(e,t,n,r,o){if(!ya(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(i,s),d=this.slice(r,o),f=e.slice(t,n),g=0;go)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return cfe(this,e,t,n);case"utf8":case"utf-8":return dfe(this,e,t,n);case"ascii":return wP(this,e,t,n);case"latin1":case"binary":return ffe(this,e,t,n);case"base64":return pfe(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hfe(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},Xe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var wD=4096;function mfe(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function Fi(e,t,n,r,o,i){if(!ya(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function Am(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function Lm(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function kP(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function SD(e,t,n,r,o){return o||kP(e,0,n,4),bP(e,t,n,r,23,4),n+4}function kD(e,t,n,r,o){return o||kP(e,0,n,8),bP(e,t,n,r,52,8),n+8}Xe.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=t===void 0?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},Xe.prototype.readUInt8=function(e,t){return t||To(e,1,this.length),this[e]},Xe.prototype.readUInt16LE=function(e,t){return t||To(e,2,this.length),this[e]|this[e+1]<<8},Xe.prototype.readUInt16BE=function(e,t){return t||To(e,2,this.length),this[e]<<8|this[e+1]},Xe.prototype.readUInt32LE=function(e,t){return t||To(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Xe.prototype.readUInt32BE=function(e,t){return t||To(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Xe.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||To(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},Xe.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||To(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},Xe.prototype.readInt8=function(e,t){return t||To(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Xe.prototype.readInt16LE=function(e,t){t||To(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Xe.prototype.readInt16BE=function(e,t){t||To(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Xe.prototype.readInt32LE=function(e,t){return t||To(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Xe.prototype.readInt32BE=function(e,t){return t||To(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Xe.prototype.readFloatLE=function(e,t){return t||To(e,4,this.length),Em(this,e,!0,23,4)},Xe.prototype.readFloatBE=function(e,t){return t||To(e,4,this.length),Em(this,e,!1,23,4)},Xe.prototype.readDoubleLE=function(e,t){return t||To(e,8,this.length),Em(this,e,!0,52,8)},Xe.prototype.readDoubleBE=function(e,t){return t||To(e,8,this.length),Em(this,e,!1,52,8)},Xe.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||Fi(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},Xe.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,1,255,0),Xe.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Xe.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,2,65535,0),Xe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Am(this,e,t,!0),t+2},Xe.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,2,65535,0),Xe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Am(this,e,t,!1),t+2},Xe.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,4,4294967295,0),Xe.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Lm(this,e,t,!0),t+4},Xe.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,4,4294967295,0),Xe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Lm(this,e,t,!1),t+4},Xe.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);Fi(this,e,t,n,o-1,-o)}var i=0,s=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+n},Xe.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);Fi(this,e,t,n,o-1,-o)}var i=n-1,s=1,u=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&u===0&&this[t+i+1]!==0&&(u=1),this[t+i]=(e/s>>0)-u&255;return t+n},Xe.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,1,127,-128),Xe.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Xe.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,2,32767,-32768),Xe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Am(this,e,t,!0),t+2},Xe.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,2,32767,-32768),Xe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Am(this,e,t,!1),t+2},Xe.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,4,2147483647,-2147483648),Xe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Lm(this,e,t,!0),t+4},Xe.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Fi(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Xe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Lm(this,e,t,!1),t+4},Xe.prototype.writeFloatLE=function(e,t,n){return SD(this,e,t,!0,n)},Xe.prototype.writeFloatBE=function(e,t,n){return SD(this,e,t,!1,n)},Xe.prototype.writeDoubleLE=function(e,t,n){return kD(this,e,t,!0,n)},Xe.prototype.writeDoubleBE=function(e,t,n){return kD(this,e,t,!1,n)},Xe.prototype.copy=function(e,t,n,r){if(n||(n=0),r||r===0||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!Xe.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=n===void 0?this.length:n>>>0,e||(e=0),typeof e=="number")for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function DP(e){return function(t){var n,r,o,i,s,u;LT||_P();var d=t.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=t[d-2]==="="?2:t[d-1]==="="?1:0,u=new sfe(3*d/4-s),o=s>0?d-4:d;var f=0;for(n=0,r=0;n>16&255,u[f++]=i>>8&255,u[f++]=255&i;return s===2?(i=ys[t.charCodeAt(n)]<<2|ys[t.charCodeAt(n+1)]>>4,u[f++]=255&i):s===1&&(i=ys[t.charCodeAt(n)]<<10|ys[t.charCodeAt(n+1)]<<4|ys[t.charCodeAt(n+2)]>>2,u[f++]=i>>8&255,u[f++]=255&i),u}(function(t){if((t=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}(t).replace(bfe,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(e))}function l0(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function bg(e){return e!=null&&(!!e._isBuffer||DD(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&DD(t.slice(0,0))}(e))}function DD(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Fn(e,t){return e(t={exports:{}},t.exports),t.exports}var zn=Fn(function(e,t){var n;e.exports=(n=n||function(r,o){var i=Object.create||function(){function w(){}return function(S){var N;return w.prototype=S,N=new w,w.prototype=null,N}}(),s={},u=s.lib={},d=u.Base={extend:function(w){var S=i(this);return w&&S.mixIn(w),S.hasOwnProperty("init")&&this.init!==S.init||(S.init=function(){S.$super.init.apply(this,arguments)}),S.init.prototype=S,S.$super=this,S},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var S in w)w.hasOwnProperty(S)&&(this[S]=w[S]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}},f=u.WordArray=d.extend({init:function(w,S){w=this.words=w||[],this.sigBytes=S??4*w.length},toString:function(w){return(w||v).stringify(this)},concat:function(w){var S=this.words,N=w.words,A=this.sigBytes,L=w.sigBytes;if(this.clamp(),A%4)for(var j=0;j>>2]>>>24-j%4*8&255;S[A+j>>>2]|=V<<24-(A+j)%4*8}else for(var j=0;j>>2]=N[j>>>2];return this.sigBytes+=L,this},clamp:function(){var w=this.words,S=this.sigBytes;w[S>>>2]&=4294967295<<32-S%4*8,w.length=r.ceil(S/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var S,N=[],A=function(x){var x=x,$=987654321,z=4294967295;return function(){var G=(($=36969*(65535&$)+($>>16)&z)<<16)+(x=18e3*(65535&x)+(x>>16)&z)&z;return G/=4294967296,(G+=.5)*(r.random()>.5?1:-1)}},L=0;L>>2]>>>24-L%4*8&255;A.push((j>>>4).toString(16)),A.push((15&j).toString(16))}return A.join("")},parse:function(w){for(var S=w.length,N=[],A=0;A>>3]|=parseInt(w.substr(A,2),16)<<24-A%8*4;return new f.init(N,S/2)}},_=g.Latin1={stringify:function(w){for(var S=w.words,N=w.sigBytes,A=[],L=0;L>>2]>>>24-L%4*8&255;A.push(String.fromCharCode(j))}return A.join("")},parse:function(w){for(var S=w.length,N=[],A=0;A>>2]|=(255&w.charCodeAt(A))<<24-A%4*8;return new f.init(N,S)}},M=g.Utf8={stringify:function(w){try{return decodeURIComponent(escape(_.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return _.parse(unescape(encodeURIComponent(w)))}},C=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=M.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var S=this._data,N=S.words,A=S.sigBytes,L=this.blockSize,j=4*L,V=A/j,x=(V=w?r.ceil(V):r.max((0|V)-this._minBufferSize,0))*L,$=r.min(4*x,A);if(x){for(var z=0;z>>2]|=i[d]<<24-d%4*8;o.call(this,u,s)}else o.apply(this,arguments)}).prototype=r}}(),n.lib.WordArray)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib.WordArray,i=r.enc;function s(u){return u<<8&4278255360|u>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(u){for(var d=u.words,f=u.sigBytes,g=[],v=0;v>>2]>>>16-v%4*8&65535;g.push(String.fromCharCode(_))}return g.join("")},parse:function(u){for(var d=u.length,f=[],g=0;g>>1]|=u.charCodeAt(g)<<16-g%2*16;return o.create(f,2*d)}},i.Utf16LE={stringify:function(u){for(var d=u.words,f=u.sigBytes,g=[],v=0;v>>2]>>>16-v%4*8&65535);g.push(String.fromCharCode(_))}return g.join("")},parse:function(u){for(var d=u.length,f=[],g=0;g>>1]|=s(u.charCodeAt(g)<<16-g%2*16);return o.create(f,2*d)}}}(),n.enc.Utf16)}),Fn(function(e,t){var n,r,o;e.exports=(o=(r=n=zn).lib.WordArray,r.enc.Base64={stringify:function(i){var s=i.words,u=i.sigBytes,d=this._map;i.clamp();for(var f=[],g=0;g>>2]>>>24-g%4*8&255)<<16|(s[g+1>>>2]>>>24-(g+1)%4*8&255)<<8|s[g+2>>>2]>>>24-(g+2)%4*8&255,_=0;_<4&&g+.75*_>>6*(3-_)&63));var M=d.charAt(64);if(M)for(;f.length%4;)f.push(M);return f.join("")},parse:function(i){var s=i.length,u=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f>>6-S%4*2;D[w>>>2]|=(N|A)<<24-w%4*8,w++}return o.create(D,w)}(i,s,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)}),Fn(function(e,t){var n;e.exports=(n=zn,function(r){var o=n,i=o.lib,s=i.WordArray,u=i.Hasher,d=o.algo,f=[];(function(){for(var D=0;D<64;D++)f[D]=4294967296*r.abs(r.sin(D+1))|0})();var g=d.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(D,w){for(var S=0;S<16;S++){var N=w+S,A=D[N];D[N]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8)}var L=this._hash.words,j=D[w+0],V=D[w+1],x=D[w+2],$=D[w+3],z=D[w+4],G=D[w+5],O=D[w+6],T=D[w+7],P=D[w+8],Z=D[w+9],K=D[w+10],oe=D[w+11],J=D[w+12],ie=D[w+13],pe=D[w+14],ue=D[w+15],de=L[0],Y=L[1],re=L[2],fe=L[3];de=v(de,Y,re,fe,j,7,f[0]),fe=v(fe,de,Y,re,V,12,f[1]),re=v(re,fe,de,Y,x,17,f[2]),Y=v(Y,re,fe,de,$,22,f[3]),de=v(de,Y,re,fe,z,7,f[4]),fe=v(fe,de,Y,re,G,12,f[5]),re=v(re,fe,de,Y,O,17,f[6]),Y=v(Y,re,fe,de,T,22,f[7]),de=v(de,Y,re,fe,P,7,f[8]),fe=v(fe,de,Y,re,Z,12,f[9]),re=v(re,fe,de,Y,K,17,f[10]),Y=v(Y,re,fe,de,oe,22,f[11]),de=v(de,Y,re,fe,J,7,f[12]),fe=v(fe,de,Y,re,ie,12,f[13]),re=v(re,fe,de,Y,pe,17,f[14]),de=_(de,Y=v(Y,re,fe,de,ue,22,f[15]),re,fe,V,5,f[16]),fe=_(fe,de,Y,re,O,9,f[17]),re=_(re,fe,de,Y,oe,14,f[18]),Y=_(Y,re,fe,de,j,20,f[19]),de=_(de,Y,re,fe,G,5,f[20]),fe=_(fe,de,Y,re,K,9,f[21]),re=_(re,fe,de,Y,ue,14,f[22]),Y=_(Y,re,fe,de,z,20,f[23]),de=_(de,Y,re,fe,Z,5,f[24]),fe=_(fe,de,Y,re,pe,9,f[25]),re=_(re,fe,de,Y,$,14,f[26]),Y=_(Y,re,fe,de,P,20,f[27]),de=_(de,Y,re,fe,ie,5,f[28]),fe=_(fe,de,Y,re,x,9,f[29]),re=_(re,fe,de,Y,T,14,f[30]),de=M(de,Y=_(Y,re,fe,de,J,20,f[31]),re,fe,G,4,f[32]),fe=M(fe,de,Y,re,P,11,f[33]),re=M(re,fe,de,Y,oe,16,f[34]),Y=M(Y,re,fe,de,pe,23,f[35]),de=M(de,Y,re,fe,V,4,f[36]),fe=M(fe,de,Y,re,z,11,f[37]),re=M(re,fe,de,Y,T,16,f[38]),Y=M(Y,re,fe,de,K,23,f[39]),de=M(de,Y,re,fe,ie,4,f[40]),fe=M(fe,de,Y,re,j,11,f[41]),re=M(re,fe,de,Y,$,16,f[42]),Y=M(Y,re,fe,de,O,23,f[43]),de=M(de,Y,re,fe,Z,4,f[44]),fe=M(fe,de,Y,re,J,11,f[45]),re=M(re,fe,de,Y,ue,16,f[46]),de=C(de,Y=M(Y,re,fe,de,x,23,f[47]),re,fe,j,6,f[48]),fe=C(fe,de,Y,re,T,10,f[49]),re=C(re,fe,de,Y,pe,15,f[50]),Y=C(Y,re,fe,de,G,21,f[51]),de=C(de,Y,re,fe,J,6,f[52]),fe=C(fe,de,Y,re,$,10,f[53]),re=C(re,fe,de,Y,K,15,f[54]),Y=C(Y,re,fe,de,V,21,f[55]),de=C(de,Y,re,fe,P,6,f[56]),fe=C(fe,de,Y,re,ue,10,f[57]),re=C(re,fe,de,Y,O,15,f[58]),Y=C(Y,re,fe,de,ie,21,f[59]),de=C(de,Y,re,fe,z,6,f[60]),fe=C(fe,de,Y,re,oe,10,f[61]),re=C(re,fe,de,Y,x,15,f[62]),Y=C(Y,re,fe,de,Z,21,f[63]),L[0]=L[0]+de|0,L[1]=L[1]+Y|0,L[2]=L[2]+re|0,L[3]=L[3]+fe|0},_doFinalize:function(){var D=this._data,w=D.words,S=8*this._nDataBytes,N=8*D.sigBytes;w[N>>>5]|=128<<24-N%32;var A=r.floor(S/4294967296),L=S;w[15+(N+64>>>9<<4)]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8),w[14+(N+64>>>9<<4)]=16711935&(L<<8|L>>>24)|4278255360&(L<<24|L>>>8),D.sigBytes=4*(w.length+1),this._process();for(var j=this._hash,V=j.words,x=0;x<4;x++){var $=V[x];V[x]=16711935&($<<8|$>>>24)|4278255360&($<<24|$>>>8)}return j},clone:function(){var D=u.clone.call(this);return D._hash=this._hash.clone(),D}});function v(D,w,S,N,A,L,j){var V=D+(w&S|~w&N)+A+j;return(V<>>32-L)+w}function _(D,w,S,N,A,L,j){var V=D+(w&N|S&~N)+A+j;return(V<>>32-L)+w}function M(D,w,S,N,A,L,j){var V=D+(w^S^N)+A+j;return(V<>>32-L)+w}function C(D,w,S,N,A,L,j){var V=D+(S^(w|~N))+A+j;return(V<>>32-L)+w}o.MD5=u._createHelper(g),o.HmacMD5=u._createHmacHelper(g)}(Math),n.MD5)}),Fn(function(e,t){var n,r,o,i,s,u,d,f;e.exports=(o=(r=n=zn).lib,i=o.WordArray,s=o.Hasher,u=r.algo,d=[],f=u.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(g,v){for(var _=this._hash.words,M=_[0],C=_[1],D=_[2],w=_[3],S=_[4],N=0;N<80;N++){if(N<16)d[N]=0|g[v+N];else{var A=d[N-3]^d[N-8]^d[N-14]^d[N-16];d[N]=A<<1|A>>>31}var L=(M<<5|M>>>27)+S+d[N];L+=N<20?1518500249+(C&D|~C&w):N<40?1859775393+(C^D^w):N<60?(C&D|C&w|D&w)-1894007588:(C^D^w)-899497514,S=w,w=D,D=C<<30|C>>>2,C=M,M=L}_[0]=_[0]+M|0,_[1]=_[1]+C|0,_[2]=_[2]+D|0,_[3]=_[3]+w|0,_[4]=_[4]+S|0},_doFinalize:function(){var g=this._data,v=g.words,_=8*this._nDataBytes,M=8*g.sigBytes;return v[M>>>5]|=128<<24-M%32,v[14+(M+64>>>9<<4)]=Math.floor(_/4294967296),v[15+(M+64>>>9<<4)]=_,g.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g}}),r.SHA1=s._createHelper(f),r.HmacSHA1=s._createHmacHelper(f),n.SHA1)}),Fn(function(e,t){var n;e.exports=(n=zn,function(r){var o=n,i=o.lib,s=i.WordArray,u=i.Hasher,d=o.algo,f=[],g=[];(function(){function M(S){for(var N=r.sqrt(S),A=2;A<=N;A++)if(!(S%A))return!1;return!0}function C(S){return 4294967296*(S-(0|S))|0}for(var D=2,w=0;w<64;)M(D)&&(w<8&&(f[w]=C(r.pow(D,.5))),g[w]=C(r.pow(D,1/3)),w++),D++})();var v=[],_=d.SHA256=u.extend({_doReset:function(){this._hash=new s.init(f.slice(0))},_doProcessBlock:function(M,C){for(var D=this._hash.words,w=D[0],S=D[1],N=D[2],A=D[3],L=D[4],j=D[5],V=D[6],x=D[7],$=0;$<64;$++){if($<16)v[$]=0|M[C+$];else{var z=v[$-15],G=(z<<25|z>>>7)^(z<<14|z>>>18)^z>>>3,O=v[$-2],T=(O<<15|O>>>17)^(O<<13|O>>>19)^O>>>10;v[$]=G+v[$-7]+T+v[$-16]}var P=w&S^w&N^S&N,Z=(w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22),K=x+((L<<26|L>>>6)^(L<<21|L>>>11)^(L<<7|L>>>25))+(L&j^~L&V)+g[$]+v[$];x=V,V=j,j=L,L=A+K|0,A=N,N=S,S=w,w=K+(Z+P)|0}D[0]=D[0]+w|0,D[1]=D[1]+S|0,D[2]=D[2]+N|0,D[3]=D[3]+A|0,D[4]=D[4]+L|0,D[5]=D[5]+j|0,D[6]=D[6]+V|0,D[7]=D[7]+x|0},_doFinalize:function(){var M=this._data,C=M.words,D=8*this._nDataBytes,w=8*M.sigBytes;return C[w>>>5]|=128<<24-w%32,C[14+(w+64>>>9<<4)]=r.floor(D/4294967296),C[15+(w+64>>>9<<4)]=D,M.sigBytes=4*C.length,this._process(),this._hash},clone:function(){var M=u.clone.call(this);return M._hash=this._hash.clone(),M}});o.SHA256=u._createHelper(_),o.HmacSHA256=u._createHmacHelper(_)}(Math),n.SHA256)}),Fn(function(e,t){var n,r,o,i,s,u;e.exports=(o=(r=n=zn).lib.WordArray,i=r.algo,s=i.SHA256,u=i.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var d=s._doFinalize.call(this);return d.sigBytes-=4,d}}),r.SHA224=s._createHelper(u),r.HmacSHA224=s._createHmacHelper(u),n.SHA224)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib.Hasher,i=r.x64,s=i.Word,u=i.WordArray,d=r.algo;function f(){return s.create.apply(s,arguments)}var g=[f(1116352408,3609767458),f(1899447441,602891725),f(3049323471,3964484399),f(3921009573,2173295548),f(961987163,4081628472),f(1508970993,3053834265),f(2453635748,2937671579),f(2870763221,3664609560),f(3624381080,2734883394),f(310598401,1164996542),f(607225278,1323610764),f(1426881987,3590304994),f(1925078388,4068182383),f(2162078206,991336113),f(2614888103,633803317),f(3248222580,3479774868),f(3835390401,2666613458),f(4022224774,944711139),f(264347078,2341262773),f(604807628,2007800933),f(770255983,1495990901),f(1249150122,1856431235),f(1555081692,3175218132),f(1996064986,2198950837),f(2554220882,3999719339),f(2821834349,766784016),f(2952996808,2566594879),f(3210313671,3203337956),f(3336571891,1034457026),f(3584528711,2466948901),f(113926993,3758326383),f(338241895,168717936),f(666307205,1188179964),f(773529912,1546045734),f(1294757372,1522805485),f(1396182291,2643833823),f(1695183700,2343527390),f(1986661051,1014477480),f(2177026350,1206759142),f(2456956037,344077627),f(2730485921,1290863460),f(2820302411,3158454273),f(3259730800,3505952657),f(3345764771,106217008),f(3516065817,3606008344),f(3600352804,1432725776),f(4094571909,1467031594),f(275423344,851169720),f(430227734,3100823752),f(506948616,1363258195),f(659060556,3750685593),f(883997877,3785050280),f(958139571,3318307427),f(1322822218,3812723403),f(1537002063,2003034995),f(1747873779,3602036899),f(1955562222,1575990012),f(2024104815,1125592928),f(2227730452,2716904306),f(2361852424,442776044),f(2428436474,593698344),f(2756734187,3733110249),f(3204031479,2999351573),f(3329325298,3815920427),f(3391569614,3928383900),f(3515267271,566280711),f(3940187606,3454069534),f(4118630271,4000239992),f(116418474,1914138554),f(174292421,2731055270),f(289380356,3203993006),f(460393269,320620315),f(685471733,587496836),f(852142971,1086792851),f(1017036298,365543100),f(1126000580,2618297676),f(1288033470,3409855158),f(1501505948,4234509866),f(1607167915,987167468),f(1816402316,1246189591)],v=[];(function(){for(var M=0;M<80;M++)v[M]=f()})();var _=d.SHA512=o.extend({_doReset:function(){this._hash=new u.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(M,C){for(var D=this._hash.words,w=D[0],S=D[1],N=D[2],A=D[3],L=D[4],j=D[5],V=D[6],x=D[7],$=w.high,z=w.low,G=S.high,O=S.low,T=N.high,P=N.low,Z=A.high,K=A.low,oe=L.high,J=L.low,ie=j.high,pe=j.low,ue=V.high,de=V.low,Y=x.high,re=x.low,fe=$,Ae=z,ye=G,le=O,Q=T,ve=P,Le=Z,me=K,W=oe,te=J,se=ie,Te=pe,ce=ue,Se=de,Pe=Y,xe=re,He=0;He<80;He++){var Ie=v[He];if(He<16)var q=Ie.high=0|M[C+2*He],ne=Ie.low=0|M[C+2*He+1];else{var _e=v[He-15],Be=_e.high,je=_e.low,lt=(Be>>>1|je<<31)^(Be>>>8|je<<24)^Be>>>7,Fe=(je>>>1|Be<<31)^(je>>>8|Be<<24)^(je>>>7|Be<<25),it=v[He-2],Tt=it.high,mn=it.low,In=(Tt>>>19|mn<<13)^(Tt<<3|mn>>>29)^Tt>>>6,Cn=(mn>>>19|Tt<<13)^(mn<<3|Tt>>>29)^(mn>>>6|Tt<<26),En=v[He-7],vn=En.high,Qe=En.low,yt=v[He-16],Nt=yt.high,ln=yt.low;q=(q=(q=lt+vn+((ne=Fe+Qe)>>>0>>0?1:0))+In+((ne+=Cn)>>>0>>0?1:0))+Nt+((ne+=ln)>>>0>>0?1:0),Ie.high=q,Ie.low=ne}var en,Tn=W&se^~W&ce,qn=te&Te^~te&Se,ze=fe&ye^fe&Q^ye&Q,wt=Ae&le^Ae&ve^le&ve,_t=(fe>>>28|Ae<<4)^(fe<<30|Ae>>>2)^(fe<<25|Ae>>>7),Bt=(Ae>>>28|fe<<4)^(Ae<<30|fe>>>2)^(Ae<<25|fe>>>7),Wt=(W>>>14|te<<18)^(W>>>18|te<<14)^(W<<23|te>>>9),mr=(te>>>14|W<<18)^(te>>>18|W<<14)^(te<<23|W>>>9),Cr=g[He],Xo=Cr.high,ho=Cr.low,$e=Pe+Wt+((en=xe+mr)>>>0>>0?1:0),Ze=Bt+wt;Pe=ce,xe=Se,ce=se,Se=Te,se=W,Te=te,W=Le+($e=($e=($e=$e+Tn+((en+=qn)>>>0>>0?1:0))+Xo+((en+=ho)>>>0>>0?1:0))+q+((en+=ne)>>>0>>0?1:0))+((te=me+en|0)>>>0>>0?1:0)|0,Le=Q,me=ve,Q=ye,ve=le,ye=fe,le=Ae,fe=$e+(_t+ze+(Ze>>>0>>0?1:0))+((Ae=en+Ze|0)>>>0>>0?1:0)|0}z=w.low=z+Ae,w.high=$+fe+(z>>>0>>0?1:0),O=S.low=O+le,S.high=G+ye+(O>>>0>>0?1:0),P=N.low=P+ve,N.high=T+Q+(P>>>0>>0?1:0),K=A.low=K+me,A.high=Z+Le+(K>>>0>>0?1:0),J=L.low=J+te,L.high=oe+W+(J>>>0>>0?1:0),pe=j.low=pe+Te,j.high=ie+se+(pe>>>0>>0?1:0),de=V.low=de+Se,V.high=ue+ce+(de>>>0>>0?1:0),re=x.low=re+xe,x.high=Y+Pe+(re>>>0>>0?1:0)},_doFinalize:function(){var M=this._data,C=M.words,D=8*this._nDataBytes,w=8*M.sigBytes;return C[w>>>5]|=128<<24-w%32,C[30+(w+128>>>10<<5)]=Math.floor(D/4294967296),C[31+(w+128>>>10<<5)]=D,M.sigBytes=4*C.length,this._process(),this._hash.toX32()},clone:function(){var M=o.clone.call(this);return M._hash=this._hash.clone(),M},blockSize:32});r.SHA512=o._createHelper(_),r.HmacSHA512=o._createHmacHelper(_)}(),n.SHA512)}),Fn(function(e,t){var n,r,o,i,s,u,d,f;e.exports=(o=(r=n=zn).x64,i=o.Word,s=o.WordArray,u=r.algo,d=u.SHA512,f=u.SHA384=d.extend({_doReset:function(){this._hash=new s.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var g=d._doFinalize.call(this);return g.sigBytes-=16,g}}),r.SHA384=d._createHelper(f),r.HmacSHA384=d._createHmacHelper(f),n.SHA384)}),Fn(function(e,t){var n;e.exports=(n=zn,function(r){var o=n,i=o.lib,s=i.WordArray,u=i.Hasher,d=o.x64.Word,f=o.algo,g=[],v=[],_=[];(function(){for(var D=1,w=0,S=0;S<24;S++){g[D+5*w]=(S+1)*(S+2)/2%64;var N=(2*D+3*w)%5;D=w%5,w=N}for(D=0;D<5;D++)for(w=0;w<5;w++)v[D+5*w]=w+(2*D+3*w)%5*5;for(var A=1,L=0;L<24;L++){for(var j=0,V=0,x=0;x<7;x++){if(1&A){var $=(1<>>24)|4278255360&(L<<24|L>>>8),j=16711935&(j<<8|j>>>24)|4278255360&(j<<24|j>>>8),(re=S[A]).high^=j,re.low^=L}for(var V=0;V<24;V++){for(var x=0;x<5;x++){for(var $=0,z=0,G=0;G<5;G++)$^=(re=S[x+5*G]).high,z^=re.low;var O=M[x];O.high=$,O.low=z}for(x=0;x<5;x++){var T=M[(x+4)%5],P=M[(x+1)%5],Z=P.high,K=P.low;for($=T.high^(Z<<1|K>>>31),z=T.low^(K<<1|Z>>>31),G=0;G<5;G++)(re=S[x+5*G]).high^=$,re.low^=z}for(var oe=1;oe<25;oe++){var J=(re=S[oe]).high,ie=re.low,pe=g[oe];pe<32?($=J<>>32-pe,z=ie<>>32-pe):($=ie<>>64-pe,z=J<>>64-pe);var ue=M[v[oe]];ue.high=$,ue.low=z}var de=M[0],Y=S[0];for(de.high=Y.high,de.low=Y.low,x=0;x<5;x++)for(G=0;G<5;G++){var re=S[oe=x+5*G],fe=M[oe],Ae=M[(x+1)%5+5*G],ye=M[(x+2)%5+5*G];re.high=fe.high^~Ae.high&ye.high,re.low=fe.low^~Ae.low&ye.low}re=S[0];var le=_[V];re.high^=le.high,re.low^=le.low}},_doFinalize:function(){var D=this._data,w=D.words,S=(this._nDataBytes,8*D.sigBytes),N=32*this.blockSize;w[S>>>5]|=1<<24-S%32,w[(r.ceil((S+1)/N)*N>>>5)-1]|=128,D.sigBytes=4*w.length,this._process();for(var A=this._state,L=this.cfg.outputLength/8,j=L/8,V=[],x=0;x>>24)|4278255360&(z<<24|z>>>8),G=16711935&(G<<8|G>>>24)|4278255360&(G<<24|G>>>8),V.push(G),V.push(z)}return new s.init(V,L)},clone:function(){for(var D=u.clone.call(this),w=D._state=this._state.slice(0),S=0;S<25;S++)w[S]=w[S].clone();return D}});o.SHA3=u._createHelper(C),o.HmacSHA3=u._createHmacHelper(C)}(Math),n.SHA3)}),Fn(function(e,t){var n;e.exports=(n=zn,function(r){var o=n,i=o.lib,s=i.WordArray,u=i.Hasher,d=o.algo,f=s.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]),g=s.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]),v=s.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]),_=s.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]),M=s.create([0,1518500249,1859775393,2400959708,2840853838]),C=s.create([1352829926,1548603684,1836072691,2053994217,0]),D=d.RIPEMD160=u.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(V,x){for(var $=0;$<16;$++){var z=x+$,G=V[z];V[z]=16711935&(G<<8|G>>>24)|4278255360&(G<<24|G>>>8)}var O,T,P,Z,K,oe,J,ie,pe,ue,de,Y=this._hash.words,re=M.words,fe=C.words,Ae=f.words,ye=g.words,le=v.words,Q=_.words;for(oe=O=Y[0],J=T=Y[1],ie=P=Y[2],pe=Z=Y[3],ue=K=Y[4],$=0;$<80;$+=1)de=O+V[x+Ae[$]]|0,de+=$<16?w(T,P,Z)+re[0]:$<32?S(T,P,Z)+re[1]:$<48?N(T,P,Z)+re[2]:$<64?A(T,P,Z)+re[3]:L(T,P,Z)+re[4],de=(de=j(de|=0,le[$]))+K|0,O=K,K=Z,Z=j(P,10),P=T,T=de,de=oe+V[x+ye[$]]|0,de+=$<16?L(J,ie,pe)+fe[0]:$<32?A(J,ie,pe)+fe[1]:$<48?N(J,ie,pe)+fe[2]:$<64?S(J,ie,pe)+fe[3]:w(J,ie,pe)+fe[4],de=(de=j(de|=0,Q[$]))+ue|0,oe=ue,ue=pe,pe=j(ie,10),ie=J,J=de;de=Y[1]+P+pe|0,Y[1]=Y[2]+Z+ue|0,Y[2]=Y[3]+K+oe|0,Y[3]=Y[4]+O+J|0,Y[4]=Y[0]+T+ie|0,Y[0]=de},_doFinalize:function(){var V=this._data,x=V.words,$=8*this._nDataBytes,z=8*V.sigBytes;x[z>>>5]|=128<<24-z%32,x[14+(z+64>>>9<<4)]=16711935&($<<8|$>>>24)|4278255360&($<<24|$>>>8),V.sigBytes=4*(x.length+1),this._process();for(var G=this._hash,O=G.words,T=0;T<5;T++){var P=O[T];O[T]=16711935&(P<<8|P>>>24)|4278255360&(P<<24|P>>>8)}return G},clone:function(){var V=u.clone.call(this);return V._hash=this._hash.clone(),V}});function w(V,x,$){return V^x^$}function S(V,x,$){return V&x|~V&$}function N(V,x,$){return(V|~x)^$}function A(V,x,$){return V&$|x&~$}function L(V,x,$){return V^(x|~$)}function j(V,x){return V<>>32-x}o.RIPEMD160=u._createHelper(D),o.HmacRIPEMD160=u._createHmacHelper(D)}(),n.RIPEMD160)}),Fn(function(e,t){var n,r,o,i,s,u;e.exports=(r=(n=zn).lib,o=r.Base,i=n.enc,s=i.Utf8,u=n.algo,void(u.HMAC=o.extend({init:function(d,f){d=this._hasher=new d.init,typeof f=="string"&&(f=s.parse(f));var g=d.blockSize,v=4*g;f.sigBytes>v&&(f=d.finalize(f)),f.clamp();for(var _=this._oKey=f.clone(),M=this._iKey=f.clone(),C=_.words,D=M.words,w=0;w>>2];G.sigBytes-=O}},i.BlockCipher=M.extend({cfg:M.cfg.extend({mode:w,padding:N}),reset:function(){M.reset.call(this);var G=this.cfg,O=G.iv,T=G.mode;if(this._xformMode==this._ENC_XFORM_MODE)var P=T.createEncryptor;else{var P=T.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==P?this._mode.init(this,O&&O.words):(this._mode=P.call(T,this,O&&O.words),this._mode.__creator=P)},_doProcessBlock:function(G,O){this._mode.processBlock(G,O)},_doFinalize:function(){var G=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){G.pad(this._data,this.blockSize);var O=this._process(!0)}else{var O=this._process(!0);G.unpad(O)}return O},blockSize:4}),A=i.CipherParams=s.extend({init:function(G){this.mixIn(G)},toString:function(G){return(G||this.formatter).stringify(this)}}),L=o.format={},j=L.OpenSSL={stringify:function(G){var O=G.ciphertext,T=G.salt;if(T)var P=u.create([1398893684,1701076831]).concat(T).concat(O);else var P=O;return P.toString(g)},parse:function(G){var O=g.parse(G),T=O.words;if(T[0]==1398893684&&T[1]==1701076831){var P=u.create(T.slice(2,4));T.splice(0,4),O.sigBytes-=16}return A.create({ciphertext:O,salt:P})}},V=i.SerializableCipher=s.extend({cfg:s.extend({format:j}),encrypt:function(G,O,T,P){P=this.cfg.extend(P);var Z=G.createEncryptor(T,P),K=Z.finalize(O),oe=Z.cfg;return A.create({ciphertext:K,key:T,iv:oe.iv,algorithm:G,mode:oe.mode,padding:oe.padding,blockSize:G.blockSize,formatter:P.format})},decrypt:function(G,O,T,P){P=this.cfg.extend(P),O=this._parse(O,P.format);var Z=G.createDecryptor(T,P).finalize(O.ciphertext);return Z},_parse:function(G,O){return typeof G=="string"?O.parse(G,this):G}}),x=o.kdf={},$=x.OpenSSL={execute:function(G,O,T,P){P||(P=u.random(8));var Z=_.create({keySize:O+T}).compute(G,P),K=u.create(Z.words.slice(O),4*T);return Z.sigBytes=4*O,A.create({key:Z,iv:K,salt:P})}},z=i.PasswordBasedCipher=V.extend({cfg:V.cfg.extend({kdf:$}),encrypt:function(G,O,T,P){var Z=(P=this.cfg.extend(P)).kdf.execute(T,G.keySize,G.ivSize);P.iv=Z.iv;var K=V.encrypt.call(this,G,O,Z.key,P);return K.mixIn(Z),K},decrypt:function(G,O,T,P){P=this.cfg.extend(P),O=this._parse(O,P.format);var Z=P.kdf.execute(T,G.keySize,G.ivSize,O.salt);P.iv=Z.iv;var K=V.decrypt.call(this,G,O,Z.key,P);return K}})))}),Fn(function(e,t){var n;e.exports=((n=zn).mode.CFB=function(){var r=n.lib.BlockCipherMode.extend();function o(i,s,u,d){var f=this._iv;if(f){var g=f.slice(0);this._iv=void 0}else g=this._prevBlock;d.encryptBlock(g,0);for(var v=0;v>24&255)==255){var u=s>>16&255,d=s>>8&255,f=255&s;u===255?(u=0,d===255?(d=0,f===255?f=0:++f):++d):++u,s=0,s+=u<<16,s+=d<<8,s+=f}else s+=1<<24;return s}var i=r.Encryptor=r.extend({processBlock:function(s,u){var d=this._cipher,f=d.blockSize,g=this._iv,v=this._counter;g&&(v=this._counter=g.slice(0),this._iv=void 0),function(C){(C[0]=o(C[0]))===0&&(C[1]=o(C[1]))}(v);var _=v.slice(0);d.encryptBlock(_,0);for(var M=0;M>>2]|=u<<24-d%4*8,r.sigBytes+=u},unpad:function(r){var o=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=o}},n.pad.Ansix923)}),Fn(function(e,t){var n;e.exports=((n=zn).pad.Iso10126={pad:function(r,o){var i=4*o,s=i-r.sigBytes%i;r.concat(n.lib.WordArray.random(s-1)).concat(n.lib.WordArray.create([s<<24],1))},unpad:function(r){var o=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=o}},n.pad.Iso10126)}),Fn(function(e,t){var n;e.exports=((n=zn).pad.Iso97971={pad:function(r,o){r.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(r,o)},unpad:function(r){n.pad.ZeroPadding.unpad(r),r.sigBytes--}},n.pad.Iso97971)}),Fn(function(e,t){var n;e.exports=((n=zn).pad.ZeroPadding={pad:function(r,o){var i=4*o;r.clamp(),r.sigBytes+=i-(r.sigBytes%i||i)},unpad:function(r){for(var o=r.words,i=r.sigBytes-1;!(o[i>>>2]>>>24-i%4*8&255);)i--;r.sigBytes=i+1}},n.pad.ZeroPadding)}),Fn(function(e,t){var n;e.exports=((n=zn).pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)}),Fn(function(e,t){var n,r,o,i;e.exports=(o=(r=n=zn).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(s){return s.ciphertext.toString(i)},parse:function(s){var u=i.parse(s);return o.create({ciphertext:u})}},n.format.Hex)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib.BlockCipher,i=r.algo,s=[],u=[],d=[],f=[],g=[],v=[],_=[],M=[],C=[],D=[];(function(){for(var N=[],A=0;A<256;A++)N[A]=A<128?A<<1:A<<1^283;var L=0,j=0;for(A=0;A<256;A++){var V=j^j<<1^j<<2^j<<3^j<<4;V=V>>>8^255&V^99,s[L]=V,u[V]=L;var x=N[L],$=N[x],z=N[$],G=257*N[V]^16843008*V;d[L]=G<<24|G>>>8,f[L]=G<<16|G>>>16,g[L]=G<<8|G>>>24,v[L]=G,G=16843009*z^65537*$^257*x^16843008*L,_[V]=G<<24|G>>>8,M[V]=G<<16|G>>>16,C[V]=G<<8|G>>>24,D[V]=G,L?(L=x^N[N[N[z^x]]],j^=N[N[j]]):L=j=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],S=i.AES=o.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var N=this._keyPriorReset=this._key,A=N.words,L=N.sigBytes/4,j=4*((this._nRounds=L+6)+1),V=this._keySchedule=[],x=0;x6&&x%L==4&&($=s[$>>>24]<<24|s[$>>>16&255]<<16|s[$>>>8&255]<<8|s[255&$]):($=s[($=$<<8|$>>>24)>>>24]<<24|s[$>>>16&255]<<16|s[$>>>8&255]<<8|s[255&$],$^=w[x/L|0]<<24),V[x]=V[x-L]^$}for(var z=this._invKeySchedule=[],G=0;G>>24]]^M[s[$>>>16&255]]^C[s[$>>>8&255]]^D[s[255&$]]}},encryptBlock:function(N,A){this._doCryptBlock(N,A,this._keySchedule,d,f,g,v,s)},decryptBlock:function(N,A){var L=N[A+1];N[A+1]=N[A+3],N[A+3]=L,this._doCryptBlock(N,A,this._invKeySchedule,_,M,C,D,u),L=N[A+1],N[A+1]=N[A+3],N[A+3]=L},_doCryptBlock:function(N,A,L,j,V,x,$,z){for(var G=this._nRounds,O=N[A]^L[0],T=N[A+1]^L[1],P=N[A+2]^L[2],Z=N[A+3]^L[3],K=4,oe=1;oe>>24]^V[T>>>16&255]^x[P>>>8&255]^$[255&Z]^L[K++],ie=j[T>>>24]^V[P>>>16&255]^x[Z>>>8&255]^$[255&O]^L[K++],pe=j[P>>>24]^V[Z>>>16&255]^x[O>>>8&255]^$[255&T]^L[K++],ue=j[Z>>>24]^V[O>>>16&255]^x[T>>>8&255]^$[255&P]^L[K++];O=J,T=ie,P=pe,Z=ue}J=(z[O>>>24]<<24|z[T>>>16&255]<<16|z[P>>>8&255]<<8|z[255&Z])^L[K++],ie=(z[T>>>24]<<24|z[P>>>16&255]<<16|z[Z>>>8&255]<<8|z[255&O])^L[K++],pe=(z[P>>>24]<<24|z[Z>>>16&255]<<16|z[O>>>8&255]<<8|z[255&T])^L[K++],ue=(z[Z>>>24]<<24|z[O>>>16&255]<<16|z[T>>>8&255]<<8|z[255&P])^L[K++],N[A]=J,N[A+1]=ie,N[A+2]=pe,N[A+3]=ue},keySize:8});r.AES=o._createHelper(S)}(),n.AES)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib,i=o.WordArray,s=o.BlockCipher,u=r.algo,d=[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],f=[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],g=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],v=[{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}],_=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],M=u.DES=s.extend({_doReset:function(){for(var S=this._key.words,N=[],A=0;A<56;A++){var L=d[A]-1;N[A]=S[L>>>5]>>>31-L%32&1}for(var j=this._subKeys=[],V=0;V<16;V++){var x=j[V]=[],$=g[V];for(A=0;A<24;A++)x[A/6|0]|=N[(f[A]-1+$)%28]<<31-A%6,x[4+(A/6|0)]|=N[28+(f[A+24]-1+$)%28]<<31-A%6;for(x[0]=x[0]<<1|x[0]>>>31,A=1;A<7;A++)x[A]=x[A]>>>4*(A-1)+3;x[7]=x[7]<<5|x[7]>>>27}var z=this._invSubKeys=[];for(A=0;A<16;A++)z[A]=j[15-A]},encryptBlock:function(S,N){this._doCryptBlock(S,N,this._subKeys)},decryptBlock:function(S,N){this._doCryptBlock(S,N,this._invSubKeys)},_doCryptBlock:function(S,N,A){this._lBlock=S[N],this._rBlock=S[N+1],C.call(this,4,252645135),C.call(this,16,65535),D.call(this,2,858993459),D.call(this,8,16711935),C.call(this,1,1431655765);for(var L=0;L<16;L++){for(var j=A[L],V=this._lBlock,x=this._rBlock,$=0,z=0;z<8;z++)$|=v[z][((x^j[z])&_[z])>>>0];this._lBlock=x,this._rBlock=V^$}var G=this._lBlock;this._lBlock=this._rBlock,this._rBlock=G,C.call(this,1,1431655765),D.call(this,8,16711935),D.call(this,2,858993459),C.call(this,16,65535),C.call(this,4,252645135),S[N]=this._lBlock,S[N+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function C(S,N){var A=(this._lBlock>>>S^this._rBlock)&N;this._rBlock^=A,this._lBlock^=A<>>S^this._lBlock)&N;this._lBlock^=A,this._rBlock^=A<>>2]>>>24-D%4*8&255;C=(C+_[M]+w)%256;var S=_[M];_[M]=_[C],_[C]=S}this._i=this._j=0},_doProcessBlock:function(f,g){f[g]^=u.call(this)},keySize:8,ivSize:0});function u(){for(var f=this._S,g=this._i,v=this._j,_=0,M=0;M<4;M++){v=(v+f[g=(g+1)%256])%256;var C=f[g];f[g]=f[v],f[v]=C,_|=f[(f[g]+f[v])%256]<<24-8*M}return this._i=g,this._j=v,_}r.RC4=o._createHelper(s);var d=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var f=this.cfg.drop;f>0;f--)u.call(this)}});r.RC4Drop=o._createHelper(d)}(),n.RC4)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib.StreamCipher,i=r.algo,s=[],u=[],d=[],f=i.Rabbit=o.extend({_doReset:function(){for(var v=this._key.words,_=this.cfg.iv,M=0;M<4;M++)v[M]=16711935&(v[M]<<8|v[M]>>>24)|4278255360&(v[M]<<24|v[M]>>>8);var C=this._X=[v[0],v[3]<<16|v[2]>>>16,v[1],v[0]<<16|v[3]>>>16,v[2],v[1]<<16|v[0]>>>16,v[3],v[2]<<16|v[1]>>>16],D=this._C=[v[2]<<16|v[2]>>>16,4294901760&v[0]|65535&v[1],v[3]<<16|v[3]>>>16,4294901760&v[1]|65535&v[2],v[0]<<16|v[0]>>>16,4294901760&v[2]|65535&v[3],v[1]<<16|v[1]>>>16,4294901760&v[3]|65535&v[0]];for(this._b=0,M=0;M<4;M++)g.call(this);for(M=0;M<8;M++)D[M]^=C[M+4&7];if(_){var w=_.words,S=w[0],N=w[1],A=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8),L=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8),j=A>>>16|4294901760&L,V=L<<16|65535&A;for(D[0]^=A,D[1]^=j,D[2]^=L,D[3]^=V,D[4]^=A,D[5]^=j,D[6]^=L,D[7]^=V,M=0;M<4;M++)g.call(this)}},_doProcessBlock:function(v,_){var M=this._X;g.call(this),s[0]=M[0]^M[5]>>>16^M[3]<<16,s[1]=M[2]^M[7]>>>16^M[5]<<16,s[2]=M[4]^M[1]>>>16^M[7]<<16,s[3]=M[6]^M[3]>>>16^M[1]<<16;for(var C=0;C<4;C++)s[C]=16711935&(s[C]<<8|s[C]>>>24)|4278255360&(s[C]<<24|s[C]>>>8),v[_+C]^=s[C]},blockSize:4,ivSize:2});function g(){for(var v=this._X,_=this._C,M=0;M<8;M++)u[M]=_[M];for(_[0]=_[0]+1295307597+this._b|0,_[1]=_[1]+3545052371+(_[0]>>>0>>0?1:0)|0,_[2]=_[2]+886263092+(_[1]>>>0>>0?1:0)|0,_[3]=_[3]+1295307597+(_[2]>>>0>>0?1:0)|0,_[4]=_[4]+3545052371+(_[3]>>>0>>0?1:0)|0,_[5]=_[5]+886263092+(_[4]>>>0>>0?1:0)|0,_[6]=_[6]+1295307597+(_[5]>>>0>>0?1:0)|0,_[7]=_[7]+3545052371+(_[6]>>>0>>0?1:0)|0,this._b=_[7]>>>0>>0?1:0,M=0;M<8;M++){var C=v[M]+_[M],D=65535&C,w=C>>>16,S=((D*D>>>17)+D*w>>>15)+w*w,N=((4294901760&C)*C|0)+((65535&C)*C|0);d[M]=S^N}v[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,v[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,v[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,v[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,v[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,v[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,v[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,v[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}r.Rabbit=o._createHelper(f)}(),n.Rabbit)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib.StreamCipher,i=r.algo,s=[],u=[],d=[],f=i.RabbitLegacy=o.extend({_doReset:function(){var v=this._key.words,_=this.cfg.iv,M=this._X=[v[0],v[3]<<16|v[2]>>>16,v[1],v[0]<<16|v[3]>>>16,v[2],v[1]<<16|v[0]>>>16,v[3],v[2]<<16|v[1]>>>16],C=this._C=[v[2]<<16|v[2]>>>16,4294901760&v[0]|65535&v[1],v[3]<<16|v[3]>>>16,4294901760&v[1]|65535&v[2],v[0]<<16|v[0]>>>16,4294901760&v[2]|65535&v[3],v[1]<<16|v[1]>>>16,4294901760&v[3]|65535&v[0]];this._b=0;for(var D=0;D<4;D++)g.call(this);for(D=0;D<8;D++)C[D]^=M[D+4&7];if(_){var w=_.words,S=w[0],N=w[1],A=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8),L=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8),j=A>>>16|4294901760&L,V=L<<16|65535&A;for(C[0]^=A,C[1]^=j,C[2]^=L,C[3]^=V,C[4]^=A,C[5]^=j,C[6]^=L,C[7]^=V,D=0;D<4;D++)g.call(this)}},_doProcessBlock:function(v,_){var M=this._X;g.call(this),s[0]=M[0]^M[5]>>>16^M[3]<<16,s[1]=M[2]^M[7]>>>16^M[5]<<16,s[2]=M[4]^M[1]>>>16^M[7]<<16,s[3]=M[6]^M[3]>>>16^M[1]<<16;for(var C=0;C<4;C++)s[C]=16711935&(s[C]<<8|s[C]>>>24)|4278255360&(s[C]<<24|s[C]>>>8),v[_+C]^=s[C]},blockSize:4,ivSize:2});function g(){for(var v=this._X,_=this._C,M=0;M<8;M++)u[M]=_[M];for(_[0]=_[0]+1295307597+this._b|0,_[1]=_[1]+3545052371+(_[0]>>>0>>0?1:0)|0,_[2]=_[2]+886263092+(_[1]>>>0>>0?1:0)|0,_[3]=_[3]+1295307597+(_[2]>>>0>>0?1:0)|0,_[4]=_[4]+3545052371+(_[3]>>>0>>0?1:0)|0,_[5]=_[5]+886263092+(_[4]>>>0>>0?1:0)|0,_[6]=_[6]+1295307597+(_[5]>>>0>>0?1:0)|0,_[7]=_[7]+3545052371+(_[6]>>>0>>0?1:0)|0,this._b=_[7]>>>0>>0?1:0,M=0;M<8;M++){var C=v[M]+_[M],D=65535&C,w=C>>>16,S=((D*D>>>17)+D*w>>>15)+w*w,N=((4294901760&C)*C|0)+((65535&C)*C|0);d[M]=S^N}v[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,v[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,v[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,v[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,v[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,v[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,v[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,v[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}r.RabbitLegacy=o._createHelper(f)}(),n.RabbitLegacy)}),Fn(function(e,t){e.exports=zn}));function EP(){throw new Error("setTimeout has not been defined")}function AP(){throw new Error("clearTimeout has not been defined")}var Pl=EP,xl=AP;function LP(e){if(Pl===setTimeout)return setTimeout(e,0);if((Pl===EP||!Pl)&&setTimeout)return Pl=setTimeout,setTimeout(e,0);try{return Pl(e,0)}catch{try{return Pl.call(null,e,0)}catch{return Pl.call(this,e,0)}}}typeof xf.setTimeout=="function"&&(Pl=setTimeout),typeof xf.clearTimeout=="function"&&(xl=clearTimeout);var bc,sl=[],gf=!1,pv=-1;function Ife(){gf&&bc&&(gf=!1,bc.length?sl=bc.concat(sl):pv=-1,sl.length&&OP())}function OP(){if(!gf){var e=LP(Ife);gf=!0;for(var t=sl.length;t;){for(bc=sl,sl=[];++pv1)for(var n=1;n0&&s.length>o){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,u=d,typeof console.warn=="function"?console.warn(u):console.log(u)}}else s=i[t]=n,++e._eventsCount;return e}function LD(e,t,n){var r=!1;function o(){e.removeListener(t,o),r||(r=!0,n.apply(e,arguments))}return o.listener=n,o}function OD(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}function Mg(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}Ul.prototype=Object.create(null),Gn.EventEmitter=Gn,Gn.usingDomains=!1,Gn.prototype.domain=void 0,Gn.prototype._events=void 0,Gn.prototype._maxListeners=void 0,Gn.defaultMaxListeners=10,Gn.init=function(){this.domain=null,Gn.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Ul,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Gn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Gn.prototype.getMaxListeners=function(){return NP(this)},Gn.prototype.emit=function(e){var t,n,r,o,i,s,u,d=e==="error";if(s=this._events)d=d&&s.error==null;else if(!d)return!1;if(u=this.domain,d){if(t=arguments[1],!u){if(t instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=u,t.domainThrown=!1,u.emit("error",t),!1}if(!(n=s[e]))return!1;var g=typeof n=="function";switch(r=arguments.length){case 1:Cfe(n,g,this);break;case 2:Tfe(n,g,this,arguments[1]);break;case 3:wfe(n,g,this,arguments[1],arguments[2]);break;case 4:Sfe(n,g,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i0;)if(n[i]===t||n[i].listener&&n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount==0)return this._events=new Ul,this;delete r[e]}else(function(u,d){for(var f=d,g=f+1,v=u.length;g0?Reflect.ownKeys(this._events):[]};var Hi=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},Dfe=/%[sdj%]/g;function Efe(e){if(!MI(e)){for(var t=[],n=0;n=o)return u;switch(u){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return u}}),s=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),xP(t)?n.showHidden=t:t&&function(r,o){if(!o||!Ig(o))return r;for(var i=Object.keys(o),s=i.length;s--;)r[i[s]]=o[i[s]]}(n,t),nu(n.showHidden)&&(n.showHidden=!1),nu(n.depth)&&(n.depth=2),nu(n.colors)&&(n.colors=!1),nu(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Afe),ay(n,e,n.depth)}function Afe(e,t){var n=pu.styles[t];return n?"\x1B["+pu.colors[n][0]+"m"+e+"\x1B["+pu.colors[n][1]+"m":e}function Lfe(e,t){return e}function ay(e,t,n){if(e.customInspect&&t&&Sb(t.inspect)&&t.inspect!==pu&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return MI(r)||(r=ay(e,r,n)),r}var o=function(M,C){if(nu(C))return M.stylize("undefined","undefined");if(MI(C)){var D="'"+JSON.stringify(C).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return M.stylize(D,"string")}if(w=C,typeof w=="number")return M.stylize(""+C,"number");var w;if(xP(C))return M.stylize(""+C,"boolean");if(RT(C))return M.stylize("null","null")}(e,t);if(o)return o;var i=Object.keys(t),s=function(M){var C={};return M.forEach(function(D,w){C[D]=!0}),C}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),wb(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Ib(t);if(i.length===0){if(Sb(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(Tb(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(RD(t))return e.stylize(Date.prototype.toString.call(t),"date");if(wb(t))return Ib(t)}var d,f,g="",v=!1,_=["{","}"];return d=t,Array.isArray(d)&&(v=!0,_=["[","]"]),Sb(t)&&(g=" [Function"+(t.name?": "+t.name:"")+"]"),Tb(t)&&(g=" "+RegExp.prototype.toString.call(t)),RD(t)&&(g=" "+Date.prototype.toUTCString.call(t)),wb(t)&&(g=" "+Ib(t)),i.length!==0||v&&t.length!=0?n<0?Tb(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),f=v?function(M,C,D,w,S){for(var N=[],A=0,L=C.length;A60?D[0]+(C===""?"":C+` `)+" "+M.join(`, `)+" "+D[1]:D[0]+C+" "+M.join(", ")+" "+D[1]}(f,g,_)):_[0]+g+_[1]}function Ib(e){return"["+Error.prototype.toString.call(e)+"]"}function Cb(e,t,n,r,o,i){var s,u,d;if((d=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=d.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):d.set&&(u=e.stylize("[Setter]","special")),UP(r,o)||(s="["+o+"]"),u||(e.seen.indexOf(d.value)<0?(u=RT(n)?ay(e,d.value,null):ay(e,d.value,n-1)).indexOf(` `)>-1&&(u=i?u.split(` `).map(function(f){return" "+f}).join(` `).substr(2):` `+u.split(` `).map(function(f){return" "+f}).join(` `)):u=e.stylize("[Circular]","special")),nu(s)){if(i&&o.match(/^\d+$/))return u;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function xP(e){return typeof e=="boolean"}function RT(e){return e===null}function MI(e){return typeof e=="string"}function nu(e){return e===void 0}function Tb(e){return Ig(e)&&NT(e)==="[object RegExp]"}function Ig(e){return typeof e=="object"&&e!==null}function RD(e){return Ig(e)&&NT(e)==="[object Date]"}function wb(e){return Ig(e)&&(NT(e)==="[object Error]"||e instanceof Error)}function Sb(e){return typeof e=="function"}function NT(e){return Object.prototype.toString.call(e)}function UP(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tc(){this.head=null,this.tail=null,this.length=0}pu.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},pu.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},tc.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},tc.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},tc.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},tc.prototype.clear=function(){this.head=this.tail=null,this.length=0},tc.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},tc.prototype.concat=function(e){if(this.length===0)return Xe.alloc(0);if(this.length===1)return this.head.data;for(var t=Xe.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var Ofe=Xe.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Mh(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!Ofe(t))throw new Error("Unknown encoding: "+t)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Nfe;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Pfe;break;default:return void(this.write=Rfe)}this.charBuffer=new Xe(6),this.charReceived=0,this.charLength=0}function Rfe(e){return e.toString(this.encoding)}function Nfe(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Pfe(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Mh.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&o<=56319)){if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var o;if(r=(t+=e.toString(this.encoding,0,r)).length-1,(o=t.charCodeAt(r))>=55296&&o<=56319){var i=this.surrogateSize;return this.charLength+=i,this.charReceived+=i,this.charBuffer.copy(this.charBuffer,i,0,i),e.copy(this.charBuffer,0,0,i),t.substring(0,r)}return t},Mh.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},Mh.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,o=this.encoding;t+=r.slice(0,n).toString(o)}return t},Vr.ReadableState=FP;var rr=function(e){return nu(Mb)&&(Mb=""),e=e.toUpperCase(),Om[e]||(new RegExp("\\b"+e+"\\b","i").test(Mb)?Om[e]=function(){var t=Efe.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Om[e]=function(){}),Om[e]}("stream");function FP(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof ks&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||n===0?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new tc,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Mh(e.encoding),this.encoding=e.encoding)}function Vr(e){if(!(this instanceof Vr))return new Vr(e);this._readableState=new FP(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),Gn.call(this)}function ND(e,t,n,r,o){var i=function(f,g){var v=null;return bg(g)||typeof g=="string"||g==null||f.objectMode||(v=new TypeError("Invalid non-string/buffer chunk")),v}(t,n);if(i)e.emit("error",i);else if(n===null)t.reading=!1,function(f,g){if(!g.ended){if(g.decoder){var v=g.decoder.end();v&&v.length&&(g.buffer.push(v),g.length+=g.objectMode?1:v.length)}g.ended=!0,ly(f)}}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&o){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var d;!t.decoder||o||r||(n=t.decoder.write(n),d=!t.objectMode&&n.length===0),o||(t.reading=!1),d||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&ly(e))),function(f,g){g.readingMore||(g.readingMore=!0,Wo(xfe,f,g))}(e,t)}else o||(t.reading=!1);return function(f){return!f.ended&&(f.needReadable||f.lengtht.highWaterMark&&(t.highWaterMark=function(n){return n>=PD?n=PD:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function ly(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(rr("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Wo(UD,e):UD(e))}function UD(e){rr("emit readable"),e.emit("readable"),PT(e)}function xfe(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):t.buffer.length===1?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(r,o,i){var s;return r_.length?_.length:u;if(M===_.length?v+=_:v+=_.slice(0,u),(u-=M)===0){M===_.length?(++g,f.next?d.head=f.next:d.head=d.tail=null):(d.head=f,f.data=_.slice(M));break}++g}return d.length-=g,v}(r,o):function(u,d){var f=Xe.allocUnsafe(u),g=d.head,v=1;for(g.data.copy(f),u-=g.data.length;g=g.next;){var _=g.data,M=u>_.length?_.length:u;if(_.copy(f,f.length-u,0,M),(u-=M)===0){M===_.length?(++v,g.next?d.head=g.next:d.head=d.tail=null):(d.head=g,g.data=_.slice(M));break}++v}return d.length-=v,f}(r,o),s}(e,t.buffer,t.decoder),n);var n}function kb(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Wo(Gfe,t,e))}function Gfe(e,t){e.endEmitted||e.length!==0||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function GD(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return rr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?kb(this):ly(this),null;if((e=xD(e,t))===0&&t.ended)return t.length===0&&kb(this),null;var r,o=t.needReadable;return rr("need readable",o),(t.length===0||t.length-e0?FD(e,t):null)===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&kb(this)),r!==null&&this.emit("data",r),r},Vr.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Vr.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,rr("pipe count=%d opts=%j",r.pipesCount,t);var o=!t||t.end!==!1?s:f;function i(w){rr("onunpipe"),w===n&&f()}function s(){rr("onend"),e.end()}r.endEmitted?Wo(o):n.once("end",o),e.on("unpipe",i);var u=function(w){return function(){var S=w._readableState;rr("pipeOnDrain",S.awaitDrain),S.awaitDrain&&S.awaitDrain--,S.awaitDrain===0&&w.listeners("data").length&&(S.flowing=!0,PT(w))}}(n);e.on("drain",u);var d=!1;function f(){rr("cleanup"),e.removeListener("close",M),e.removeListener("finish",C),e.removeListener("drain",u),e.removeListener("error",_),e.removeListener("unpipe",i),n.removeListener("end",s),n.removeListener("end",f),n.removeListener("data",v),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u()}var g=!1;function v(w){rr("ondata"),g=!1,e.write(w)!==!1||g||((r.pipesCount===1&&r.pipes===e||r.pipesCount>1&&GD(r.pipes,e)!==-1)&&!d&&(rr("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,g=!0),n.pause())}function _(w){var S;rr("onerror",w),D(),e.removeListener("error",_),S="error",e.listeners(S).length===0&&e.emit("error",w)}function M(){e.removeListener("finish",C),D()}function C(){rr("onfinish"),e.removeListener("close",M),D()}function D(){rr("unpipe"),n.unpipe(e)}return n.on("data",v),function(w,S,N){if(typeof w.prependListener=="function")return w.prependListener(S,N);w._events&&w._events[S]?Array.isArray(w._events[S])?w._events[S].unshift(N):w._events[S]=[N,w._events[S]]:w.on(S,N)}(e,"error",_),e.once("close",M),e.once("finish",C),e.emit("pipe",n),r.flowing||(rr("pipe resume"),n.resume()),e},Vr.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},ai.prototype._write=function(e,t,n){n(new Error("not implemented"))},ai.prototype._writev=null,ai.prototype.end=function(e,t,n){var r=this._writableState;typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(o,i,s){i.ending=!0,BP(o,i),s&&(i.finished?Wo(s):o.once("finish",s)),i.ended=!0,o.writable=!1}(this,r,n)},Hi(ks,Vr);for(var HD=Object.keys(ai.prototype),Db=0;Db=0;)e[t]=0}var Kfe=0,VP=1,Yfe=2,xT=29,Cg=256,ng=Cg+1+xT,mf=30,UT=19,jD=2*ng+1,Mc=15,Ab=16,Jfe=7,FT=256,zP=16,jP=17,WP=18,TI=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],hv=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Xfe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],WD=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Za=new Array(2*(ng+2));Xf(Za);var Ch=new Array(2*mf);Xf(Ch);var rg=new Array(512);Xf(rg);var og=new Array(256);Xf(og);var GT=new Array(xT);Xf(GT);var KD,YD,JD,dy=new Array(mf);function Lb(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}function Ob(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function KP(e){return e<256?rg[e]:rg[256+(e>>>7)]}function ig(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Vi(e,t,n){e.bi_valid>Ab-n?(e.bi_buf|=t<>Ab-e.bi_valid,e.bi_valid+=n-Ab):(e.bi_buf|=t<>>=1,n<<=1;while(--t>0);return n>>>1}function JP(e,t,n){var r,o,i=new Array(Mc+1),s=0;for(r=1;r<=Mc;r++)i[r]=s=s+n[r-1]<<1;for(o=0;o<=t;o++){var u=e[2*o+1];u!==0&&(e[2*o]=YP(i[u]++,u))}}function XP(e){var t;for(t=0;t8?ig(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function XD(e,t,n,r){var o=2*t,i=2*n;return e[o]>1;n>=1;n--)Rb(e,i,n);o=d;do n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Rb(e,i,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,i[2*o]=i[2*n]+i[2*r],e.depth[o]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,i[2*n+1]=i[2*r+1]=o,e.heap[1]=o++,Rb(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(g,v){var _,M,C,D,w,S,N=v.dyn_tree,A=v.max_code,L=v.stat_desc.static_tree,j=v.stat_desc.has_stree,V=v.stat_desc.extra_bits,x=v.stat_desc.extra_base,$=v.stat_desc.max_length,z=0;for(D=0;D<=Mc;D++)g.bl_count[D]=0;for(N[2*g.heap[g.heap_max]+1]=0,_=g.heap_max+1;_$&&(D=$,z++),N[2*M+1]=D,M>A||(g.bl_count[D]++,w=0,M>=x&&(w=V[M-x]),S=N[2*M],g.opt_len+=S*(D+w),j&&(g.static_len+=S*(L[2*M+1]+w)));if(z!==0){do{for(D=$-1;g.bl_count[D]===0;)D--;g.bl_count[D]--,g.bl_count[D+1]+=2,g.bl_count[$]--,z-=2}while(z>0);for(D=$;D!==0;D--)for(M=g.bl_count[D];M!==0;)(C=g.heap[--_])>A||(N[2*C+1]!==D&&(g.opt_len+=(D-N[2*C+1])*N[2*C],N[2*C+1]=D),M--)}}(e,t),JP(i,f,e.bl_count)}function QD(e,t,n){var r,o,i=-1,s=t[1],u=0,d=7,f=4;for(s===0&&(d=138,f=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)o=s,s=t[2*(r+1)+1],++u>=7;o=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(e)}function epe(e,t,n,r){var o,i,s=0;e.level>0?(e.strm.data_type===Wfe&&(e.strm.data_type=function(u){var d,f=4093624447;for(d=0;d<=31;d++,f>>>=1)if(1&f&&u.dyn_ltree[2*d]!==0)return VD;if(u.dyn_ltree[18]!==0||u.dyn_ltree[20]!==0||u.dyn_ltree[26]!==0)return zD;for(d=32;d=3&&u.bl_tree[2*WD[d]+1]===0;d--);return u.opt_len+=3*(d+1)+5+5+4,d}(e),o=e.opt_len+3+7>>>3,(i=e.static_len+3+7>>>3)<=o&&(o=i)):o=i=n+5,n+4<=o&&t!==-1?QP(e,t,n,r):e.strategy===jfe||i===o?(Vi(e,(VP<<1)+(r?1:0),3),ZD(e,Za,Ch)):(Vi(e,(Yfe<<1)+(r?1:0),3),function(u,d,f,g){var v;for(Vi(u,d-257,5),Vi(u,f-1,5),Vi(u,g-4,4),v=0;v>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(og[n]+Cg+1)]++,e.dyn_dtree[2*KP(t)]++),e.last_lit===e.lit_bufsize-1}function wI(e,t,n,r){for(var o=65535&e|0,i=e>>>16&65535|0,s=0;n!==0;){n-=s=n>2e3?2e3:n;do i=i+(o=o+t[r++]|0)|0;while(--s);o%=65521,i%=65521}return o|i<<16|0}var tpe=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();function ko(e,t,n,r){var o=tpe,i=r+n;e^=-1;for(var s=r;s>>8^o[255&(e^t[s])];return-1^e}var Qd,Wc=0,npe=1,rpe=3,Hl=4,nE=5,cc=0,rE=1,Kc=-2,ope=-3,Pb=-5,ipe=-1,spe=1,Rm=2,ape=3,lpe=4,upe=2,$T=8,cpe=9,SI=286,dpe=30,fpe=19,ppe=2*SI+1,hpe=15,tr=3,ru=258,js=ru+tr+1,gpe=32,BT=42,kI=69,gv=73,mv=91,vv=103,Ic=113,eh=666,Do=1,Th=2,Cc=3,vf=4,mpe=3;function ou(e,t){return e.msg=qP[t],t}function oE(e){return(e<<1)-(e>4?9:0)}function dc(e){for(var t=e.length;--t>=0;)e[t]=0}function Fl(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(tl(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Ko(e,t){epe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Fl(e.strm)}function Jn(e,t){e.pending_buf[e.pending++]=t}function qp(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function e4(e,t){var n,r,o=e.max_chain_length,i=e.strstart,s=e.prev_length,u=e.nice_match,d=e.strstart>e.w_size-js?e.strstart-(e.w_size-js):0,f=e.window,g=e.w_mask,v=e.prev,_=e.strstart+ru,M=f[i+s-1],C=f[i+s];e.prev_length>=e.good_match&&(o>>=2),u>e.lookahead&&(u=e.lookahead);do if(f[(n=t)+s]===C&&f[n+s-1]===M&&f[n]===f[i]&&f[++n]===f[i+1]){i+=2,n++;do;while(f[++i]===f[++n]&&f[++i]===f[++n]&&f[++i]===f[++n]&&f[++i]===f[++n]&&f[++i]===f[++n]&&f[++i]===f[++n]&&f[++i]===f[++n]&&f[++i]===f[++n]&&i<_);if(r=ru-(_-i),i=_-ru,r>s){if(e.match_start=t,s=r,r>=u)break;M=f[i+s-1],C=f[i+s]}}while((t=v[t&g])>d&&--o!=0);return s<=e.lookahead?s:e.lookahead}function sg(e){var t,n,r,o,i,s,u,d,f,g,v=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=v+(v-js)){tl(e.window,e.window,v,v,0),e.match_start-=v,e.strstart-=v,e.block_start-=v,t=n=e.hash_size;do r=e.head[--t],e.head[t]=r>=v?r-v:0;while(--n);t=n=v;do r=e.prev[--t],e.prev[t]=r>=v?r-v:0;while(--n);o+=v}if(e.strm.avail_in===0)break;if(s=e.strm,u=e.window,d=e.strstart+e.lookahead,f=o,g=void 0,(g=s.avail_in)>f&&(g=f),n=g===0?0:(s.avail_in-=g,tl(u,s.input,s.next_in,g,d),s.state.wrap===1?s.adler=wI(s.adler,u,g,d):s.state.wrap===2&&(s.adler=ko(s.adler,u,g,d)),s.next_in+=g,s.total_in+=g,g),e.lookahead+=n,e.lookahead+e.insert>=tr)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=tr&&(e.ins_h=(e.ins_h<=tr)if(r=hu(e,e.strstart-e.match_start,e.match_length-tr),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=tr){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=tr&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=tr-1)),e.prev_length>=tr&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-tr,r=hu(e,e.strstart-1-e.prev_match,e.prev_length-tr),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<nE||t<0)return e?ou(e,Kc):Kc;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===eh&&t!==Hl)return ou(e,e.avail_out===0?Pb:Kc);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===BT)if(r.wrap===2)e.adler=0,Jn(r,31),Jn(r,139),Jn(r,8),r.gzhead?(Jn(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Jn(r,255&r.gzhead.time),Jn(r,r.gzhead.time>>8&255),Jn(r,r.gzhead.time>>16&255),Jn(r,r.gzhead.time>>24&255),Jn(r,r.level===9?2:r.strategy>=Rm||r.level<2?4:0),Jn(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Jn(r,255&r.gzhead.extra.length),Jn(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ko(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=kI):(Jn(r,0),Jn(r,0),Jn(r,0),Jn(r,0),Jn(r,0),Jn(r,r.level===9?2:r.strategy>=Rm||r.level<2?4:0),Jn(r,mpe),r.status=Ic);else{var s=$T+(r.w_bits-8<<4)<<8;s|=(r.strategy>=Rm||r.level<2?0:r.level<6?1:r.level===6?2:3)<<6,r.strstart!==0&&(s|=gpe),s+=31-s%31,r.status=Ic,qp(r,s),r.strstart!==0&&(qp(r,e.adler>>>16),qp(r,65535&e.adler)),e.adler=1}if(r.status===kI)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(e.adler=ko(e.adler,r.pending_buf,r.pending-o,o)),Fl(e),o=r.pending,r.pending!==r.pending_buf_size));)Jn(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=ko(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=gv)}else r.status=gv;if(r.status===gv)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=ko(e.adler,r.pending_buf,r.pending-o,o)),Fl(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindexo&&(e.adler=ko(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.gzindex=0,r.status=mv)}else r.status=mv;if(r.status===mv)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=ko(e.adler,r.pending_buf,r.pending-o,o)),Fl(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindexo&&(e.adler=ko(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.status=vv)}else r.status=vv;if(r.status===vv&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Fl(e),r.pending+2<=r.pending_buf_size&&(Jn(r,255&e.adler),Jn(r,e.adler>>8&255),e.adler=0,r.status=Ic)):r.status=Ic),r.pending!==0){if(Fl(e),e.avail_out===0)return r.last_flush=-1,cc}else if(e.avail_in===0&&oE(t)<=oE(n)&&t!==Hl)return ou(e,Pb);if(r.status===eh&&e.avail_in!==0)return ou(e,Pb);if(e.avail_in!==0||r.lookahead!==0||t!==Wc&&r.status!==eh){var u=r.strategy===Rm?function(d,f){for(var g;;){if(d.lookahead===0&&(sg(d),d.lookahead===0)){if(f===Wc)return Do;break}if(d.match_length=0,g=hu(d,0,d.window[d.strstart]),d.lookahead--,d.strstart++,g&&(Ko(d,!1),d.strm.avail_out===0))return Do}return d.insert=0,f===Hl?(Ko(d,!0),d.strm.avail_out===0?Cc:vf):d.last_lit&&(Ko(d,!1),d.strm.avail_out===0)?Do:Th}(r,t):r.strategy===ape?function(d,f){for(var g,v,_,M,C=d.window;;){if(d.lookahead<=ru){if(sg(d),d.lookahead<=ru&&f===Wc)return Do;if(d.lookahead===0)break}if(d.match_length=0,d.lookahead>=tr&&d.strstart>0&&(v=C[_=d.strstart-1])===C[++_]&&v===C[++_]&&v===C[++_]){M=d.strstart+ru;do;while(v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&_d.lookahead&&(d.match_length=d.lookahead)}if(d.match_length>=tr?(g=hu(d,1,d.match_length-tr),d.lookahead-=d.match_length,d.strstart+=d.match_length,d.match_length=0):(g=hu(d,0,d.window[d.strstart]),d.lookahead--,d.strstart++),g&&(Ko(d,!1),d.strm.avail_out===0))return Do}return d.insert=0,f===Hl?(Ko(d,!0),d.strm.avail_out===0?Cc:vf):d.last_lit&&(Ko(d,!1),d.strm.avail_out===0)?Do:Th}(r,t):Qd[r.level].func(r,t);if(u!==Cc&&u!==vf||(r.status=eh),u===Do||u===Cc)return e.avail_out===0&&(r.last_flush=-1),cc;if(u===Th&&(t===npe?Qfe(r):t!==nE&&(QP(r,0,0,!1),t===rpe&&(dc(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Fl(e),e.avail_out===0))return r.last_flush=-1,cc}return t!==Hl?cc:r.wrap<=0?rE:(r.wrap===2?(Jn(r,255&e.adler),Jn(r,e.adler>>8&255),Jn(r,e.adler>>16&255),Jn(r,e.adler>>24&255),Jn(r,255&e.total_in),Jn(r,e.total_in>>8&255),Jn(r,e.total_in>>16&255),Jn(r,e.total_in>>24&255)):(qp(r,e.adler>>>16),qp(r,65535&e.adler)),Fl(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?cc:rE)}Qd=[new sa(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(sg(e),e.lookahead===0&&t===Wc)return Do;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Ko(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-js&&(Ko(e,!1),e.strm.avail_out===0))return Do}return e.insert=0,t===Hl?(Ko(e,!0),e.strm.avail_out===0?Cc:vf):(e.strstart>e.block_start&&(Ko(e,!1),e.strm.avail_out),Do)}),new sa(4,4,8,4,xb),new sa(4,5,16,8,xb),new sa(4,6,32,32,xb),new sa(4,4,16,16,Gd),new sa(8,16,32,32,Gd),new sa(8,16,128,128,Gd),new sa(8,32,128,256,Gd),new sa(32,128,258,1024,Gd),new sa(32,258,258,4096,Gd)];var Nm=30,_pe=12;function bpe(e,t){var n,r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,N,A,L,j,V,x,$,z,G;n=e.state,r=e.next_in,z=e.input,o=r+(e.avail_in-5),i=e.next_out,G=e.output,s=i-(t-e.avail_out),u=i+(e.avail_out-257),d=n.dmax,f=n.wsize,g=n.whave,v=n.wnext,_=n.window,M=n.hold,C=n.bits,D=n.lencode,w=n.distcode,S=(1<>>=L=A>>>24,C-=L,(L=A>>>16&255)===0)G[i++]=65535&A;else{if(!(16&L)){if(!(64&L)){A=D[(65535&A)+(M&(1<>>=L,C-=L),C<15&&(M+=z[r++]<>>=L=A>>>24,C-=L,!(16&(L=A>>>16&255))){if(!(64&L)){A=w[(65535&A)+(M&(1<d){e.msg="invalid distance too far back",n.mode=Nm;break e}if(M>>>=L,C-=L,V>(L=i-s)){if((L=V-L)>g&&n.sane){e.msg="invalid distance too far back",n.mode=Nm;break e}if(x=0,$=_,v===0){if(x+=f-L,L2;)G[i++]=$[x++],G[i++]=$[x++],G[i++]=$[x++],j-=3;j&&(G[i++]=$[x++],j>1&&(G[i++]=$[x++]))}else{x=i-V;do G[i++]=G[x++],G[i++]=G[x++],G[i++]=G[x++],j-=3;while(j>2);j&&(G[i++]=G[x++],j>1&&(G[i++]=G[x++]))}break}}break}}while(r>3,M&=(1<<(C-=j<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r=1&&Z[j]===0;j--);if(V>j&&(V=j),j===0)return o[i++]=20971520,o[i++]=20971520,u.bits=1,0;for(L=1;L0&&(e===lE||j!==1))return-1;for(K[1]=0,N=1;N<$d;N++)K[N+1]=K[N]+Z[N];for(A=0;AsE||e===uE&&G>aE)return 1;for(;;){C=N-$,s[A]M?(D=oe[J+s[A]],w=T[P+s[A]]):(D=96,w=0),d=1<>$)+(f-=d)]=C<<24|D<<16|w|0;while(f!==0);for(d=1<>=1;if(d!==0?(O&=d-1,O+=d):O=0,A++,--Z[N]==0){if(N===j)break;N=t[n+s[A]]}if(N>V&&(O&v)!==g){for($===0&&($=V),_+=L,z=1<<(x=N-$);x+$sE||e===uE&&G>aE)return 1;o[g=O&v]=V<<24|x<<16|_-i|0}}return O!==0&&(o[_+O]=N-$<<24|64<<16|0),u.bits=V,0}var wpe=0,t4=1,n4=2,cE=4,Spe=5,Pm=6,fy=0,kpe=1,Dpe=2,gu=-2,Epe=-3,Ape=-4,Lpe=-5,dE=8,r4=1,fE=2,pE=3,hE=4,gE=5,mE=6,vE=7,yE=8,_E=9,bE=10,ME=11,qa=12,Fb=13,IE=14,Gb=15,CE=16,TE=17,wE=18,SE=19,xm=20,Um=21,kE=22,DE=23,EE=24,AE=25,LE=26,$b=27,OE=28,RE=29,Dr=30,Ope=31,Rpe=32,Npe=852,Ppe=592;function NE(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function xpe(){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 Is(320),this.work=new Is(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o4(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(n){var r;return n&&n.state?(r=n.state,n.total_in=n.total_out=r.total=0,n.msg="",r.wrap&&(n.adler=1&r.wrap),r.mode=r4,r.last=0,r.havedict=0,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new cy(Npe),r.distcode=r.distdyn=new cy(Ppe),r.sane=1,r.back=-1,fy):gu}(e)):gu}function Upe(e,t){var n,r;return e?(r=new xpe,e.state=r,r.window=null,(n=function(o,i){var s,u;return o&&o.state?(u=o.state,i<0?(s=0,i=-i):(s=1+(i>>4),i<48&&(i&=15)),i&&(i<8||i>15)?gu:(u.window!==null&&u.wbits!==i&&(u.window=null),u.wrap=s,u.wbits=i,o4(o))):gu}(e,t))!==fy&&(e.state=null),n):gu}var Bb,Hb,PE=!0;function Fpe(e){if(PE){var t;for(Bb=new cy(512),Hb=new cy(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(wh(t4,e.lens,0,288,Bb,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wh(n4,e.lens,0,32,Hb,0,e.work,{bits:5}),PE=!1}e.lencode=Bb,e.lenbits=9,e.distcode=Hb,e.distbits=5}function Gpe(e,t){var n,r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,N,A,L,j,V,x,$,z,G=0,O=new uy(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return gu;(n=e.state).mode===qa&&(n.mode=Fb),s=e.next_out,o=e.output,d=e.avail_out,i=e.next_in,r=e.input,u=e.avail_in,f=n.hold,g=n.bits,v=u,_=d,x=fy;e:for(;;)switch(n.mode){case r4:if(n.wrap===0){n.mode=Fb;break}for(;g<16;){if(u===0)break e;u--,f+=r[i++]<>>8&255,n.check=ko(n.check,O,2,0),f=0,g=0,n.mode=fE;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",n.mode=Dr;break}if((15&f)!==dE){e.msg="unknown compression method",n.mode=Dr;break}if(g-=4,V=8+(15&(f>>>=4)),n.wbits===0)n.wbits=V;else if(V>n.wbits){e.msg="invalid window size",n.mode=Dr;break}n.dmax=1<>8&1),512&n.flags&&(O[0]=255&f,O[1]=f>>>8&255,n.check=ko(n.check,O,2,0)),f=0,g=0,n.mode=pE;case pE:for(;g<32;){if(u===0)break e;u--,f+=r[i++]<>>8&255,O[2]=f>>>16&255,O[3]=f>>>24&255,n.check=ko(n.check,O,4,0)),f=0,g=0,n.mode=hE;case hE:for(;g<16;){if(u===0)break e;u--,f+=r[i++]<>8),512&n.flags&&(O[0]=255&f,O[1]=f>>>8&255,n.check=ko(n.check,O,2,0)),f=0,g=0,n.mode=gE;case gE:if(1024&n.flags){for(;g<16;){if(u===0)break e;u--,f+=r[i++]<>>8&255,n.check=ko(n.check,O,2,0)),f=0,g=0}else n.head&&(n.head.extra=null);n.mode=mE;case mE:if(1024&n.flags&&((M=n.length)>u&&(M=u),M&&(n.head&&(V=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),tl(n.head.extra,r,i,M,V)),512&n.flags&&(n.check=ko(n.check,r,M,i)),u-=M,i+=M,n.length-=M),n.length))break e;n.length=0,n.mode=vE;case vE:if(2048&n.flags){if(u===0)break e;M=0;do V=r[i+M++],n.head&&V&&n.length<65536&&(n.head.name+=String.fromCharCode(V));while(V&&M>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=qa;break;case bE:for(;g<32;){if(u===0)break e;u--,f+=r[i++]<>>=7&g,g-=7&g,n.mode=$b;break}for(;g<3;){if(u===0)break e;u--,f+=r[i++]<>>=1)){case 0:n.mode=IE;break;case 1:if(Fpe(n),n.mode=xm,t===Pm){f>>>=2,g-=2;break e}break;case 2:n.mode=TE;break;case 3:e.msg="invalid block type",n.mode=Dr}f>>>=2,g-=2;break;case IE:for(f>>>=7&g,g-=7&g;g<32;){if(u===0)break e;u--,f+=r[i++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=Dr;break}if(n.length=65535&f,f=0,g=0,n.mode=Gb,t===Pm)break e;case Gb:n.mode=CE;case CE:if(M=n.length){if(M>u&&(M=u),M>d&&(M=d),M===0)break e;tl(o,r,i,M,s),u-=M,i+=M,d-=M,s+=M,n.length-=M;break}n.mode=qa;break;case TE:for(;g<14;){if(u===0)break e;u--,f+=r[i++]<>>=5,g-=5,n.ndist=1+(31&f),f>>>=5,g-=5,n.ncode=4+(15&f),f>>>=4,g-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Dr;break}n.have=0,n.mode=wE;case wE:for(;n.have>>=3,g-=3}for(;n.have<19;)n.lens[T[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,$={bits:n.lenbits},x=wh(wpe,n.lens,0,19,n.lencode,0,n.work,$),n.lenbits=$.bits,x){e.msg="invalid code lengths set",n.mode=Dr;break}n.have=0,n.mode=SE;case SE:for(;n.have>>16&255,N=65535&G,!((w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<>>=w,g-=w,n.lens[n.have++]=N;else{if(N===16){for(z=w+2;g>>=w,g-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=Dr;break}V=n.lens[n.have-1],M=3+(3&f),f>>>=2,g-=2}else if(N===17){for(z=w+3;g>>=w)),f>>>=3,g-=3}else{for(z=w+7;g>>=w)),f>>>=7,g-=7}if(n.have+M>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Dr;break}for(;M--;)n.lens[n.have++]=V}}if(n.mode===Dr)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Dr;break}if(n.lenbits=9,$={bits:n.lenbits},x=wh(t4,n.lens,0,n.nlen,n.lencode,0,n.work,$),n.lenbits=$.bits,x){e.msg="invalid literal/lengths set",n.mode=Dr;break}if(n.distbits=6,n.distcode=n.distdyn,$={bits:n.distbits},x=wh(n4,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,$),n.distbits=$.bits,x){e.msg="invalid distances set",n.mode=Dr;break}if(n.mode=xm,t===Pm)break e;case xm:n.mode=Um;case Um:if(u>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=i,e.avail_in=u,n.hold=f,n.bits=g,bpe(e,_),s=e.next_out,o=e.output,d=e.avail_out,i=e.next_in,r=e.input,u=e.avail_in,f=n.hold,g=n.bits,n.mode===qa&&(n.back=-1);break}for(n.back=0;S=(G=n.lencode[f&(1<>>16&255,N=65535&G,!((w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<>A)])>>>16&255,N=65535&G,!(A+(w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<>>=A,g-=A,n.back+=A}if(f>>>=w,g-=w,n.back+=w,n.length=N,S===0){n.mode=LE;break}if(32&S){n.back=-1,n.mode=qa;break}if(64&S){e.msg="invalid literal/length code",n.mode=Dr;break}n.extra=15&S,n.mode=kE;case kE:if(n.extra){for(z=n.extra;g>>=n.extra,g-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DE;case DE:for(;S=(G=n.distcode[f&(1<>>16&255,N=65535&G,!((w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<>A)])>>>16&255,N=65535&G,!(A+(w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<>>=A,g-=A,n.back+=A}if(f>>>=w,g-=w,n.back+=w,64&S){e.msg="invalid distance code",n.mode=Dr;break}n.offset=N,n.extra=15&S,n.mode=EE;case EE:if(n.extra){for(z=n.extra;g>>=n.extra,g-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Dr;break}n.mode=AE;case AE:if(d===0)break e;if(M=_-d,n.offset>M){if((M=n.offset-M)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Dr;break}M>n.wnext?(M-=n.wnext,C=n.wsize-M):C=n.wnext-M,M>n.length&&(M=n.length),D=n.window}else D=o,C=s-n.offset,M=n.length;M>d&&(M=d),d-=M,n.length-=M;do o[s++]=D[C++];while(--M);n.length===0&&(n.mode=Um);break;case LE:if(d===0)break e;o[s++]=n.length,d--,n.mode=Um;break;case $b:if(n.wrap){for(;g<32;){if(u===0)break e;u--,f|=r[i++]<=ie.wsize?(tl(ie.window,Z,K-ie.wsize,ie.wsize,0),ie.wnext=0,ie.whave=ie.wsize):((J=ie.wsize-ie.wnext)>oe&&(J=oe),tl(ie.window,Z,K-oe,J,ie.wnext),(oe-=J)?(tl(ie.window,Z,K-oe,oe,0),ie.wnext=oe,ie.whave=ie.wsize):(ie.wnext+=J,ie.wnext===ie.wsize&&(ie.wnext=0),ie.whaveSh)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function $pe(e,t){for(var n=0;n15&&(_=2,f-=16),g<1||g>cpe||d!==$T||f<8||f>15||u<0||u>9||v<0||v>lpe)return ou(s,Kc);f===8&&(f=9);var M=new vpe;return s.state=M,M.strm=s,M.wrap=_,M.gzhead=null,M.w_bits=f,M.w_size=1<Dt.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsDt.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelDt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelDt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Dt.Z_FILTERED&&e.strategy!=Dt.Z_HUFFMAN_ONLY&&e.strategy!=Dt.Z_RLE&&e.strategy!=Dt.Z_FIXED&&e.strategy!=Dt.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!bg(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Dt.Zlib(t);var n=this;this._hadError=!1,this._binding.onerror=function(i,s){n._binding=null,n._hadError=!0;var u=new Error(i);u.errno=s,u.code=Dt.codes[s],n.emit("error",u)};var r=Dt.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(r=e.level);var o=Dt.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(o=e.strategy),this._binding.init(e.windowBits||Dt.Z_DEFAULT_WINDOWBITS,r,e.memLevel||Dt.Z_DEFAULT_MEMLEVEL,o,e.dictionary),this._buffer=new Xe(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=o,this.once("end",this.close)}Object.keys(yv).forEach(function(e){yv[yv[e]]=e}),Hi(Pr,Ms),Pr.prototype.params=function(e,t,n){if(eDt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Dt.Z_FILTERED&&t!=Dt.Z_HUFFMAN_ONLY&&t!=Dt.Z_RLE&&t!=Dt.Z_FIXED&&t!=Dt.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var r=this;this.flush(Dt.Z_SYNC_FLUSH,function(){r._binding.params(e,t),r._hadError||(r._level=e,r._strategy=t,n&&n())})}else Wo(n)},Pr.prototype.reset=function(){return this._binding.reset()},Pr.prototype._flush=function(e){this._transform(new Xe(0),"",e)},Pr.prototype.flush=function(e,t){var n=this._writableState;if((typeof e=="function"||e===void 0&&!t)&&(t=e,e=Dt.Z_FULL_FLUSH),n.ended)t&&Wo(t);else if(n.ending)t&&this.once("end",t);else if(n.needDrain){var r=this;this.once("drain",function(){r.flush(t)})}else this._flushFlag=e,this.write(new Xe(0),"",t)},Pr.prototype.close=function(e){if(e&&Wo(e),!this._closed){this._closed=!0,this._binding.close();var t=this;Wo(function(){t.emit("close")})}},Pr.prototype._transform=function(e,t,n){var r,o=this._writableState,i=(o.ending||o.ended)&&(!e||o.length===e.length);if(!e===null&&!bg(e))return n(new Error("invalid input"));i?r=Dt.Z_FINISH:(r=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||Dt.Z_NO_FLUSH)),this._processChunk(e,r,n)},Pr.prototype._processChunk=function(e,t,n){var r=e&&e.length,o=this._chunkSize-this._offset,i=0,s=this,u=typeof n=="function";if(!u){var d,f=[],g=0;this.on("error",function(D){d=D});do var v=this._binding.writeSync(t,e,i,r,this._buffer,this._offset,o);while(!this._hadError&&C(v[0],v[1]));if(this._hadError)throw d;var _=Xe.concat(f,g);return this.close(),_}var M=this._binding.write(t,e,i,r,this._buffer,this._offset,o);function C(D,w){if(!s._hadError){var S=o-w;if(function(L,j){if(!L)throw new Error(j)}(S>=0,"have should not go down"),S>0){var N=s._buffer.slice(s._offset,s._offset+S);s._offset+=S,u?s.push(N):(f.push(N),g+=N.length)}if((w===0||s._offset>=s._chunkSize)&&(o=s._chunkSize,s._offset=0,s._buffer=new Xe(s._chunkSize)),w===0){if(i+=r-D,r=D,!u)return!0;var A=s._binding.write(t,e,i,r,s._buffer,s._offset,s._chunkSize);return A.callback=C,void(A.buffer=e)}if(!u)return!1;n()}}M.buffer=e,M.callback=C},Hi(Tc,Pr),Hi(wc,Pr),Hi(Sc,Pr),Hi(kc,Pr),Hi(Dc,Pr),Hi(Ec,Pr),Hi(Ac,Pr);var UE={codes:yv,createDeflate:function(e){return new Tc(e)},createInflate:function(e){return new wc(e)},createDeflateRaw:function(e){return new Dc(e)},createInflateRaw:function(e){return new Ec(e)},createGzip:function(e){return new Sc(e)},createGunzip:function(e){return new kc(e)},createUnzip:function(e){return new Ac(e)},deflate:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new Tc(t),e,n)},deflateSync:function(e,t){return Zu(new Tc(t),e)},gzip:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new Sc(t),e,n)},gzipSync:function(e,t){return Zu(new Sc(t),e)},deflateRaw:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new Dc(t),e,n)},deflateRawSync:function(e,t){return Zu(new Dc(t),e)},unzip:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new Ac(t),e,n)},unzipSync:function(e,t){return Zu(new Ac(t),e)},inflate:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new wc(t),e,n)},inflateSync:function(e,t){return Zu(new wc(t),e)},gunzip:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new kc(t),e,n)},gunzipSync:function(e,t){return Zu(new kc(t),e)},inflateRaw:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Xu(new Ec(t),e,n)},inflateRawSync:function(e,t){return Zu(new Ec(t),e)},Deflate:Tc,Inflate:wc,Gzip:Sc,Gunzip:kc,DeflateRaw:Dc,InflateRaw:Ec,Unzip:Ac,Zlib:Pr};class Bpe{constructor(t,n,r){this.SDKAPPID=t,this.EXPIRETIME=r,this.PRIVATEKEY=n}genTestUserSig(t){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(t)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+t+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(t,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(t,n){return Xe.from?Xe.from(t,n):new Xe(t,n)}unescape(t){return t.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(t){return t.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(t){return this.escape(this.newBuffer(t).toString("base64"))}decode(t){return this.newBuffer(this.unescape(t),"base64")}base64encode(t){return this.newBuffer(t).toString("base64")}base64decode(t){return this.newBuffer(t,"base64").toString()}_hmacsha256(t,n,r,o){let i="TLS.identifier:"+t+` `;i+="TLS.sdkappid:"+this.SDKAPPID+` `,i+="TLS.time:"+n+` `,i+="TLS.expire:"+r+` `,o!=null&&(i+="TLS.userbuf:"+o+` `);let s=ED.HmacSHA256(i,this.PRIVATEKEY);return ED.enc.Base64.stringify(s)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(t){return t!==null&&(typeof t=="number"&&!isNaN(t-0)||typeof t=="object"&&t.constructor===Number)}_isString(t){return typeof t=="string"}genSigWithUserbuf(t,n,r){let o=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":t,"TLS.sdkappid":this.SDKAPPID,"TLS.time":o,"TLS.expire":n},s="";if(r!=null){let g=this.base64encode(r);i["TLS.userbuf"]=g,s=this._hmacsha256(t,o,n,g)}else s=this._hmacsha256(t,o,n,null);i["TLS.sig"]=s;let u=JSON.stringify(i),d=UE.deflateSync(this.newBuffer(u)).toString("base64"),f=this.escape(d);return console.log("ret="+f),f}validate(t){let n=this.decode(t),r=UE.inflateSync(n);console.log("validate ret="+r)}}const Hpe=604800;function i4(e){const{SDKAppID:t,secretKey:n,userID:r}=e,i=new Bpe(t,n,Hpe).genTestUserSig(r);return{SDKAppID:t,userSig:i}}const qpe=ot({components:{DialogTUI:jy},setup(e,t){const n=Ki(),r=n==null?void 0:n.appContext.config.globalProperties.$TUIKit,o=ki&&ki(),i=Ve(()=>JSON.parse(o.state.isMsgNeedReadReceipt)),s=Ve(()=>JSON.parse(o.state.displayOnlineStatus)),u=zt({currentConversationID:"",currentModel:"message",platform:sessionStorage.getItem("platform"),disconnectStatus:!1,disconnentContent:"聊天功能已断开,是否重新连接?",disconnectBtnText:"连接",dialogShow:!1}),d=()=>{window.parent&&window.parent.postMessage({api:"onImClose"},"*")},f=_=>{u.currentModel="message",u.currentConversationID=_},g=_=>{u.dialogShow=!0,u.disconnectStatus=!0,o==null||o.commit("setImConnent",!1)},v=()=>{console.log("manage",Oh),r.login({userID:Oh,userSig:i4({SDKAppID:cw,secretKey:Y3,userID:Oh}).userSig}).then(()=>{u.disconnectStatus=!1,o==null||o.commit("setImConnent",!0)}).catch(()=>{u.disconnentContent="连接失败,请重试",u.disconnectBtnText="重新连接",o==null||o.commit("setImConnent",!1)})};return On(()=>{r.tim.on(r.TIM.EVENT.KICKED_OUT,_=>g()),au.on("reConnectIm",_=>{_&&(u.dialogShow=!0,u.disconnectStatus=!0,o==null||o.commit("setImConnent",!1))})}),pl(()=>{r.tim.off(r.TIM.EVENT.KICKED_OUT,g)}),{...Jt(u),handleCurrentConversation:f,isMsgNeedReadReceipt:i,displayOnlineStatus:s,onClose:d,handleManage:v}}}),Vpe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAqCAYAAADBNhlmAAAAAXNSR0IArs4c6QAAAuFJREFUWEfdmL+LE1EQx2febkI2jYjdgXggov4BXuzubMwPEbMRUa+xsRGsPFELSwsVtRJsbGxODzEbEZOsjbnO0z9A5RBOhOtEbG5Dsnkjb2Pi5tf+Fp6mCtk3M5/M7HzfvIcg+Qcl54P/H9AqVfYB0TwRzQGxOaciyLcRcRsQt7R69WucKkXKYKd0Osd7XCeAU0R0yAsAET8hwEumMCNdf7ERFjYUYCdfXugR3iWgxbCBnMQCritI19Jm7X1Q+0CAdGJ5d9veeUQEZ4M69s4qrGXU7CV8vfrDz58vYLtw5iBx+xUBHfBzFuY5Am4iU09mms8/e/4Zr4dWvnIMiAwC2hUmeNC1CPgTEHXNrL6dZTMzg78zt/G34AZAAhKZmpuVyamAzjvXtQRcomWdnSXczKS03LR3ciqglS8/S6ohApcbYU0za+fG108ACimxCcLrFcI3ALzZD0C3iGBvULjBOhUhNy5BE4DWcb0VReeYAqVMo9YQwdrFcpH3oB4WUOik9sZYctuNAIodwrZ778I6FutVxhbSzeoH8b1TqByxOQ8sxu54qqocde84I4DtvH6bE12PAogILUilLji23e4TIhjJRFCfDPFOxjRu/Olyl6WV1z/67a1BA0VdJ/ZuzTQOTwCKqYRsvhXVcZJ2qLL5wRQ0LLFV1BepR63ogfA7Mnzo9DCnywC0J6ovVHBJaxjrwn4IuFMonwcOq5GdujowqhIMYzNYzjZrT0cB85UVIH5PCkBkV7Nm9f5YBvUrwMn5McrHrWHxM4gr2abx4N8qcdwmSTKDU5skrswkCjhNZkS94wh1UoAzhVoAxtrqEpIZz60uzrCQVAY9hwWnzBHHrSQAfcctZ1SKPLDiF0DloqOh1HtMRPvD6mmggbXfLBKP/E4CZD80OR3dP7DLeewcvDtSH9wHkFJffQwgpb48ckuFtNdv43om7QXmNOGV8go47A4RZ73vBWYc50nYSg/4C8nCuzoKBPvlAAAAAElFTkSuQmCC";const HT=e=>(Mr("data-v-64331a26"),e=e(),Ir(),e),zpe={class:st(["home"]),id:"preloadedImages"},jpe={class:"home-main"},Wpe={class:"home-main-box"},Kpe={class:"home-TUIKit"},Ype={class:"home-TUIKit-main"},Jpe={class:"conversation"},Xpe={key:2,class:"imDisconnent"},Zpe=HT(()=>B("img",{src:Vpe,class:"iconTips"},null,-1)),Qpe={class:"chat"},ehe=HT(()=>B("div",{class:"chat-default"},null,-1)),the=HT(()=>B("p",null,"聊天功能已断开,是否重新连接?",-1));function nhe(e,t,n,r,o,i){const s=Yt("n-tab-pane"),u=Yt("n-tabs"),d=Yt("TUIConversation"),f=Yt("TUIGroup"),g=Yt("TUIPerson"),v=Yt("TUIChat"),_=Yt("DialogTUI");return X(),ae("div",zpe,[B("main",jpe,[B("div",Wpe,[B("div",Kpe,[B("div",Ype,[B("div",Jpe,[St(u,{style:{"padding-left":"22px","--n-tab-padding":"6px 0","--n-tab-gap":"34px","--n-tab-text-color":"#000","--n-tab-text-color-hover":"#0f0f0f","--n-tab-text-color-active":"#000","--n-tab-font-weight-active":"600","padding-top":"6px","--n-bar-color":"#198cfe"},"bar-width":20,value:e.currentModel,"onUpdate:value":t[0]||(t[0]=M=>{e.currentModel=M})},{default:xt(()=>[St(s,{name:"message",tab:"聊天"}),e.platform!="orchestra"?(X(),It(s,{key:0,name:"group",tab:"群聊"})):Ce("",!0),e.platform!="orchestra"?(X(),It(s,{key:1,name:"contact",tab:"联系人"})):Ce("",!0)]),_:1},8,["value"]),$n(St(d,{onCurrent:e.handleCurrentConversation,displayOnlineStatus:e.displayOnlineStatus},null,8,["onCurrent","displayOnlineStatus"]),[[eo,e.currentModel==="message"]]),e.platform!="orchestra"&&e.currentModel==="group"?(X(),It(f,{key:0,onCurrent:e.handleCurrentConversation,displayOnlineStatus:e.displayOnlineStatus},null,8,["onCurrent","displayOnlineStatus"])):Ce("",!0),e.platform!="orchestra"&&e.currentModel==="contact"?(X(),It(g,{key:1,onCurrent:e.handleCurrentConversation,displayOnlineStatus:e.displayOnlineStatus},null,8,["onCurrent","displayOnlineStatus"])):Ce("",!0),e.disconnectStatus?(X(),ae("div",Xpe,[B("p",null,[Zpe,jr(" "+Ee(e.disconnentContent),1)]),B("span",{class:"btnConnent",onClick:t[1]||(t[1]=M=>e.dialogShow=!0)},Ee(e.disconnectBtnText),1)])):Ce("",!0)]),B("div",Qpe,[St(v,{isMsgNeedReadReceipt:e.isMsgNeedReadReceipt,isNeedTyping:!0,isNeedEmojiReact:!0},{default:xt(()=>[ehe]),_:1},8,["isMsgNeedReadReceipt"])])])])])]),B("i",{class:"closeModal",onClick:t[2]||(t[2]=(...M)=>e.onClose&&e.onClose(...M))}),St(_,{show:e.dialogShow,isHeaderShow:!0,title:"提示","is-footer-show":!0,onSubmit:t[3]||(t[3]=M=>e.handleManage()),"onUpdate:show":t[4]||(t[4]=M=>e.dialogShow=M)},{default:xt(()=>[the]),_:1},8,["show"])])}const rhe=jt(qpe,[["render",nhe],["__scopeId","data-v-64331a26"]]),ohe=[{id:1,label:"发送一条消息",status:!1},{id:2,label:"撤回一条消息",status:!1},{id:3,label:"修改一次我的昵称",status:!1},{id:4,label:"发起一个群聊",status:!1},{id:5,label:"开启一次群禁言",status:!1},{id:6,label:"解散一个群聊",status:!1},{id:7,label:"发起一次通话",status:!1}],as={taskList:ohe,userInfo:{},platform:"classroom",imConnent:!0,token:"",isMsgNeedReadReceipt:!0,displayOnlineStatus:!0,allowNotification:!0,_isTIMCallKit:!0};if(localStorage.getItem("TUIKit-userInfo")){const e=localStorage.getItem("TUIKit-userInfo")||{};try{as.userInfo=JSON.parse(e)}catch{as.userInfo={}}}if(sessionStorage.getItem("isMsgNeedReadReceipt")){const e=sessionStorage.getItem("isMsgNeedReadReceipt")||"";try{as.isMsgNeedReadReceipt=JSON.parse(e)}catch{as.isMsgNeedReadReceipt=!1}}if(sessionStorage.getItem("displayOnlineStatus")){const e=sessionStorage.getItem("displayOnlineStatus")||"";try{as.displayOnlineStatus=JSON.parse(e)}catch{as.displayOnlineStatus=!1}}if(sessionStorage.getItem("allowNotification")){const e=sessionStorage.getItem("allowNotification")||"";try{as.allowNotification=JSON.parse(e)}catch{as.allowNotification=!1}}if(sessionStorage.getItem("platform")){const e=sessionStorage.getItem("platform")||"";try{as.platform=JSON.parse(e)}catch{as.platform=!1}}if(sessionStorage.getItem("token")){const e=sessionStorage.getItem("token")||"";try{as.token=JSON.parse(e)}catch{as.token=!1}}const ihe=YO({state:as,mutations:{handleTask(e,t){e.taskList[t].status=!0},setUserInfo(e,t){e.userInfo=t,localStorage.setItem("TUIKit-userInfo",JSON.stringify(t))},setNeedReadReceipt(e,t){e.isMsgNeedReadReceipt=t,sessionStorage.setItem("isMsgNeedReadReceipt",JSON.stringify(t))},setDisplayOnlineStatus(e,t){e.displayOnlineStatus=t,sessionStorage.setItem("displayOnlineStatus",JSON.stringify(t))},setNotification(e,t){e.allowNotification=t,sessionStorage.setItem("allowNotification",JSON.stringify(t))},setPlatform(e,t){e.platform=t,sessionStorage.setItem("platform",t)},setImConnent(e,t){e.imConnent=t}},actions:{},modules:{}});let py=[];const s4=new WeakMap;function she(){py.forEach(e=>e(...s4.get(e))),py=[]}function a4(e,...t){s4.set(e,t),!py.includes(e)&&py.push(e)===1&&requestAnimationFrame(she)}function hy(e){return e.composedPath()[0]||null}function ahe(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function th(e,t){const n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const FE={black:"#000",silver:"#C0C0C0",gray:"#808080",white:"#FFF",maroon:"#800000",red:"#F00",purple:"#800080",fuchsia:"#F0F",green:"#008000",lime:"#0F0",olive:"#808000",yellow:"#FF0",navy:"#000080",blue:"#00F",teal:"#008080",aqua:"#0FF",transparent:"#0000"},Zf="^\\s*",Qf="\\s*$",Lc="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Oc="([0-9A-Fa-f])",Rc="([0-9A-Fa-f]{2})",lhe=new RegExp(`${Zf}rgb\\s*\\(${Lc},${Lc},${Lc}\\)${Qf}`),uhe=new RegExp(`${Zf}rgba\\s*\\(${Lc},${Lc},${Lc},${Lc}\\)${Qf}`),che=new RegExp(`${Zf}#${Oc}${Oc}${Oc}${Qf}`),dhe=new RegExp(`${Zf}#${Rc}${Rc}${Rc}${Qf}`),fhe=new RegExp(`${Zf}#${Oc}${Oc}${Oc}${Oc}${Qf}`),phe=new RegExp(`${Zf}#${Rc}${Rc}${Rc}${Rc}${Qf}`);function Gi(e){return parseInt(e,16)}function rd(e){try{let t;if(t=dhe.exec(e))return[Gi(t[1]),Gi(t[2]),Gi(t[3]),1];if(t=lhe.exec(e))return[ci(t[1]),ci(t[5]),ci(t[9]),1];if(t=uhe.exec(e))return[ci(t[1]),ci(t[5]),ci(t[9]),kh(t[13])];if(t=che.exec(e))return[Gi(t[1]+t[1]),Gi(t[2]+t[2]),Gi(t[3]+t[3]),1];if(t=phe.exec(e))return[Gi(t[1]),Gi(t[2]),Gi(t[3]),kh(Gi(t[4])/255)];if(t=fhe.exec(e))return[Gi(t[1]+t[1]),Gi(t[2]+t[2]),Gi(t[3]+t[3]),kh(Gi(t[4]+t[4])/255)];if(e in FE)return rd(FE[e]);throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function hhe(e){return e>1?1:e<0?0:e}function DI(e,t,n,r){return`rgba(${ci(e)}, ${ci(t)}, ${ci(n)}, ${hhe(r)})`}function qb(e,t,n,r,o){return ci((e*t*(1-r)+n*r)/o)}function u0(e,t){Array.isArray(e)||(e=rd(e)),Array.isArray(t)||(t=rd(t));const n=e[3],r=t[3],o=kh(n+r-n*r);return DI(qb(e[0],n,t[0],r,o),qb(e[1],n,t[1],r,o),qb(e[2],n,t[2],r,o),o)}function Nc(e,t){const[n,r,o,i=1]=Array.isArray(e)?e:rd(e);return t.alpha?DI(n,r,o,t.alpha):DI(n,r,o,i)}function Gm(e,t){const[n,r,o,i=1]=Array.isArray(e)?e:rd(e),{lightness:s=1,alpha:u=1}=t;return ghe([n*s,r*s,o*s,i*u])}function kh(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ci(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function ghe(e){const[t,n,r]=e;return 3 in e?`rgba(${ci(t)}, ${ci(n)}, ${ci(r)}, ${kh(e[3])})`:`rgba(${ci(t)}, ${ci(n)}, ${ci(r)}, 1)`}function mhe(e=8){return Math.random().toString(16).slice(2,2+e)}function vhe(e,t=[],n){const r={};return t.forEach(o=>{r[o]=e[o]}),Object.assign(r,n)}function yhe(e,t=[],n){const r={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(r[i]=e[i])}),Object.assign(r,n)}function yf(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(jr(String(r)));return}if(Array.isArray(r)){yf(r,t,n);return}if(r.type===dt){if(r.children===null)return;Array.isArray(r.children)&&yf(r.children,t,n)}else r.type!==Si&&n.push(r)}}),n}function Er(e,...t){if(Array.isArray(e))e.forEach(n=>Er(n,...t));else return e(...t)}const _he=(e,...t)=>typeof e=="function"?e(...t):typeof e=="string"?jr(e):typeof e=="number"?jr(String(e)):null;function GE(e,t){console.error(`[naive/${e}]: ${t}`)}function l4(e,t){throw new Error(`[naive/${e}]: ${t}`)}function $E(e,t="default",n=void 0){const r=e[t];if(!r)return GE("getFirstSlotVNode",`slot[${t}] is empty`),null;const o=yf(r(n));return o.length===1?o[0]:(GE("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Tg(e){return e.some(t=>Hh(t)?!(t.type===Si||t.type===dt&&!Tg(t.children)):!0)?e:null}function Dh(e,t){return e&&Tg(e())||t()}function bhe(e,t,n){return e&&Tg(e(t))||n(t)}function qs(e,t){const n=e&&Tg(e());return t(n||null)}function EI(e){return!(e&&Tg(e()))}const BE=ot({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),Mhe=/^(\d|\.)+$/,HE=/(\d|\.)+/;function Vb(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e=="number"){const o=(e+n)*t;return o===0?"0":`${o}px`}else if(typeof e=="string")if(Mhe.test(e)){const o=(Number(e)+n)*t;return r?o===0?"0":`${o}px`:`${o}`}else{const o=HE.exec(e);return o?e.replace(HE,String((Number(o[0])+n)*t)):e}return e}function qE(e){return e.replace(/#|\(|\)|,|\s/g,"_")}function Ihe(e){let t=0;for(let n=0;n{let o=Ihe(r);if(o){if(o===1){e.forEach(s=>{n.push(r.replace("&",s))});return}}else{e.forEach(s=>{n.push((s&&s+" ")+r)});return}let i=[r];for(;o--;){const s=[];i.forEach(u=>{e.forEach(d=>{s.push(u.replace("&",d))})}),i=s}i.forEach(s=>n.push(s))}),n}function whe(e,t){const n=[];return t.split(u4).forEach(r=>{e.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function She(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=The(t,n):t=whe(t,n))}),t.join(", ").replace(Che," ")}function VE(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function c0(e){return document.querySelector(`style[cssr-id="${e}"]`)}function khe(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function $m(e){return e?/^\s*@(s|m)/.test(e):!1}const Dhe=/[A-Z]/g;function c4(e){return e.replace(Dhe,t=>"-"+t.toLowerCase())}function Ehe(e,t=" "){return typeof e=="object"&&e!==null?` { `+Object.entries(e).map(n=>t+` ${c4(n[0])}: ${n[1]};`).join(` `)+` `+t+"}":`: ${e};`}function Ahe(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function zE(e,t,n,r){if(!t)return"";const o=Ahe(t,n,r);if(!o)return"";if(typeof o=="string")return`${e} { ${o} }`;const i=Object.keys(o);if(i.length===0)return n.config.keepEmptyBlock?e+` { }`:"";const s=e?[e+" {"]:[];return i.forEach(u=>{const d=o[u];if(u==="raw"){s.push(` `+d+` `);return}u=c4(u),d!=null&&s.push(` ${u}${Ehe(d)}`)}),e&&s.push("}"),s.join(` `)}function AI(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))AI(r,t,n);else if(typeof r=="function"){const o=r(t);Array.isArray(o)?AI(o,t,n):o&&n(o)}else r&&n(r)})}function d4(e,t,n,r,o,i){const s=e.$;let u="";if(!s||typeof s=="string")$m(s)?u=s:t.push(s);else if(typeof s=="function"){const g=s({context:r.context,props:o});$m(g)?u=g:t.push(g)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")$m(s.$)?u=s.$:t.push(s.$);else if(s.$){const g=s.$({context:r.context,props:o});$m(g)?u=g:t.push(g)}const d=She(t),f=zE(d,e.props,r,o);u?(n.push(`${u} {`),i&&f&&i.insertRule(`${u} { ${f} } `)):(i&&f&&i.insertRule(f),!i&&f.length&&n.push(f)),e.children&&AI(e.children,{context:r.context,props:o},g=>{if(typeof g=="string"){const v=zE(d,{raw:g},r,o);i?i.insertRule(v):n.push(v)}else d4(g,t,n,r,o,i)}),t.pop(),u&&n.push("}"),s&&s.after&&s.after(r.context)}function f4(e,t,n,r=!1){const o=[];return d4(e,[],o,t,n,r?e.instance.__styleSheet:void 0),r?"":o.join(` `)}function LI(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Lhe(e,t,n){const{els:r}=t;if(n===void 0)r.forEach(VE),t.els=[];else{const o=c0(n);o&&r.includes(o)&&(VE(o),t.els=r.filter(i=>i!==o))}}function jE(e,t){e.push(t)}function Ohe(e,t,n,r,o,i,s,u,d){if(i&&!d){if(n===void 0){console.error("[css-render/mount]: `id` is required in `silent` mode.");return}const _=window.__cssrContext;_[n]||(_[n]=!0,f4(t,e,r,i));return}let f;if(n===void 0&&(f=t.render(r),n=LI(f)),d){d.adapter(n,f??t.render(r));return}const g=c0(n);if(g!==null&&!s)return g;const v=g??khe(n);if(f===void 0&&(f=t.render(r)),v.textContent=f,g!==null)return g;if(u){const _=document.head.querySelector(`meta[name="${u}"]`);if(_)return document.head.insertBefore(v,_),jE(t.els,v),v}return o?document.head.insertBefore(v,document.head.querySelector("style, link")):document.head.appendChild(v),jE(t.els,v),v}function Rhe(e){return f4(this,this.instance,e)}function Nhe(e={}){const{id:t,ssr:n,props:r,head:o=!1,silent:i=!1,force:s=!1,anchorMetaName:u}=e;return Ohe(this.instance,this,t,r,o,i,s,u,n)}function Phe(e={}){const{id:t}=e;Lhe(this.instance,this,t)}const Bm=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:Rhe,mount:Nhe,unmount:Phe}},xhe=function(e,t,n,r){return Array.isArray(t)?Bm(e,{$:null},null,t):Array.isArray(n)?Bm(e,t,null,n):Array.isArray(r)?Bm(e,t,n,r):Bm(e,t,n,null)};function p4(e={}){let t=null;const n={c:(...r)=>xhe(n,...r),use:(r,...o)=>r.install(n,...o),find:c0,context:{},config:e,get __styleSheet(){if(!t){const r=document.createElement("style");return document.head.appendChild(r),t=document.styleSheets[document.styleSheets.length-1],t}return t}};return n}function Uhe(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return c0(e)!==null}function Fhe(e){let t=".",n="__",r="--",o;if(e){let C=e.blockPrefix;C&&(t=C),C=e.elementPrefix,C&&(n=C),C=e.modifierPrefix,C&&(r=C)}const i={install(C){o=C.c;const D=C.context;D.bem={},D.bem.b=null,D.bem.els=null}};function s(C){let D,w;return{before(S){D=S.bem.b,w=S.bem.els,S.bem.els=null},after(S){S.bem.b=D,S.bem.els=w},$({context:S,props:N}){return C=typeof C=="string"?C:C({context:S,props:N}),S.bem.b=C,`${(N==null?void 0:N.bPrefix)||t}${S.bem.b}`}}}function u(C){let D;return{before(w){D=w.bem.els},after(w){w.bem.els=D},$({context:w,props:S}){return C=typeof C=="string"?C:C({context:w,props:S}),w.bem.els=C.split(",").map(N=>N.trim()),w.bem.els.map(N=>`${(S==null?void 0:S.bPrefix)||t}${w.bem.b}${n}${N}`).join(", ")}}}function d(C){return{$({context:D,props:w}){C=typeof C=="string"?C:C({context:D,props:w});const S=C.split(",").map(L=>L.trim());function N(L){return S.map(j=>`&${(w==null?void 0:w.bPrefix)||t}${D.bem.b}${L!==void 0?`${n}${L}`:""}${r}${j}`).join(", ")}const A=D.bem.els;return A!==null?N(A[0]):N()}}}function f(C){return{$({context:D,props:w}){C=typeof C=="string"?C:C({context:D,props:w});const S=D.bem.els;return`&:not(${(w==null?void 0:w.bPrefix)||t}${D.bem.b}${S!==null&&S.length>0?`${n}${S[0]}`:""}${r}${C})`}}}return Object.assign(i,{cB:(...C)=>o(s(C[0]),C[1],C[2]),cE:(...C)=>o(u(C[0]),C[1],C[2]),cM:(...C)=>o(d(C[0]),C[1],C[2]),cNotM:(...C)=>o(f(C[0]),C[1],C[2])}),i}function Qt(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}Qt("abc","def");const Ghe="n",$he=`.${Ghe}-`,Bhe="__",Hhe="--",h4=p4(),g4=Fhe({blockPrefix:$he,elementPrefix:Bhe,modifierPrefix:Hhe});h4.use(g4);const{c:ut,find:IIe}=h4,{cB:et,cE:gt,cM:bt,cNotM:rs}=g4,qhe=(...e)=>ut(">",[et(...e)]);let zb;function Vhe(){return zb===void 0&&(zb=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),zb}const wg=typeof document<"u"&&typeof window<"u";function zhe(e){const t=Ne(!!e.value);if(t.value)return Ph(t);const n=$t(e,r=>{r&&(t.value=!0,n())});return Ph(t)}function Mu(e){const t=Ve(e),n=Ne(t.value);return $t(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const jhe=typeof window<"u";let _f,Eh;const Whe=()=>{var e,t;_f=jhe?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,Eh=!1,_f!==void 0?_f.then(()=>{Eh=!0}):Eh=!0};Whe();function m4(e){if(Eh)return;let t=!1;On(()=>{Eh||_f==null||_f.then(()=>{t||e()})}),gi(()=>{t=!0})}function _v(e){return e.composedPath()[0]}const Khe={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Yhe(e,t,n){if(e==="mousemoveoutside"){const r=o=>{t.contains(_v(o))||n(o)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const o=s=>{r=!t.contains(_v(s))},i=s=>{r&&(t.contains(_v(s))||n(s))};return{mousedown:o,mouseup:i,touchstart:o,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function v4(e,t,n){const r=Khe[e];let o=r.get(t);o===void 0&&r.set(t,o=new WeakMap);let i=o.get(n);return i===void 0&&o.set(n,i=Yhe(e,t,n)),i}function Jhe(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const o=v4(e,t,n);return Object.keys(o).forEach(i=>{po(i,document,o[i],r)}),!0}return!1}function Xhe(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const o=v4(e,t,n);return Object.keys(o).forEach(i=>{_r(i,document,o[i],r)}),!0}return!1}function Zhe(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function o(x,$,z){const G=x[$];return x[$]=function(){return z.apply(x,arguments),G.apply(x,arguments)},x}function i(x,$){x[$]=Event.prototype[$]}const s=new WeakMap,u=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function d(){var x;return(x=s.get(this))!==null&&x!==void 0?x:null}function f(x,$){u!==void 0&&Object.defineProperty(x,"currentTarget",{configurable:!0,enumerable:!0,get:$??u.get})}const g={bubble:{},capture:{}},v={};function _(){const x=function($){const{type:z,eventPhase:G,bubbles:O}=$,T=_v($);if(G===2)return;const P=G===1?"capture":"bubble";let Z=T;const K=[];for(;Z===null&&(Z=window),K.push(Z),Z!==window;)Z=Z.parentNode||null;const oe=g.capture[z],J=g.bubble[z];if(o($,"stopPropagation",n),o($,"stopImmediatePropagation",r),f($,d),P==="capture"){if(oe===void 0)return;for(let ie=K.length-1;ie>=0&&!e.has($);--ie){const pe=K[ie],ue=oe.get(pe);if(ue!==void 0){s.set($,pe);for(const de of ue){if(t.has($))break;de($)}}if(ie===0&&!O&&J!==void 0){const de=J.get(pe);if(de!==void 0)for(const Y of de){if(t.has($))break;Y($)}}}}else if(P==="bubble"){if(J===void 0)return;for(let ie=0;ieT($))};return x.displayName="evtdUnifiedWindowEventHandler",x}const C=_(),D=M();function w(x,$){const z=g[x];return z[$]===void 0&&(z[$]=new Map,window.addEventListener($,C,x==="capture")),z[$]}function S(x){return v[x]===void 0&&(v[x]=new Set,window.addEventListener(x,D)),v[x]}function N(x,$){let z=x.get($);return z===void 0&&x.set($,z=new Set),z}function A(x,$,z,G){const O=g[$][z];if(O!==void 0){const T=O.get(x);if(T!==void 0&&T.has(G))return!0}return!1}function L(x,$){const z=v[x];return!!(z!==void 0&&z.has($))}function j(x,$,z,G){let O;if(typeof G=="object"&&G.once===!0?O=oe=>{V(x,$,O,G),z(oe)}:O=z,Jhe(x,$,O,G))return;const P=G===!0||typeof G=="object"&&G.capture===!0?"capture":"bubble",Z=w(P,x),K=N(Z,$);if(K.has(O)||K.add(O),$===window){const oe=S(x);oe.has(O)||oe.add(O)}}function V(x,$,z,G){if(Xhe(x,$,z,G))return;const T=G===!0||typeof G=="object"&&G.capture===!0,P=T?"capture":"bubble",Z=w(P,x),K=N(Z,$);if($===window&&!A($,T?"bubble":"capture",x,z)&&L(x,z)){const J=v[x];J.delete(z),J.size===0&&(window.removeEventListener(x,D),v[x]=void 0)}K.has(z)&&K.delete(z),K.size===0&&Z.delete($),Z.size===0&&(window.removeEventListener(x,C,P==="capture"),g[P][x]=void 0)}return{on:j,off:V}}const{on:po,off:_r}=Zhe();function qT(e,t){return $t(e,n=>{n!==void 0&&(t.value=n)}),Ve(()=>e.value===void 0?t.value:e.value)}function d0(){const e=Ne(!1);return On(()=>{e.value=!0}),Ph(e)}function gy(e,t){return Ve(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Qhe=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function ege(){return Qhe}const tge="n-internal-select-menu-body",y4="n-modal-body",_4="n-drawer-body",b4="n-popover-body",M4="__disabled__";function Uf(e){const t=tn(y4,null),n=tn(_4,null),r=tn(b4,null),o=tn(tge,null),i=Ne();if(typeof document<"u"){i.value=document.fullscreenElement;const s=()=>{i.value=document.fullscreenElement};On(()=>{po("fullscreenchange",document,s)}),gi(()=>{_r("fullscreenchange",document,s)})}return Mu(()=>{var s;const{to:u}=e;return u!==void 0?u===!1?M4:u===!0?i.value||"body":u:t!=null&&t.value?(s=t.value.$el)!==null&&s!==void 0?s:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:u??(i.value||"body")})}Uf.tdkey=M4;Uf.propTo={type:[String,Object,Boolean],default:void 0};function OI(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function RI(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(jr(String(r)));return}if(Array.isArray(r)){RI(r,t,n);return}if(r.type===dt){if(r.children===null)return;Array.isArray(r.children)&&RI(r.children,t,n)}else r.type!==Si&&n.push(r)}}),n}function WE(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const o=RI(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Ll=null;function I4(){if(Ll===null&&(Ll=document.getElementById("v-binder-view-measurer"),Ll===null)){Ll=document.createElement("div"),Ll.id="v-binder-view-measurer";const{style:e}=Ll;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Ll)}return Ll.getBoundingClientRect()}function nge(e,t){const n=I4();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function jb(e){const t=e.getBoundingClientRect(),n=I4();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function rge(e){return e.nodeType===9?null:e.parentNode}function C4(e){if(e===null)return null;const t=rge(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:o}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+o+r))return t}return C4(t)}const oge=ot({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;ui("VBinder",(t=Ki())===null||t===void 0?void 0:t.proxy);const n=tn("VBinder",null),r=Ne(null),o=S=>{r.value=S,n&&e.syncTargetWithParent&&n.setTargetRef(S)};let i=[];const s=()=>{let S=r.value;for(;S=C4(S),S!==null;)i.push(S);for(const N of i)po("scroll",N,v,!0)},u=()=>{for(const S of i)_r("scroll",S,v,!0);i=[]},d=new Set,f=S=>{d.size===0&&s(),d.has(S)||d.add(S)},g=S=>{d.has(S)&&d.delete(S),d.size===0&&u()},v=()=>{a4(_)},_=()=>{d.forEach(S=>S())},M=new Set,C=S=>{M.size===0&&po("resize",window,w),M.has(S)||M.add(S)},D=S=>{M.has(S)&&M.delete(S),M.size===0&&_r("resize",window,w)},w=()=>{M.forEach(S=>S())};return gi(()=>{_r("resize",window,w),u()}),{targetRef:r,setTargetRef:o,addScrollListener:f,removeScrollListener:g,addResizeListener:C,removeResizeListener:D}},render(){return OI("binder",this.$slots)}}),ige=oge,sge=ot({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=tn("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?$n(WE("follower",this.$slots),[[t]]):WE("follower",this.$slots)}}),Bd="@@mmoContext",age={mounted(e,{value:t}){e[Bd]={handler:void 0},typeof t=="function"&&(e[Bd].handler=t,po("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Bd];typeof t=="function"?n.handler?n.handler!==t&&(_r("mousemoveoutside",e,n.handler),n.handler=t,po("mousemoveoutside",e,t)):(e[Bd].handler=t,po("mousemoveoutside",e,t)):n.handler&&(_r("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Bd];t&&_r("mousemoveoutside",e,t),e[Bd].handler=void 0}},lge=age,Hd="@@coContext",uge={mounted(e,{value:t,modifiers:n}){e[Hd]={handler:void 0},typeof t=="function"&&(e[Hd].handler=t,po("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Hd];typeof t=="function"?r.handler?r.handler!==t&&(_r("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,po("clickoutside",e,t,{capture:n.capture})):(e[Hd].handler=t,po("clickoutside",e,t,{capture:n.capture})):r.handler&&(_r("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Hd];n&&_r("clickoutside",e,n,{capture:t.capture}),e[Hd].handler=void 0}},KE=uge;function cge(e,t){console.error(`[vdirs/${e}]: ${t}`)}class dge{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:o}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${o}`,r.set(t,o),this.nextZIndex=o+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&cge("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Wb=new dge,qd="@@ziContext",fge={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:o}=n;e[qd]={enabled:!!o,initialized:!1},o&&(Wb.ensureZIndex(e,r),e[qd].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:o}=n,i=e[qd].enabled;o&&!i&&(Wb.ensureZIndex(e,r),e[qd].initialized=!0),e[qd].enabled=!!o},unmounted(e,t){if(!e[qd].initialized)return;const{value:n={}}=t,{zIndex:r}=n;Wb.unregister(e,r)}},VT=fge,T4=Symbol("@css-render/vue3-ssr");function pge(e,t){return``}function hge(e,t){const n=tn(T4,null);if(n===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:r,ids:o}=n;o.has(e)||r!==null&&(o.add(e),r.push(pge(e,t)))}const gge=typeof document<"u";function ep(){if(gge)return;const e=tn(T4,null);if(e!==null)return{adapter:hge,context:e}}function YE(e,t){console.error(`[vueuc/${e}]: ${t}`)}const{c:tf}=p4(),w4="vueuc-style";function JE(e){return typeof e=="string"?document.querySelector(e):e()}const S4=ot({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:zhe(cr(e,"show")),mergedTo:Ve(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?OI("lazy-teleport",this.$slots):Re(yC,{disabled:this.disabled,to:this.mergedTo},OI("lazy-teleport",this.$slots)):null}}),Hm={top:"bottom",bottom:"top",left:"right",right:"left"},XE={start:"end",center:"center",end:"start"},Kb={top:"height",bottom:"height",left:"width",right:"width"},mge={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},vge={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},yge={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ZE={top:!0,bottom:!1,left:!0,right:!1},QE={top:"end",bottom:"start",left:"end",right:"start"};function _ge(e,t,n,r,o,i){if(!o||i)return{placement:e,top:0,left:0};const[s,u]=e.split("-");let d=u??"center",f={top:0,left:0};const g=(M,C,D)=>{let w=0,S=0;const N=n[M]-t[C]-t[M];return N>0&&r&&(D?S=ZE[C]?N:-N:w=ZE[C]?N:-N),{left:w,top:S}},v=s==="left"||s==="right";if(d!=="center"){const M=yge[e],C=Hm[M],D=Kb[M];if(n[D]>t[D]){if(t[M]+t[D]t[C]&&(d=XE[u])}else{const M=s==="bottom"||s==="top"?"left":"top",C=Hm[M],D=Kb[M],w=(n[D]-t[D])/2;(t[M]t[C]?(d=QE[M],f=g(D,M,v)):(d=QE[C],f=g(D,C,v)))}let _=s;return t[s] *",{pointerEvents:"all"})])]),Cge=ot({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=tn("VBinder"),n=Mu(()=>e.enabled!==void 0?e.enabled:e.show),r=Ne(null),o=Ne(null),i=()=>{const{syncTrigger:_}=e;_.includes("scroll")&&t.addScrollListener(d),_.includes("resize")&&t.addResizeListener(d)},s=()=>{t.removeScrollListener(d),t.removeResizeListener(d)};On(()=>{n.value&&(d(),i())});const u=ep();Ige.mount({id:"vueuc/binder",head:!0,anchorMetaName:w4,ssr:u}),gi(()=>{s()}),m4(()=>{n.value&&d()});const d=()=>{if(!n.value)return;const _=r.value;if(_===null)return;const M=t.targetRef,{x:C,y:D,overlap:w}=e,S=C!==void 0&&D!==void 0?nge(C,D):jb(M);_.style.setProperty("--v-target-width",`${Math.round(S.width)}px`),_.style.setProperty("--v-target-height",`${Math.round(S.height)}px`);const{width:N,minWidth:A,placement:L,internalShift:j,flip:V}=e;_.setAttribute("v-placement",L),w?_.setAttribute("v-overlap",""):_.removeAttribute("v-overlap");const{style:x}=_;N==="target"?x.width=`${S.width}px`:N!==void 0?x.width=N:x.width="",A==="target"?x.minWidth=`${S.width}px`:A!==void 0?x.minWidth=A:x.minWidth="";const $=jb(_),z=jb(o.value),{left:G,top:O,placement:T}=_ge(L,S,$,j,V,w),P=bge(T,w),{left:Z,top:K,transform:oe}=Mge(T,z,S,O,G,w);_.setAttribute("v-placement",T),_.style.setProperty("--v-offset-left",`${Math.round(G)}px`),_.style.setProperty("--v-offset-top",`${Math.round(O)}px`),_.style.transform=`translateX(${Z}) translateY(${K}) ${oe}`,_.style.setProperty("--v-transform-origin",P),_.style.transformOrigin=P};$t(n,_=>{_?(i(),f()):s()});const f=()=>{br().then(d).catch(_=>console.error(_))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(_=>{$t(cr(e,_),d)}),["teleportDisabled"].forEach(_=>{$t(cr(e,_),f)}),$t(cr(e,"syncTrigger"),_=>{_.includes("resize")?t.addResizeListener(d):t.removeResizeListener(d),_.includes("scroll")?t.addScrollListener(d):t.removeScrollListener(d)});const g=d0(),v=Mu(()=>{const{to:_}=e;if(_!==void 0)return _;g.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:v,syncPosition:d}},render(){return Re(S4,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=Re("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[Re("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?$n(n,[[VT,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var Yc=[],Tge=function(){return Yc.some(function(e){return e.activeTargets.length>0})},wge=function(){return Yc.some(function(e){return e.skippedTargets.length>0})},eA="ResizeObserver loop completed with undelivered notifications.",Sge=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:eA}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=eA),window.dispatchEvent(e)},ag;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ag||(ag={}));var Jc=function(e){return Object.freeze(e)},kge=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,Jc(this)}return e}(),k4=function(){function e(t,n,r,o){return this.x=t,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Jc(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,o=t.top,i=t.right,s=t.bottom,u=t.left,d=t.width,f=t.height;return{x:n,y:r,top:o,right:i,bottom:s,left:u,width:d,height:f}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),zT=function(e){return e instanceof SVGElement&&"getBBox"in e},D4=function(e){if(zT(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||e.getClientRects().length)},tA=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Dge=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Ah=typeof window<"u"?window:{},qm=new WeakMap,nA=/auto|scroll/,Ege=/^tb|vertical/,Age=/msie|trident/i.test(Ah.navigator&&Ah.navigator.userAgent),aa=function(e){return parseFloat(e||"0")},bf=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new kge((n?t:e)||0,(n?e:t)||0)},rA=Jc({devicePixelContentBoxSize:bf(),borderBoxSize:bf(),contentBoxSize:bf(),contentRect:new k4(0,0,0,0)}),E4=function(e,t){if(t===void 0&&(t=!1),qm.has(e)&&!t)return qm.get(e);if(D4(e))return qm.set(e,rA),rA;var n=getComputedStyle(e),r=zT(e)&&e.ownerSVGElement&&e.getBBox(),o=!Age&&n.boxSizing==="border-box",i=Ege.test(n.writingMode||""),s=!r&&nA.test(n.overflowY||""),u=!r&&nA.test(n.overflowX||""),d=r?0:aa(n.paddingTop),f=r?0:aa(n.paddingRight),g=r?0:aa(n.paddingBottom),v=r?0:aa(n.paddingLeft),_=r?0:aa(n.borderTopWidth),M=r?0:aa(n.borderRightWidth),C=r?0:aa(n.borderBottomWidth),D=r?0:aa(n.borderLeftWidth),w=v+f,S=d+g,N=D+M,A=_+C,L=u?e.offsetHeight-A-e.clientHeight:0,j=s?e.offsetWidth-N-e.clientWidth:0,V=o?w+N:0,x=o?S+A:0,$=r?r.width:aa(n.width)-V-j,z=r?r.height:aa(n.height)-x-L,G=$+w+j+N,O=z+S+L+A,T=Jc({devicePixelContentBoxSize:bf(Math.round($*devicePixelRatio),Math.round(z*devicePixelRatio),i),borderBoxSize:bf(G,O,i),contentBoxSize:bf($,z,i),contentRect:new k4(v,d,$,z)});return qm.set(e,T),T},A4=function(e,t,n){var r=E4(e,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case ag.DEVICE_PIXEL_CONTENT_BOX:return s;case ag.BORDER_BOX:return o;default:return i}},Lge=function(){function e(t){var n=E4(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=Jc([n.borderBoxSize]),this.contentBoxSize=Jc([n.contentBoxSize]),this.devicePixelContentBoxSize=Jc([n.devicePixelContentBoxSize])}return e}(),L4=function(e){if(D4(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Oge=function(){var e=1/0,t=[];Yc.forEach(function(s){if(s.activeTargets.length!==0){var u=[];s.activeTargets.forEach(function(f){var g=new Lge(f.target),v=L4(f.target);u.push(g),f.lastReportedSize=A4(f.target,f.observedBox),ve?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Rge=function(){var e=0;for(oA(e);Tge();)e=Oge(),oA(e);return wge()&&Sge(),e>0},Yb,O4=[],Nge=function(){return O4.splice(0).forEach(function(e){return e()})},Pge=function(e){if(!Yb){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Nge()}).observe(n,r),Yb=function(){n.textContent="".concat(t?t--:t++)}}O4.push(e),Yb()},xge=function(e){Pge(function(){requestAnimationFrame(e)})},bv=0,Uge=function(){return!!bv},Fge=250,Gge={attributes:!0,characterData:!0,childList:!0,subtree:!0},iA=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],sA=function(e){return e===void 0&&(e=0),Date.now()+e},Jb=!1,$ge=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Fge),!Jb){Jb=!0;var r=sA(t);xge(function(){var o=!1;try{o=Rge()}finally{if(Jb=!1,t=r-sA(),!Uge())return;o?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Gge)};document.body?n():Ah.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),iA.forEach(function(n){return Ah.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),iA.forEach(function(n){return Ah.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),NI=new $ge,aA=function(e){!bv&&e>0&&NI.start(),bv+=e,!bv&&NI.stop()},Bge=function(e){return!zT(e)&&!Dge(e)&&getComputedStyle(e).display==="inline"},Hge=function(){function e(t,n){this.target=t,this.observedBox=n||ag.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=A4(this.target,this.observedBox,!0);return Bge(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),qge=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),Vm=new WeakMap,lA=function(e,t){for(var n=0;n=0&&(i&&Yc.splice(Yc.indexOf(r),1),r.observationTargets.splice(o,1),aA(-1))},e.disconnect=function(t){var n=this,r=Vm.get(t);r.observationTargets.slice().forEach(function(o){return n.unobserve(t,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Vge=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");zm.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!tA(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");zm.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!tA(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");zm.unobserve(this,t)},e.prototype.disconnect=function(){zm.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class zge{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Vge)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const uA=new zge,lg=ot({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=Ki().proxy;function r(o){const{onResize:i}=e;i!==void 0&&i(o)}On(()=>{const o=n.$el;if(o===void 0){YE("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){YE("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(uA.registerHandler(o.nextElementSibling,r),t=!0)}),gi(()=>{t&&uA.unregisterHandler(n.$el.nextElementSibling)})},render(){return Ft(this.$slots,"default")}}),jge=tf(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[tf("&::-webkit-scrollbar",{width:0,height:0})]),Wge=ot({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const e=Ne(null);function t(o){!(o.currentTarget.offsetWidth=0;t--){const n=e.childNodes[t];if(R4(n)&&(x4(n)||P4(n)))return!0}return!1}function x4(e){if(!Kge(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Kge(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Vp=[];const Yge=ot({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=mhe(),n=Ne(null),r=Ne(null);let o=!1,i=!1;const s=typeof document>"u"?null:document.activeElement;function u(){return Vp[Vp.length-1]===t}function d(w){var S;w.code==="Escape"&&u()&&((S=e.onEsc)===null||S===void 0||S.call(e,w))}On(()=>{$t(()=>e.active,w=>{w?(v(),po("keydown",document,d)):(_r("keydown",document,d),o&&_())},{immediate:!0})}),gi(()=>{_r("keydown",document,d),o&&_()});function f(w){if(!i&&u()){const S=g();if(S===null||S.contains(hy(w)))return;M("first")}}function g(){const w=n.value;if(w===null)return null;let S=w;for(;S=S.nextSibling,!(S===null||S instanceof Element&&S.tagName==="DIV"););return S}function v(){var w;if(!e.disabled){if(Vp.push(t),e.autoFocus){const{initialFocusTo:S}=e;S===void 0?M("first"):(w=JE(S))===null||w===void 0||w.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",f,!0)}}function _(){var w;if(e.disabled||(document.removeEventListener("focus",f,!0),Vp=Vp.filter(N=>N!==t),u()))return;const{finalFocusTo:S}=e;S!==void 0?(w=JE(S))===null||w===void 0||w.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&s instanceof HTMLElement&&(i=!0,s.focus({preventScroll:!0}),i=!1)}function M(w){if(u()&&e.active){const S=n.value,N=r.value;if(S!==null&&N!==null){const A=g();if(A==null||A===N){i=!0,S.focus({preventScroll:!0}),i=!1;return}i=!0;const L=w==="first"?N4(A):P4(A);i=!1,L||(i=!0,S.focus({preventScroll:!0}),i=!1)}}}function C(w){if(i)return;const S=g();S!==null&&(w.relatedTarget!==null&&S.contains(w.relatedTarget)?M("last"):M("first"))}function D(w){i||(w.relatedTarget!==null&&w.relatedTarget===n.value?M("last"):M("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:C,handleEndFocus:D}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return Re(dt,null,[Re("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),Re("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function Jge(e){const t={isDeactivated:!1};let n=!1;return AL(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),LL(()=>{t.isDeactivated=!0,n||(n=!0)}),t}const cA="n-form-item";function U4(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const o=tn(cA,null);ui(cA,null);const i=Ve(n?()=>n(o):()=>{const{size:d}=e;if(d)return d;if(o){const{mergedSize:f}=o;if(f.value!==void 0)return f.value}return t}),s=Ve(r?()=>r(o):()=>{const{disabled:d}=e;return d!==void 0?d:o?o.disabled.value:!1}),u=Ve(()=>{const{status:d}=e;return d||(o==null?void 0:o.mergedValidationStatus.value)});return gi(()=>{o&&o.restoreValidation()}),{mergedSizeRef:i,mergedDisabledRef:s,mergedStatusRef:u,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}var Xge=typeof global=="object"&&global&&global.Object===Object&&global;const F4=Xge;var Zge=typeof self=="object"&&self&&self.Object===Object&&self,Qge=F4||Zge||Function("return this")();const Xs=Qge;var eme=Xs.Symbol;const Iu=eme;var G4=Object.prototype,tme=G4.hasOwnProperty,nme=G4.toString,zp=Iu?Iu.toStringTag:void 0;function rme(e){var t=tme.call(e,zp),n=e[zp];try{e[zp]=void 0;var r=!0}catch{}var o=nme.call(e);return r&&(t?e[zp]=n:delete e[zp]),o}var ome=Object.prototype,ime=ome.toString;function sme(e){return ime.call(e)}var ame="[object Null]",lme="[object Undefined]",dA=Iu?Iu.toStringTag:void 0;function fd(e){return e==null?e===void 0?lme:ame:dA&&dA in Object(e)?rme(e):sme(e)}function Cu(e){return e!=null&&typeof e=="object"}var ume="[object Symbol]";function f0(e){return typeof e=="symbol"||Cu(e)&&fd(e)==ume}function $4(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n0){if(++t>=Hme)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function jme(e){return function(){return e}}var Wme=function(){try{var e=hd(Object,"defineProperty");return e({},"",{}),e}catch{}}();const vy=Wme;var Kme=vy?function(e,t){return vy(e,"toString",{configurable:!0,enumerable:!1,value:jme(t),writable:!0})}:jT;const Yme=Kme;var Jme=zme(Yme);const Xme=Jme;var Zme=9007199254740991,Qme=/^(?:0|[1-9]\d*)$/;function KT(e,t){var n=typeof e;return t=t??Zme,!!t&&(n=="number"||n!="symbol"&&Qme.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=sve}function tp(e){return e!=null&&JT(e.length)&&!WT(e)}function ave(e,t,n){if(!As(n))return!1;var r=typeof t;return(r=="number"?tp(n)&&KT(t,n.length):r=="string"&&t in n)?Sg(n[t],e):!1}function lve(e){return ive(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&ave(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r-1}function wye(e,t){var n=this.__data__,r=p0(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++to?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r=r?e:Jye(e,t,n)}var Zye="\\ud800-\\udfff",Qye="\\u0300-\\u036f",e0e="\\ufe20-\\ufe2f",t0e="\\u20d0-\\u20ff",n0e=Qye+e0e+t0e,r0e="\\ufe0e\\ufe0f",o0e="\\u200d",i0e=RegExp("["+o0e+Zye+n0e+r0e+"]");function Z4(e){return i0e.test(e)}function s0e(e){return e.split("")}var Q4="\\ud800-\\udfff",a0e="\\u0300-\\u036f",l0e="\\ufe20-\\ufe2f",u0e="\\u20d0-\\u20ff",c0e=a0e+l0e+u0e,d0e="\\ufe0e\\ufe0f",f0e="["+Q4+"]",xI="["+c0e+"]",UI="\\ud83c[\\udffb-\\udfff]",p0e="(?:"+xI+"|"+UI+")",e3="[^"+Q4+"]",t3="(?:\\ud83c[\\udde6-\\uddff]){2}",n3="[\\ud800-\\udbff][\\udc00-\\udfff]",h0e="\\u200d",r3=p0e+"?",o3="["+d0e+"]?",g0e="(?:"+h0e+"(?:"+[e3,t3,n3].join("|")+")"+o3+r3+")*",m0e=o3+r3+g0e,v0e="(?:"+[e3+xI+"?",xI,t3,n3,f0e].join("|")+")",y0e=RegExp(UI+"(?="+UI+")|"+v0e+m0e,"g");function _0e(e){return e.match(y0e)||[]}function b0e(e){return Z4(e)?_0e(e):s0e(e)}function M0e(e){return function(t){t=g0(t);var n=Z4(t)?b0e(t):void 0,r=n?n[0]:t.charAt(0),o=n?Xye(n,1).join(""):t.slice(1);return r[e]()+o}}var I0e=M0e("toUpperCase");const C0e=I0e;function T0e(e,t,n,r){var o=-1,i=e==null?0:e.length;for(r&&i&&(n=e[++o]);++ou))return!1;var f=i.get(e),g=i.get(t);if(f&&g)return f==t&&g==e;var v=-1,_=!0,M=n&K_e?new My:void 0;for(i.set(e,t),i.set(t,e);++v=t||x<0||v&&$>=i}function S(){var V=eM();if(w(V))return N(V);u=setTimeout(S,D(V))}function N(V){return u=void 0,_&&r?M(V):(r=o=void 0,s)}function A(){u!==void 0&&clearTimeout(u),f=0,r=d=o=u=void 0}function L(){return u===void 0?s:N(eM())}function j(){var V=eM(),x=w(V);if(r=arguments,o=this,d=V,x){if(u===void 0)return C(d);if(v)return clearTimeout(u),u=setTimeout(S,t),M(d)}return u===void 0&&(u=setTimeout(S,t)),s}return j.cancel=A,j.flush=L,j}function BI(e,t,n){(n!==void 0&&!Sg(e[t],n)||n===void 0&&!(t in e))&&YT(e,t,n)}function V1e(e){return Cu(e)&&tp(e)}function HI(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function z1e(e){return rve(e,W4(e))}function j1e(e,t,n,r,o,i,s){var u=HI(e,n),d=HI(t,n),f=s.get(d);if(f){BI(e,n,f);return}var g=i?i(u,d,n+"",e,t,s):void 0,v=g===void 0;if(v){var _=Es(d),M=!_&&_y(d),C=!_&&!M&&ZT(d);g=d,_||M||C?Es(u)?g=u:V1e(u)?g=Bme(u):M?(v=!1,g=M_e(d,!0)):C?(v=!1,g=$_e(d,!0)):g=[]:Yye(d)||yy(d)?(g=u,yy(u)?g=z1e(u):(!As(u)||WT(u))&&(g=B_e(d))):v=!1}v&&(s.set(d,g),o(g,d,r,i,s),s.delete(d)),BI(e,n,g)}function C3(e,t,n,r,o){e!==t&&I3(t,function(i,s){if(o||(o=new Ia),As(i))j1e(e,t,s,n,C3,r,o);else{var u=r?r(HI(e,s),i,s+"",e,t,o):void 0;u===void 0&&(u=i),BI(e,s,u)}},W4)}function W1e(e,t){var n=-1,r=tp(e)?Array(e.length):[];return F1e(e,function(o,i,s){r[++n]=t(o,i,s)}),r}function K1e(e,t){var n=Es(e)?$4:W1e;return n(e,O1e(t))}var Y1e=p_e(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const J1e=Y1e;var X1e=lve(function(e,t,n){C3(e,t,n)});const Wm=X1e;var Z1e="Expected a function";function tM(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Z1e);return As(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),q1e(e,t,{leading:r,maxWait:t,trailing:o})}const np={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Q1e,fontFamily:ebe,lineHeight:tbe}=np,T3=ut("body",` margin: 0; font-size: ${Q1e}; font-family: ${ebe}; line-height: ${tbe}; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; `,[ut("input",` font-family: inherit; font-size: inherit; `)]),gd="n-config-provider",dg="naive-ui-style";function no(e,t,n,r,o,i){const s=ep(),u=tn(gd,null);if(n){const f=()=>{const g=i==null?void 0:i.value;n.mount({id:g===void 0?t:g+t,head:!0,props:{bPrefix:g?`.${g}-`:void 0},anchorMetaName:dg,ssr:s}),u!=null&&u.preflightStyleDisabled||T3.mount({id:"n-global",head:!0,anchorMetaName:dg,ssr:s})};s?f():Bf(f)}return Ve(()=>{var f;const{theme:{common:g,self:v,peers:_={}}={},themeOverrides:M={},builtinThemeOverrides:C={}}=o,{common:D,peers:w}=M,{common:S=void 0,[e]:{common:N=void 0,self:A=void 0,peers:L={}}={}}=(u==null?void 0:u.mergedThemeRef.value)||{},{common:j=void 0,[e]:V={}}=(u==null?void 0:u.mergedThemeOverridesRef.value)||{},{common:x,peers:$={}}=V,z=Wm({},g||N||S||r.common,j,x,D),G=Wm((f=v||A||r.self)===null||f===void 0?void 0:f(z),C,V,M);return{common:z,self:G,peers:Wm({},r.peers,L,_),peerOverrides:Wm({},C.peers,$,w)}})}no.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const nbe="n";function La(e={},t={defaultBordered:!0}){const n=tn(gd,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:Ve(()=>{var r,o;const{bordered:i}=e;return i!==void 0?i:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:Ve(()=>(n==null?void 0:n.mergedClsPrefixRef.value)||nbe),namespaceRef:Ve(()=>n==null?void 0:n.mergedNamespaceRef.value)}}const rbe={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},obe=rbe,ibe={name:"en-US",locale:yT},sbe=ibe;function rw(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=tn(gd,null)||{},r=Ve(()=>{var i,s;return(s=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&s!==void 0?s:obe[e]});return{dateLocaleRef:Ve(()=>{var i;return(i=n==null?void 0:n.value)!==null&&i!==void 0?i:sbe}),localeRef:r}}function rp(e,t,n){if(!t)return;const r=ep(),o=tn(gd,null),i=()=>{const s=n==null?void 0:n.value;t.mount({id:s===void 0?e:s+e,head:!0,anchorMetaName:dg,props:{bPrefix:s?`.${s}-`:void 0},ssr:r}),o!=null&&o.preflightStyleDisabled||T3.mount({id:"n-global",head:!0,anchorMetaName:dg,ssr:r})};r?i():Bf(i)}function Nu(e,t,n,r){var o;n||l4("useThemeClass","cssVarsRef is not passed");const i=(o=tn(gd,null))===null||o===void 0?void 0:o.mergedThemeHashRef,s=Ne(""),u=ep();let d;const f=`__${e}`,g=()=>{let v=f;const _=t?t.value:void 0,M=i==null?void 0:i.value;M&&(v+="-"+M),_&&(v+="-"+_);const{themeOverrides:C,builtinThemeOverrides:D}=r;C&&(v+="-"+LI(JSON.stringify(C))),D&&(v+="-"+LI(JSON.stringify(D))),s.value=v,d=()=>{const w=n.value;let S="";for(const N in w)S+=`${N}: ${w[N]};`;ut(`.${v}`,S).mount({id:v,ssr:u}),d=void 0}};return nn(()=>{g()}),{themeClass:s,onRender:()=>{d==null||d()}}}function ow(e,t,n){if(!t)return;const r=ep(),o=Ve(()=>{const{value:s}=t;if(!s)return;const u=s[e];if(u)return u}),i=()=>{nn(()=>{const{value:s}=n,u=`${s}${e}Rtl`;if(Uhe(u,r))return;const{value:d}=o;d&&d.style.mount({id:u,head:!0,anchorMetaName:dg,props:{bPrefix:s?`.${s}-`:void 0},ssr:r})})};return r?i():Bf(i),o}const abe=ot({name:"Add",render(){return Re("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}});function op(e,t){return ot({name:C0e(e),setup(){var n;const r=(n=tn(gd,null))===null||n===void 0?void 0:n.mergedIconsRef;return()=>{var o;const i=(o=r==null?void 0:r.value)===null||o===void 0?void 0:o[e];return i?i():t}}})}const lbe=op("close",Re("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},Re("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},Re("g",{fill:"currentColor","fill-rule":"nonzero"},Re("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),ube=ot({name:"Eye",render(){return Re("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Re("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),Re("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),cbe=ot({name:"EyeOff",render(){return Re("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Re("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),Re("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),Re("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),Re("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),Re("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),dbe=ot({name:"Empty",render(){return Re("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),Re("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),fbe=ot({name:"ChevronDown",render(){return Re("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),pbe=op("clear",Re("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Re("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},Re("g",{fill:"currentColor","fill-rule":"nonzero"},Re("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),hbe=op("rotateClockwise",Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",fill:"currentColor"}),Re("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",fill:"currentColor"}))),gbe=op("rotateClockwise",Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",fill:"currentColor"}),Re("path",{d:"M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}))),mbe=op("zoomIn",Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",fill:"currentColor"}),Re("path",{d:"M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",fill:"currentColor"}))),vbe=op("zoomOut",Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",fill:"currentColor"}),Re("path",{d:"M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",fill:"currentColor"}))),ybe=ot({name:"ResizeSmall",render(){return Re("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Re("g",{fill:"none"},Re("path",{d:"M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",fill:"currentColor"})))}}),iw=ot({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=d0();return()=>Re(bo,{name:"icon-switch-transition",appear:n.value},t)}}),_be=ot({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function n(u){e.width?u.style.maxWidth=`${u.offsetWidth}px`:u.style.maxHeight=`${u.offsetHeight}px`,u.offsetWidth}function r(u){e.width?u.style.maxWidth="0":u.style.maxHeight="0",u.offsetWidth;const{onLeave:d}=e;d&&d()}function o(u){e.width?u.style.maxWidth="":u.style.maxHeight="";const{onAfterLeave:d}=e;d&&d()}function i(u){if(u.style.transition="none",e.width){const d=u.offsetWidth;u.style.maxWidth="0",u.offsetWidth,u.style.transition="",u.style.maxWidth=`${d}px`}else if(e.reverse)u.style.maxHeight=`${u.offsetHeight}px`,u.offsetHeight,u.style.transition="",u.style.maxHeight="0";else{const d=u.offsetHeight;u.style.maxHeight="0",u.offsetWidth,u.style.transition="",u.style.maxHeight=`${d}px`}u.offsetWidth}function s(u){var d;e.width?u.style.maxWidth="":e.reverse||(u.style.maxHeight=""),(d=e.onAfterEnter)===null||d===void 0||d.call(e)}return()=>{const{group:u,width:d,appear:f,mode:g}=e,v=u?rO:bo,_={name:d?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:f,onEnter:i,onAfterEnter:s,onBeforeLeave:n,onLeave:r,onAfterLeave:o};return u||(_.mode=g),Re(v,_,t)}}}),bbe=et("base-icon",` height: 1em; width: 1em; line-height: 1em; text-align: center; display: inline-block; position: relative; fill: currentColor; transform: translateZ(0); `,[ut("svg",` height: 1em; width: 1em; `)]),Ti=ot({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){rp("-base-icon",bbe,cr(e,"clsPrefix"))},render(){return Re("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Mbe=et("base-close",` display: flex; align-items: center; justify-content: center; cursor: pointer; background-color: transparent; color: var(--n-close-icon-color); border-radius: var(--n-close-border-radius); height: var(--n-close-size); width: var(--n-close-size); font-size: var(--n-close-icon-size); outline: none; border: none; position: relative; padding: 0; `,[bt("absolute",` height: var(--n-close-icon-size); width: var(--n-close-icon-size); `),ut("&::before",` content: ""; position: absolute; width: var(--n-close-size); height: var(--n-close-size); left: 50%; top: 50%; transform: translateY(-50%) translateX(-50%); transition: inherit; border-radius: inherit; `),rs("disabled",[ut("&:hover",` color: var(--n-close-icon-color-hover); `),ut("&:hover::before",` background-color: var(--n-close-color-hover); `),ut("&:focus::before",` background-color: var(--n-close-color-hover); `),ut("&:active",` color: var(--n-close-icon-color-pressed); `),ut("&:active::before",` background-color: var(--n-close-color-pressed); `)]),bt("disabled",` cursor: not-allowed; color: var(--n-close-icon-color-disabled); background-color: transparent; `),bt("round",[ut("&::before",` border-radius: 50%; `)])]),Ibe=ot({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return rp("-base-close",Mbe,cr(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:n,absolute:r,round:o,isButtonTag:i}=e;return Re(i?"button":"div",{type:i?"button":void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:i?void 0:"button",disabled:n,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,o&&`${t}-base-close--round`],onMousedown:u=>{e.focusable||u.preventDefault()},onClick:e.onClick},Re(Ti,{clsPrefix:t},{default:()=>Re(lbe,null)}))}}}),{cubicBezierEaseInOut:Cbe}=np;function Iy({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${Cbe} !important`}={}){return[ut("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:e+" scale(0.75)",left:t,top:n,opacity:0}),ut("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),ut("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:n,transition:r})]}const Tbe=ut([ut("@keyframes loading-container-rotate",` to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } `),ut("@keyframes loading-layer-rotate",` 12.5% { -webkit-transform: rotate(135deg); transform: rotate(135deg); } 25% { -webkit-transform: rotate(270deg); transform: rotate(270deg); } 37.5% { -webkit-transform: rotate(405deg); transform: rotate(405deg); } 50% { -webkit-transform: rotate(540deg); transform: rotate(540deg); } 62.5% { -webkit-transform: rotate(675deg); transform: rotate(675deg); } 75% { -webkit-transform: rotate(810deg); transform: rotate(810deg); } 87.5% { -webkit-transform: rotate(945deg); transform: rotate(945deg); } 100% { -webkit-transform: rotate(1080deg); transform: rotate(1080deg); } `),ut("@keyframes loading-left-spin",` from { -webkit-transform: rotate(265deg); transform: rotate(265deg); } 50% { -webkit-transform: rotate(130deg); transform: rotate(130deg); } to { -webkit-transform: rotate(265deg); transform: rotate(265deg); } `),ut("@keyframes loading-right-spin",` from { -webkit-transform: rotate(-265deg); transform: rotate(-265deg); } 50% { -webkit-transform: rotate(-130deg); transform: rotate(-130deg); } to { -webkit-transform: rotate(-265deg); transform: rotate(-265deg); } `),et("base-loading",` position: relative; line-height: 0; width: 1em; height: 1em; `,[gt("transition-wrapper",` position: absolute; width: 100%; height: 100%; `,[Iy()]),gt("container",` display: inline-flex; position: relative; direction: ltr; line-height: 0; animation: loading-container-rotate 1568.2352941176ms linear infinite; font-size: 0; letter-spacing: 0; white-space: nowrap; opacity: 1; width: 100%; height: 100%; `,[gt("svg",` stroke: var(--n-text-color); fill: transparent; position: absolute; height: 100%; overflow: hidden; `),gt("container-layer",` position: absolute; width: 100%; height: 100%; animation: loading-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; `,[gt("container-layer-left",` display: inline-flex; position: relative; width: 50%; height: 100%; overflow: hidden; `,[gt("svg",` animation: loading-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; width: 200%; `)]),gt("container-layer-patch",` position: absolute; top: 0; left: 47.5%; box-sizing: border-box; width: 5%; height: 100%; overflow: hidden; `,[gt("svg",` left: -900%; width: 2000%; transform: rotate(180deg); `)]),gt("container-layer-right",` display: inline-flex; position: relative; width: 50%; height: 100%; overflow: hidden; `,[gt("svg",` animation: loading-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; left: -100%; width: 200%; `)])])]),gt("placeholder",` position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); `,[Iy({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})])])]),wbe={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},sw=ot({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},wbe),setup(e){rp("-base-loading",Tbe,cr(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:n,stroke:r,scale:o}=this,i=t/o;return Re("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},Re(iw,null,{default:()=>this.show?Re("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},Re("div",{class:`${e}-base-loading__container`},Re("div",{class:`${e}-base-loading__container-layer`},Re("div",{class:`${e}-base-loading__container-layer-left`},Re("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},Re("circle",{fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:i,cy:i,r:t-n/2,"stroke-dasharray":4.91*t,"stroke-dashoffset":2.46*t}))),Re("div",{class:`${e}-base-loading__container-layer-patch`},Re("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},Re("circle",{fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:i,cy:i,r:t-n/2,"stroke-dasharray":4.91*t,"stroke-dashoffset":2.46*t}))),Re("div",{class:`${e}-base-loading__container-layer-right`},Re("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},Re("circle",{fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:i,cy:i,r:t-n/2,"stroke-dasharray":4.91*t,"stroke-dashoffset":2.46*t})))))):Re("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),Zt={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaDisabledInput:"0.02",alphaPending:"0.05",alphaTablePending:"0.02",alphaPressed:"0.07",alphaAvatar:"0.2",alphaRail:"0.14",alphaProgressRail:".08",alphaBorder:"0.12",alphaDivider:"0.06",alphaInput:"0",alphaAction:"0.02",alphaTab:"0.04",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",alphaCode:"0.05",alphaTag:"0.02",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Sbe=rd(Zt.neutralBase),w3=rd(Zt.neutralInvertBase),kbe="rgba("+w3.slice(0,3).join(", ")+", ";function qA(e){return kbe+String(e)+")"}function oi(e){const t=Array.from(w3);return t[3]=Number(e),u0(Sbe,t)}const Dbe=Object.assign(Object.assign({name:"common"},np),{baseColor:Zt.neutralBase,primaryColor:Zt.primaryDefault,primaryColorHover:Zt.primaryHover,primaryColorPressed:Zt.primaryActive,primaryColorSuppl:Zt.primarySuppl,infoColor:Zt.infoDefault,infoColorHover:Zt.infoHover,infoColorPressed:Zt.infoActive,infoColorSuppl:Zt.infoSuppl,successColor:Zt.successDefault,successColorHover:Zt.successHover,successColorPressed:Zt.successActive,successColorSuppl:Zt.successSuppl,warningColor:Zt.warningDefault,warningColorHover:Zt.warningHover,warningColorPressed:Zt.warningActive,warningColorSuppl:Zt.warningSuppl,errorColor:Zt.errorDefault,errorColorHover:Zt.errorHover,errorColorPressed:Zt.errorActive,errorColorSuppl:Zt.errorSuppl,textColorBase:Zt.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:oi(Zt.alpha4),placeholderColor:oi(Zt.alpha4),placeholderColorDisabled:oi(Zt.alpha5),iconColor:oi(Zt.alpha4),iconColorHover:Gm(oi(Zt.alpha4),{lightness:.75}),iconColorPressed:Gm(oi(Zt.alpha4),{lightness:.9}),iconColorDisabled:oi(Zt.alpha5),opacity1:Zt.alpha1,opacity2:Zt.alpha2,opacity3:Zt.alpha3,opacity4:Zt.alpha4,opacity5:Zt.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:oi(Number(Zt.alphaClose)),closeIconColorHover:oi(Number(Zt.alphaClose)),closeIconColorPressed:oi(Number(Zt.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:oi(Zt.alpha4),clearColorHover:Gm(oi(Zt.alpha4),{lightness:.75}),clearColorPressed:Gm(oi(Zt.alpha4),{lightness:.9}),scrollbarColor:qA(Zt.alphaScrollbar),scrollbarColorHover:qA(Zt.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:oi(Zt.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:Zt.neutralPopover,tableColor:Zt.neutralCard,cardColor:Zt.neutralCard,modalColor:Zt.neutralModal,bodyColor:Zt.neutralBody,tagColor:"#eee",avatarColor:oi(Zt.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:oi(Zt.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:Zt.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),vl=Dbe,Ebe={iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"},Abe=e=>{const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeSmall:o,fontSizeMedium:i,fontSizeLarge:s,fontSizeHuge:u}=e;return Object.assign(Object.assign({},Ebe),{fontSizeSmall:o,fontSizeMedium:i,fontSizeLarge:s,fontSizeHuge:u,textColor:t,iconColor:n,extraTextColor:r})},Lbe={name:"Empty",common:vl,self:Abe},Obe=Lbe,Rbe=et("empty",` display: flex; flex-direction: column; align-items: center; font-size: var(--n-font-size); `,[gt("icon",` width: var(--n-icon-size); height: var(--n-icon-size); font-size: var(--n-icon-size); line-height: var(--n-icon-size); color: var(--n-icon-color); transition: color .3s var(--n-bezier); `,[ut("+",[gt("description",` margin-top: 8px; `)])]),gt("description",` transition: color .3s var(--n-bezier); color: var(--n-text-color); `),gt("extra",` text-align: center; transition: color .3s var(--n-bezier); margin-top: 12px; color: var(--n-extra-text-color); `)]),Nbe=Object.assign(Object.assign({},no.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Pbe=ot({name:"Empty",props:Nbe,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=La(e),r=no("Empty","-empty",Rbe,Obe,e,t),{localeRef:o}=rw("Empty"),i=tn(gd,null),s=Ve(()=>{var g,v,_;return(g=e.description)!==null&&g!==void 0?g:(_=(v=i==null?void 0:i.mergedComponentPropsRef.value)===null||v===void 0?void 0:v.Empty)===null||_===void 0?void 0:_.description}),u=Ve(()=>{var g,v;return((v=(g=i==null?void 0:i.mergedComponentPropsRef.value)===null||g===void 0?void 0:g.Empty)===null||v===void 0?void 0:v.renderIcon)||(()=>Re(dbe,null))}),d=Ve(()=>{const{size:g}=e,{common:{cubicBezierEaseInOut:v},self:{[Qt("iconSize",g)]:_,[Qt("fontSize",g)]:M,textColor:C,iconColor:D,extraTextColor:w}}=r.value;return{"--n-icon-size":_,"--n-font-size":M,"--n-bezier":v,"--n-text-color":C,"--n-icon-color":D,"--n-extra-text-color":w}}),f=n?Nu("empty",Ve(()=>{let g="";const{size:v}=e;return g+=v[0],g}),d,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:u,localizedDescription:Ve(()=>s.value||o.value.description),cssVars:n?void 0:d,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),Re("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?Re("div",{class:`${t}-empty__icon`},e.icon?e.icon():Re(Ti,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?Re("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?Re("div",{class:`${t}-empty__extra`},e.extra()):null)}}),xbe=e=>{const{scrollbarColor:t,scrollbarColorHover:n}=e;return{color:t,colorHover:n}},Ube={name:"Scrollbar",common:vl,self:xbe},Fbe=Ube,{cubicBezierEaseInOut:VA}=np;function Cy({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=VA,leaveCubicBezier:o=VA}={}){return[ut(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),ut(`&.${e}-transition-leave-active`,{transition:`all ${n} ${o}!important`}),ut(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),ut(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const Gbe=et("scrollbar",` overflow: hidden; position: relative; z-index: auto; height: 100%; width: 100%; `,[ut(">",[et("scrollbar-container",` width: 100%; overflow: scroll; height: 100%; max-height: inherit; scrollbar-width: none; `,[ut("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` width: 0; height: 0; display: none; `),ut(">",[et("scrollbar-content",` box-sizing: border-box; min-width: 100%; `)])])]),ut(">, +",[et("scrollbar-rail",` position: absolute; pointer-events: none; user-select: none; -webkit-user-select: none; `,[bt("horizontal",` left: 2px; right: 2px; bottom: 4px; height: var(--n-scrollbar-height); `,[ut(">",[gt("scrollbar",` height: var(--n-scrollbar-height); border-radius: var(--n-scrollbar-border-radius); right: 0; `)])]),bt("vertical",` right: 4px; top: 2px; bottom: 2px; width: var(--n-scrollbar-width); `,[ut(">",[gt("scrollbar",` width: var(--n-scrollbar-width); border-radius: var(--n-scrollbar-border-radius); bottom: 0; `)])]),bt("disabled",[ut(">",[gt("scrollbar",{pointerEvents:"none"})])]),ut(">",[gt("scrollbar",` position: absolute; cursor: pointer; pointer-events: all; background-color: var(--n-scrollbar-color); transition: background-color .2s var(--n-scrollbar-bezier); `,[Cy(),ut("&:hover",{backgroundColor:"var(--n-scrollbar-color-hover)"})])])])])]),$be=Object.assign(Object.assign({},no.props),{size:{type:Number,default:5},duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:String,contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean}),S3=ot({name:"Scrollbar",props:$be,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=La(e),o=ow("Scrollbar",r,t),i=Ne(null),s=Ne(null),u=Ne(null),d=Ne(null),f=Ne(null),g=Ne(null),v=Ne(null),_=Ne(null),M=Ne(null),C=Ne(null),D=Ne(null),w=Ne(0),S=Ne(0),N=Ne(!1),A=Ne(!1);let L=!1,j=!1,V,x,$=0,z=0,G=0,O=0;const T=ege(),P=Ve(()=>{const{value:Qe}=_,{value:yt}=g,{value:Nt}=C;return Qe===null||yt===null||Nt===null?0:Math.min(Qe,Nt*Qe/yt+e.size*1.5)}),Z=Ve(()=>`${P.value}px`),K=Ve(()=>{const{value:Qe}=M,{value:yt}=v,{value:Nt}=D;return Qe===null||yt===null||Nt===null?0:Nt*Qe/yt+e.size*1.5}),oe=Ve(()=>`${K.value}px`),J=Ve(()=>{const{value:Qe}=_,{value:yt}=w,{value:Nt}=g,{value:ln}=C;if(Qe===null||Nt===null||ln===null)return 0;{const en=Nt-Qe;return en?yt/en*(ln-P.value):0}}),ie=Ve(()=>`${J.value}px`),pe=Ve(()=>{const{value:Qe}=M,{value:yt}=S,{value:Nt}=v,{value:ln}=D;if(Qe===null||Nt===null||ln===null)return 0;{const en=Nt-Qe;return en?yt/en*(ln-K.value):0}}),ue=Ve(()=>`${pe.value}px`),de=Ve(()=>{const{value:Qe}=_,{value:yt}=g;return Qe!==null&&yt!==null&&yt>Qe}),Y=Ve(()=>{const{value:Qe}=M,{value:yt}=v;return Qe!==null&&yt!==null&&yt>Qe}),re=Ve(()=>{const{trigger:Qe}=e;return Qe==="none"||N.value}),fe=Ve(()=>{const{trigger:Qe}=e;return Qe==="none"||A.value}),Ae=Ve(()=>{const{container:Qe}=e;return Qe?Qe():s.value}),ye=Ve(()=>{const{content:Qe}=e;return Qe?Qe():u.value}),le=Jge(()=>{e.container||Le({top:w.value,left:S.value})}),Q=()=>{le.isDeactivated||_e()},ve=Qe=>{if(le.isDeactivated)return;const{onResize:yt}=e;yt&&yt(Qe),_e()},Le=(Qe,yt)=>{if(!e.scrollable)return;if(typeof Qe=="number"){W(yt??0,Qe,0,!1,"auto");return}const{left:Nt,top:ln,index:en,elSize:Tn,position:qn,behavior:ze,el:wt,debounce:_t=!0}=Qe;(Nt!==void 0||ln!==void 0)&&W(Nt??0,ln??0,0,!1,ze),wt!==void 0?W(0,wt.offsetTop,wt.offsetHeight,_t,ze):en!==void 0&&Tn!==void 0?W(0,en*Tn,Tn,_t,ze):qn==="bottom"?W(0,Number.MAX_SAFE_INTEGER,0,!1,ze):qn==="top"&&W(0,0,0,!1,ze)},me=(Qe,yt)=>{if(!e.scrollable)return;const{value:Nt}=Ae;Nt&&(typeof Qe=="object"?Nt.scrollBy(Qe):Nt.scrollBy(Qe,yt||0))};function W(Qe,yt,Nt,ln,en){const{value:Tn}=Ae;if(Tn){if(ln){const{scrollTop:qn,offsetHeight:ze}=Tn;if(yt>qn){yt+Nt<=qn+ze||Tn.scrollTo({left:Qe,top:yt+Nt-ze,behavior:en});return}}Tn.scrollTo({left:Qe,top:yt,behavior:en})}}function te(){Pe(),xe(),_e()}function se(){Te()}function Te(){ce(),Se()}function ce(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{A.value=!1},e.duration)}function Se(){V!==void 0&&window.clearTimeout(V),V=window.setTimeout(()=>{N.value=!1},e.duration)}function Pe(){V!==void 0&&window.clearTimeout(V),N.value=!0}function xe(){x!==void 0&&window.clearTimeout(x),A.value=!0}function He(Qe){const{onScroll:yt}=e;yt&&yt(Qe),Ie()}function Ie(){const{value:Qe}=Ae;Qe&&(w.value=Qe.scrollTop,S.value=Qe.scrollLeft*(o!=null&&o.value?-1:1))}function q(){const{value:Qe}=ye;Qe&&(g.value=Qe.offsetHeight,v.value=Qe.offsetWidth);const{value:yt}=Ae;yt&&(_.value=yt.offsetHeight,M.value=yt.offsetWidth);const{value:Nt}=f,{value:ln}=d;Nt&&(D.value=Nt.offsetWidth),ln&&(C.value=ln.offsetHeight)}function ne(){const{value:Qe}=Ae;Qe&&(w.value=Qe.scrollTop,S.value=Qe.scrollLeft*(o!=null&&o.value?-1:1),_.value=Qe.offsetHeight,M.value=Qe.offsetWidth,g.value=Qe.scrollHeight,v.value=Qe.scrollWidth);const{value:yt}=f,{value:Nt}=d;yt&&(D.value=yt.offsetWidth),Nt&&(C.value=Nt.offsetHeight)}function _e(){e.scrollable&&(e.useUnifiedContainer?ne():(q(),Ie()))}function Be(Qe){var yt;return!(!((yt=i.value)===null||yt===void 0)&&yt.contains(hy(Qe)))}function je(Qe){Qe.preventDefault(),Qe.stopPropagation(),j=!0,po("mousemove",window,lt,!0),po("mouseup",window,Fe,!0),z=S.value,G=o!=null&&o.value?window.innerWidth-Qe.clientX:Qe.clientX}function lt(Qe){if(!j)return;V!==void 0&&window.clearTimeout(V),x!==void 0&&window.clearTimeout(x);const{value:yt}=M,{value:Nt}=v,{value:ln}=K;if(yt===null||Nt===null)return;const Tn=(o!=null&&o.value?window.innerWidth-Qe.clientX-G:Qe.clientX-G)*(Nt-yt)/(yt-ln),qn=Nt-yt;let ze=z+Tn;ze=Math.min(qn,ze),ze=Math.max(ze,0);const{value:wt}=Ae;if(wt){wt.scrollLeft=ze*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:_t}=e;_t&&_t(ze)}}function Fe(Qe){Qe.preventDefault(),Qe.stopPropagation(),_r("mousemove",window,lt,!0),_r("mouseup",window,Fe,!0),j=!1,_e(),Be(Qe)&&Te()}function it(Qe){Qe.preventDefault(),Qe.stopPropagation(),L=!0,po("mousemove",window,Tt,!0),po("mouseup",window,mn,!0),$=w.value,O=Qe.clientY}function Tt(Qe){if(!L)return;V!==void 0&&window.clearTimeout(V),x!==void 0&&window.clearTimeout(x);const{value:yt}=_,{value:Nt}=g,{value:ln}=P;if(yt===null||Nt===null)return;const Tn=(Qe.clientY-O)*(Nt-yt)/(yt-ln),qn=Nt-yt;let ze=$+Tn;ze=Math.min(qn,ze),ze=Math.max(ze,0);const{value:wt}=Ae;wt&&(wt.scrollTop=ze)}function mn(Qe){Qe.preventDefault(),Qe.stopPropagation(),_r("mousemove",window,Tt,!0),_r("mouseup",window,mn,!0),L=!1,_e(),Be(Qe)&&Te()}nn(()=>{const{value:Qe}=Y,{value:yt}=de,{value:Nt}=t,{value:ln}=f,{value:en}=d;ln&&(Qe?ln.classList.remove(`${Nt}-scrollbar-rail--disabled`):ln.classList.add(`${Nt}-scrollbar-rail--disabled`)),en&&(yt?en.classList.remove(`${Nt}-scrollbar-rail--disabled`):en.classList.add(`${Nt}-scrollbar-rail--disabled`))}),On(()=>{e.container||_e()}),gi(()=>{V!==void 0&&window.clearTimeout(V),x!==void 0&&window.clearTimeout(x),_r("mousemove",window,Tt,!0),_r("mouseup",window,mn,!0)});const In=no("Scrollbar","-scrollbar",Gbe,Fbe,e,t),Cn=Ve(()=>{const{common:{cubicBezierEaseInOut:Qe,scrollbarBorderRadius:yt,scrollbarHeight:Nt,scrollbarWidth:ln},self:{color:en,colorHover:Tn}}=In.value;return{"--n-scrollbar-bezier":Qe,"--n-scrollbar-color":en,"--n-scrollbar-color-hover":Tn,"--n-scrollbar-border-radius":yt,"--n-scrollbar-width":ln,"--n-scrollbar-height":Nt}}),En=n?Nu("scrollbar",void 0,Cn,e):void 0;return Object.assign(Object.assign({},{scrollTo:Le,scrollBy:me,sync:_e,syncUnifiedContainer:ne,handleMouseEnterWrapper:te,handleMouseLeaveWrapper:se}),{mergedClsPrefix:t,rtlEnabled:o,containerScrollTop:w,wrapperRef:i,containerRef:s,contentRef:u,yRailRef:d,xRailRef:f,needYBar:de,needXBar:Y,yBarSizePx:Z,xBarSizePx:oe,yBarTopPx:ie,xBarLeftPx:ue,isShowXBar:re,isShowYBar:fe,isIos:T,handleScroll:He,handleContentResize:Q,handleContainerResize:ve,handleYScrollMouseDown:it,handleXScrollMouseDown:je,cssVars:n?void 0:Cn,themeClass:En==null?void 0:En.themeClass,onRender:En==null?void 0:En.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:i}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const s=this.trigger==="none",u=()=>Re("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`],"data-scrollbar-rail":!0,style:this.verticalRailStyle,"aria-hidden":!0},Re(s?BE:bo,s?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?Re("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),d=()=>{var g,v;return(g=this.onRender)===null||g===void 0||g.call(this),Re("div",Eo(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,o&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(v=t.default)===null||v===void 0?void 0:v.call(t):Re("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},Re(lg,{onResize:this.handleContentResize},{default:()=>Re("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},t)})),i?null:u(),this.xScrollable&&Re("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},Re(s?BE:bo,s?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?Re("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},f=this.container?d():Re(lg,{onResize:this.handleContainerResize},{default:d});return i?Re(dt,null,f,u()):f}}),k3=S3,Bbe=S3,{cubicBezierEaseIn:zA,cubicBezierEaseOut:jA}=np;function Hbe({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:o=""}={}){return[ut("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${zA}, transform ${t} ${zA} ${o&&","+o}`}),ut("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${jA}, transform ${t} ${jA} ${o&&","+o}`}),ut("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ut("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const qbe=et("base-wave",` position: absolute; left: 0; right: 0; top: 0; bottom: 0; border-radius: inherit; `),Vbe=ot({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){rp("-base-wave",qbe,cr(e,"clsPrefix"));const t=Ne(null),n=Ne(!1);let r=null;return gi(()=>{r!==null&&window.clearTimeout(r)}),{active:n,selfRef:t,play(){r!==null&&(window.clearTimeout(r),n.value=!1,r=null),br(()=>{var o;(o=t.value)===null||o===void 0||o.offsetHeight,n.value=!0,r=window.setTimeout(()=>{n.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return Re("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),zbe={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"},jbe=e=>{const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:o,fontSize:i,dividerColor:s}=e;return Object.assign(Object.assign({},zbe),{fontSize:i,borderRadius:o,color:n,dividerColor:s,textColor:r,boxShadow:t})},Wbe={name:"Popover",common:vl,self:jbe},D3=Wbe,nM={top:"bottom",bottom:"top",left:"right",right:"left"},yo="var(--n-arrow-height) * 1.414",Kbe=ut([et("popover",` transition: box-shadow .3s var(--n-bezier), background-color .3s var(--n-bezier), color .3s var(--n-bezier); position: relative; font-size: var(--n-font-size); color: var(--n-text-color); box-shadow: var(--n-box-shadow); word-break: break-word; `,[ut(">",[et("scrollbar",` height: inherit; max-height: inherit; `)]),rs("raw",` background-color: var(--n-color); border-radius: var(--n-border-radius); `,[rs("scrollable",[rs("show-header-or-footer","padding: var(--n-padding);")])]),gt("header",` padding: var(--n-padding); border-bottom: 1px solid var(--n-divider-color); transition: border-color .3s var(--n-bezier); `),gt("footer",` padding: var(--n-padding); border-top: 1px solid var(--n-divider-color); transition: border-color .3s var(--n-bezier); `),bt("scrollable, show-header-or-footer",[gt("content",` padding: var(--n-padding); `)])]),et("popover-shared",` transform-origin: inherit; `,[et("popover-arrow-wrapper",` position: absolute; overflow: hidden; pointer-events: none; `,[et("popover-arrow",` transition: background-color .3s var(--n-bezier); position: absolute; display: block; width: calc(${yo}); height: calc(${yo}); box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12); transform: rotate(45deg); background-color: var(--n-color); pointer-events: all; `)]),ut("&.popover-transition-enter-from, &.popover-transition-leave-to",` opacity: 0; transform: scale(.85); `),ut("&.popover-transition-enter-to, &.popover-transition-leave-from",` transform: scale(1); opacity: 1; `),ut("&.popover-transition-enter-active",` transition: box-shadow .3s var(--n-bezier), background-color .3s var(--n-bezier), color .3s var(--n-bezier), opacity .15s var(--n-bezier-ease-out), transform .15s var(--n-bezier-ease-out); `),ut("&.popover-transition-leave-active",` transition: box-shadow .3s var(--n-bezier), background-color .3s var(--n-bezier), color .3s var(--n-bezier), opacity .15s var(--n-bezier-ease-in), transform .15s var(--n-bezier-ease-in); `)]),ms("top-start",` top: calc(${yo} / -2); left: calc(${Va("top-start")} - var(--v-offset-left)); `),ms("top",` top: calc(${yo} / -2); transform: translateX(calc(${yo} / -2)) rotate(45deg); left: 50%; `),ms("top-end",` top: calc(${yo} / -2); right: calc(${Va("top-end")} + var(--v-offset-left)); `),ms("bottom-start",` bottom: calc(${yo} / -2); left: calc(${Va("bottom-start")} - var(--v-offset-left)); `),ms("bottom",` bottom: calc(${yo} / -2); transform: translateX(calc(${yo} / -2)) rotate(45deg); left: 50%; `),ms("bottom-end",` bottom: calc(${yo} / -2); right: calc(${Va("bottom-end")} + var(--v-offset-left)); `),ms("left-start",` left: calc(${yo} / -2); top: calc(${Va("left-start")} - var(--v-offset-top)); `),ms("left",` left: calc(${yo} / -2); transform: translateY(calc(${yo} / -2)) rotate(45deg); top: 50%; `),ms("left-end",` left: calc(${yo} / -2); bottom: calc(${Va("left-end")} + var(--v-offset-top)); `),ms("right-start",` right: calc(${yo} / -2); top: calc(${Va("right-start")} - var(--v-offset-top)); `),ms("right",` right: calc(${yo} / -2); transform: translateY(calc(${yo} / -2)) rotate(45deg); top: 50%; `),ms("right-end",` right: calc(${yo} / -2); bottom: calc(${Va("right-end")} + var(--v-offset-top)); `),...K1e({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(o=>{const i=o.split("-")[1]==="end",u=`calc((${`var(--v-target-${r}, 0px)`} - ${yo}) / 2)`,d=Va(o);return ut(`[v-placement="${o}"] >`,[et("popover-shared",[bt("center-arrow",[et("popover-arrow",`${t}: calc(max(${u}, ${d}) ${i?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Va(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function ms(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ut(`[v-placement="${e}"] >`,[et("popover-shared",` margin-${nM[n]}: var(--n-space); `,[bt("show-arrow",` margin-${nM[n]}: var(--n-space-arrow); `),bt("overlap",` margin: 0; `),qhe("popover-arrow-wrapper",` right: 0; left: 0; top: 0; bottom: 0; ${n}: 100%; ${nM[n]}: auto; ${r} `,[et("popover-arrow",t)])])])}const E3=Object.assign(Object.assign({},no.props),{to:Uf.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),Ybe=({arrowStyle:e,clsPrefix:t})=>Re("div",{key:"__popover-arrow__",class:`${t}-popover-arrow-wrapper`},Re("div",{class:`${t}-popover-arrow`,style:e})),Jbe=ot({name:"PopoverBody",inheritAttrs:!1,props:E3,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:i}=La(e),s=no("Popover","-popover",Kbe,D3,e,o),u=Ne(null),d=tn("NPopover"),f=Ne(null),g=Ne(e.show),v=Ne(!1);nn(()=>{const{show:x}=e;x&&!Vhe()&&!e.internalDeactivateImmediately&&(v.value=!0)});const _=Ve(()=>{const{trigger:x,onClickoutside:$}=e,z=[],{positionManuallyRef:{value:G}}=d;return G||(x==="click"&&!$&&z.push([KE,L,void 0,{capture:!0}]),x==="hover"&&z.push([lge,A])),$&&z.push([KE,L,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&v.value)&&z.push([eo,e.show]),z}),M=Ve(()=>{const x=e.width==="trigger"?void 0:Vb(e.width),$=[];x&&$.push({width:x});const{maxWidth:z,minWidth:G}=e;return z&&$.push({maxWidth:Vb(z)}),G&&$.push({maxWidth:Vb(G)}),i||$.push(C.value),$}),C=Ve(()=>{const{common:{cubicBezierEaseInOut:x,cubicBezierEaseIn:$,cubicBezierEaseOut:z},self:{space:G,spaceArrow:O,padding:T,fontSize:P,textColor:Z,dividerColor:K,color:oe,boxShadow:J,borderRadius:ie,arrowHeight:pe,arrowOffset:ue,arrowOffsetVertical:de}}=s.value;return{"--n-box-shadow":J,"--n-bezier":x,"--n-bezier-ease-in":$,"--n-bezier-ease-out":z,"--n-font-size":P,"--n-text-color":Z,"--n-color":oe,"--n-divider-color":K,"--n-border-radius":ie,"--n-arrow-height":pe,"--n-arrow-offset":ue,"--n-arrow-offset-vertical":de,"--n-padding":T,"--n-space":G,"--n-space-arrow":O}}),D=i?Nu("popover",void 0,C,e):void 0;d.setBodyInstance({syncPosition:w}),gi(()=>{d.setBodyInstance(null)}),$t(cr(e,"show"),x=>{e.animated||(x?g.value=!0:g.value=!1)});function w(){var x;(x=u.value)===null||x===void 0||x.syncPosition()}function S(x){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(x)}function N(x){e.trigger==="hover"&&e.keepAliveOnHover&&d.handleMouseLeave(x)}function A(x){e.trigger==="hover"&&!j().contains(hy(x))&&d.handleMouseMoveOutside(x)}function L(x){(e.trigger==="click"&&!j().contains(hy(x))||e.onClickoutside)&&d.handleClickOutside(x)}function j(){return d.getTriggerElement()}ui(b4,f),ui(_4,null),ui(y4,null);function V(){if(D==null||D.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&v.value))return null;let $;const z=d.internalRenderBodyRef.value,{value:G}=o;if(z)$=z([`${G}-popover-shared`,D==null?void 0:D.themeClass.value,e.overlap&&`${G}-popover-shared--overlap`,e.showArrow&&`${G}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${G}-popover-shared--center-arrow`],f,M.value,S,N);else{const{value:O}=d.extraClassRef,{internalTrapFocus:T}=e,P=!EI(t.header)||!EI(t.footer),Z=()=>{var K;const oe=P?Re(dt,null,qs(t.header,pe=>pe?Re("div",{class:`${G}-popover__header`,style:e.headerStyle},pe):null),qs(t.default,pe=>pe?Re("div",{class:`${G}-popover__content`,style:e.contentStyle},t):null),qs(t.footer,pe=>pe?Re("div",{class:`${G}-popover__footer`,style:e.footerStyle},pe):null)):e.scrollable?(K=t.default)===null||K===void 0?void 0:K.call(t):Re("div",{class:`${G}-popover__content`,style:e.contentStyle},t),J=e.scrollable?Re(Bbe,{contentClass:P?void 0:`${G}-popover__content`,contentStyle:P?void 0:e.contentStyle},{default:()=>oe}):oe,ie=e.showArrow?Ybe({arrowStyle:e.arrowStyle,clsPrefix:G}):null;return[J,ie]};$=Re("div",Eo({class:[`${G}-popover`,`${G}-popover-shared`,D==null?void 0:D.themeClass.value,O.map(K=>`${G}-${K}`),{[`${G}-popover--scrollable`]:e.scrollable,[`${G}-popover--show-header-or-footer`]:P,[`${G}-popover--raw`]:e.raw,[`${G}-popover-shared--overlap`]:e.overlap,[`${G}-popover-shared--show-arrow`]:e.showArrow,[`${G}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:f,style:M.value,onKeydown:d.handleKeydown,onMouseenter:S,onMouseleave:N},n),T?Re(Yge,{active:e.show,autoFocus:!0},{default:Z}):Z())}return $n($,_.value)}return{displayed:v,namespace:r,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:u,adjustedTo:Uf(e),followerEnabled:g,renderContentNode:V}},render(){return Re(Cge,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Uf.tdkey},{default:()=>this.animated?Re(bo,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),Xbe=Object.keys(E3),Zbe={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Qbe(e,t,n){Zbe[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const o=e.props[r],i=n[r];o?e.props[r]=(...s)=>{o(...s),i(...s)}:e.props[r]=i})}const A3={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Uf.propTo,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},eMe=Object.assign(Object.assign(Object.assign({},no.props),A3),{internalOnAfterLeave:Function,internalRenderBody:Function}),L3=ot({name:"Popover",inheritAttrs:!1,props:eMe,__popover__:!0,setup(e){const t=d0(),n=Ne(null),r=Ve(()=>e.show),o=Ne(e.defaultShow),i=qT(r,o),s=Mu(()=>e.disabled?!1:i.value),u=()=>{if(e.disabled)return!0;const{getDisabled:Z}=e;return!!(Z!=null&&Z())},d=()=>u()?!1:i.value,f=gy(e,["arrow","showArrow"]),g=Ve(()=>e.overlap?!1:f.value);let v=null;const _=Ne(null),M=Ne(null),C=Mu(()=>e.x!==void 0&&e.y!==void 0);function D(Z){const{"onUpdate:show":K,onUpdateShow:oe,onShow:J,onHide:ie}=e;o.value=Z,K&&Er(K,Z),oe&&Er(oe,Z),Z&&J&&Er(J,!0),Z&&ie&&Er(ie,!1)}function w(){v&&v.syncPosition()}function S(){const{value:Z}=_;Z&&(window.clearTimeout(Z),_.value=null)}function N(){const{value:Z}=M;Z&&(window.clearTimeout(Z),M.value=null)}function A(){const Z=u();if(e.trigger==="focus"&&!Z){if(d())return;D(!0)}}function L(){const Z=u();if(e.trigger==="focus"&&!Z){if(!d())return;D(!1)}}function j(){const Z=u();if(e.trigger==="hover"&&!Z){if(N(),_.value!==null||d())return;const K=()=>{D(!0),_.value=null},{delay:oe}=e;oe===0?K():_.value=window.setTimeout(K,oe)}}function V(){const Z=u();if(e.trigger==="hover"&&!Z){if(S(),M.value!==null||!d())return;const K=()=>{D(!1),M.value=null},{duration:oe}=e;oe===0?K():M.value=window.setTimeout(K,oe)}}function x(){V()}function $(Z){var K;d()&&(e.trigger==="click"&&(S(),N(),D(!1)),(K=e.onClickoutside)===null||K===void 0||K.call(e,Z))}function z(){if(e.trigger==="click"&&!u()){S(),N();const Z=!d();D(Z)}}function G(Z){e.internalTrapFocus&&Z.key==="Escape"&&(S(),N(),D(!1))}function O(Z){o.value=Z}function T(){var Z;return(Z=n.value)===null||Z===void 0?void 0:Z.targetRef}function P(Z){v=Z}return ui("NPopover",{getTriggerElement:T,handleKeydown:G,handleMouseEnter:j,handleMouseLeave:V,handleClickOutside:$,handleMouseMoveOutside:x,setBodyInstance:P,positionManuallyRef:C,isMountedRef:t,zIndexRef:cr(e,"zIndex"),extraClassRef:cr(e,"internalExtraClass"),internalRenderBodyRef:cr(e,"internalRenderBody")}),nn(()=>{i.value&&u()&&D(!1)}),{binderInstRef:n,positionManually:C,mergedShowConsideringDisabledProp:s,uncontrolledShow:o,mergedShowArrow:g,getMergedShow:d,setShow:O,handleClick:z,handleMouseEnter:j,handleMouseLeave:V,handleFocus:A,handleBlur:L,syncPosition:w}},render(){var e;const{positionManually:t,$slots:n}=this;let r,o=!1;if(!t&&(n.activator?r=$E(n,"activator"):r=$E(n,"trigger"),r)){r=Ta(r),r=r.type===Hf?Re("span",[r]):r;const i={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[i,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[i];else{const{internalInheritedEventHandlers:s}=this,u=[i,...s],d={onBlur:f=>{u.forEach(g=>{g.onBlur(f)})},onFocus:f=>{u.forEach(g=>{g.onFocus(f)})},onClick:f=>{u.forEach(g=>{g.onClick(f)})},onMouseenter:f=>{u.forEach(g=>{g.onMouseenter(f)})},onMouseleave:f=>{u.forEach(g=>{g.onMouseleave(f)})}};Qbe(r,s?"nested":t?"manual":this.trigger,d)}}return Re(ige,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const i=this.getMergedShow();return[this.internalTrapFocus&&i?$n(Re("div",{style:{position:"fixed",inset:0}}),[[VT,{enabled:i,zIndex:this.zIndex}]]):null,t?null:Re(sge,null,{default:()=>r}),Re(Jbe,vhe(this.$props,Xbe,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:i})),{default:()=>{var s,u;return(u=(s=this.$slots).default)===null||u===void 0?void 0:u.call(s)},header:()=>{var s,u;return(u=(s=this.$slots).header)===null||u===void 0?void 0:u.call(s)},footer:()=>{var s,u;return(u=(s=this.$slots).footer)===null||u===void 0?void 0:u.call(s)}})]}})}}),tMe=et("base-clear",` flex-shrink: 0; height: 1em; width: 1em; position: relative; `,[ut(">",[gt("clear",` font-size: var(--n-clear-size); height: 1em; width: 1em; cursor: pointer; color: var(--n-clear-color); transition: color .3s var(--n-bezier); display: flex; `,[ut("&:hover",` color: var(--n-clear-color-hover)!important; `),ut("&:active",` color: var(--n-clear-color-pressed)!important; `)]),gt("placeholder",` display: flex; `),gt("clear, placeholder",` position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); `,[Iy({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),qI=ot({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return rp("-base-clear",tMe,cr(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return Re("div",{class:`${e}-base-clear`},Re(iw,null,{default:()=>{var t,n;return this.show?Re("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Dh(this.$slots.icon,()=>[Re(Ti,{clsPrefix:e},{default:()=>Re(pbe,null)})])):Re("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),nMe=ot({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:n}=e;return Re(sw,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?Re(qI,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>Re(Ti,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Dh(t.default,()=>[Re(fbe,null)])})}):null})}}}),{cubicBezierEaseInOut:Ol}=np;function rMe({duration:e=".2s",delay:t=".1s"}={}){return[ut("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),ut("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` opacity: 0!important; margin-left: 0!important; margin-right: 0!important; `),ut("&.fade-in-width-expand-transition-leave-active",` overflow: hidden; transition: opacity ${e} ${Ol}, max-width ${e} ${Ol} ${t}, margin-left ${e} ${Ol} ${t}, margin-right ${e} ${Ol} ${t}; `),ut("&.fade-in-width-expand-transition-enter-active",` overflow: hidden; transition: opacity ${e} ${Ol} ${t}, max-width ${e} ${Ol}, margin-left ${e} ${Ol}, margin-right ${e} ${Ol}; `)]}const oMe=wg&&"chrome"in window;wg&&navigator.userAgent.includes("Firefox");const O3=wg&&navigator.userAgent.includes("Safari")&&!oMe,iMe={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},sMe=e=>{const{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:o,primaryColorHover:i,inputColor:s,inputColorDisabled:u,borderColor:d,warningColor:f,warningColorHover:g,errorColor:v,errorColorHover:_,borderRadius:M,lineHeight:C,fontSizeTiny:D,fontSizeSmall:w,fontSizeMedium:S,fontSizeLarge:N,heightTiny:A,heightSmall:L,heightMedium:j,heightLarge:V,actionColor:x,clearColor:$,clearColorHover:z,clearColorPressed:G,placeholderColor:O,placeholderColorDisabled:T,iconColor:P,iconColorDisabled:Z,iconColorHover:K,iconColorPressed:oe}=e;return Object.assign(Object.assign({},iMe),{countTextColorDisabled:r,countTextColor:n,heightTiny:A,heightSmall:L,heightMedium:j,heightLarge:V,fontSizeTiny:D,fontSizeSmall:w,fontSizeMedium:S,fontSizeLarge:N,lineHeight:C,lineHeightTextarea:C,borderRadius:M,iconSize:"16px",groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:o,placeholderColor:O,placeholderColorDisabled:T,color:s,colorDisabled:u,colorFocus:s,groupLabelBorder:`1px solid ${d}`,border:`1px solid ${d}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${d}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${Nc(o,{alpha:.2})}`,loadingColor:o,loadingColorWarning:f,borderWarning:`1px solid ${f}`,borderHoverWarning:`1px solid ${g}`,colorFocusWarning:s,borderFocusWarning:`1px solid ${g}`,boxShadowFocusWarning:`0 0 0 2px ${Nc(f,{alpha:.2})}`,caretColorWarning:f,loadingColorError:v,borderError:`1px solid ${v}`,borderHoverError:`1px solid ${_}`,colorFocusError:s,borderFocusError:`1px solid ${_}`,boxShadowFocusError:`0 0 0 2px ${Nc(v,{alpha:.2})}`,caretColorError:v,clearColor:$,clearColorHover:z,clearColorPressed:G,iconColor:P,iconColorDisabled:Z,iconColorHover:K,iconColorPressed:oe,suffixTextColor:t})},aMe={name:"Input",common:vl,self:sMe},lMe=aMe,R3="n-input";function uMe(e){let t=0;for(const n of e)t++;return t}function Km(e){return e===""||e==null}function cMe(e){const t=Ne(null);function n(){const{value:i}=e;if(!(i!=null&&i.focus)){o();return}const{selectionStart:s,selectionEnd:u,value:d}=i;if(s==null||u==null){o();return}t.value={start:s,end:u,beforeText:d.slice(0,s),afterText:d.slice(u)}}function r(){var i;const{value:s}=t,{value:u}=e;if(!s||!u)return;const{value:d}=u,{start:f,beforeText:g,afterText:v}=s;let _=d.length;if(d.endsWith(v))_=d.length-v.length;else if(d.startsWith(g))_=g.length;else{const M=g[f-1],C=d.indexOf(M,f-1);C!==-1&&(_=C+1)}(i=u.setSelectionRange)===null||i===void 0||i.call(u,_,_)}function o(){t.value=null}return $t(e,o),{recordCursor:n,restoreCursor:r}}const WA=ot({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:n,maxlengthRef:r,mergedClsPrefixRef:o,countGraphemesRef:i}=tn(R3),s=Ve(()=>{const{value:u}=n;return u===null||Array.isArray(u)?0:(i.value||uMe)(u)});return()=>{const{value:u}=r,{value:d}=n;return Re("span",{class:`${o.value}-input-word-count`},bhe(t.default,{value:d===null||Array.isArray(d)?"":d},()=>[u===void 0?s.value:`${s.value} / ${u}`]))}}}),dMe=et("input",` max-width: 100%; cursor: text; line-height: 1.5; z-index: auto; outline: none; box-sizing: border-box; position: relative; display: inline-flex; border-radius: var(--n-border-radius); background-color: var(--n-color); transition: background-color .3s var(--n-bezier); font-size: var(--n-font-size); --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2); `,[gt("input, textarea",` overflow: hidden; flex-grow: 1; position: relative; `),gt("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",` box-sizing: border-box; font-size: inherit; line-height: 1.5; font-family: inherit; border: none; outline: none; background-color: #0000; text-align: inherit; transition: -webkit-text-fill-color .3s var(--n-bezier), caret-color .3s var(--n-bezier), color .3s var(--n-bezier), text-decoration-color .3s var(--n-bezier); `),gt("input-el, textarea-el",` -webkit-appearance: none; scrollbar-width: none; width: 100%; min-width: 0; text-decoration-color: var(--n-text-decoration-color); color: var(--n-text-color); caret-color: var(--n-caret-color); background-color: transparent; `,[ut("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` width: 0; height: 0; display: none; `),ut("&::placeholder",` color: #0000; -webkit-text-fill-color: transparent !important; `),ut("&:-webkit-autofill ~",[gt("placeholder","display: none;")])]),bt("round",[rs("textarea","border-radius: calc(var(--n-height) / 2);")]),gt("placeholder",` pointer-events: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; color: var(--n-placeholder-color); `,[ut("span",` width: 100%; display: inline-block; `)]),bt("textarea",[gt("placeholder","overflow: visible;")]),rs("autosize","width: 100%;"),bt("autosize",[gt("textarea-el, input-el",` position: absolute; top: 0; left: 0; height: 100%; `)]),et("input-wrapper",` overflow: hidden; display: inline-flex; flex-grow: 1; position: relative; padding-left: var(--n-padding-left); padding-right: var(--n-padding-right); `),gt("input-mirror",` padding: 0; height: var(--n-height); line-height: var(--n-height); overflow: hidden; visibility: hidden; position: static; white-space: pre; pointer-events: none; `),gt("input-el",` padding: 0; height: var(--n-height); line-height: var(--n-height); `,[ut("+",[gt("placeholder",` display: flex; align-items: center; `)])]),rs("textarea",[gt("placeholder","white-space: nowrap;")]),gt("eye",` display: flex; align-items: center; justify-content: center; transition: color .3s var(--n-bezier); `),bt("textarea","width: 100%;",[et("input-word-count",` position: absolute; right: var(--n-padding-right); bottom: var(--n-padding-vertical); `),bt("resizable",[et("input-wrapper",` resize: vertical; min-height: var(--n-height); `)]),gt("textarea-el, textarea-mirror, placeholder",` height: 100%; padding-left: 0; padding-right: 0; padding-top: var(--n-padding-vertical); padding-bottom: var(--n-padding-vertical); word-break: break-word; display: inline-block; vertical-align: bottom; box-sizing: border-box; line-height: var(--n-line-height-textarea); margin: 0; resize: none; white-space: pre-wrap; `),gt("textarea-mirror",` width: 100%; pointer-events: none; overflow: hidden; visibility: hidden; position: static; white-space: pre-wrap; overflow-wrap: break-word; `)]),bt("pair",[gt("input-el, placeholder","text-align: center;"),gt("separator",` display: flex; align-items: center; transition: color .3s var(--n-bezier); color: var(--n-text-color); white-space: nowrap; `,[et("icon",` color: var(--n-icon-color); `),et("base-icon",` color: var(--n-icon-color); `)])]),bt("disabled",` cursor: not-allowed; background-color: var(--n-color-disabled); `,[gt("border","border: var(--n-border-disabled);"),gt("input-el, textarea-el",` cursor: not-allowed; color: var(--n-text-color-disabled); text-decoration-color: var(--n-text-color-disabled); `),gt("placeholder","color: var(--n-placeholder-color-disabled);"),gt("separator","color: var(--n-text-color-disabled);",[et("icon",` color: var(--n-icon-color-disabled); `),et("base-icon",` color: var(--n-icon-color-disabled); `)]),et("input-word-count",` color: var(--n-count-text-color-disabled); `),gt("suffix, prefix","color: var(--n-text-color-disabled);",[et("icon",` color: var(--n-icon-color-disabled); `),et("internal-icon",` color: var(--n-icon-color-disabled); `)])]),rs("disabled",[gt("eye",` color: var(--n-icon-color); cursor: pointer; `,[ut("&:hover",` color: var(--n-icon-color-hover); `),ut("&:active",` color: var(--n-icon-color-pressed); `)]),ut("&:hover",[gt("state-border","border: var(--n-border-hover);")]),bt("focus","background-color: var(--n-color-focus);",[gt("state-border",` border: var(--n-border-focus); box-shadow: var(--n-box-shadow-focus); `)])]),gt("border, state-border",` box-sizing: border-box; position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; border-radius: inherit; border: var(--n-border); transition: box-shadow .3s var(--n-bezier), border-color .3s var(--n-bezier); `),gt("state-border",` border-color: #0000; z-index: 1; `),gt("prefix","margin-right: 4px;"),gt("suffix",` margin-left: 4px; `),gt("suffix, prefix",` transition: color .3s var(--n-bezier); flex-wrap: nowrap; flex-shrink: 0; line-height: var(--n-height); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; color: var(--n-suffix-text-color); `,[et("base-loading",` font-size: var(--n-icon-size); margin: 0 2px; color: var(--n-loading-color); `),et("base-clear",` font-size: var(--n-icon-size); `,[gt("placeholder",[et("base-icon",` transition: color .3s var(--n-bezier); color: var(--n-icon-color); font-size: var(--n-icon-size); `)])]),ut(">",[et("icon",` transition: color .3s var(--n-bezier); color: var(--n-icon-color); font-size: var(--n-icon-size); `)]),et("base-icon",` font-size: var(--n-icon-size); `)]),et("input-word-count",` pointer-events: none; line-height: 1.5; font-size: .85em; color: var(--n-count-text-color); transition: color .3s var(--n-bezier); margin-left: 4px; font-variant: tabular-nums; `),["warning","error"].map(e=>bt(`${e}-status`,[rs("disabled",[et("base-loading",` color: var(--n-loading-color-${e}) `),gt("input-el, textarea-el",` caret-color: var(--n-caret-color-${e}); `),gt("state-border",` border: var(--n-border-${e}); `),ut("&:hover",[gt("state-border",` border: var(--n-border-hover-${e}); `)]),ut("&:focus",` background-color: var(--n-color-focus-${e}); `,[gt("state-border",` box-shadow: var(--n-box-shadow-focus-${e}); border: var(--n-border-focus-${e}); `)]),bt("focus",` background-color: var(--n-color-focus-${e}); `,[gt("state-border",` box-shadow: var(--n-box-shadow-focus-${e}); border: var(--n-border-focus-${e}); `)])])]))]),fMe=et("input",[bt("disabled",[gt("input-el, textarea-el",` -webkit-text-fill-color: var(--n-text-color-disabled); `)])]),pMe=Object.assign(Object.assign({},no.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:Function,onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:Boolean,showPasswordToggle:Boolean}),hMe=ot({name:"Input",props:pMe,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:r,mergedRtlRef:o}=La(e),i=no("Input","-input",dMe,lMe,e,t);O3&&rp("-input-safari",fMe,t);const s=Ne(null),u=Ne(null),d=Ne(null),f=Ne(null),g=Ne(null),v=Ne(null),_=Ne(null),M=cMe(_),C=Ne(null),{localeRef:D}=rw("Input"),w=Ne(e.defaultValue),S=cr(e,"value"),N=qT(S,w),A=U4(e),{mergedSizeRef:L,mergedDisabledRef:j,mergedStatusRef:V}=A,x=Ne(!1),$=Ne(!1),z=Ne(!1),G=Ne(!1);let O=null;const T=Ve(()=>{const{placeholder:$e,pair:Ze}=e;return Ze?Array.isArray($e)?$e:$e===void 0?["",""]:[$e,$e]:$e===void 0?[D.value.placeholder]:[$e]}),P=Ve(()=>{const{value:$e}=z,{value:Ze}=N,{value:Ht}=T;return!$e&&(Km(Ze)||Array.isArray(Ze)&&Km(Ze[0]))&&Ht[0]}),Z=Ve(()=>{const{value:$e}=z,{value:Ze}=N,{value:Ht}=T;return!$e&&Ht[1]&&(Km(Ze)||Array.isArray(Ze)&&Km(Ze[1]))}),K=Mu(()=>e.internalForceFocus||x.value),oe=Mu(()=>{if(j.value||e.readonly||!e.clearable||!K.value&&!$.value)return!1;const{value:$e}=N,{value:Ze}=K;return e.pair?!!(Array.isArray($e)&&($e[0]||$e[1]))&&($.value||Ze):!!$e&&($.value||Ze)}),J=Ve(()=>{const{showPasswordOn:$e}=e;if($e)return $e;if(e.showPasswordToggle)return"click"}),ie=Ne(!1),pe=Ve(()=>{const{textDecoration:$e}=e;return $e?Array.isArray($e)?$e.map(Ze=>({textDecoration:Ze})):[{textDecoration:$e}]:["",""]}),ue=Ne(void 0),de=()=>{var $e,Ze;if(e.type==="textarea"){const{autosize:Ht}=e;if(Ht&&(ue.value=(Ze=($e=C.value)===null||$e===void 0?void 0:$e.$el)===null||Ze===void 0?void 0:Ze.offsetWidth),!u.value||typeof Ht=="boolean")return;const{paddingTop:wn,paddingBottom:Mn,lineHeight:Pn}=window.getComputedStyle(u.value),Kr=Number(wn.slice(0,-2)),Gr=Number(Mn.slice(0,-2)),ro=Number(Pn.slice(0,-2)),{value:ls}=d;if(!ls)return;if(Ht.minRows){const U=Math.max(Ht.minRows,1),us=`${Kr+Gr+ro*U}px`;ls.style.minHeight=us}if(Ht.maxRows){const U=`${Kr+Gr+ro*Ht.maxRows}px`;ls.style.maxHeight=U}}},Y=Ve(()=>{const{maxlength:$e}=e;return $e===void 0?void 0:Number($e)});On(()=>{const{value:$e}=N;Array.isArray($e)||qn($e)});const re=Ki().proxy;function fe($e){const{onUpdateValue:Ze,"onUpdate:value":Ht,onInput:wn}=e,{nTriggerFormInput:Mn}=A;Ze&&Er(Ze,$e),Ht&&Er(Ht,$e),wn&&Er(wn,$e),w.value=$e,Mn()}function Ae($e){const{onChange:Ze}=e,{nTriggerFormChange:Ht}=A;Ze&&Er(Ze,$e),w.value=$e,Ht()}function ye($e){const{onBlur:Ze}=e,{nTriggerFormBlur:Ht}=A;Ze&&Er(Ze,$e),Ht()}function le($e){const{onFocus:Ze}=e,{nTriggerFormFocus:Ht}=A;Ze&&Er(Ze,$e),Ht()}function Q($e){const{onClear:Ze}=e;Ze&&Er(Ze,$e)}function ve($e){const{onInputBlur:Ze}=e;Ze&&Er(Ze,$e)}function Le($e){const{onInputFocus:Ze}=e;Ze&&Er(Ze,$e)}function me(){const{onDeactivate:$e}=e;$e&&Er($e)}function W(){const{onActivate:$e}=e;$e&&Er($e)}function te($e){const{onClick:Ze}=e;Ze&&Er(Ze,$e)}function se($e){const{onWrapperFocus:Ze}=e;Ze&&Er(Ze,$e)}function Te($e){const{onWrapperBlur:Ze}=e;Ze&&Er(Ze,$e)}function ce(){z.value=!0}function Se($e){z.value=!1,$e.target===v.value?Pe($e,1):Pe($e,0)}function Pe($e,Ze=0,Ht="input"){const wn=$e.target.value;if(qn(wn),$e instanceof InputEvent&&!$e.isComposing&&(z.value=!1),e.type==="textarea"){const{value:Pn}=C;Pn&&Pn.syncUnifiedContainer()}if(O=wn,z.value)return;M.recordCursor();const Mn=xe(wn);if(Mn)if(!e.pair)Ht==="input"?fe(wn):Ae(wn);else{let{value:Pn}=N;Array.isArray(Pn)?Pn=[Pn[0],Pn[1]]:Pn=["",""],Pn[Ze]=wn,Ht==="input"?fe(Pn):Ae(Pn)}re.$forceUpdate(),Mn||br(M.restoreCursor)}function xe($e){const{countGraphemes:Ze,maxlength:Ht,minlength:wn}=e;if(Ze){let Pn;if(Ht!==void 0&&(Pn===void 0&&(Pn=Ze($e)),Pn>Number(Ht))||wn!==void 0&&(Pn===void 0&&(Pn=Ze($e)),Pn{wn.preventDefault(),_r("mouseup",document,Ze)};if(po("mouseup",document,Ze),J.value!=="mousedown")return;ie.value=!0;const Ht=()=>{ie.value=!1,_r("mouseup",document,Ht)};po("mouseup",document,Ht)}function Cn($e){var Ze;switch((Ze=e.onKeydown)===null||Ze===void 0||Ze.call(e,$e),$e.key){case"Escape":vn();break;case"Enter":En($e);break}}function En($e){var Ze,Ht;if(e.passivelyActivated){const{value:wn}=G;if(wn){e.internalDeactivateOnEnter&&vn();return}$e.preventDefault(),e.type==="textarea"?(Ze=u.value)===null||Ze===void 0||Ze.focus():(Ht=g.value)===null||Ht===void 0||Ht.focus()}}function vn(){e.passivelyActivated&&(G.value=!1,br(()=>{var $e;($e=s.value)===null||$e===void 0||$e.focus()}))}function Qe(){var $e,Ze,Ht;j.value||(e.passivelyActivated?($e=s.value)===null||$e===void 0||$e.focus():((Ze=u.value)===null||Ze===void 0||Ze.focus(),(Ht=g.value)===null||Ht===void 0||Ht.focus()))}function yt(){var $e;!(($e=s.value)===null||$e===void 0)&&$e.contains(document.activeElement)&&document.activeElement.blur()}function Nt(){var $e,Ze;($e=u.value)===null||$e===void 0||$e.select(),(Ze=g.value)===null||Ze===void 0||Ze.select()}function ln(){j.value||(u.value?u.value.focus():g.value&&g.value.focus())}function en(){const{value:$e}=s;$e!=null&&$e.contains(document.activeElement)&&$e!==document.activeElement&&vn()}function Tn($e){if(e.type==="textarea"){const{value:Ze}=u;Ze==null||Ze.scrollTo($e)}else{const{value:Ze}=g;Ze==null||Ze.scrollTo($e)}}function qn($e){const{type:Ze,pair:Ht,autosize:wn}=e;if(!Ht&&wn)if(Ze==="textarea"){const{value:Mn}=d;Mn&&(Mn.textContent=($e??"")+`\r `)}else{const{value:Mn}=f;Mn&&($e?Mn.textContent=$e:Mn.innerHTML=" ")}}function ze(){de()}const wt=Ne({top:"0"});function _t($e){var Ze;const{scrollTop:Ht}=$e.target;wt.value.top=`${-Ht}px`,(Ze=C.value)===null||Ze===void 0||Ze.syncUnifiedContainer()}let Bt=null;nn(()=>{const{autosize:$e,type:Ze}=e;$e&&Ze==="textarea"?Bt=$t(N,Ht=>{!Array.isArray(Ht)&&Ht!==O&&qn(Ht)}):Bt==null||Bt()});let Wt=null;nn(()=>{e.type==="textarea"?Wt=$t(N,$e=>{var Ze;!Array.isArray($e)&&$e!==O&&((Ze=C.value)===null||Ze===void 0||Ze.syncUnifiedContainer())}):Wt==null||Wt()}),ui(R3,{mergedValueRef:N,maxlengthRef:Y,mergedClsPrefixRef:t,countGraphemesRef:cr(e,"countGraphemes")});const mr={wrapperElRef:s,inputElRef:g,textareaElRef:u,isCompositing:z,focus:Qe,blur:yt,select:Nt,deactivate:en,activate:ln,scrollTo:Tn},Cr=ow("Input",o,t),Xo=Ve(()=>{const{value:$e}=L,{common:{cubicBezierEaseInOut:Ze},self:{color:Ht,borderRadius:wn,textColor:Mn,caretColor:Pn,caretColorError:Kr,caretColorWarning:Gr,textDecorationColor:ro,border:ls,borderDisabled:U,borderHover:us,borderFocus:Gt,placeholderColor:yl,placeholderColorDisabled:Zs,lineHeightTextarea:_l,colorDisabled:bl,colorFocus:Oa,textColorDisabled:Zo,boxShadowFocus:Ra,iconSize:cs,colorFocusWarning:Ji,boxShadowFocusWarning:md,borderWarning:vd,borderFocusWarning:Qs,borderHoverWarning:ip,colorFocusError:yd,boxShadowFocusError:$r,borderError:un,borderFocusError:Et,borderHoverError:Xi,clearSize:yn,clearColor:rt,clearColorHover:Ge,clearColorPressed:ds,iconColor:Fo,iconColorDisabled:sp,suffixTextColor:_d,countTextColor:Ls,countTextColorDisabled:bd,iconColorHover:Ri,iconColorPressed:Ml,loadingColor:Il,loadingColorError:Qo,loadingColorWarning:Md,[Qt("padding",$e)]:ap,[Qt("fontSize",$e)]:ea,[Qt("height",$e)]:Cl}}=i.value,{left:Tl,right:Id}=th(ap);return{"--n-bezier":Ze,"--n-count-text-color":Ls,"--n-count-text-color-disabled":bd,"--n-color":Ht,"--n-font-size":ea,"--n-border-radius":wn,"--n-height":Cl,"--n-padding-left":Tl,"--n-padding-right":Id,"--n-text-color":Mn,"--n-caret-color":Pn,"--n-text-decoration-color":ro,"--n-border":ls,"--n-border-disabled":U,"--n-border-hover":us,"--n-border-focus":Gt,"--n-placeholder-color":yl,"--n-placeholder-color-disabled":Zs,"--n-icon-size":cs,"--n-line-height-textarea":_l,"--n-color-disabled":bl,"--n-color-focus":Oa,"--n-text-color-disabled":Zo,"--n-box-shadow-focus":Ra,"--n-loading-color":Il,"--n-caret-color-warning":Gr,"--n-color-focus-warning":Ji,"--n-box-shadow-focus-warning":md,"--n-border-warning":vd,"--n-border-focus-warning":Qs,"--n-border-hover-warning":ip,"--n-loading-color-warning":Md,"--n-caret-color-error":Kr,"--n-color-focus-error":yd,"--n-box-shadow-focus-error":$r,"--n-border-error":un,"--n-border-focus-error":Et,"--n-border-hover-error":Xi,"--n-loading-color-error":Qo,"--n-clear-color":rt,"--n-clear-size":yn,"--n-clear-color-hover":Ge,"--n-clear-color-pressed":ds,"--n-icon-color":Fo,"--n-icon-color-hover":Ri,"--n-icon-color-pressed":Ml,"--n-icon-color-disabled":sp,"--n-suffix-text-color":_d}}),ho=r?Nu("input",Ve(()=>{const{value:$e}=L;return $e[0]}),Xo,e):void 0;return Object.assign(Object.assign({},mr),{wrapperElRef:s,inputElRef:g,inputMirrorElRef:f,inputEl2Ref:v,textareaElRef:u,textareaMirrorElRef:d,textareaScrollbarInstRef:C,rtlEnabled:Cr,uncontrolledValue:w,mergedValue:N,passwordVisible:ie,mergedPlaceholder:T,showPlaceholder1:P,showPlaceholder2:Z,mergedFocus:K,isComposing:z,activated:G,showClearButton:oe,mergedSize:L,mergedDisabled:j,textDecorationStyle:pe,mergedClsPrefix:t,mergedBordered:n,mergedShowPasswordOn:J,placeholderStyle:wt,mergedStatus:V,textAreaScrollContainerWidth:ue,handleTextAreaScroll:_t,handleCompositionStart:ce,handleCompositionEnd:Se,handleInput:Pe,handleInputBlur:He,handleInputFocus:Ie,handleWrapperBlur:q,handleWrapperFocus:ne,handleMouseEnter:it,handleMouseLeave:Tt,handleMouseDown:Fe,handleChange:Be,handleClick:je,handleClear:lt,handlePasswordToggleClick:mn,handlePasswordToggleMousedown:In,handleWrapperKeydown:Cn,handleTextAreaMirrorResize:ze,getTextareaScrollContainer:()=>u.value,mergedTheme:i,cssVars:r?void 0:Xo,themeClass:ho==null?void 0:ho.themeClass,onRender:ho==null?void 0:ho.onRender})},render(){var e,t;const{mergedClsPrefix:n,mergedStatus:r,themeClass:o,type:i,countGraphemes:s,onRender:u}=this,d=this.$slots;return u==null||u(),Re("div",{ref:"wrapperElRef",class:[`${n}-input`,o,r&&`${n}-input--${r}-status`,{[`${n}-input--rtl`]:this.rtlEnabled,[`${n}-input--disabled`]:this.mergedDisabled,[`${n}-input--textarea`]:i==="textarea",[`${n}-input--resizable`]:this.resizable&&!this.autosize,[`${n}-input--autosize`]:this.autosize,[`${n}-input--round`]:this.round&&i!=="textarea",[`${n}-input--pair`]:this.pair,[`${n}-input--focus`]:this.mergedFocus,[`${n}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.onKeyup,onKeydown:this.handleWrapperKeydown},Re("div",{class:`${n}-input-wrapper`},qs(d.prefix,f=>f&&Re("div",{class:`${n}-input__prefix`},f)),i==="textarea"?Re(k3,{ref:"textareaScrollbarInstRef",class:`${n}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var f,g;const{textAreaScrollContainerWidth:v}=this,_={width:this.autosize&&v&&`${v}px`};return Re(dt,null,Re("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${n}-input__textarea-el`,(f=this.inputProps)===null||f===void 0?void 0:f.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:s?void 0:this.maxlength,minlength:s?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(g=this.inputProps)===null||g===void 0?void 0:g.style,_],onBlur:this.handleInputBlur,onFocus:M=>{this.handleInputFocus(M,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?Re("div",{class:`${n}-input__placeholder`,style:[this.placeholderStyle,_],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?Re(lg,{onResize:this.handleTextAreaMirrorResize},{default:()=>Re("div",{ref:"textareaMirrorElRef",class:`${n}-input__textarea-mirror`,key:"mirror"})}):null)}}):Re("div",{class:`${n}-input__input`},Re("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${n}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:s?void 0:this.maxlength,minlength:s?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:f=>{this.handleInputFocus(f,0)},onInput:f=>{this.handleInput(f,0)},onChange:f=>{this.handleChange(f,0)}})),this.showPlaceholder1?Re("div",{class:`${n}-input__placeholder`},Re("span",null,this.mergedPlaceholder[0])):null,this.autosize?Re("div",{class:`${n}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&qs(d.suffix,f=>f||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?Re("div",{class:`${n}-input__suffix`},[qs(d["clear-icon-placeholder"],g=>(this.clearable||g)&&Re(qI,{clsPrefix:n,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>g,icon:()=>{var v,_;return(_=(v=this.$slots)["clear-icon"])===null||_===void 0?void 0:_.call(v)}})),this.internalLoadingBeforeSuffix?null:f,this.loading!==void 0?Re(nMe,{clsPrefix:n,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?f:null,this.showCount&&this.type!=="textarea"?Re(WA,null,{default:g=>{var v;return(v=d.count)===null||v===void 0?void 0:v.call(d,g)}}):null,this.mergedShowPasswordOn&&this.type==="password"?Re("div",{class:`${n}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Dh(d["password-visible-icon"],()=>[Re(Ti,{clsPrefix:n},{default:()=>Re(ube,null)})]):Dh(d["password-invisible-icon"],()=>[Re(Ti,{clsPrefix:n},{default:()=>Re(cbe,null)})])):null]):null)),this.pair?Re("span",{class:`${n}-input__separator`},Dh(d.separator,()=>[this.separator])):null,this.pair?Re("div",{class:`${n}-input-wrapper`},Re("div",{class:`${n}-input__input`},Re("input",{ref:"inputEl2Ref",type:this.type,class:`${n}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:s?void 0:this.maxlength,minlength:s?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:f=>{this.handleInputFocus(f,1)},onInput:f=>{this.handleInput(f,1)},onChange:f=>{this.handleChange(f,1)}}),this.showPlaceholder2?Re("div",{class:`${n}-input__placeholder`},Re("span",null,this.mergedPlaceholder[1])):null),qs(d.suffix,f=>(this.clearable||f)&&Re("div",{class:`${n}-input__suffix`},[this.clearable&&Re(qI,{clsPrefix:n,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var g;return(g=d["clear-icon"])===null||g===void 0?void 0:g.call(d)},placeholder:()=>{var g;return(g=d["clear-icon-placeholder"])===null||g===void 0?void 0:g.call(d)}}),f]))):null,this.mergedBordered?Re("div",{class:`${n}-input__border`}):null,this.mergedBordered?Re("div",{class:`${n}-input__state-border`}):null,this.showCount&&i==="textarea"?Re(WA,null,{default:f=>{var g;const{renderCount:v}=this;return v?v(f):(g=d.count)===null||g===void 0?void 0:g.call(d,f)}}):null)}}),gMe=wg&&"loading"in document.createElement("img"),mMe=(e={})=>{var t;const{root:n=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(t=e.threshold)!==null&&t!==void 0?t:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof n=="string"?document.querySelector(n):n)||document.documentElement})}},rM=new WeakMap,oM=new WeakMap,iM=new WeakMap,vMe=(e,t,n)=>{if(!e)return()=>{};const r=mMe(t),{root:o}=r.options;let i;const s=rM.get(o);s?i=s:(i=new Map,rM.set(o,i));let u,d;i.has(r.hash)?(d=i.get(r.hash),d[1].has(e)||(u=d[0],d[1].add(e),u.observe(e))):(u=new IntersectionObserver(v=>{v.forEach(_=>{if(_.isIntersecting){const M=oM.get(_.target),C=iM.get(_.target);M&&M(),C&&(C.value=!0)}})},r.options),u.observe(e),d=[u,new Set([e])],i.set(r.hash,d));let f=!1;const g=()=>{f||(oM.delete(e),iM.delete(e),f=!0,d[1].has(e)&&(d[0].unobserve(e),d[1].delete(e)),d[1].size<=0&&i.delete(r.hash),i.size||rM.delete(o))};return oM.set(e,g),iM.set(e,n),g};function Qu(e){return u0(e,[255,255,255,.16])}function Ym(e){return u0(e,[0,0,0,.12])}const yMe="n-button-group",_Me={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"},bMe=e=>{const{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:o,borderRadius:i,fontSizeTiny:s,fontSizeSmall:u,fontSizeMedium:d,fontSizeLarge:f,opacityDisabled:g,textColor2:v,textColor3:_,primaryColorHover:M,primaryColorPressed:C,borderColor:D,primaryColor:w,baseColor:S,infoColor:N,infoColorHover:A,infoColorPressed:L,successColor:j,successColorHover:V,successColorPressed:x,warningColor:$,warningColorHover:z,warningColorPressed:G,errorColor:O,errorColorHover:T,errorColorPressed:P,fontWeight:Z,buttonColor2:K,buttonColor2Hover:oe,buttonColor2Pressed:J,fontWeightStrong:ie}=e;return Object.assign(Object.assign({},_Me),{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:o,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:s,fontSizeSmall:u,fontSizeMedium:d,fontSizeLarge:f,opacityDisabled:g,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:K,colorSecondaryHover:oe,colorSecondaryPressed:J,colorTertiary:K,colorTertiaryHover:oe,colorTertiaryPressed:J,colorQuaternary:"#0000",colorQuaternaryHover:oe,colorQuaternaryPressed:J,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:v,textColorTertiary:_,textColorHover:M,textColorPressed:C,textColorFocus:M,textColorDisabled:v,textColorText:v,textColorTextHover:M,textColorTextPressed:C,textColorTextFocus:M,textColorTextDisabled:v,textColorGhost:v,textColorGhostHover:M,textColorGhostPressed:C,textColorGhostFocus:M,textColorGhostDisabled:v,border:`1px solid ${D}`,borderHover:`1px solid ${M}`,borderPressed:`1px solid ${C}`,borderFocus:`1px solid ${M}`,borderDisabled:`1px solid ${D}`,rippleColor:w,colorPrimary:w,colorHoverPrimary:M,colorPressedPrimary:C,colorFocusPrimary:M,colorDisabledPrimary:w,textColorPrimary:S,textColorHoverPrimary:S,textColorPressedPrimary:S,textColorFocusPrimary:S,textColorDisabledPrimary:S,textColorTextPrimary:w,textColorTextHoverPrimary:M,textColorTextPressedPrimary:C,textColorTextFocusPrimary:M,textColorTextDisabledPrimary:v,textColorGhostPrimary:w,textColorGhostHoverPrimary:M,textColorGhostPressedPrimary:C,textColorGhostFocusPrimary:M,textColorGhostDisabledPrimary:w,borderPrimary:`1px solid ${w}`,borderHoverPrimary:`1px solid ${M}`,borderPressedPrimary:`1px solid ${C}`,borderFocusPrimary:`1px solid ${M}`,borderDisabledPrimary:`1px solid ${w}`,rippleColorPrimary:w,colorInfo:N,colorHoverInfo:A,colorPressedInfo:L,colorFocusInfo:A,colorDisabledInfo:N,textColorInfo:S,textColorHoverInfo:S,textColorPressedInfo:S,textColorFocusInfo:S,textColorDisabledInfo:S,textColorTextInfo:N,textColorTextHoverInfo:A,textColorTextPressedInfo:L,textColorTextFocusInfo:A,textColorTextDisabledInfo:v,textColorGhostInfo:N,textColorGhostHoverInfo:A,textColorGhostPressedInfo:L,textColorGhostFocusInfo:A,textColorGhostDisabledInfo:N,borderInfo:`1px solid ${N}`,borderHoverInfo:`1px solid ${A}`,borderPressedInfo:`1px solid ${L}`,borderFocusInfo:`1px solid ${A}`,borderDisabledInfo:`1px solid ${N}`,rippleColorInfo:N,colorSuccess:j,colorHoverSuccess:V,colorPressedSuccess:x,colorFocusSuccess:V,colorDisabledSuccess:j,textColorSuccess:S,textColorHoverSuccess:S,textColorPressedSuccess:S,textColorFocusSuccess:S,textColorDisabledSuccess:S,textColorTextSuccess:j,textColorTextHoverSuccess:V,textColorTextPressedSuccess:x,textColorTextFocusSuccess:V,textColorTextDisabledSuccess:v,textColorGhostSuccess:j,textColorGhostHoverSuccess:V,textColorGhostPressedSuccess:x,textColorGhostFocusSuccess:V,textColorGhostDisabledSuccess:j,borderSuccess:`1px solid ${j}`,borderHoverSuccess:`1px solid ${V}`,borderPressedSuccess:`1px solid ${x}`,borderFocusSuccess:`1px solid ${V}`,borderDisabledSuccess:`1px solid ${j}`,rippleColorSuccess:j,colorWarning:$,colorHoverWarning:z,colorPressedWarning:G,colorFocusWarning:z,colorDisabledWarning:$,textColorWarning:S,textColorHoverWarning:S,textColorPressedWarning:S,textColorFocusWarning:S,textColorDisabledWarning:S,textColorTextWarning:$,textColorTextHoverWarning:z,textColorTextPressedWarning:G,textColorTextFocusWarning:z,textColorTextDisabledWarning:v,textColorGhostWarning:$,textColorGhostHoverWarning:z,textColorGhostPressedWarning:G,textColorGhostFocusWarning:z,textColorGhostDisabledWarning:$,borderWarning:`1px solid ${$}`,borderHoverWarning:`1px solid ${z}`,borderPressedWarning:`1px solid ${G}`,borderFocusWarning:`1px solid ${z}`,borderDisabledWarning:`1px solid ${$}`,rippleColorWarning:$,colorError:O,colorHoverError:T,colorPressedError:P,colorFocusError:T,colorDisabledError:O,textColorError:S,textColorHoverError:S,textColorPressedError:S,textColorFocusError:S,textColorDisabledError:S,textColorTextError:O,textColorTextHoverError:T,textColorTextPressedError:P,textColorTextFocusError:T,textColorTextDisabledError:v,textColorGhostError:O,textColorGhostHoverError:T,textColorGhostPressedError:P,textColorGhostFocusError:T,textColorGhostDisabledError:O,borderError:`1px solid ${O}`,borderHoverError:`1px solid ${T}`,borderPressedError:`1px solid ${P}`,borderFocusError:`1px solid ${T}`,borderDisabledError:`1px solid ${O}`,rippleColorError:O,waveOpacity:"0.6",fontWeight:Z,fontWeightStrong:ie})},MMe={name:"Button",common:vl,self:bMe},IMe=MMe,CMe=ut([et("button",` margin: 0; font-weight: var(--n-font-weight); line-height: 1; font-family: inherit; padding: var(--n-padding); height: var(--n-height); font-size: var(--n-font-size); border-radius: var(--n-border-radius); color: var(--n-text-color); background-color: var(--n-color); width: var(--n-width); white-space: nowrap; outline: none; position: relative; z-index: auto; border: none; display: inline-flex; flex-wrap: nowrap; flex-shrink: 0; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; text-align: center; cursor: pointer; text-decoration: none; transition: color .3s var(--n-bezier), background-color .3s var(--n-bezier), opacity .3s var(--n-bezier), border-color .3s var(--n-bezier); `,[bt("color",[gt("border",{borderColor:"var(--n-border-color)"}),bt("disabled",[gt("border",{borderColor:"var(--n-border-color-disabled)"})]),rs("disabled",[ut("&:focus",[gt("state-border",{borderColor:"var(--n-border-color-focus)"})]),ut("&:hover",[gt("state-border",{borderColor:"var(--n-border-color-hover)"})]),ut("&:active",[gt("state-border",{borderColor:"var(--n-border-color-pressed)"})]),bt("pressed",[gt("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),bt("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[gt("border",{border:"var(--n-border-disabled)"})]),rs("disabled",[ut("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[gt("state-border",{border:"var(--n-border-focus)"})]),ut("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[gt("state-border",{border:"var(--n-border-hover)"})]),ut("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[gt("state-border",{border:"var(--n-border-pressed)"})]),bt("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[gt("state-border",{border:"var(--n-border-pressed)"})])]),bt("loading","cursor: wait;"),et("base-wave",` pointer-events: none; top: 0; right: 0; bottom: 0; left: 0; animation-iteration-count: 1; animation-duration: var(--n-ripple-duration); animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out); `,[bt("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),wg&&"MozBoxSizing"in document.createElement("div").style?ut("&::moz-focus-inner",{border:0}):null,gt("border, state-border",` position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-radius: inherit; transition: border-color .3s var(--n-bezier); pointer-events: none; `),gt("border",{border:"var(--n-border)"}),gt("state-border",{border:"var(--n-border)",borderColor:"#0000",zIndex:1}),gt("icon",` margin: var(--n-icon-margin); margin-left: 0; height: var(--n-icon-size); width: var(--n-icon-size); max-width: var(--n-icon-size); font-size: var(--n-icon-size); position: relative; flex-shrink: 0; `,[et("icon-slot",` height: var(--n-icon-size); width: var(--n-icon-size); position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; `,[Iy({top:"50%",originalTransform:"translateY(-50%)"})]),rMe()]),gt("content",` display: flex; align-items: center; flex-wrap: nowrap; min-width: 0; `,[ut("~",[gt("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),bt("block",` display: flex; width: 100%; `),bt("dashed",[gt("border, state-border",{borderStyle:"dashed !important"})]),bt("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),ut("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),ut("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),TMe=Object.assign(Object.assign({},no.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!O3}}),wMe=ot({name:"Button",props:TMe,setup(e){const t=Ne(null),n=Ne(null),r=Ne(!1),o=Mu(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=tn(yMe,{}),{mergedSizeRef:s}=U4({},{defaultSize:"medium",mergedSize:L=>{const{size:j}=e;if(j)return j;const{size:V}=i;if(V)return V;const{mergedSize:x}=L||{};return x?x.value:"medium"}}),u=Ve(()=>e.focusable&&!e.disabled),d=L=>{var j;u.value||L.preventDefault(),!e.nativeFocusBehavior&&(L.preventDefault(),!e.disabled&&u.value&&((j=t.value)===null||j===void 0||j.focus({preventScroll:!0})))},f=L=>{var j;if(!e.disabled&&!e.loading){const{onClick:V}=e;V&&Er(V,L),e.text||(j=n.value)===null||j===void 0||j.play()}},g=L=>{switch(L.key){case"Enter":if(!e.keyboard)return;r.value=!1}},v=L=>{switch(L.key){case"Enter":if(!e.keyboard||e.loading){L.preventDefault();return}r.value=!0}},_=()=>{r.value=!1},{inlineThemeDisabled:M,mergedClsPrefixRef:C,mergedRtlRef:D}=La(e),w=no("Button","-button",CMe,IMe,e,C),S=ow("Button",D,C),N=Ve(()=>{const L=w.value,{common:{cubicBezierEaseInOut:j,cubicBezierEaseOut:V},self:x}=L,{rippleDuration:$,opacityDisabled:z,fontWeight:G,fontWeightStrong:O}=x,T=s.value,{dashed:P,type:Z,ghost:K,text:oe,color:J,round:ie,circle:pe,textColor:ue,secondary:de,tertiary:Y,quaternary:re,strong:fe}=e,Ae={"font-weight":fe?O:G};let ye={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const le=Z==="tertiary",Q=Z==="default",ve=le?"default":Z;if(oe){const He=ue||J;ye={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":He||x[Qt("textColorText",ve)],"--n-text-color-hover":He?Qu(He):x[Qt("textColorTextHover",ve)],"--n-text-color-pressed":He?Ym(He):x[Qt("textColorTextPressed",ve)],"--n-text-color-focus":He?Qu(He):x[Qt("textColorTextHover",ve)],"--n-text-color-disabled":He||x[Qt("textColorTextDisabled",ve)]}}else if(K||P){const He=ue||J;ye={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":J||x[Qt("rippleColor",ve)],"--n-text-color":He||x[Qt("textColorGhost",ve)],"--n-text-color-hover":He?Qu(He):x[Qt("textColorGhostHover",ve)],"--n-text-color-pressed":He?Ym(He):x[Qt("textColorGhostPressed",ve)],"--n-text-color-focus":He?Qu(He):x[Qt("textColorGhostHover",ve)],"--n-text-color-disabled":He||x[Qt("textColorGhostDisabled",ve)]}}else if(de){const He=Q?x.textColor:le?x.textColorTertiary:x[Qt("color",ve)],Ie=J||He,q=Z!=="default"&&Z!=="tertiary";ye={"--n-color":q?Nc(Ie,{alpha:Number(x.colorOpacitySecondary)}):x.colorSecondary,"--n-color-hover":q?Nc(Ie,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-pressed":q?Nc(Ie,{alpha:Number(x.colorOpacitySecondaryPressed)}):x.colorSecondaryPressed,"--n-color-focus":q?Nc(Ie,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-disabled":x.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":Ie,"--n-text-color-hover":Ie,"--n-text-color-pressed":Ie,"--n-text-color-focus":Ie,"--n-text-color-disabled":Ie}}else if(Y||re){const He=Q?x.textColor:le?x.textColorTertiary:x[Qt("color",ve)],Ie=J||He;Y?(ye["--n-color"]=x.colorTertiary,ye["--n-color-hover"]=x.colorTertiaryHover,ye["--n-color-pressed"]=x.colorTertiaryPressed,ye["--n-color-focus"]=x.colorSecondaryHover,ye["--n-color-disabled"]=x.colorTertiary):(ye["--n-color"]=x.colorQuaternary,ye["--n-color-hover"]=x.colorQuaternaryHover,ye["--n-color-pressed"]=x.colorQuaternaryPressed,ye["--n-color-focus"]=x.colorQuaternaryHover,ye["--n-color-disabled"]=x.colorQuaternary),ye["--n-ripple-color"]="#0000",ye["--n-text-color"]=Ie,ye["--n-text-color-hover"]=Ie,ye["--n-text-color-pressed"]=Ie,ye["--n-text-color-focus"]=Ie,ye["--n-text-color-disabled"]=Ie}else ye={"--n-color":J||x[Qt("color",ve)],"--n-color-hover":J?Qu(J):x[Qt("colorHover",ve)],"--n-color-pressed":J?Ym(J):x[Qt("colorPressed",ve)],"--n-color-focus":J?Qu(J):x[Qt("colorFocus",ve)],"--n-color-disabled":J||x[Qt("colorDisabled",ve)],"--n-ripple-color":J||x[Qt("rippleColor",ve)],"--n-text-color":ue||(J?x.textColorPrimary:le?x.textColorTertiary:x[Qt("textColor",ve)]),"--n-text-color-hover":ue||(J?x.textColorHoverPrimary:x[Qt("textColorHover",ve)]),"--n-text-color-pressed":ue||(J?x.textColorPressedPrimary:x[Qt("textColorPressed",ve)]),"--n-text-color-focus":ue||(J?x.textColorFocusPrimary:x[Qt("textColorFocus",ve)]),"--n-text-color-disabled":ue||(J?x.textColorDisabledPrimary:x[Qt("textColorDisabled",ve)])};let Le={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};oe?Le={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:Le={"--n-border":x[Qt("border",ve)],"--n-border-hover":x[Qt("borderHover",ve)],"--n-border-pressed":x[Qt("borderPressed",ve)],"--n-border-focus":x[Qt("borderFocus",ve)],"--n-border-disabled":x[Qt("borderDisabled",ve)]};const{[Qt("height",T)]:me,[Qt("fontSize",T)]:W,[Qt("padding",T)]:te,[Qt("paddingRound",T)]:se,[Qt("iconSize",T)]:Te,[Qt("borderRadius",T)]:ce,[Qt("iconMargin",T)]:Se,waveOpacity:Pe}=x,xe={"--n-width":pe&&!oe?me:"initial","--n-height":oe?"initial":me,"--n-font-size":W,"--n-padding":pe||oe?"initial":ie?se:te,"--n-icon-size":Te,"--n-icon-margin":Se,"--n-border-radius":oe?"initial":pe||ie?me:ce};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":j,"--n-bezier-ease-out":V,"--n-ripple-duration":$,"--n-opacity-disabled":z,"--n-wave-opacity":Pe},Ae),ye),Le),xe)}),A=M?Nu("button",Ve(()=>{let L="";const{dashed:j,type:V,ghost:x,text:$,color:z,round:G,circle:O,textColor:T,secondary:P,tertiary:Z,quaternary:K,strong:oe}=e;j&&(L+="a"),x&&(L+="b"),$&&(L+="c"),G&&(L+="d"),O&&(L+="e"),P&&(L+="f"),Z&&(L+="g"),K&&(L+="h"),oe&&(L+="i"),z&&(L+="j"+qE(z)),T&&(L+="k"+qE(T));const{value:J}=s;return L+="l"+J[0],L+="m"+V[0],L}),N,e):void 0;return{selfElRef:t,waveElRef:n,mergedClsPrefix:C,mergedFocusable:u,mergedSize:s,showBorder:o,enterPressed:r,rtlEnabled:S,handleMousedown:d,handleKeydown:v,handleBlur:_,handleKeyup:g,handleClick:f,customColorCssVars:Ve(()=>{const{color:L}=e;if(!L)return null;const j=Qu(L);return{"--n-border-color":L,"--n-border-color-hover":j,"--n-border-color-pressed":Ym(L),"--n-border-color-focus":j,"--n-border-color-disabled":L}}),cssVars:M?void 0:N,themeClass:A==null?void 0:A.themeClass,onRender:A==null?void 0:A.onRender}},render(){const{mergedClsPrefix:e,tag:t,onRender:n}=this;n==null||n();const r=qs(this.$slots.default,o=>o&&Re("span",{class:`${e}-button__content`},o));return Re(t,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,Re(_be,{width:!0},{default:()=>qs(this.$slots.icon,o=>(this.loading||this.renderIcon||o)&&Re("span",{class:`${e}-button__icon`,style:{margin:EI(this.$slots.default)?"0":""}},Re(iw,null,{default:()=>this.loading?Re(sw,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):Re("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():o)})))}),this.iconPlacement==="left"&&r,this.text?null:Re(Vbe,{ref:"waveElRef",clsPrefix:e}),this.showBorder?Re("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?Re("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),SMe=wMe,kMe={padding:"8px 14px"},DMe=e=>{const{borderRadius:t,boxShadow2:n,baseColor:r}=e;return Object.assign(Object.assign({},kMe),{borderRadius:t,boxShadow:n,color:u0(r,"rgba(0, 0, 0, .85)"),textColor:r})},EMe={name:"Tooltip",common:vl,peers:{Popover:D3},self:DMe},N3=EMe,AMe=Object.assign(Object.assign({},A3),no.props),P3=ot({name:"Tooltip",props:AMe,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=La(e),n=no("Tooltip","-tooltip",void 0,N3,e,t),r=Ne(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(i){r.value.setShow(i)}}),{popoverRef:r,mergedTheme:n,popoverThemeOverrides:Ve(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return Re(L3,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),x3=Object.assign(Object.assign({},no.props),{showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean}),U3="n-image";function LMe(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const OMe={name:"Image",common:vl,peers:{Tooltip:N3},self:LMe},RMe=e=>{const{opacityDisabled:t,heightTiny:n,heightSmall:r,heightMedium:o,heightLarge:i,heightHuge:s,primaryColor:u,fontSize:d}=e;return{fontSize:d,textColor:u,sizeTiny:n,sizeSmall:r,sizeMedium:o,sizeLarge:i,sizeHuge:s,color:u,opacitySpinning:t}},NMe={name:"Spin",common:vl,self:RMe},PMe=NMe,xMe={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"},UMe=e=>{const{textColor2:t,primaryColor:n,textColorDisabled:r,closeIconColor:o,closeIconColorHover:i,closeIconColorPressed:s,closeColorHover:u,closeColorPressed:d,tabColor:f,baseColor:g,dividerColor:v,fontWeight:_,textColor1:M,borderRadius:C,fontSize:D,fontWeightStrong:w}=e;return Object.assign(Object.assign({},xMe),{colorSegment:f,tabFontSizeCard:D,tabTextColorLine:M,tabTextColorActiveLine:n,tabTextColorHoverLine:n,tabTextColorDisabledLine:r,tabTextColorSegment:M,tabTextColorActiveSegment:t,tabTextColorHoverSegment:t,tabTextColorDisabledSegment:r,tabTextColorBar:M,tabTextColorActiveBar:n,tabTextColorHoverBar:n,tabTextColorDisabledBar:r,tabTextColorCard:M,tabTextColorHoverCard:M,tabTextColorActiveCard:n,tabTextColorDisabledCard:r,barColor:n,closeIconColor:o,closeIconColorHover:i,closeIconColorPressed:s,closeColorHover:u,closeColorPressed:d,closeBorderRadius:C,tabColor:f,tabColorSegment:g,tabBorderColor:v,tabFontWeightActive:_,tabFontWeight:_,tabBorderRadius:C,paneTextColor:t,fontWeightStrong:w})},FMe={name:"Tabs",common:vl,self:UMe},GMe=FMe,$Me=Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),BMe=Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),HMe=Re("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Re("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"})),qMe=ut([ut("body >",[et("image-container","position: fixed;")]),et("image-preview-container",` position: fixed; left: 0; right: 0; top: 0; bottom: 0; display: flex; `),et("image-preview-overlay",` z-index: -1; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .3); `,[Cy()]),et("image-preview-toolbar",` z-index: 1; position: absolute; left: 50%; transform: translateX(-50%); border-radius: var(--n-toolbar-border-radius); height: 48px; bottom: 40px; padding: 0 12px; background: var(--n-toolbar-color); box-shadow: var(--n-toolbar-box-shadow); color: var(--n-toolbar-icon-color); transition: color .3s var(--n-bezier); display: flex; align-items: center; `,[et("base-icon",` padding: 0 8px; font-size: 28px; cursor: pointer; `),Cy()]),et("image-preview-wrapper",` position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; pointer-events: none; `,[Hbe()]),et("image-preview",` user-select: none; -webkit-user-select: none; pointer-events: all; margin: auto; max-height: calc(100vh - 32px); max-width: calc(100vw - 32px); transition: transform .3s var(--n-bezier); `),et("image",` display: inline-flex; max-height: 100%; max-width: 100%; `,[rs("preview-disabled",` cursor: pointer; `),ut("img",` border-radius: inherit; `)])]),Jm=32,VMe=ot({name:"ImagePreview",props:Object.assign(Object.assign({},x3),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=no("Image","-image",qMe,OMe,e,cr(e,"clsPrefix"));let n=null;const r=Ne(null),o=Ne(null),i=Ne(void 0),s=Ne(!1),u=Ne(!1),{localeRef:d}=rw("Image");function f(){const{value:W}=o;if(!n||!W)return;const{style:te}=W,se=n.getBoundingClientRect(),Te=se.left+se.width/2,ce=se.top+se.height/2;te.transformOrigin=`${Te}px ${ce}px`}function g(W){var te,se;switch(W.key){case" ":W.preventDefault();break;case"ArrowLeft":(te=e.onPrev)===null||te===void 0||te.call(e);break;case"ArrowRight":(se=e.onNext)===null||se===void 0||se.call(e);break;case"Escape":Ae();break}}$t(s,W=>{W?po("keydown",document,g):_r("keydown",document,g)}),gi(()=>{_r("keydown",document,g)});let v=0,_=0,M=0,C=0,D=0,w=0,S=0,N=0,A=!1;function L(W){const{clientX:te,clientY:se}=W;M=te-v,C=se-_,a4(fe)}function j(W){const{mouseUpClientX:te,mouseUpClientY:se,mouseDownClientX:Te,mouseDownClientY:ce}=W,Se=Te-te,Pe=ce-se,xe=`vertical${Pe>0?"Top":"Bottom"}`,He=`horizontal${Se>0?"Left":"Right"}`;return{moveVerticalDirection:xe,moveHorizontalDirection:He,deltaHorizontal:Se,deltaVertical:Pe}}function V(W){const{value:te}=r;if(!te)return{offsetX:0,offsetY:0};const se=te.getBoundingClientRect(),{moveVerticalDirection:Te,moveHorizontalDirection:ce,deltaHorizontal:Se,deltaVertical:Pe}=W||{};let xe=0,He=0;return se.width<=window.innerWidth?xe=0:se.left>0?xe=(se.width-window.innerWidth)/2:se.right0?He=(se.height-window.innerHeight)/2:se.bottom.5){const W=P;T-=1,P=Math.max(.5,Math.pow(O,T));const te=W-P;fe(!1);const se=V();P+=te,fe(!1),P-=te,M=se.offsetX,C=se.offsetY,fe()}}function fe(W=!0){var te;const{value:se}=r;if(!se)return;const{style:Te}=se,ce=Oo((te=$==null?void 0:$.previewedImgPropsRef.value)===null||te===void 0?void 0:te.style);let Se="";if(typeof ce=="string")Se=ce+";";else for(const xe in ce)Se+=`${J1e(xe)}: ${ce[xe]};`;const Pe=`transform-origin: center; transform: translateX(${M}px) translateY(${C}px) rotate(${Z}deg) scale(${P});`;A?Te.cssText=Se+"cursor: grabbing; transition: none;"+Pe:Te.cssText=Se+"cursor: grab;"+Pe+(W?"":"transition: none;"),W||se.offsetHeight}function Ae(){s.value=!s.value,u.value=!0}function ye(){P=de(),T=Math.ceil(Math.log(P)/Math.log(O)),M=0,C=0,fe()}const le={setPreviewSrc:W=>{i.value=W},setThumbnailEl:W=>{n=W},toggleShow:Ae};function Q(W,te){if(e.showToolbarTooltip){const{value:se}=t;return Re(P3,{to:!1,theme:se.peers.Tooltip,themeOverrides:se.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[te],trigger:()=>W})}else return W}const ve=Ve(()=>{const{common:{cubicBezierEaseInOut:W},self:{toolbarIconColor:te,toolbarBorderRadius:se,toolbarBoxShadow:Te,toolbarColor:ce}}=t.value;return{"--n-bezier":W,"--n-toolbar-icon-color":te,"--n-toolbar-color":ce,"--n-toolbar-border-radius":se,"--n-toolbar-box-shadow":Te}}),{inlineThemeDisabled:Le}=La(),me=Le?Nu("image-preview",void 0,ve,e):void 0;return Object.assign({previewRef:r,previewWrapperRef:o,previewSrc:i,show:s,appear:d0(),displayed:u,previewedImgProps:$==null?void 0:$.previewedImgPropsRef,handleWheel(W){W.preventDefault()},handlePreviewMousedown:z,handlePreviewDblclick:G,syncTransformOrigin:f,handleAfterLeave:()=>{K(),Z=0,u.value=!1},handleDragStart:W=>{var te,se;(se=(te=$==null?void 0:$.previewedImgPropsRef.value)===null||te===void 0?void 0:te.onDragstart)===null||se===void 0||se.call(te,W),W.preventDefault()},zoomIn:Y,zoomOut:re,rotateCounterclockwise:ie,rotateClockwise:pe,handleSwitchPrev:oe,handleSwitchNext:J,withTooltip:Q,resizeToOrignalImageSize:ye,cssVars:Le?void 0:ve,themeClass:me==null?void 0:me.themeClass,onRender:me==null?void 0:me.onRender},le)},render(){var e,t;const{clsPrefix:n}=this;return Re(dt,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),Re(S4,{show:this.show},{default:()=>{var r;return this.show||this.displayed?((r=this.onRender)===null||r===void 0||r.call(this),$n(Re("div",{class:[`${n}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},Re(bo,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?Re("div",{class:`${n}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?Re(bo,{name:"fade-in-transition",appear:this.appear},{default:()=>{if(!this.show)return null;const{withTooltip:o}=this;return Re("div",{class:`${n}-image-preview-toolbar`},this.onPrev?Re(dt,null,o(Re(Ti,{clsPrefix:n,onClick:this.handleSwitchPrev},{default:()=>$Me}),"tipPrevious"),o(Re(Ti,{clsPrefix:n,onClick:this.handleSwitchNext},{default:()=>BMe}),"tipNext")):null,o(Re(Ti,{clsPrefix:n,onClick:this.rotateCounterclockwise},{default:()=>Re(gbe,null)}),"tipCounterclockwise"),o(Re(Ti,{clsPrefix:n,onClick:this.rotateClockwise},{default:()=>Re(hbe,null)}),"tipClockwise"),o(Re(Ti,{clsPrefix:n,onClick:this.resizeToOrignalImageSize},{default:()=>Re(ybe,null)}),"tipOriginalSize"),o(Re(Ti,{clsPrefix:n,onClick:this.zoomOut},{default:()=>Re(vbe,null)}),"tipZoomOut"),o(Re(Ti,{clsPrefix:n,onClick:this.zoomIn},{default:()=>Re(mbe,null)}),"tipZoomIn"),o(Re(Ti,{clsPrefix:n,onClick:this.toggleShow},{default:()=>HMe}),"tipClose"))}}):null,Re(bo,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:o={}}=this;return $n(Re("div",{class:`${n}-image-preview-wrapper`,ref:"previewWrapperRef"},Re("img",Object.assign({},o,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${n}-image-preview`,o.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[eo,this.show]])}})),[[VT,{enabled:this.show}]])):null}}))}}),zMe="n-image-group",jMe=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},x3),WMe=ot({name:"Image",props:jMe,inheritAttrs:!1,setup(e){const t=Ne(null),n=Ne(!1),r=Ne(null),o=tn(zMe,null),{mergedClsPrefixRef:i}=o||La(e),s={click:()=>{if(e.previewDisabled||n.value)return;const f=e.previewSrc||e.src;if(o){o.setPreviewSrc(f),o.setThumbnailEl(t.value),o.toggleShow();return}const{value:g}=r;g&&(g.setPreviewSrc(f),g.setThumbnailEl(t.value),g.toggleShow())}},u=Ne(!e.lazy);On(()=>{var f;(f=t.value)===null||f===void 0||f.setAttribute("data-group-id",(o==null?void 0:o.groupId)||"")}),On(()=>{if(e.lazy&&e.intersectionObserverOptions){let f;const g=nn(()=>{f==null||f(),f=void 0,f=vMe(t.value,e.intersectionObserverOptions,u)});gi(()=>{g(),f==null||f()})}}),nn(()=>{var f;e.src,(f=e.imgProps)===null||f===void 0||f.src,n.value=!1});const d=Ne(!1);return ui(U3,{previewedImgPropsRef:cr(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:i,groupId:o==null?void 0:o.groupId,previewInstRef:r,imageRef:t,showError:n,shouldStartLoading:u,loaded:d,mergedOnClick:f=>{var g,v;s.click(),(v=(g=e.imgProps)===null||g===void 0?void 0:g.onClick)===null||v===void 0||v.call(g,f)},mergedOnError:f=>{if(!u.value)return;n.value=!0;const{onError:g,imgProps:{onError:v}={}}=e;g==null||g(f),v==null||v(f)},mergedOnLoad:f=>{const{onLoad:g,imgProps:{onLoad:v}={}}=e;g==null||g(f),v==null||v(f),d.value=!0}},s)},render(){var e,t;const{mergedClsPrefix:n,imgProps:r={},loaded:o,$attrs:i,lazy:s}=this,u=(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e),d=this.src||r.src,f=Re("img",Object.assign(Object.assign({},r),{ref:"imageRef",width:this.width||r.width,height:this.height||r.height,src:this.showError?this.fallbackSrc:s&&this.intersectionObserverOptions?this.shouldStartLoading?d:void 0:d,alt:this.alt||r.alt,"aria-label":this.alt||r.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:gMe&&s&&!this.intersectionObserverOptions?"lazy":"eager",style:[r.style||"",u&&!o?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return Re("div",Object.assign({},i,{role:"none",class:[i.class,`${n}-image`,(this.previewDisabled||this.showError)&&`${n}-image--preview-disabled`]}),this.groupId?f:Re(VMe,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:n,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},{default:()=>f}),!o&&u)}}),KMe=Object.assign(Object.assign({},no.props),{trigger:String,xScrollable:Boolean,onScroll:Function,size:Number}),YMe=ot({name:"Scrollbar",props:KMe,setup(){const e=Ne(null);return Object.assign(Object.assign({},{scrollTo:(...n)=>{var r;(r=e.value)===null||r===void 0||r.scrollTo(n[0],n[1])},scrollBy:(...n)=>{var r;(r=e.value)===null||r===void 0||r.scrollBy(n[0],n[1])}}),{scrollbarInstRef:e})},render(){return Re(k3,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),JMe=YMe,XMe=ut([ut("@keyframes spin-rotate",` from { transform: rotate(0); } to { transform: rotate(360deg); } `),et("spin-container",{position:"relative"},[et("spin-body",` position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); `,[Cy()])]),et("spin-body",` display: inline-flex; align-items: center; justify-content: center; flex-direction: column; `),et("spin",` display: inline-flex; height: var(--n-size); width: var(--n-size); font-size: var(--n-size); color: var(--n-color); `,[bt("rotate",` animation: spin-rotate 2s linear infinite; `)]),et("spin-description",` display: inline-block; font-size: var(--n-font-size); color: var(--n-text-color); transition: color .3s var(--n-bezier); margin-top: 8px; `),et("spin-content",` opacity: 1; transition: opacity .3s var(--n-bezier); pointer-events: all; `,[bt("spinning",` user-select: none; -webkit-user-select: none; pointer-events: none; opacity: var(--n-opacity-spinning); `)])]),ZMe={small:20,medium:18,large:16},QMe=Object.assign(Object.assign({},no.props),{description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0}}),eIe=ot({name:"Spin",props:QMe,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=La(e),r=no("Spin","-spin",XMe,PMe,e,t),o=Ve(()=>{const{size:s}=e,{common:{cubicBezierEaseInOut:u},self:d}=r.value,{opacitySpinning:f,color:g,textColor:v}=d,_=typeof s=="number"?ahe(s):d[Qt("size",s)];return{"--n-bezier":u,"--n-opacity-spinning":f,"--n-size":_,"--n-color":g,"--n-text-color":v}}),i=n?Nu("spin",Ve(()=>{const{size:s}=e;return typeof s=="number"?String(s):s[0]}),o,e):void 0;return{mergedClsPrefix:t,compitableShow:gy(e,["spinning","show"]),mergedStrokeWidth:Ve(()=>{const{strokeWidth:s}=e;if(s!==void 0)return s;const{size:u}=e;return ZMe[typeof u=="number"?"medium":u]}),cssVars:n?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e,t;const{$slots:n,mergedClsPrefix:r,description:o}=this,i=n.icon&&this.rotate,s=(o||n.description)&&Re("div",{class:`${r}-spin-description`},o||((e=n.description)===null||e===void 0?void 0:e.call(n))),u=n.icon?Re("div",{class:[`${r}-spin-body`,this.themeClass]},Re("div",{class:[`${r}-spin`,i&&`${r}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),s):Re("div",{class:[`${r}-spin-body`,this.themeClass]},Re(sw,{clsPrefix:r,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),s);return(t=this.onRender)===null||t===void 0||t.call(this),n.default?Re("div",{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},Re("div",{class:[`${r}-spin-content`,this.compitableShow&&`${r}-spin-content--spinning`]},n),Re(bo,{name:"fade-in-transition"},{default:()=>this.compitableShow?u:null})):u}}),aw="n-tabs",F3={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},tIe=ot({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:F3,setup(e){const t=tn(aw,null);return t||l4("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:t.paneStyleRef,class:t.paneClassRef,mergedClsPrefix:t.mergedClsPrefixRef}},render(){return Re("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),nIe=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},yhe(F3,["displayDirective"])),VI=ot({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:nIe,setup(e){const{mergedClsPrefixRef:t,valueRef:n,typeRef:r,closableRef:o,tabStyleRef:i,tabChangeIdRef:s,onBeforeLeaveRef:u,triggerRef:d,handleAdd:f,activateTab:g,handleClose:v}=tn(aw);return{trigger:d,mergedClosable:Ve(()=>{if(e.internalAddable)return!1;const{closable:_}=e;return _===void 0?o.value:_}),style:i,clsPrefix:t,value:n,type:r,handleClose(_){_.stopPropagation(),!e.disabled&&v(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){f();return}const{name:_}=e,M=++s.id;if(_!==n.value){const{value:C}=u;C?Promise.resolve(C(e.name,n.value)).then(D=>{D&&s.id===M&&g(_)}):g(_)}}}},render(){const{internalAddable:e,clsPrefix:t,name:n,disabled:r,label:o,tab:i,value:s,mergedClosable:u,style:d,trigger:f,$slots:{default:g}}=this,v=o??i;return Re("div",{class:`${t}-tabs-tab-wrapper`},this.internalLeftPadded?Re("div",{class:`${t}-tabs-tab-pad`}):null,Re("div",Object.assign({key:n,"data-name":n,"data-disabled":r?!0:void 0},Eo({class:[`${t}-tabs-tab`,s===n&&`${t}-tabs-tab--active`,r&&`${t}-tabs-tab--disabled`,u&&`${t}-tabs-tab--closable`,e&&`${t}-tabs-tab--addable`],onClick:f==="click"?this.activateTab:void 0,onMouseenter:f==="hover"?this.activateTab:void 0,style:e?void 0:d},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),Re("span",{class:`${t}-tabs-tab__label`},e?Re(dt,null,Re("div",{class:`${t}-tabs-tab__height-placeholder`}," "),Re(Ti,{clsPrefix:t},{default:()=>Re(abe,null)})):g?g():typeof v=="object"?v:_he(v??n)),u&&this.type==="card"?Re(Ibe,{clsPrefix:t,class:`${t}-tabs-tab__close`,onClick:this.handleClose,disabled:r}):null))}}),rIe=et("tabs",` box-sizing: border-box; width: 100%; display: flex; flex-direction: column; transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier); `,[bt("segment-type",[et("tabs-rail",[ut("&.transition-disabled","color: red;",[et("tabs-tab",` transition: none; `)])])]),bt("top",[et("tab-pane",` padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left); `)]),bt("left",[et("tab-pane",` padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top); `)]),bt("left, right",` flex-direction: row; `,[et("tabs-bar",` width: 2px; right: 0; transition: top .2s var(--n-bezier), max-height .2s var(--n-bezier), background-color .3s var(--n-bezier); `),et("tabs-tab",` padding: var(--n-tab-padding-vertical); `)]),bt("right",` flex-direction: row-reverse; `,[et("tab-pane",` padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom); `),et("tabs-bar",` left: 0; `)]),bt("bottom",` flex-direction: column-reverse; justify-content: flex-end; `,[et("tab-pane",` padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left); `),et("tabs-bar",` top: 0; `)]),et("tabs-rail",` padding: 3px; border-radius: var(--n-tab-border-radius); width: 100%; background-color: var(--n-color-segment); transition: background-color .3s var(--n-bezier); display: flex; align-items: center; `,[et("tabs-tab-wrapper",` flex-basis: 0; flex-grow: 1; display: flex; align-items: center; justify-content: center; `,[et("tabs-tab",` overflow: hidden; border-radius: var(--n-tab-border-radius); width: 100%; display: flex; align-items: center; justify-content: center; `,[bt("active",` font-weight: var(--n-font-weight-strong); color: var(--n-tab-text-color-active); background-color: var(--n-tab-color-segment); box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08); `),ut("&:hover",` color: var(--n-tab-text-color-hover); `)])])]),bt("flex",[et("tabs-nav",{width:"100%"},[et("tabs-wrapper",{width:"100%"},[et("tabs-tab",{marginRight:0})])])]),et("tabs-nav",` box-sizing: border-box; line-height: 1.5; display: flex; transition: border-color .3s var(--n-bezier); `,[gt("prefix, suffix",` display: flex; align-items: center; `),gt("prefix","padding-right: 16px;"),gt("suffix","padding-left: 16px;")]),bt("top, bottom",[et("tabs-nav-scroll-wrapper",[ut("&::before",` top: 0; bottom: 0; left: 0; width: 20px; `),ut("&::after",` top: 0; bottom: 0; right: 0; width: 20px; `),bt("shadow-start",[ut("&::before",` box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12); `)]),bt("shadow-end",[ut("&::after",` box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12); `)])])]),bt("left, right",[et("tabs-nav-scroll-wrapper",[ut("&::before",` top: 0; left: 0; right: 0; height: 20px; `),ut("&::after",` bottom: 0; left: 0; right: 0; height: 20px; `),bt("shadow-start",[ut("&::before",` box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12); `)]),bt("shadow-end",[ut("&::after",` box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12); `)])])]),et("tabs-nav-scroll-wrapper",` flex: 1; position: relative; overflow: hidden; `,[et("tabs-nav-y-scroll",` height: 100%; width: 100%; overflow-y: auto; scrollbar-width: none; `,[ut("&::-webkit-scrollbar",` width: 0; height: 0; `)]),ut("&::before, &::after",` transition: box-shadow .3s var(--n-bezier); pointer-events: none; content: ""; position: absolute; z-index: 1; `)]),et("tabs-nav-scroll-content",` display: flex; position: relative; min-width: 100%; width: fit-content; box-sizing: border-box; `),et("tabs-wrapper",` display: inline-flex; flex-wrap: nowrap; position: relative; `),et("tabs-tab-wrapper",` display: flex; flex-wrap: nowrap; flex-shrink: 0; flex-grow: 0; `),et("tabs-tab",` cursor: pointer; white-space: nowrap; flex-wrap: nowrap; display: inline-flex; align-items: center; color: var(--n-tab-text-color); font-size: var(--n-tab-font-size); background-clip: padding-box; padding: var(--n-tab-padding); transition: box-shadow .3s var(--n-bezier), color .3s var(--n-bezier), background-color .3s var(--n-bezier), border-color .3s var(--n-bezier); `,[bt("disabled",{cursor:"not-allowed"}),gt("close",` margin-left: 6px; transition: background-color .3s var(--n-bezier), color .3s var(--n-bezier); `),gt("label",` display: flex; align-items: center; `)]),et("tabs-bar",` position: absolute; bottom: 0; height: 2px; border-radius: 1px; background-color: var(--n-bar-color); transition: left .2s var(--n-bezier), max-width .2s var(--n-bezier), background-color .3s var(--n-bezier); `,[ut("&.transition-disabled",` transition: none; `),bt("disabled",` background-color: var(--n-tab-text-color-disabled) `)]),et("tabs-pane-wrapper",` position: relative; overflow: hidden; transition: max-height .2s var(--n-bezier); `),et("tab-pane",` color: var(--n-pane-text-color); width: 100%; transition: color .3s var(--n-bezier), background-color .3s var(--n-bezier), opacity .2s var(--n-bezier); left: 0; right: 0; top: 0; `,[ut("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",` transition: color .3s var(--n-bezier), background-color .3s var(--n-bezier), transform .2s var(--n-bezier), opacity .2s var(--n-bezier); `),ut("&.next-transition-leave-active, &.prev-transition-leave-active",` position: absolute; `),ut("&.next-transition-enter-from, &.prev-transition-leave-to",` transform: translateX(32px); opacity: 0; `),ut("&.next-transition-leave-to, &.prev-transition-enter-from",` transform: translateX(-32px); opacity: 0; `),ut("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",` transform: translateX(0); opacity: 1; `)]),et("tabs-tab-pad",` box-sizing: border-box; width: var(--n-tab-gap); flex-grow: 0; flex-shrink: 0; `),bt("line-type, bar-type",[et("tabs-tab",` font-weight: var(--n-tab-font-weight); box-sizing: border-box; vertical-align: bottom; `,[ut("&:hover",{color:"var(--n-tab-text-color-hover)"}),bt("active",` color: var(--n-tab-text-color-active); font-weight: var(--n-tab-font-weight-active); `),bt("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),et("tabs-nav",[bt("line-type",[bt("top",[gt("prefix, suffix",` border-bottom: 1px solid var(--n-tab-border-color); `),et("tabs-nav-scroll-content",` border-bottom: 1px solid var(--n-tab-border-color); `),et("tabs-bar",` bottom: -1px; `)]),bt("left",[gt("prefix, suffix",` border-right: 1px solid var(--n-tab-border-color); `),et("tabs-nav-scroll-content",` border-right: 1px solid var(--n-tab-border-color); `),et("tabs-bar",` right: -1px; `)]),bt("right",[gt("prefix, suffix",` border-left: 1px solid var(--n-tab-border-color); `),et("tabs-nav-scroll-content",` border-left: 1px solid var(--n-tab-border-color); `),et("tabs-bar",` left: -1px; `)]),bt("bottom",[gt("prefix, suffix",` border-top: 1px solid var(--n-tab-border-color); `),et("tabs-nav-scroll-content",` border-top: 1px solid var(--n-tab-border-color); `),et("tabs-bar",` top: -1px; `)]),gt("prefix, suffix",` transition: border-color .3s var(--n-bezier); `),et("tabs-nav-scroll-content",` transition: border-color .3s var(--n-bezier); `),et("tabs-bar",` border-radius: 0; `)]),bt("card-type",[gt("prefix, suffix",` transition: border-color .3s var(--n-bezier); border-bottom: 1px solid var(--n-tab-border-color); `),et("tabs-pad",` flex-grow: 1; transition: border-color .3s var(--n-bezier); border-bottom: 1px solid var(--n-tab-border-color); `),et("tabs-tab-pad",` transition: border-color .3s var(--n-bezier); `),et("tabs-tab",` font-weight: var(--n-tab-font-weight); border: 1px solid var(--n-tab-border-color); background-color: var(--n-tab-color); box-sizing: border-box; position: relative; vertical-align: bottom; display: flex; justify-content: space-between; font-size: var(--n-tab-font-size); color: var(--n-tab-text-color); `,[bt("addable",` padding-left: 8px; padding-right: 8px; font-size: 16px; `,[gt("height-placeholder",` width: 0; font-size: var(--n-tab-font-size); `),rs("disabled",[ut("&:hover",` color: var(--n-tab-text-color-hover); `)])]),bt("closable","padding-right: 8px;"),bt("active",` background-color: #0000; font-weight: var(--n-tab-font-weight-active); color: var(--n-tab-text-color-active); `),bt("disabled","color: var(--n-tab-text-color-disabled);")]),et("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),bt("left, right",[et("tabs-wrapper",` flex-direction: column; `,[et("tabs-tab-wrapper",` flex-direction: column; `,[et("tabs-tab-pad",` height: var(--n-tab-gap-vertical); width: 100%; `)])])]),bt("top",[bt("card-type",[et("tabs-tab",` border-top-left-radius: var(--n-tab-border-radius); border-top-right-radius: var(--n-tab-border-radius); `,[bt("active",` border-bottom: 1px solid #0000; `)]),et("tabs-tab-pad",` border-bottom: 1px solid var(--n-tab-border-color); `)])]),bt("left",[bt("card-type",[et("tabs-tab",` border-top-left-radius: var(--n-tab-border-radius); border-bottom-left-radius: var(--n-tab-border-radius); `,[bt("active",` border-right: 1px solid #0000; `)]),et("tabs-tab-pad",` border-right: 1px solid var(--n-tab-border-color); `)])]),bt("right",[bt("card-type",[et("tabs-tab",` border-top-right-radius: var(--n-tab-border-radius); border-bottom-right-radius: var(--n-tab-border-radius); `,[bt("active",` border-left: 1px solid #0000; `)]),et("tabs-tab-pad",` border-left: 1px solid var(--n-tab-border-color); `)])]),bt("bottom",[bt("card-type",[et("tabs-tab",` border-bottom-left-radius: var(--n-tab-border-radius); border-bottom-right-radius: var(--n-tab-border-radius); `,[bt("active",` border-top: 1px solid #0000; `)]),et("tabs-tab-pad",` border-top: 1px solid var(--n-tab-border-color); `)])])])]),oIe=Object.assign(Object.assign({},no.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),iIe=ot({name:"Tabs",props:oIe,setup(e,{slots:t}){var n,r,o,i;const{mergedClsPrefixRef:s,inlineThemeDisabled:u}=La(e),d=no("Tabs","-tabs",rIe,GMe,e,s),f=Ne(null),g=Ne(null),v=Ne(null),_=Ne(null),M=Ne(null),C=Ne(!0),D=Ne(!0),w=gy(e,["labelSize","size"]),S=gy(e,["activeName","value"]),N=Ne((r=(n=S.value)!==null&&n!==void 0?n:e.defaultValue)!==null&&r!==void 0?r:t.default?(i=(o=yf(t.default())[0])===null||o===void 0?void 0:o.props)===null||i===void 0?void 0:i.name:null),A=qT(S,N),L={id:0},j=Ve(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});$t(A,()=>{L.id=0,z(),G()});function V(){var ce;const{value:Se}=A;return Se===null?null:(ce=f.value)===null||ce===void 0?void 0:ce.querySelector(`[data-name="${Se}"]`)}function x(ce){if(e.type==="card")return;const{value:Se}=g;if(Se&&ce){const Pe=`${s.value}-tabs-bar--disabled`,{barWidth:xe,placement:He}=e;if(ce.dataset.disabled==="true"?Se.classList.add(Pe):Se.classList.remove(Pe),["top","bottom"].includes(He)){if($(["top","maxHeight","height"]),typeof xe=="number"&&ce.offsetWidth>=xe){const Ie=Math.floor((ce.offsetWidth-xe)/2)+ce.offsetLeft;Se.style.left=`${Ie}px`,Se.style.maxWidth=`${xe}px`}else Se.style.left=`${ce.offsetLeft}px`,Se.style.maxWidth=`${ce.offsetWidth}px`;Se.style.width="8192px",Se.offsetWidth}else{if($(["left","maxWidth","width"]),typeof xe=="number"&&ce.offsetHeight>=xe){const Ie=Math.floor((ce.offsetHeight-xe)/2)+ce.offsetTop;Se.style.top=`${Ie}px`,Se.style.maxHeight=`${xe}px`}else Se.style.top=`${ce.offsetTop}px`,Se.style.maxHeight=`${ce.offsetHeight}px`;Se.style.height="8192px",Se.offsetHeight}}}function $(ce){const{value:Se}=g;if(Se)for(const Pe of ce)Se.style[Pe]=""}function z(){if(e.type==="card")return;const ce=V();ce&&x(ce)}function G(ce){var Se;const Pe=(Se=M.value)===null||Se===void 0?void 0:Se.$el;if(!Pe)return;const xe=V();if(!xe)return;const{scrollLeft:He,offsetWidth:Ie}=Pe,{offsetLeft:q,offsetWidth:ne}=xe;He>q?Pe.scrollTo({top:0,left:q,behavior:"smooth"}):q+ne>He+Ie&&Pe.scrollTo({top:0,left:q+ne-Ie,behavior:"smooth"})}const O=Ne(null);let T=0,P=null;function Z(ce){const Se=O.value;if(Se){T=ce.getBoundingClientRect().height;const Pe=`${T}px`,xe=()=>{Se.style.height=Pe,Se.style.maxHeight=Pe};P?(xe(),P(),P=null):P=xe}}function K(ce){const Se=O.value;if(Se){const Pe=ce.getBoundingClientRect().height,xe=()=>{document.body.offsetHeight,Se.style.maxHeight=`${Pe}px`,Se.style.height=`${Math.max(T,Pe)}px`};P?(P(),P=null,xe()):P=xe}}function oe(){const ce=O.value;ce&&(ce.style.maxHeight="",ce.style.height="")}const J={value:[]},ie=Ne("next");function pe(ce){const Se=A.value;let Pe="next";for(const xe of J.value){if(xe===Se)break;if(xe===ce){Pe="prev";break}}ie.value=Pe,ue(ce)}function ue(ce){const{onActiveNameChange:Se,onUpdateValue:Pe,"onUpdate:value":xe}=e;Se&&Er(Se,ce),Pe&&Er(Pe,ce),xe&&Er(xe,ce),N.value=ce}function de(ce){const{onClose:Se}=e;Se&&Er(Se,ce)}function Y(){const{value:ce}=g;if(!ce)return;const Se="transition-disabled";ce.classList.add(Se),z(),ce.classList.remove(Se)}let re=0;function fe(ce){var Se;if(ce.contentRect.width===0&&ce.contentRect.height===0||re===ce.contentRect.width)return;re=ce.contentRect.width;const{type:Pe}=e;(Pe==="line"||Pe==="bar")&&Y(),Pe!=="segment"&&Le((Se=M.value)===null||Se===void 0?void 0:Se.$el)}const Ae=tM(fe,64);$t([()=>e.justifyContent,()=>e.size],()=>{br(()=>{const{type:ce}=e;(ce==="line"||ce==="bar")&&Y()})});const ye=Ne(!1);function le(ce){var Se;const{target:Pe,contentRect:{width:xe}}=ce,He=Pe.parentElement.offsetWidth;if(!ye.value)HeIe.$el.offsetWidth&&(ye.value=!1)}Le((Se=M.value)===null||Se===void 0?void 0:Se.$el)}const Q=tM(le,64);function ve(){const{onAdd:ce}=e;ce&&ce(),br(()=>{const Se=V(),{value:Pe}=M;!Se||!Pe||Pe.scrollTo({left:Se.offsetLeft,top:0,behavior:"smooth"})})}function Le(ce){if(!ce)return;const{placement:Se}=e;if(Se==="top"||Se==="bottom"){const{scrollLeft:Pe,scrollWidth:xe,offsetWidth:He}=ce;C.value=Pe<=0,D.value=Pe+He>=xe}else{const{scrollTop:Pe,scrollHeight:xe,offsetHeight:He}=ce;C.value=Pe<=0,D.value=Pe+He>=xe}}const me=tM(ce=>{Le(ce.target)},64);ui(aw,{triggerRef:cr(e,"trigger"),tabStyleRef:cr(e,"tabStyle"),paneClassRef:cr(e,"paneClass"),paneStyleRef:cr(e,"paneStyle"),mergedClsPrefixRef:s,typeRef:cr(e,"type"),closableRef:cr(e,"closable"),valueRef:A,tabChangeIdRef:L,onBeforeLeaveRef:cr(e,"onBeforeLeave"),activateTab:pe,handleClose:de,handleAdd:ve}),m4(()=>{z(),G()}),nn(()=>{const{value:ce}=v;if(!ce)return;const{value:Se}=s,Pe=`${Se}-tabs-nav-scroll-wrapper--shadow-start`,xe=`${Se}-tabs-nav-scroll-wrapper--shadow-end`;C.value?ce.classList.remove(Pe):ce.classList.add(Pe),D.value?ce.classList.remove(xe):ce.classList.add(xe)});const W=Ne(null);$t(A,()=>{if(e.type==="segment"){const ce=W.value;ce&&br(()=>{ce.classList.add("transition-disabled"),ce.offsetWidth,ce.classList.remove("transition-disabled")})}});const te={syncBarPosition:()=>{z()}},se=Ve(()=>{const{value:ce}=w,{type:Se}=e,Pe={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[Se],xe=`${ce}${Pe}`,{self:{barColor:He,closeIconColor:Ie,closeIconColorHover:q,closeIconColorPressed:ne,tabColor:_e,tabBorderColor:Be,paneTextColor:je,tabFontWeight:lt,tabBorderRadius:Fe,tabFontWeightActive:it,colorSegment:Tt,fontWeightStrong:mn,tabColorSegment:In,closeSize:Cn,closeIconSize:En,closeColorHover:vn,closeColorPressed:Qe,closeBorderRadius:yt,[Qt("panePadding",ce)]:Nt,[Qt("tabPadding",xe)]:ln,[Qt("tabPaddingVertical",xe)]:en,[Qt("tabGap",xe)]:Tn,[Qt("tabGap",`${xe}Vertical`)]:qn,[Qt("tabTextColor",Se)]:ze,[Qt("tabTextColorActive",Se)]:wt,[Qt("tabTextColorHover",Se)]:_t,[Qt("tabTextColorDisabled",Se)]:Bt,[Qt("tabFontSize",ce)]:Wt},common:{cubicBezierEaseInOut:mr}}=d.value;return{"--n-bezier":mr,"--n-color-segment":Tt,"--n-bar-color":He,"--n-tab-font-size":Wt,"--n-tab-text-color":ze,"--n-tab-text-color-active":wt,"--n-tab-text-color-disabled":Bt,"--n-tab-text-color-hover":_t,"--n-pane-text-color":je,"--n-tab-border-color":Be,"--n-tab-border-radius":Fe,"--n-close-size":Cn,"--n-close-icon-size":En,"--n-close-color-hover":vn,"--n-close-color-pressed":Qe,"--n-close-border-radius":yt,"--n-close-icon-color":Ie,"--n-close-icon-color-hover":q,"--n-close-icon-color-pressed":ne,"--n-tab-color":_e,"--n-tab-font-weight":lt,"--n-tab-font-weight-active":it,"--n-tab-padding":ln,"--n-tab-padding-vertical":en,"--n-tab-gap":Tn,"--n-tab-gap-vertical":qn,"--n-pane-padding-left":th(Nt,"left"),"--n-pane-padding-right":th(Nt,"right"),"--n-pane-padding-top":th(Nt,"top"),"--n-pane-padding-bottom":th(Nt,"bottom"),"--n-font-weight-strong":mn,"--n-tab-color-segment":In}}),Te=u?Nu("tabs",Ve(()=>`${w.value[0]}${e.type[0]}`),se,e):void 0;return Object.assign({mergedClsPrefix:s,mergedValue:A,renderedNames:new Set,tabsRailElRef:W,tabsPaneWrapperRef:O,tabsElRef:f,barElRef:g,addTabInstRef:_,xScrollInstRef:M,scrollWrapperElRef:v,addTabFixed:ye,tabWrapperStyle:j,handleNavResize:Ae,mergedSize:w,handleScroll:me,handleTabsResize:Q,cssVars:u?void 0:se,themeClass:Te==null?void 0:Te.themeClass,animationDirection:ie,renderNameListRef:J,onAnimationBeforeLeave:Z,onAnimationEnter:K,onAnimationAfterEnter:oe,onRender:Te==null?void 0:Te.onRender},te)},render(){const{mergedClsPrefix:e,type:t,placement:n,addTabFixed:r,addable:o,mergedSize:i,renderNameListRef:s,onRender:u,paneWrapperClass:d,paneWrapperStyle:f,$slots:{default:g,prefix:v,suffix:_}}=this;u==null||u();const M=g?yf(g()).filter(j=>j.type.__TAB_PANE__===!0):[],C=g?yf(g()).filter(j=>j.type.__TAB__===!0):[],D=!C.length,w=t==="card",S=t==="segment",N=!w&&!S&&this.justifyContent;s.value=[];const A=()=>{const j=Re("div",{style:this.tabWrapperStyle,class:[`${e}-tabs-wrapper`]},N?null:Re("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),D?M.map((V,x)=>(s.value.push(V.props.name),sM(Re(VI,Object.assign({},V.props,{internalCreatedByPane:!0,internalLeftPadded:x!==0&&(!N||N==="center"||N==="start"||N==="end")}),V.children?{default:V.children.tab}:void 0)))):C.map((V,x)=>(s.value.push(V.props.name),sM(x!==0&&!N?JA(V):V))),!r&&o&&w?YA(o,(D?M.length:C.length)!==0):null,N?null:Re("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return Re("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},w&&o?Re(lg,{onResize:this.handleTabsResize},{default:()=>j}):j,w?Re("div",{class:`${e}-tabs-pad`}):null,w?null:Re("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},L=S?"top":n;return Re("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${t}-type`,`${e}-tabs--${i}-size`,N&&`${e}-tabs--flex`,`${e}-tabs--${L}`],style:this.cssVars},Re("div",{class:[`${e}-tabs-nav--${t}-type`,`${e}-tabs-nav--${L}`,`${e}-tabs-nav`]},qs(v,j=>j&&Re("div",{class:`${e}-tabs-nav__prefix`},j)),S?Re("div",{class:`${e}-tabs-rail`,ref:"tabsRailElRef"},D?M.map((j,V)=>(s.value.push(j.props.name),Re(VI,Object.assign({},j.props,{internalCreatedByPane:!0,internalLeftPadded:V!==0}),j.children?{default:j.children.tab}:void 0))):C.map((j,V)=>(s.value.push(j.props.name),V===0?j:JA(j)))):Re(lg,{onResize:this.handleNavResize},{default:()=>Re("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(L)?Re(Wge,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:A}):Re("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll},A()))}),r&&o&&w?YA(o,!0):null,qs(_,j=>j&&Re("div",{class:`${e}-tabs-nav__suffix`},j))),D&&(this.animated&&(L==="top"||L==="bottom")?Re("div",{ref:"tabsPaneWrapperRef",style:f,class:[`${e}-tabs-pane-wrapper`,d]},KA(M,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):KA(M,this.mergedValue,this.renderedNames)))}});function KA(e,t,n,r,o,i,s){const u=[];return e.forEach(d=>{const{name:f,displayDirective:g,"display-directive":v}=d.props,_=C=>g===C||v===C,M=t===f;if(d.key!==void 0&&(d.key=f),M||_("show")||_("show:lazy")&&n.has(f)){n.has(f)||n.add(f);const C=!_("if");u.push(C?$n(d,[[eo,M]]):d)}}),s?Re(rO,{name:`${s}-transition`,onBeforeLeave:r,onEnter:o,onAfterEnter:i},{default:()=>u}):u}function YA(e,t){return Re(VI,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:t,disabled:typeof e=="object"&&e.disabled})}function JA(e){const t=Ta(e);return t.props?t.props.internalLeftPadded=!0:t.props={internalLeftPadded:!0},t}function sM(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const sIe="2.34.4";function aIe({componentPrefix:e="N",components:t=[]}={}){const n=[];function r(i,s,u){i.component(e+s)||i.component(e+s,u)}function o(i){n.includes(i)||(n.push(i),t.forEach(s=>{const{name:u,alias:d}=s;r(i,u,s),d&&d.forEach(f=>{r(i,f,s)})}))}return{version:sIe,componentPrefix:e,install:o}}const G3="%[a-f0-9]{2}",XA=new RegExp("("+G3+")|([^%]+?)","gi"),ZA=new RegExp("("+G3+")+","gi");function zI(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],zI(n),zI(r))}function lIe(e){try{return decodeURIComponent(e)}catch{let t=e.match(XA)||[];for(let n=1;ne==null,pIe=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),jI=Symbol("encodeFragmentIdentifier");function hIe(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[co(t,e),"[",o,"]"].join("")]:[...n,[co(t,e),"[",co(o,e),"]=",co(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[co(t,e),"[]"].join("")]:[...n,[co(t,e),"[]=",co(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[co(t,e),":list="].join("")]:[...n,[co(t,e),":list=",co(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,o)=>o===void 0||e.skipNull&&o===null||e.skipEmptyString&&o===""?r:(o=o===null?"":o,r.length===0?[[co(n,e),t,co(o,e)].join("")]:[[r,co(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,co(t,e)]:[...n,[co(t,e),"=",co(r,e)].join("")]}}function gIe(e){let t;switch(e.arrayFormat){case"index":return(n,r,o)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){o[n]=r;return}o[n]===void 0&&(o[n]={}),o[n][t[1]]=r};case"bracket":return(n,r,o)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){o[n]=r;return}if(o[n]===void 0){o[n]=[r];return}o[n]=[...o[n],r]};case"colon-list-separator":return(n,r,o)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){o[n]=r;return}if(o[n]===void 0){o[n]=[r];return}o[n]=[...o[n],r]};case"comma":case"separator":return(n,r,o)=>{const i=typeof r=="string"&&r.includes(e.arrayFormatSeparator),s=typeof r=="string"&&!i&&Qa(r,e).includes(e.arrayFormatSeparator);r=s?Qa(r,e):r;const u=i||s?r.split(e.arrayFormatSeparator).map(d=>Qa(d,e)):r===null?r:Qa(r,e);o[n]=u};case"bracket-separator":return(n,r,o)=>{const i=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!i){o[n]=r&&Qa(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(u=>Qa(u,e));if(o[n]===void 0){o[n]=s;return}o[n]=[...o[n],...s]};default:return(n,r,o)=>{if(o[n]===void 0){o[n]=r;return}o[n]=[...[o[n]].flat(),r]}}}function B3(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function co(e,t){return t.encode?t.strict?pIe(e):encodeURIComponent(e):e}function Qa(e,t){return t.decode?cIe(e):e}function H3(e){return Array.isArray(e)?e.sort():typeof e=="object"?H3(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function q3(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function mIe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function QA(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function lw(e){e=q3(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function uw(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},B3(t.arrayFormatSeparator);const n=gIe(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const o of e.split("&")){if(o==="")continue;const i=t.decode?o.replace(/\+/g," "):o;let[s,u]=$3(i,"=");s===void 0&&(s=i),u=u===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?u:Qa(u,t),n(Qa(s,t),u,r)}for(const[o,i]of Object.entries(r))if(typeof i=="object"&&i!==null)for(const[s,u]of Object.entries(i))i[s]=QA(u,t);else r[o]=QA(i,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((o,i)=>{const s=r[i];return s&&typeof s=="object"&&!Array.isArray(s)?o[i]=H3(s):o[i]=s,o},Object.create(null))}function V3(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},B3(t.arrayFormatSeparator);const n=s=>t.skipNull&&fIe(e[s])||t.skipEmptyString&&e[s]==="",r=hIe(t),o={};for(const[s,u]of Object.entries(e))n(s)||(o[s]=u);const i=Object.keys(o);return t.sort!==!1&&i.sort(t.sort),i.map(s=>{const u=e[s];return u===void 0?"":u===null?co(s,t):Array.isArray(u)?u.length===0&&t.arrayFormat==="bracket-separator"?co(s,t)+"[]":u.reduce(r(s),[]).join("&"):co(s,t)+"="+co(u,t)}).filter(s=>s.length>0).join("&")}function z3(e,t){var o;t={decode:!0,...t};let[n,r]=$3(e,"#");return n===void 0&&(n=e),{url:((o=n==null?void 0:n.split("?"))==null?void 0:o[0])??"",query:uw(lw(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Qa(r,t)}:{}}}function j3(e,t){t={encode:!0,strict:!0,[jI]:!0,...t};const n=q3(e.url).split("?")[0]||"",r=lw(e.url),o={...uw(r,{sort:!1}),...e.query};let i=V3(o,t);i&&(i=`?${i}`);let s=mIe(e.url);if(e.fragmentIdentifier){const u=new URL(n);u.hash=e.fragmentIdentifier,s=t[jI]?u.hash:`#${e.fragmentIdentifier}`}return`${n}${i}${s}`}function W3(e,t,n){n={parseFragmentIdentifier:!0,[jI]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=z3(e,n);return j3({url:r,query:dIe(o,t),fragmentIdentifier:i},n)}function vIe(e,t,n){const r=Array.isArray(t)?o=>!t.includes(o):(o,i)=>!t(o,i);return W3(e,r,n)}const K3=Object.freeze(Object.defineProperty({__proto__:null,exclude:vIe,extract:lw,parse:uw,parseUrl:z3,pick:W3,stringify:V3,stringifyUrl:j3},Symbol.toStringTag,{value:"Module"})),yIe=aIe({components:[SMe,iIe,tIe,hMe,Pbe,WMe,eIe,JMe,L3,P3]}),kg=K3.parse(location.search),v0=K3.parse(location.hash.split("?")[1]),_Ie=kg.Authorization||v0.Authorization||"";sessionStorage.setItem("Authorization",_Ie);sessionStorage.setItem("platform",kg.platform||v0.platform||"");console.log(!1,"false");const cw=kg.appId||v0.appId||1400805079,Y3=kg.secretKey||v0.secretKey||"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30",Oh=kg.userID,dw=yI.init({SDKAppID:cw});dw.use(Zde);dw.login({userID:Oh,userSig:i4({SDKAppID:cw,secretKey:Y3,userID:Oh}).userSig});G7(rhe).use(yIe).use(ihe).use(dw).mount("#app");